1 /**************************************************************************
2 * Copyright(c) 1998-2006, ALICE Experiment at CERN, All rights reserved. *
4 * Author: The ALICE Off-line Project. *
5 * Contributors are mentioned in the code where appropriate. *
7 * Permission to use, copy, modify and distribute this software and its *
8 * documentation strictly for non-commercial purposes is hereby granted *
9 * without fee, provided that the above copyright notice appears in all *
10 * copies and that both the copyright notice and this permission notice *
11 * appear in the supporting documentation. The authors make no claims *
12 * about the suitability of this software for any purpose. It is *
13 * provided "as is" without express or implied warranty. *
14 **************************************************************************/
18 /////////////////////////////////////////////////////////////
20 // class used to extract and store reco info of muon track
22 // Author: X-M. Zhang, zhang@clermont.in2p3.fr
23 // zhangxm@iopp.ccnu.edu.cn
24 /////////////////////////////////////////////////////////////
26 #include "AliAODTrack.h"
27 #include "AliESDMuonTrack.h"
28 #include "AliMuonInfoStoreRD.h"
32 ClassImp(AliMuonInfoStoreRD)
34 const TString AliMuonInfoStoreRD::fgkStdBranchName("MuonRD");
35 Double_t AliMuonInfoStoreRD::fgCuts[16] = {-999999., 999999.,
44 //-----------------------------------------------------------------------------
45 AliMuonInfoStoreRD::AliMuonInfoStoreRD() :
51 fChi2MatchTrigger(0.),
55 // default constructor
57 for (Int_t i=3; i--;) fDCA[i]=0.;
60 //-----------------------------------------------------------------------------
61 AliMuonInfoStoreRD::AliMuonInfoStoreRD(AliAODTrack *trk) :
67 fChi2MatchTrigger(0.),
71 // AOD-base constructor
73 for (Int_t i=3; i--;) fDCA[i]=0.;
74 this->FillMuonInfo(trk);
77 //-----------------------------------------------------------------------------
78 AliMuonInfoStoreRD::AliMuonInfoStoreRD(AliESDMuonTrack *trk) :
84 fChi2MatchTrigger(0.),
88 // ESD-base constructor
90 for (Int_t i=3; i--;) fDCA[i]=0.;
91 this->FillMuonInfo(trk);
94 //-----------------------------------------------------------------------------
95 AliMuonInfoStoreRD::AliMuonInfoStoreRD(const AliMuonInfoStoreRD &src) :
97 fMomentum(src.fMomentum),
99 fMatchTrigger(src.fMatchTrigger),
100 fChi2FitMomentum(src.fChi2FitMomentum),
101 fChi2MatchTrigger(src.fChi2MatchTrigger),
102 fRabsEnd(src.fRabsEnd)
107 for (Int_t i=3; i--;) fDCA[i]=src.fDCA[i];
110 //-----------------------------------------------------------------------------
111 AliMuonInfoStoreRD& AliMuonInfoStoreRD::operator=(const AliMuonInfoStoreRD &src)
114 // assignment constructor
116 if(&src==this) return *this;
118 fMomentum = src.fMomentum;
119 fCharge = src.fCharge;
120 fMatchTrigger = src.fMatchTrigger;
121 fChi2FitMomentum = src.fChi2FitMomentum;
122 fChi2MatchTrigger = src.fChi2MatchTrigger;
123 fRabsEnd = src.fRabsEnd;
125 for (Int_t i=3; i--;) fDCA[i]=src.fDCA[i];
130 //-----------------------------------------------------------------------------
131 AliMuonInfoStoreRD::~AliMuonInfoStoreRD()
138 //-----------------------------------------------------------------------------
139 void AliMuonInfoStoreRD::FillMuonInfo(AliAODTrack *trk)
141 // extract reco info of muon track from AOD
145 this->SetMomentum(arr);
150 this->SetCharge(trk->Charge());
151 this->SetMatchTrigger(trk->GetMatchTrigger());
152 this->SetChi2FitMomentum(trk->Chi2perNDF());
153 this->SetChi2MatchTrigger(trk->GetChi2MatchTrigger());
154 this->SetRabsEnd(trk->GetRAtAbsorberEnd());
160 //-----------------------------------------------------------------------------
161 void AliMuonInfoStoreRD::FillMuonInfo(AliESDMuonTrack *trk)
163 // extract reco info of muon track from ESD
167 this->SetMomentum(arr);
169 arr[0] = trk->GetNonBendingCoorAtDCA();
170 arr[1] = trk->GetBendingCoorAtDCA();
171 arr[2] = trk->GetZ();
174 this->SetCharge(trk->Charge());
175 this->SetMatchTrigger(trk->GetMatchTrigger());
176 this->SetChi2FitMomentum(trk->GetChi2()/(2.*trk->GetNHit()-5.));
177 this->SetChi2MatchTrigger(trk->GetChi2MatchTrigger());
178 this->SetRabsEnd(trk->GetRAtAbsorberEnd());
183 //-----------------------------------------------------------------------------
184 Bool_t AliMuonInfoStoreRD::IsSelected()
186 // select muon tracks according to the selection cuts
188 Double_t p = Momentum().Mag();
189 if (p<AliMuonInfoStoreRD::fgCuts[0] || p>AliMuonInfoStoreRD::fgCuts[1]) return kFALSE;
191 Double_t pt = Momentum().Pt();
192 if (pt<AliMuonInfoStoreRD::fgCuts[2] || pt>AliMuonInfoStoreRD::fgCuts[3]) return kFALSE;
194 Double_t eta = Momentum().Eta();
195 if (eta<AliMuonInfoStoreRD::fgCuts[4] || eta>AliMuonInfoStoreRD::fgCuts[5]) return kFALSE;
197 Double_t dca = this->DCA();
198 if (dca<AliMuonInfoStoreRD::fgCuts[6] || dca>AliMuonInfoStoreRD::fgCuts[7]) return kFALSE;
200 Int_t trigger = this->MatchTrigger();
201 if (trigger<AliMuonInfoStoreRD::fgCuts[8] || trigger>AliMuonInfoStoreRD::fgCuts[9]) return kFALSE;
203 Double_t theta = 180.*(1.-TMath::ATan(this->RabsEnd()/505.)/TMath::Pi());
204 if (theta<AliMuonInfoStoreRD::fgCuts[10] || theta>AliMuonInfoStoreRD::fgCuts[11]) return kFALSE;
206 Double_t chi2Trk = this->Chi2Tracker();
207 if (chi2Trk<AliMuonInfoStoreRD::fgCuts[12] || chi2Trk>AliMuonInfoStoreRD::fgCuts[13]) return kFALSE;
209 Double_t chi2Trg = this->Chi2Trigger();
210 if (chi2Trg<AliMuonInfoStoreRD::fgCuts[14] || chi2Trg>AliMuonInfoStoreRD::fgCuts[15]) return kFALSE;