void QAmacro_mdt_2() { Bool_t Test=kTRUE; TFile* f = new TFile("pygen_sim_01_test04_test2.root"); TTree *tree=(TTree *) f->Get("cbmsim") ; TGeoManager *geoMan = (TGeoManager*) f->Get("FAIRGeom"); TClonesArray* fMdt=new TClonesArray("PndMdtPoint"); tree->SetBranchAddress("MdtPoint",&fMdt); TClonesArray* fMC=new TClonesArray("PndMCTrack"); tree->SetBranchAddress("MCTrack",&fMC); Int_t NEvents = (Int_t) tree->GetEntriesFast(); cout<<"N. of events: "<GetEntry(js); // Dimension of arrays cout<<"fMC->GetEntriesFast() "<GetEntriesFast()<GetEntriesFast(); cout<<"fMdt->GetEntriesFast() "<GetEntriesFast()<GetEntriesFast(); cout<<"N. of hits: "<At(trk_loop); cout<GetPdgCode()<At(i); PndMCTrack* track = (PndMCTrack*)fMC->At(point->GetTrackID()); Pid1=point->GetPDG(); Pid2= track->GetPdgCode(); if((Pid1-Pid2)!=0) {cout<< " - "<< i <<" (Point ) Pid "<< Pid1 << " track Pid "<< Pid2 << endl; Test=kFALSE; } } // end loop trk fMC->Delete(); } // end loop on events if (Test){ cout << " Test passed" << endl; cout << " All ok " << endl; }else{ cout << " Test Failed" << endl; cout << " Not Ok " << endl; } exit(0); }