Skip to content
Snippets Groups Projects
Commit f5c6c1f7 authored by Pierre Morfouace's avatar Pierre Morfouace
Browse files

Adding macro for Vendeta calibration

parent 18f3d438
No related branches found
No related tags found
No related merge requests found
Pipeline #193511 passed
TChain* chain;
int NumberOfDetectors=2;
/////////////////////////////////////
void LoadRootFile(){
chain = new TChain("PhysicsTree");
chain->Add("/home/faster/nptool/Outputs/Analysis/test.root");
}
/////////////////////////////////////
void GenerateTOFHisto(){
LoadRootFile();
TFile* ofile = new TFile("histo_tof_file.root","recreate");
for(int i=0; i<NumberOfDetectors; i++){
// LG //
TString to_draw = Form("LG_Tof>>hLG_%i(1000,0,100)",i+1);
TString condition = Form("LG_ID==%i",i+1);
TString histo_name_LG = Form("hLG_%i",i+1);
chain->Draw(to_draw,condition,"",1e6);
TH1F* hLG = (TH1F*) gDirectory->FindObjectAny(histo_name_LG);
// HG //
to_draw = Form("HG_Tof>>hHG_%i(1000,0,100)",i+1);
condition = Form("HG_ID==%i",i+1);
TString histo_name_HG = Form("hHG_%i",i+1);
chain->Draw(to_draw,condition,"",1e6);
TH1F* hHG = (TH1F*) gDirectory->FindObjectAny(histo_name_HG);
}
ofile->Write();
ofile->Close();
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment