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");
36 //-----------------------------------------------------------------------------
37 AliMuonInfoStoreRD::AliMuonInfoStoreRD() :
45 fChi2MatchTrigger(0.),
50 // default constructor
52 for (Int_t i=3; i--;) fDCA[i]=0.;
55 //-----------------------------------------------------------------------------
56 AliMuonInfoStoreRD::AliMuonInfoStoreRD(AliAODTrack *trk, UInt_t selMask) :
64 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, UInt_t selMask) :
84 fChi2MatchTrigger(0.),
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 fMomentumAtVtx(src.fMomentumAtVtx),
99 fMomentumAtDCA(src.fMomentumAtDCA),
100 fMomentumUncor(src.fMomentumUncor),
101 fCharge(src.fCharge),
102 fMatchTrigger(src.fMatchTrigger),
103 fChi2FitMomentum(src.fChi2FitMomentum),
104 fChi2MatchTrigger(src.fChi2MatchTrigger),
105 fRabsEnd(src.fRabsEnd),
106 fSelMask(src.fSelMask)
111 for (Int_t i=3; i--;) fDCA[i]=src.fDCA[i];
114 //-----------------------------------------------------------------------------
115 AliMuonInfoStoreRD& AliMuonInfoStoreRD::operator=(const AliMuonInfoStoreRD &src)
118 // assignment constructor
120 if(&src==this) return *this;
122 fMomentumAtVtx = src.fMomentumAtVtx;
123 fMomentumAtDCA = src.fMomentumAtDCA;
124 fMomentumUncor = src.fMomentumUncor;
125 fCharge = src.fCharge;
126 fMatchTrigger = src.fMatchTrigger;
127 fChi2FitMomentum = src.fChi2FitMomentum;
128 fChi2MatchTrigger = src.fChi2MatchTrigger;
129 fRabsEnd = src.fRabsEnd;
130 fSelMask = src.fSelMask;
132 for (Int_t i=3; i--;) fDCA[i]=src.fDCA[i];
137 //-----------------------------------------------------------------------------
138 AliMuonInfoStoreRD::~AliMuonInfoStoreRD()
145 //-----------------------------------------------------------------------------
146 void AliMuonInfoStoreRD::FillMuonInfo(AliAODTrack *trk)
148 // extract reco info of muon track from AOD
151 trk->PxPyPz(arr); this->SetMomentumAtVtx(arr);
152 trk->PxPyPzAtDCA(arr); this->SetMomentumAtDCA(arr);
153 trk->XYZAtDCA(arr); this->SetDCA(arr);
154 this->SetCharge(trk->Charge());
155 this->SetMatchTrigger(trk->GetMatchTrigger());
156 this->SetChi2FitMomentum(trk->Chi2perNDF());
157 this->SetChi2MatchTrigger(trk->GetChi2MatchTrigger());
158 this->SetRabsEnd(trk->GetRAtAbsorberEnd());
163 //-----------------------------------------------------------------------------
164 void AliMuonInfoStoreRD::FillMuonInfo(AliESDMuonTrack *trk)
166 // extract reco info of muon track from ESD
169 arr[0]=trk->Px(); arr[1]=trk->Py(); arr[2]=trk->Pz(); this->SetMomentumAtVtx(arr);
170 arr[0]=trk->PxAtDCA(); arr[1]=trk->PyAtDCA(); arr[2]=trk->PzAtDCA(); this->SetMomentumAtDCA(arr);
171 arr[0]=trk->PxUncorrected(); arr[1]=trk->PyUncorrected(); arr[2]=trk->PzUncorrected(); this->SetMomentumUncor(arr);
172 arr[0]=trk->GetNonBendingCoorAtDCA(); arr[1]=trk->GetBendingCoorAtDCA(); arr[2]=trk->GetZ(); this->SetDCA(arr);
173 this->SetCharge(trk->Charge());
174 this->SetMatchTrigger(trk->GetMatchTrigger());
175 this->SetChi2FitMomentum(trk->GetChi2()/(2.*trk->GetNHit()-5.));
176 this->SetChi2MatchTrigger(trk->GetChi2MatchTrigger());
177 this->SetRabsEnd(trk->GetRAtAbsorberEnd());