- // find the reference track and store further information
- TParticle *part = muLight.FindRefTrack(trackReco, trackRefs, pstack);
- if (part) {
+ // try to match the reconstructed track with a simulated one
+ Int_t nMatchClusters = 0;
+ AliMUONTrack* matchedTrackRef = rc->FindCompatibleTrack(*trackReco, *trackRefs, nMatchClusters, kFALSE, 10.);
+
+ if (matchedTrackRef) {
+
+ //store new referenced track in the muonArray
+ AliMUONTrackLight* muLight = new ((*muonArray)[nreftracks++]) AliMUONTrackLight();
+
+ // assign parameters concerning the reconstructed tracks
+ muLight->FillFromESD(esdTrack);
+ // muLight->FillFromAliMUONTrack(trackReco);
+
+ // store further information related to the simulated track
+ muLight->SetTrackPythiaLine(matchedTrackRef->GetUniqueID());
+ TParticle *part = pstack->Particle(matchedTrackRef->GetUniqueID());
+ muLight->SetTrackPDGCode(part->GetPdgCode());