void ReadHits() { TH1F *zeta = new TH1F("zeta","zeta",5000,-40.5,+40.5); gROOT->Macro("$VMCWORKDIR/gconfig/rootlogon.C"); gROOT->LoadMacro("../Tools.C"); std::string inFile = "../Mvd_Test_reco.root"; TFile* f = new TFile(inFile.c_str()); // the sim file you want to analyse TTree *t=(TTree *) f->Get("cbmsim") ; TClonesArray* hit_array=new TClonesArray("PndMvdHit"); t->SetBranchAddress("MVDHitsStrip",&hit_array);//Branch names for (Int_t j=0; jGetEntriesFast(); j++) { t->GetEntry(j); for (Int_t i=0; iGetEntriesFast(); i++) { PndMvdHit *hit = (PndMvdHit*) hit_array->At(i); cout << "event: " << j << ", hit: " << i << ", z = " << hit -> GetZ() << ", det: " << (hit->GetDetName()) << endl; zeta->Fill( hit -> GetZ()); } // end loop over hits of one event } // end loop on events zeta->DrawCopy(); } void ReadDigi() { gROOT->Macro("$VMCWORKDIR/gconfig/rootlogon.C"); gROOT->LoadMacro("../Tools.C"); std::string inFile = "../Mvd_Test_digi.root"; TCanvas *can = new TCanvas("n","n",1200,400); can -> Divide(2,1); TH1F *hmodtop = new TH1F("moduli con digi top","moduli con digi top",18,0.5,6.5); TH1F *hmodbottom = new TH1F("moduli con digi bottom","moduli con digi bottom",18,0.5,6.5); TFile* f = new TFile(inFile.c_str()); // the sim file you want to analyse TTree *t=(TTree *) f->Get("cbmsim") ; std::string id; Int_t modulo = 0; Int_t fe = 0; TClonesArray* hit_array=new TClonesArray("PndMvdDigiStrip"); t->SetBranchAddress("MVDStripDigis",&hit_array);//Branch names for (Int_t j=0; jGetEntriesFast(); j++) { t->GetEntry(j); for (Int_t i=0; iGetEntriesFast(); i++) { PndMvdDigiStrip *hit = (PndMvdDigiStrip*) hit_array->At(i); id = hit->GetDetName(); if (id == "1_1/2_0/3_0/") modulo = 1; if (id == "1_1/2_0/4_0/") modulo = 2; if (id == "1_1/2_0/5_0/") modulo = 3; if (id == "1_1/2_0/6_0/") modulo = 4; if (id == "1_1/2_0/7_0/") modulo = 5; if (id == "1_1/2_0/8_0/") modulo = 6; fe = hit->GetFE(); if (fe < 3) { cout << fe << endl; hmodtop -> Fill(modulo); } else { cout << "bottom " << fe << endl; hmodbottom -> Fill(modulo); } } // end loop over hits of one event } // end loop on events can->cd(1); hmodtop -> DrawCopy(); can->cd(2); hmodbottom -> DrawCopy(); } void ReadCandidates() { TH1F *zeta = new TH1F("zeta","zeta",5000,-40.5,+40.5); gROOT->Macro("$VMCWORKDIR/gconfig/rootlogon.C"); gROOT->LoadMacro("../Tools.C"); std::string inFile = "../Mvd_Test_reco.root"; TFile* f = new TFile(inFile.c_str()); // the sim file you want to analyse TTree *t=(TTree *) f->Get("cbmsim") ; TClonesArray* hit_array=new TClonesArray("PndMvdClusterStrip"); t->SetBranchAddress("MVDStripClusterCand",&hit_array);//Branch names for (Int_t j=0; jGetEntriesFast(); j++) { t->GetEntry(j); for (Int_t i=0; iGetEntriesFast(); i++) { PndMvdClusterStrip *hit = (PndMvdClusterStrip*) hit_array->At(i); cout << "Event " << j << ", cand " << i << endl; hit->Print(); } // end loop over hits of one event } // end loop on events zeta->DrawCopy(); }