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[12] = {-999999., 999999.,
40 //-----------------------------------------------------------------------------
41 AliMuonInfoStoreRD::AliMuonInfoStoreRD() :
47 fChi2MatchTrigger(0.),
51 // default constructor
53 for (Int_t i=3; i--;) fDCA[i]=0.;
56 //-----------------------------------------------------------------------------
57 AliMuonInfoStoreRD::AliMuonInfoStoreRD(AliAODTrack *trk) :
63 fChi2MatchTrigger(0.),
67 // AOD-base constructor
69 for (Int_t i=3; i--;) fDCA[i]=0.;
70 this->FillMuonInfo(trk);
73 //-----------------------------------------------------------------------------
74 AliMuonInfoStoreRD::AliMuonInfoStoreRD(AliESDMuonTrack *trk) :
80 fChi2MatchTrigger(0.),
84 // ESD-base constructor
86 for (Int_t i=3; i--;) fDCA[i]=0.;
87 this->FillMuonInfo(trk);
90 //-----------------------------------------------------------------------------
91 AliMuonInfoStoreRD::AliMuonInfoStoreRD(const AliMuonInfoStoreRD &src) :
93 fMomentum(src.fMomentum),
95 fMatchTrigger(src.fMatchTrigger),
96 fChi2FitMomentum(src.fChi2FitMomentum),
97 fChi2MatchTrigger(src.fChi2MatchTrigger),
98 fRabsEnd(src.fRabsEnd)
103 for (Int_t i=3; i--;) fDCA[i]=src.fDCA[i];
106 //-----------------------------------------------------------------------------
107 AliMuonInfoStoreRD& AliMuonInfoStoreRD::operator=(const AliMuonInfoStoreRD &src)
110 // assignment constructor
112 if(&src==this) return *this;
114 fMomentum = src.fMomentum;
115 fCharge = src.fCharge;
116 fMatchTrigger = src.fMatchTrigger;
117 fChi2FitMomentum = src.fChi2FitMomentum;
118 fChi2MatchTrigger = src.fChi2MatchTrigger;
119 fRabsEnd = src.fRabsEnd;
121 for (Int_t i=3; i--;) fDCA[i]=src.fDCA[i];
126 //-----------------------------------------------------------------------------
127 AliMuonInfoStoreRD::~AliMuonInfoStoreRD()
134 //-----------------------------------------------------------------------------
135 void AliMuonInfoStoreRD::FillMuonInfo(AliAODTrack *trk)
137 // extract reco info of muon track from AOD
141 this->SetMomentum(arr);
146 this->SetCharge(trk->Charge());
147 this->SetMatchTrigger(trk->GetMatchTrigger());
148 this->SetChi2FitMomentum(trk->Chi2perNDF());
149 this->SetChi2MatchTrigger(trk->GetChi2MatchTrigger());
150 this->SetRabsEnd(trk->GetRAtAbsorberEnd());
156 //-----------------------------------------------------------------------------
157 void AliMuonInfoStoreRD::FillMuonInfo(AliESDMuonTrack *trk)
159 // extract reco info of muon track from ESD
163 this->SetMomentum(arr);
165 arr[0] = trk->GetNonBendingCoorAtDCA();
166 arr[1] = trk->GetBendingCoorAtDCA();
167 arr[2] = trk->GetZ();
170 this->SetCharge(trk->Charge());
171 this->SetMatchTrigger(trk->GetMatchTrigger());
172 this->SetChi2FitMomentum(trk->GetChi2()/(2.*trk->GetNHit()-5.));
173 this->SetChi2MatchTrigger(trk->GetChi2MatchTrigger());
174 this->SetRabsEnd(trk->GetRAtAbsorberEnd());
179 //-----------------------------------------------------------------------------
180 Bool_t AliMuonInfoStoreRD::IsSelected()
182 // select muon tracks according to the selection cuts
184 Double_t p = Momentum().Mag();
185 if (p<AliMuonInfoStoreRD::fgCuts[0] || p>AliMuonInfoStoreRD::fgCuts[1]) return kFALSE;
187 Double_t pt = Momentum().Pt();
188 if (pt<AliMuonInfoStoreRD::fgCuts[2] || pt>AliMuonInfoStoreRD::fgCuts[3]) return kFALSE;
190 Double_t eta = Momentum().Eta();
191 if (eta<AliMuonInfoStoreRD::fgCuts[4] || eta>AliMuonInfoStoreRD::fgCuts[5]) return kFALSE;
193 Double_t dca = this->DCA();
194 if (dca<AliMuonInfoStoreRD::fgCuts[6] || dca>AliMuonInfoStoreRD::fgCuts[7]) return kFALSE;
196 Int_t trigger = this->MatchTrigger();
197 if (trigger<AliMuonInfoStoreRD::fgCuts[8] || trigger>AliMuonInfoStoreRD::fgCuts[9]) return kFALSE;
199 Double_t theta = 180.*(1.-TMath::ATan(this->RabsEnd()/505.)/TMath::Pi());
200 if (theta<AliMuonInfoStoreRD::fgCuts[10] || theta>AliMuonInfoStoreRD::fgCuts[11]) return kFALSE;