-//============================================
-TParticle* AliMUONTrackLight::FindRefTrack(AliMUONTrack* trackReco, TClonesArray* trackRefArray, AliRunLoader *runLoader){
- /// find the MC particle that corresponds to a given rec track
- TParticle *part = 0;
- const Double_t kSigma2Cut = 16; // 4 sigmas cut, kSigma2Cut = 4*4
- Int_t nTrackRef = trackRefArray->GetEntriesFast();
- Int_t compPart = 0;
- for (Int_t iref = 0; iref < nTrackRef; iref++) {
- AliMUONTrack *trackRef = (AliMUONTrack *)trackRefArray->At(iref);
- // check if trackRef is compatible with trackReco:
- //routine returns for each chamber a yes/no information if the
- //hit of rec. track and hit of referenced track are compatible
- Bool_t *compTrack = trackRef->CompatibleTrack(trackReco,kSigma2Cut);
- Int_t iTrack = this->TrackCheck(compTrack); //returns number of validated conditions
- if (iTrack==4) {
- compPart++;
- Int_t trackID = trackRef->GetTrackID();
- this->SetTrackPythiaLine(trackID);
- part = ((AliStack *)(((AliHeader *) runLoader->GetHeader())->Stack()))->Particle(trackID);
- fTrackPDGCode = part->GetPdgCode();
- }
- }
- if (compPart>1) {
- printf ("<AliMUONTrackLight::FindRefTrack> ERROR: more than one particle compatible to the reconstructed track.\n");
- Int_t i=0, j=1/i;
- printf ("j=%d \n",j);
- }
- return part;
-}
-
-//============================================
-Int_t AliMUONTrackLight::TrackCheck(Bool_t *compTrack){
- /// Apply reconstruction requirements
- /// Return number of validated conditions
- /// If all the tests are verified then TrackCheck = 4 (good track)
- Int_t iTrack = 0;
- Int_t hitsInLastStations = 0;
-
- // apply reconstruction requirements
- if (compTrack[0] || compTrack[1]) iTrack++; // at least one hit in st. 0
- if (compTrack[2] || compTrack[3]) iTrack++; // at least one hit in st. 1
- if (compTrack[4] || compTrack[5]) iTrack++; // at least one hit in st. 2
- for (Int_t ch = 6; ch < AliMUONConstants::NTrackingCh(); ch++) {
- if (compTrack[ch]) hitsInLastStations++;
- }
- if (hitsInLastStations > 2) iTrack++; // at least 3 hits in st. 3 & 4
- return iTrack;
-}
-
-//============================================
-void AliMUONTrackLight::FillMuonHistory(AliRunLoader *runLoader, TParticle *part){
- /// scans the muon history to determine parents pdg code and pythia line
- // kept for backward compatibility
- // see the overloaded method FillMuonHistory(AliStack *stack, TParticle *part)
- AliStack *stack = runLoader->GetHeader()->Stack();
- FillMuonHistory(stack,part);
-}
-