1234567891011121314151617181920212223 |
- R__LOAD_LIBRARY(/nica/mpd21/parfenov/mpd_winter2019/winter_scripts/build_test/PicoDst/libPicoDst.so)
- void test_Ids()
- {
- TFile *fi = new TFile("test_picodst.root","read");
- TTree *tree = (TTree*) fi->Get("picodst");
- TClonesArray *recoTracks = nullptr;
- TClonesArray *mcTracks = nullptr;
- tree->SetBranchAddress("mctracks",&mcTracks);
- tree->SetBranchAddress("recotracks",&recoTracks);
- for (int iEv=0; iEv<tree->GetEntriesFast(); iEv++)
- {
- tree->GetEntry(iEv);
- for (int i=0; i<recoTracks->GetEntriesFast(); i++)
- {
- auto recoTrack = (PicoDstRecoTrack*) recoTracks->UncheckedAt(i);
- auto mcTrack = (PicoDstMCTrack*) mcTracks->UncheckedAt(recoTrack->GetMcId());
- if (recoTrack->GetInitialMcId() != mcTrack->GetInitialId())
- std::cout << "Event " << iEv << ", recotrack " << i << ": InitMcId(reco)= " << recoTrack->GetInitialMcId() << ", InitMcId(mc)= " << mcTrack->GetInitialId() << ", McId= " << recoTrack->GetMcId() << std::endl;
- }
- }
- }
|