@@ -165,24 +165,24 @@ o2::dataformats::V0Ext SVStudySpec::processV0(int iv, o2::globaltracking::RecoCo
165165 v0ext.v0 = v0sel;
166166 }
167167 v0ext.v0ID = v0id;
168- o2::MCCompLabel lb;
168+ o2::MCCompLabel lb[ 0 ] ;
169169 const o2::MCTrack* mcTrks[2 ];
170170 for (int ip = 0 ; ip < 2 ; ip++) {
171171 auto & prInfo = v0ext.prInfo [ip];
172172 auto gid = v0ext.v0ID .getProngID (ip);
173173 auto gidset = recoData.getSingleDetectorRefs (gid);
174- lb = recoData.getTrackMCLabel (gid);
175- if (lb.isValid ()) {
176- prInfo.corrGlo = !lb.isFake ();
174+ lb[ip] = recoData.getTrackMCLabel (gid);
175+ if (lb[ip] .isValid ()) {
176+ prInfo.corrGlo = !lb[ip] .isFake ();
177177 }
178178 // get TPC tracks, if any
179179 if (gidset[GTrackID::TPC].isSourceSet ()) {
180180 const auto & tpcTr = recoData.getTPCTrack (gidset[GTrackID::TPC]);
181181 prInfo.trackTPC = tpcTr;
182182 prInfo.nClTPC = tpcTr.getNClusters ();
183- lb = recoData.getTrackMCLabel (gidset[GTrackID::TPC]);
184- if (lb.isValid ()) {
185- prInfo.corrTPC = !lb.isFake ();
183+ lb[ip] = recoData.getTrackMCLabel (gidset[GTrackID::TPC]);
184+ if (lb[ip] .isValid ()) {
185+ prInfo.corrTPC = !lb[ip] .isFake ();
186186 }
187187 }
188188 // get ITS tracks, if any
@@ -191,9 +191,9 @@ o2::dataformats::V0Ext SVStudySpec::processV0(int iv, o2::globaltracking::RecoCo
191191 if (gidset[GTrackID::ITS].isSourceSet ()) {
192192 const auto & itsTr = recoData.getITSTrack (gidset[GTrackID::ITS]);
193193 prInfo.nClITS = itsTr.getNClusters ();
194- lb = recoData.getTrackMCLabel (gidset[GTrackID::ITS]);
195- if (lb.isValid ()) {
196- prInfo.corrITS = !lb.isFake ();
194+ lb[ip] = recoData.getTrackMCLabel (gidset[GTrackID::ITS]);
195+ if (lb[ip] .isValid ()) {
196+ prInfo.corrITS = !lb[ip] .isFake ();
197197 }
198198 for (int il = 0 ; il < 7 ; il++) {
199199 if (itsTr.hasHitOnLayer (il)) {
@@ -203,9 +203,9 @@ o2::dataformats::V0Ext SVStudySpec::processV0(int iv, o2::globaltracking::RecoCo
203203 } else {
204204 const auto & itsTrf = recoData.getITSABRefs ()[gidset[GTrackID::ITSAB]];
205205 prInfo.nClITS = itsTrf.getNClusters ();
206- lb = recoData.getTrackMCLabel (gidset[GTrackID::ITSAB]);
207- if (lb.isValid ()) {
208- prInfo.corrITS = !lb.isFake ();
206+ lb[ip] = recoData.getTrackMCLabel (gidset[GTrackID::ITSAB]);
207+ if (lb[ip] .isValid ()) {
208+ prInfo.corrITS = !lb[ip] .isFake ();
209209 }
210210 for (int il = 0 ; il < 7 ; il++) {
211211 if (itsTrf.hasHitOnLayer (il)) {
@@ -216,21 +216,22 @@ o2::dataformats::V0Ext SVStudySpec::processV0(int iv, o2::globaltracking::RecoCo
216216 }
217217 if (gidset[GTrackID::ITSTPC].isSourceSet ()) {
218218 auto mtc = recoData.getTPCITSTrack (gidset[GTrackID::ITSTPC]);
219- lb = recoData.getTrackMCLabel (gidset[GTrackID::ITSTPC]);
219+ lb[ip] = recoData.getTrackMCLabel (gidset[GTrackID::ITSTPC]);
220220 prInfo.chi2ITSTPC = mtc.getChi2Match ();
221- if (lb.isValid ()) {
222- prInfo.corrITSTPC = !lb.isFake ();
221+ if (lb[ip] .isValid ()) {
222+ prInfo.corrITSTPC = !lb[ip] .isFake ();
223223 }
224224 }
225225 }
226226 if (mUseMC ) { // temp store of mctrks
227- mcTrks[ip] = mcReader->getTrack (lb);
227+ mcTrks[ip] = mcReader->getTrack (lb[ip] );
228228 }
229229 }
230230 if (mUseMC && (mcTrks[0 ] != nullptr ) && (mcTrks[1 ] != nullptr )) {
231231 // check majority vote on mother particle otherwise leave pdg -1
232- if (mcTrks[0 ]->getMotherTrackId () == mcTrks[1 ]->getMotherTrackId ()) {
233- const auto mother = mcReader->getTrack (lb.getSourceID (), lb.getEventID (), mcTrks[0 ]->getMotherTrackId ());
232+ if (lb[0 ].isValid () && lb[1 ].isValid () && lb[0 ].getSourceID () == lb[1 ].getSourceID () && lb[0 ].getEventID () == lb[1 ].getEventID () &&
233+ mcTrks[0 ]->getMotherTrackId () == mcTrks[1 ]->getMotherTrackId ()) {
234+ const auto mother = mcReader->getTrack (lb[0 ].getSourceID (), lb[0 ].getEventID (), mcTrks[0 ]->getMotherTrackId ());
234235 v0ext.mcPID = mother->GetPdgCode ();
235236 }
236237 }
0 commit comments