A new file to make a dummy root file, for when data for one step doesn't exist but we still want to run the calibration.

This commit is contained in:
redford_s
2017-04-07 15:52:42 +02:00
parent a7f7000991
commit 36469f8c5f
4 changed files with 29 additions and 1 deletions

24
dummyRootFileMaker.cpp Normal file
View File

@@ -0,0 +1,24 @@
// file to write a dummy results root file, so the calib writer can run even when no data exists
#include "/afs/psi.ch/project/mythen/sophie/sls_detector_calibration/jungfrauCommonHeader.h"
#include "/afs/psi.ch/project/mythen/sophie/sls_detector_calibration/jungfrauCommonFunctions.h"
#include "TFile.h"
#include "TH2.h"
int main(int argc, char* argv[]) {
TH2F* g1overg2map = new TH2F("g1overg2map","",NC,-0.5,NC-0.5,NR,-0.5,NR-0.5);
TH2F* g1overg2ermap = new TH2F("g1overg2ermap","",NC,-0.5,NC-0.5,NR,-0.5,NR-0.5);
for (int i = 0; i < NCH; i++) {
g1overg2map->SetBinContent((i%NC)+1,(i/NC)+1,13.0);
g1overg2ermap->SetBinContent((i%NC)+1,(i/NC)+1,0.1);
}
TFile* saved_file2 = new TFile("data/M027/CS_ratio_M027.root","RECREATE");
g1overg2map->Write();
g1overg2ermap->Write();
saved_file2->Close();
}