@@ -40,15 +40,15 @@ void checkTOFMatching(bool batchMode = true)
4040 TTree * tpcTree = (TTree * )ftracksTPC -> Get ("events" );
4141 std ::vector < o2 ::tpc ::TrackTPC > * mTPCTracksArrayInp = new std ::vector < o2 ::tpc ::TrackTPC > ;
4242 tpcTree -> SetBranchAddress ("Tracks" , & mTPCTracksArrayInp );
43- o2 :: dataformats :: MCTruthContainer < o2 ::MCCompLabel > * mcTPC = new o2 :: dataformats :: MCTruthContainer < o2 ::MCCompLabel > ( );
43+ std :: vector < o2 ::MCCompLabel > * mcTPC = new std :: vector < o2 ::MCCompLabel > ( );
4444 tpcTree -> SetBranchAddress ("TracksMCTruth" , & mcTPC );
4545
4646 // getting the ITS tracks
4747 TFile * ftracksITS = new TFile ("o2trac_its.root" );
4848 TTree * itsTree = (TTree * )ftracksITS -> Get ("o2sim" );
4949 std ::vector < o2 ::its ::TrackITS > * mITSTracksArrayInp = new std ::vector < o2 ::its ::TrackITS > ;
5050 itsTree -> SetBranchAddress ("ITSTrack" , & mITSTracksArrayInp );
51- o2 :: dataformats :: MCTruthContainer < o2 ::MCCompLabel > * mcITS = new o2 :: dataformats :: MCTruthContainer < o2 ::MCCompLabel > ( );
51+ std :: vector < o2 ::MCCompLabel > * mcITS = new std :: vector < o2 ::MCCompLabel > ( );
5252 itsTree -> SetBranchAddress ("ITSTrackMCTruth" , & mcITS );
5353
5454 // getting the TOF clusters
@@ -274,23 +274,19 @@ void checkTOFMatching(bool batchMode = true)
274274 Printf ("matched ITStrack index = %d" , evIdxITS );
275275#endif
276276 // getting the TPC labels
277- const auto& labelsTPC = mcTPC -> getLabels ( evIdxTPC ) ;
277+ const auto& labelsTPC = ( * mcTPC )[ evIdxTPC ] ;
278278#ifdef DEBUG
279- for (uint ilabel = 0 ; ilabel < labelsTPC .size (); ilabel ++ ) {
280- Printf ("TPC label %d: trackID = %d, eventID = %d, sourceID = %d" , ilabel , labelsTPC [ilabel ].getTrackID (), labelsTPC [ilabel ].getEventID (), labelsTPC [ilabel ].getSourceID ());
281- }
279+ Printf ("TPC label: trackID = %d, eventID = %d, sourceID = %d" , labelsTPC .getTrackID (), labelsTPC .getEventID (), labelsTPC .getSourceID ());
282280#endif
283281
284282 // getting the ITS labels
285- const auto& labelsITS = mcITS -> getLabels ( evIdxITS ) ;
283+ const auto& labelsITS = ( * mcITS )[ evIdxITS ] ;
286284#ifdef DEBUG
287- for (uint ilabel = 0 ; ilabel < labelsITS .size (); ilabel ++ ) {
288- Printf ("ITS label %d: trackID = %d, eventID = %d, sourceID = %d" , ilabel , labelsITS [ilabel ].getTrackID (), labelsITS [ilabel ].getEventID (), labelsITS [ilabel ].getSourceID ());
289- }
285+ Printf ("ITS label: trackID = %d, eventID = %d, sourceID = %d" , ilabel , labelsITS .getTrackID (), labelsITS .getEventID (), labelsITS .getSourceID ());
290286#endif
291287 bool bMatched = kFALSE ;
292288 for (uint ilabel = 0 ; ilabel < labelsTOF .size (); ilabel ++ ) {
293- if ((abs (labelsTPC [ 0 ] .getTrackID ()) == labelsTOF [ilabel ].getTrackID () && labelsTPC [ 0 ] .getEventID () == labelsTOF [ilabel ].getEventID () && labelsTPC [ 0 ] .getSourceID () == labelsTOF [ilabel ].getSourceID ()) || (labelsITS [ 0 ] .getTrackID () == labelsTOF [ilabel ].getTrackID () && labelsITS [ 0 ] .getEventID () == labelsTOF [ilabel ].getEventID () && labelsITS [ 0 ] .getSourceID () == labelsTOF [ilabel ].getSourceID ())) {
289+ if ((abs (labelsTPC .getTrackID ()) == labelsTOF [ilabel ].getTrackID () && labelsTPC .getEventID () == labelsTOF [ilabel ].getEventID () && labelsTPC .getSourceID () == labelsTOF [ilabel ].getSourceID ()) || (labelsITS .getTrackID () == labelsTOF [ilabel ].getTrackID () && labelsITS .getEventID () == labelsTOF [ilabel ].getEventID () && labelsITS .getSourceID () == labelsTOF [ilabel ].getSourceID ())) {
294290 nGoodMatches ++ ;
295291 bMatched = kTRUE ;
296292 break ;
@@ -352,23 +348,19 @@ void checkTOFMatching(bool batchMode = true)
352348 o2 ::dataformats ::TrackTPCITS trackITSTPC = mTracksArrayInp -> at (i );
353349 const auto evIdxTPCcheck = trackITSTPC .getRefTPC ();
354350 const auto evIdxITScheck = trackITSTPC .getRefITS ();
355- const auto& labelsTPCcheck = mcTPC -> getLabels (evIdxTPCcheck );
356- for (uint ilabel = 0 ; ilabel < labelsTPCcheck .size (); ilabel ++ ) {
357- if (abs (labelsTPCcheck [ilabel ].getTrackID ()) == trackIdTOF && labelsTPCcheck [ilabel ].getEventID () == eventIdTOF && labelsTPCcheck [ilabel ].getSourceID () == sourceIdTOF ) {
351+ const auto& labelsTPCcheck = (* mcTPC )[evIdxTPCcheck ];
352+ if (abs (labelsTPCcheck .getTrackID ()) == trackIdTOF && labelsTPCcheck .getEventID () == eventIdTOF && labelsTPCcheck .getSourceID () == sourceIdTOF ) {
358353#ifdef DEBUG
359- Printf ("The TPC track that should have been matched to TOF is number %d" , i );
354+ Printf ("The TPC track that should have been matched to TOF is number %d" , i );
360355#endif
361- TPCfound = true;
362- }
356+ TPCfound = true;
363357 }
364- const auto& labelsITScheck = mcITS -> getLabels (evIdxITScheck );
365- for (uint ilabel = 0 ; ilabel < labelsITScheck .size (); ilabel ++ ) {
366- if (labelsITScheck [ilabel ].getTrackID () == trackIdTOF && labelsITScheck [ilabel ].getEventID () == eventIdTOF && labelsITScheck [ilabel ].getSourceID () == sourceIdTOF ) {
358+ const auto& labelsITScheck = (* mcITS )[evIdxITScheck ];
359+ if (labelsITScheck .getTrackID () == trackIdTOF && labelsITScheck .getEventID () == eventIdTOF && labelsITScheck .getSourceID () == sourceIdTOF ) {
367360#ifdef DEBUG
368- Printf ("The ITS track that should have been matched to TOF is number %d" , i );
361+ Printf ("The ITS track that should have been matched to TOF is number %d" , i );
369362#endif
370- ITSfound = true;
371- }
363+ ITSfound = true;
372364 }
373365 }
374366#ifdef DEBUG
0 commit comments