30 TFile *outputFile=
new TFile(
"testUnfold5_histograms.root",
"recreate");
36 TFile *binningSchemes=
new TFile(
"testUnfold5_binning.root");
42 binningSchemes->
GetObject(
"detector",detectorBinning);
43 binningSchemes->
GetObject(
"generator",generatorBinning);
45 delete binningSchemes;
47 detectorBinning->
Write();
48 generatorBinning->
Write();
53 cout<<
"could not read 'detector' binning\n";
55 if(generatorBinning) {
58 cout<<
"could not read 'generator' binning\n";
63 detectorBinning->
FindNode(
"detectordistribution");
66 generatorBinning->
FindNode(
"signal");
69 generatorBinning->
FindNode(
"background");
76 Float_t etaRec,ptRec,discr,etaGen,ptGen;
77 Int_t istriggered,issignal;
84 TFile *dataFile=
new TFile(
"testUnfold5_data.root");
88 cout<<
"could not read 'data' tree\n";
104 cout<<
"loop over data events\n";
107 if(dataTree->
GetEntry(ievent)<=0)
break;
112 histDataReco->
Fill(binNumber);
118 histDataTruth->
Fill(binNumber);
122 histDataTruth->
Fill(binNumber);
136 (generatorBinning,detectorBinning,
"histMCGenRec");
138 TFile *signalFile=
new TFile(
"testUnfold5_signal.root");
142 cout<<
"could not read 'signal' tree\n";
154 cout<<
"loop over MC signal events\n";
157 if(signalTree->
GetEntry(ievent)<=0)
break;
168 histMCGenRec->
Fill(genBin,recBin);
174 TFile *bgrFile=
new TFile(
"testUnfold5_background.root");
178 cout<<
"could not read 'background' tree\n";
188 cout<<
"loop over MC background events\n";
191 if(bgrTree->
GetEntry(ievent)<=0)
break;
200 (ptRec,etaRec,discr);
201 histMCGenRec->
Fill(genBin,recBin);
virtual Bool_t cd(const char *path=0)
Change current directory to "this" directory.
virtual Int_t Write(const char *name=0, Int_t option=0, Int_t bufsize=0)
Write this object to the current directory.
virtual Int_t Fill(Double_t x)
Increment bin with abscissa X by 1.
virtual void SetBranchStatus(const char *bname, Bool_t status=1, UInt_t *found=0)
Set branch status to Process or DoNotProcess.
A ROOT file is a suite of consecutive data records (TKey instances) with a well defined format...
virtual TObject * Get(const char *namecycle)
Return pointer to object identified by namecycle.
virtual Int_t GetEntry(Long64_t entry=0, Int_t getall=0)
Read all branches of entry and return total number of bytes read.
static void SetDefaultSumw2(Bool_t sumw2=kTRUE)
When this static function is called with sumw2=kTRUE, all new histograms will automatically activate ...
virtual Int_t SetBranchAddress(const char *bname, void *add, TBranch **ptr=0)
Change branch address, dealing with clone trees properly.
TH1 * CreateHistogram(const char *histogramName, Bool_t originalAxisBinning=kFALSE, Int_t **binMap=0, const char *histogramTitle=0, const char *axisSteering=0) const
void GetObject(const char *namecycle, T *&ptr)
Service class for 2-Dim histogram classes.
virtual Int_t Write(const char *name=0, Int_t opt=0, Int_t bufsiz=0)
Write memory objects to this file.
Int_t GetGlobalBinNumber(Double_t x) const
static TH2D * CreateHistogramOfMigrations(TUnfoldBinning const *xAxis, TUnfoldBinning const *yAxis, char const *histogramName, Bool_t originalXAxisBinning=kFALSE, Bool_t originalYAxisBinning=kFALSE, char const *histogramTitle=0)
void PrintStream(std::ostream &out, Int_t indent=0) const
This class serves as a container of analysis bins analysis bins are specified by defining the axes of...
virtual Long64_t GetEntriesFast() const
virtual void ResetBranchAddresses()
Tell all of our branches to drop their current objects and allocate new ones.
TUnfoldBinning const * FindNode(char const *name) const
A TTree object has a header with a name and a title.
Int_t Fill(Double_t)
Invalid Fill method.