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 **************************************************************************/
16 /////////////////////////////////////////////////////////////
18 // class used to extract and store reco info of muon track
20 // Author: X-M. Zhang, zhang@clermont.in2p3.fr
21 // zhangxm@iopp.ccnu.edu.cn
22 /////////////////////////////////////////////////////////////
24 #include "AliAODTrack.h"
25 #include "AliESDMuonTrack.h"
26 #include "AliMuonInfoStoreRD.h"
30 ClassImp(AliMuonInfoStoreRD)
32 const TString AliMuonInfoStoreRD::fgkStdBranchName("MuonRD");
33 Double_t AliMuonInfoStoreRD::fgCuts[16] = {-999999., 999999.,
42 //-----------------------------------------------------------------------------
43 AliMuonInfoStoreRD::AliMuonInfoStoreRD() :
49 fChi2MatchTrigger(0.),
53 // default constructor
55 for (Int_t i=3; i--;) fDCA[i]=0.;
58 //-----------------------------------------------------------------------------
59 AliMuonInfoStoreRD::AliMuonInfoStoreRD(AliAODTrack *trk) :
65 fChi2MatchTrigger(0.),
69 // AOD-base constructor
71 for (Int_t i=3; i--;) fDCA[i]=0.;
72 this->FillMuonInfo(trk);
75 //-----------------------------------------------------------------------------
76 AliMuonInfoStoreRD::AliMuonInfoStoreRD(AliESDMuonTrack *trk) :
82 fChi2MatchTrigger(0.),
86 // ESD-base constructor
88 for (Int_t i=3; i--;) fDCA[i]=0.;
89 this->FillMuonInfo(trk);
92 //-----------------------------------------------------------------------------
93 AliMuonInfoStoreRD::AliMuonInfoStoreRD(const AliMuonInfoStoreRD &src) :
95 fMomentum(src.fMomentum),
97 fMatchTrigger(src.fMatchTrigger),
98 fChi2FitMomentum(src.fChi2FitMomentum),
99 fChi2MatchTrigger(src.fChi2MatchTrigger),
100 fRabsEnd(src.fRabsEnd)
105 for (Int_t i=3; i--;) fDCA[i]=src.fDCA[i];
108 //-----------------------------------------------------------------------------
109 AliMuonInfoStoreRD& AliMuonInfoStoreRD::operator=(const AliMuonInfoStoreRD &src)
112 // assignment constructor
114 if(&src==this) return *this;
116 fMomentum = src.fMomentum;
117 fCharge = src.fCharge;
118 fMatchTrigger = src.fMatchTrigger;
119 fChi2FitMomentum = src.fChi2FitMomentum;
120 fChi2MatchTrigger = src.fChi2MatchTrigger;
121 fRabsEnd = src.fRabsEnd;
123 for (Int_t i=3; i--;) fDCA[i]=src.fDCA[i];
128 //-----------------------------------------------------------------------------
129 AliMuonInfoStoreRD::~AliMuonInfoStoreRD()
136 //-----------------------------------------------------------------------------
137 void AliMuonInfoStoreRD::FillMuonInfo(AliAODTrack *trk)
139 // extract reco info of muon track from AOD
143 this->SetMomentum(arr);
148 this->SetCharge(trk->Charge());
149 this->SetMatchTrigger(trk->GetMatchTrigger());
150 this->SetChi2FitMomentum(trk->Chi2perNDF());
151 this->SetChi2MatchTrigger(trk->GetChi2MatchTrigger());
152 this->SetRabsEnd(trk->GetRAtAbsorberEnd());
158 //-----------------------------------------------------------------------------
159 void AliMuonInfoStoreRD::FillMuonInfo(AliESDMuonTrack *trk)
161 // extract reco info of muon track from ESD
165 this->SetMomentum(arr);
167 arr[0] = trk->GetNonBendingCoorAtDCA();
168 arr[1] = trk->GetBendingCoorAtDCA();
169 arr[2] = trk->GetZ();
172 this->SetCharge(trk->Charge());
173 this->SetMatchTrigger(trk->GetMatchTrigger());
174 this->SetChi2FitMomentum(trk->GetChi2()/(2.*trk->GetNHit()-5.));
175 this->SetChi2MatchTrigger(trk->GetChi2MatchTrigger());
176 this->SetRabsEnd(trk->GetRAtAbsorberEnd());
181 //-----------------------------------------------------------------------------
182 Bool_t AliMuonInfoStoreRD::IsSelected()
184 // select muon tracks according to the selection cuts
186 Double_t p = Momentum().Mag();
187 if (p<AliMuonInfoStoreRD::fgCuts[0] || p>AliMuonInfoStoreRD::fgCuts[1]) return kFALSE;
189 Double_t pt = Momentum().Pt();
190 if (pt<AliMuonInfoStoreRD::fgCuts[2] || pt>AliMuonInfoStoreRD::fgCuts[3]) return kFALSE;
192 Double_t eta = Momentum().Eta();
193 if (eta<AliMuonInfoStoreRD::fgCuts[4] || eta>AliMuonInfoStoreRD::fgCuts[5]) return kFALSE;
195 Double_t dca = this->DCA();
196 if (dca<AliMuonInfoStoreRD::fgCuts[6] || dca>AliMuonInfoStoreRD::fgCuts[7]) return kFALSE;
198 Int_t trigger = this->MatchTrigger();
199 if (trigger<AliMuonInfoStoreRD::fgCuts[8] || trigger>AliMuonInfoStoreRD::fgCuts[9]) return kFALSE;
201 Double_t theta = 180.*(1.-TMath::ATan(this->RabsEnd()/505.)/TMath::Pi());
202 if (theta<AliMuonInfoStoreRD::fgCuts[10] || theta>AliMuonInfoStoreRD::fgCuts[11]) return kFALSE;
204 Double_t chi2Trk = this->Chi2Tracker();
205 if (chi2Trk<AliMuonInfoStoreRD::fgCuts[12] || chi2Trk>AliMuonInfoStoreRD::fgCuts[13]) return kFALSE;
207 Double_t chi2Trg = this->Chi2Trigger();
208 if (chi2Trg<AliMuonInfoStoreRD::fgCuts[14] || chi2Trg>AliMuonInfoStoreRD::fgCuts[15]) return kFALSE;