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[10] = {-999999., 999999.,
39 //-----------------------------------------------------------------------------
40 AliMuonInfoStoreRD::AliMuonInfoStoreRD() :
52 // default constructor
54 for (Int_t i=3; i--;) fDCA[i] = 0.;
57 //-----------------------------------------------------------------------------
58 AliMuonInfoStoreRD::AliMuonInfoStoreRD(AliAODTrack *trk) :
70 // AOD-base constructor
72 for (Int_t i=3; i--;) fDCA[i] = 0.;
73 this->FillMuonInfo(trk);
76 //-----------------------------------------------------------------------------
77 AliMuonInfoStoreRD::AliMuonInfoStoreRD(AliESDMuonTrack *trk) :
89 // ESD-base constructor
91 for (Int_t i=3; i--;) fDCA[i] = 0.;
92 this->FillMuonInfo(trk);
95 //-----------------------------------------------------------------------------
96 AliMuonInfoStoreRD::AliMuonInfoStoreRD(const AliMuonInfoStoreRD &src) :
98 fMomentum(src.fMomentum),
99 fMomentumAtDCA(src.fMomentumAtDCA),
100 fCharge(src.fCharge),
101 fMatchTrigger(src.fMatchTrigger),
102 fNClusters(src.fNClusters),
103 fMUONClusterMap(src.fMUONClusterMap),
104 fChi2FitMomentum(src.fChi2FitMomentum),
105 fChi2MatchTrigger(src.fChi2MatchTrigger)
110 for (Int_t i=3; i--;) fDCA[i] = src.fDCA[i];
113 //-----------------------------------------------------------------------------
114 AliMuonInfoStoreRD& AliMuonInfoStoreRD::operator=(const AliMuonInfoStoreRD &src)
117 // assignment constructor
119 if(&src==this) return *this;
121 fMomentum = src.fMomentum;
122 fMomentumAtDCA = src.fMomentumAtDCA;
124 fCharge = src.fCharge;
125 fMatchTrigger = src.fMatchTrigger;
126 fNClusters = src.fNClusters;
127 fMUONClusterMap = src.fMUONClusterMap;
128 fChi2FitMomentum = src.fChi2FitMomentum;
129 fChi2MatchTrigger = src.fChi2MatchTrigger;
131 for (Int_t i=3; i--;) fDCA[i] = src.fDCA[i];
136 //-----------------------------------------------------------------------------
137 AliMuonInfoStoreRD::~AliMuonInfoStoreRD()
144 //-----------------------------------------------------------------------------
145 void AliMuonInfoStoreRD::FillMuonInfo(AliAODTrack *trk)
147 // extract reco info of muon track from AOD
151 this->SetMomentum(arr);
153 trk->PxPyPzAtDCA(arr);
154 this->SetMomentumAtDCA(arr);
159 this->SetCharge(trk->Charge());
160 this->SetMatchTrigger(trk->GetMatchTrigger());
161 this->SetMUONClusterMap(trk->GetMUONClusterMap());
162 this->SetChi2FitMomentum(trk->Chi2perNDF());
163 this->SetChi2MatchTrigger(trk->GetChi2MatchTrigger());
169 //-----------------------------------------------------------------------------
170 void AliMuonInfoStoreRD::FillMuonInfo(AliESDMuonTrack *trk)
172 // extract reco info of muon track from ESD
173 // tract params before related to vertex are extracted
177 this->SetMomentum(arr);
179 trk->PxPyPzAtDCA(arr);
180 this->SetMomentumAtDCA(arr);
182 arr[0] = trk->GetNonBendingCoorAtDCA();
183 arr[1] = trk->GetBendingCoorAtDCA();
184 arr[2] = trk->GetZ();
187 this->SetCharge(trk->Charge());
188 this->SetMatchTrigger(trk->GetMatchTrigger());
189 this->SetMUONClusterMap(trk->GetMuonClusterMap());
190 this->SetChi2FitMomentum(trk->GetChi2()/(2.*trk->GetNHit()-5.));
191 this->SetChi2MatchTrigger(trk->GetChi2MatchTrigger());
193 this->SetNClusters(trk->GetNClusters());
197 //-----------------------------------------------------------------------------
198 Bool_t AliMuonInfoStoreRD::MuonSelection()
200 // select muon tracks according to the selection cuts
202 Double_t p = Momentum().Mag();
203 if (p<AliMuonInfoStoreRD::fgCuts[0] || p>AliMuonInfoStoreRD::fgCuts[1]) return kFALSE;
205 Double_t pt = Momentum().Pt();
206 if (pt<AliMuonInfoStoreRD::fgCuts[2] || pt>AliMuonInfoStoreRD::fgCuts[3]) return kFALSE;
208 Double_t eta = Momentum().Eta();
209 if (eta<AliMuonInfoStoreRD::fgCuts[4] || eta>AliMuonInfoStoreRD::fgCuts[5]) return kFALSE;
211 Double_t dca = this->DCA();
212 if (dca<AliMuonInfoStoreRD::fgCuts[6] || dca>AliMuonInfoStoreRD::fgCuts[7]) return kFALSE;
214 Int_t trigger = this->MatchTrigger();
215 if (trigger<AliMuonInfoStoreRD::fgCuts[8] || trigger>AliMuonInfoStoreRD::fgCuts[9]) return kFALSE;