#include #include #include #include #include "TObject.h" #include #include #include "TChain.h" #include "TFile.h" #include "TH1D.h" #include "TH2D.h" #include "TCanvas.h" #include "TStyle.h" #include "TRootCanvas.h" #include "TMath.h" #include "TTreeReader.h" #include "TTreeReaderValue.h" #include "TTreeReaderArray.h" #include #include "/projects/scode/include/TPID.h" #include "TApplication.h" TApplication* theApp; int main() { // Open the file containing the tree. TFile* myFile = TFile::Open("/mnt/sorted/run-1000-sorted.root"); TTreeReader fReader("data", myFile); TTreeReaderValue> pspmthigh2_dytrace = {fReader, "pspmthigh2.dytrace"}; TTreeReaderValue pspmthigh2_dymult = {fReader, "pspmthigh2.dymult"}; TTreeReaderValue> implantlist = {fReader,"implantlist"}; std::pair limits = {0, 130}; Long64_t evt = 0; Double_t temp_clover_ecal = 0.; while(fReader.Next()) { if(theApp==NULL) theApp = new TApplication("theApp",0,0); std::cout << "Implantlist size" << implantlist->size() << std::endl; if(*pspmthigh2_dymult > 0){ if(pspmthigh2_dytrace->size() > 0) { for(int m =0; m<*pspmthigh2_dymult; m++){ std::unique_ptr hdytrace(new TH1D("Trace","Trace",limits.second,0,limits.second)); // Remove statistics box and title gStyle->SetOptStat(0); gStyle->SetOptTitle(0); std::unique_ptr c(new TCanvas("c", "c", 800, 600)); for (unsigned k=limits.first; kFill(k, pspmthigh2_dytrace->at(m*130+k)); hdytrace->Draw("hist"); } c->Modified(); c->Update(); c->WaitPrimitive(); } // dymult loop done } // trace size check done } // dymult check done evt++; } // End loop over all the events return 0; }