]>
Commit | Line | Data |
---|---|---|
fd1d0cb9 | 1 | /************************************************************************** |
2 | * Copyright(c) 1998-2006, ALICE Experiment at CERN, All rights reserved. * | |
3 | * * | |
4 | * Author: The ALICE Off-line Project. * | |
5 | * Contributors are mentioned in the code where appropriate. * | |
6 | * * | |
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 | **************************************************************************/ | |
15 | ||
27de2dfb | 16 | /* $Id$ */ |
17 | ||
fd1d0cb9 | 18 | ///////////////////////////////////////////////////////////// |
19 | // | |
20 | // class used to extract and store reco info of muon track | |
21 | // | |
22 | // Author: X-M. Zhang, zhang@clermont.in2p3.fr | |
23 | // zhangxm@iopp.ccnu.edu.cn | |
24 | ///////////////////////////////////////////////////////////// | |
25 | ||
26 | #include "AliAODTrack.h" | |
27 | #include "AliESDMuonTrack.h" | |
28 | #include "AliMuonInfoStoreRD.h" | |
29 | ||
30 | class TObject; | |
31 | ||
32 | ClassImp(AliMuonInfoStoreRD) | |
33 | ||
34 | const TString AliMuonInfoStoreRD::fgkStdBranchName("MuonRD"); | |
fd1d0cb9 | 35 | |
36 | //----------------------------------------------------------------------------- | |
37 | AliMuonInfoStoreRD::AliMuonInfoStoreRD() : | |
38 | TObject(), | |
9bbc42ca | 39 | fMomentumAtVtx(), |
40 | fMomentumAtDCA(), | |
41 | fMomentumUncor(), | |
fd1d0cb9 | 42 | fCharge(0), |
43 | fMatchTrigger(-1), | |
fd1d0cb9 | 44 | fChi2FitMomentum(0.), |
1195bb6f | 45 | fChi2MatchTrigger(0.), |
9bbc42ca | 46 | fRabsEnd(0.), |
47 | fSelMask(0) | |
fd1d0cb9 | 48 | { |
49 | // | |
50 | // default constructor | |
51 | // | |
1195bb6f | 52 | for (Int_t i=3; i--;) fDCA[i]=0.; |
fd1d0cb9 | 53 | } |
54 | ||
55 | //----------------------------------------------------------------------------- | |
9bbc42ca | 56 | AliMuonInfoStoreRD::AliMuonInfoStoreRD(AliAODTrack *trk, UInt_t selMask) : |
fd1d0cb9 | 57 | TObject(), |
9bbc42ca | 58 | fMomentumAtVtx(), |
59 | fMomentumAtDCA(), | |
60 | fMomentumUncor(), | |
fd1d0cb9 | 61 | fCharge(0), |
62 | fMatchTrigger(-1), | |
fd1d0cb9 | 63 | fChi2FitMomentum(0.), |
1195bb6f | 64 | fChi2MatchTrigger(0.), |
9bbc42ca | 65 | fRabsEnd(0.), |
66 | fSelMask(selMask) | |
fd1d0cb9 | 67 | { |
68 | // | |
69 | // AOD-base constructor | |
70 | // | |
1195bb6f | 71 | for (Int_t i=3; i--;) fDCA[i]=0.; |
fd1d0cb9 | 72 | this->FillMuonInfo(trk); |
73 | } | |
74 | ||
75 | //----------------------------------------------------------------------------- | |
9bbc42ca | 76 | AliMuonInfoStoreRD::AliMuonInfoStoreRD(AliESDMuonTrack *trk, UInt_t selMask) : |
fd1d0cb9 | 77 | TObject(), |
9bbc42ca | 78 | fMomentumAtVtx(), |
79 | fMomentumAtDCA(), | |
80 | fMomentumUncor(), | |
fd1d0cb9 | 81 | fCharge(0), |
82 | fMatchTrigger(-1), | |
fd1d0cb9 | 83 | fChi2FitMomentum(0.), |
1195bb6f | 84 | fChi2MatchTrigger(0.), |
9bbc42ca | 85 | fRabsEnd(0.), |
86 | fSelMask(selMask) | |
fd1d0cb9 | 87 | { |
88 | // | |
89 | // ESD-base constructor | |
90 | // | |
1195bb6f | 91 | for (Int_t i=3; i--;) fDCA[i]=0.; |
fd1d0cb9 | 92 | this->FillMuonInfo(trk); |
93 | } | |
94 | ||
95 | //----------------------------------------------------------------------------- | |
96 | AliMuonInfoStoreRD::AliMuonInfoStoreRD(const AliMuonInfoStoreRD &src) : | |
97 | TObject(src), | |
9bbc42ca | 98 | fMomentumAtVtx(src.fMomentumAtVtx), |
99 | fMomentumAtDCA(src.fMomentumAtDCA), | |
100 | fMomentumUncor(src.fMomentumUncor), | |
fd1d0cb9 | 101 | fCharge(src.fCharge), |
102 | fMatchTrigger(src.fMatchTrigger), | |
fd1d0cb9 | 103 | fChi2FitMomentum(src.fChi2FitMomentum), |
1195bb6f | 104 | fChi2MatchTrigger(src.fChi2MatchTrigger), |
9bbc42ca | 105 | fRabsEnd(src.fRabsEnd), |
106 | fSelMask(src.fSelMask) | |
fd1d0cb9 | 107 | { |
108 | // | |
109 | // copy constructor | |
110 | // | |
1195bb6f | 111 | for (Int_t i=3; i--;) fDCA[i]=src.fDCA[i]; |
fd1d0cb9 | 112 | } |
113 | ||
114 | //----------------------------------------------------------------------------- | |
115 | AliMuonInfoStoreRD& AliMuonInfoStoreRD::operator=(const AliMuonInfoStoreRD &src) | |
116 | { | |
117 | // | |
118 | // assignment constructor | |
119 | // | |
120 | if(&src==this) return *this; | |
121 | ||
9bbc42ca | 122 | fMomentumAtVtx = src.fMomentumAtVtx; |
123 | fMomentumAtDCA = src.fMomentumAtDCA; | |
124 | fMomentumUncor = src.fMomentumUncor; | |
fd1d0cb9 | 125 | fCharge = src.fCharge; |
126 | fMatchTrigger = src.fMatchTrigger; | |
fd1d0cb9 | 127 | fChi2FitMomentum = src.fChi2FitMomentum; |
128 | fChi2MatchTrigger = src.fChi2MatchTrigger; | |
1195bb6f | 129 | fRabsEnd = src.fRabsEnd; |
9bbc42ca | 130 | fSelMask = src.fSelMask; |
fd1d0cb9 | 131 | |
1195bb6f | 132 | for (Int_t i=3; i--;) fDCA[i]=src.fDCA[i]; |
fd1d0cb9 | 133 | |
134 | return *this; | |
135 | } | |
136 | ||
137 | //----------------------------------------------------------------------------- | |
138 | AliMuonInfoStoreRD::~AliMuonInfoStoreRD() | |
139 | { | |
140 | // | |
141 | // destructor | |
142 | // | |
143 | } | |
144 | ||
145 | //----------------------------------------------------------------------------- | |
146 | void AliMuonInfoStoreRD::FillMuonInfo(AliAODTrack *trk) | |
147 | { | |
148 | // extract reco info of muon track from AOD | |
149 | ||
150 | Double_t arr[3]; | |
9bbc42ca | 151 | trk->PxPyPz(arr); this->SetMomentumAtVtx(arr); |
152 | trk->PxPyPzAtDCA(arr); this->SetMomentumAtDCA(arr); | |
153 | trk->XYZAtDCA(arr); this->SetDCA(arr); | |
fd1d0cb9 | 154 | this->SetCharge(trk->Charge()); |
155 | this->SetMatchTrigger(trk->GetMatchTrigger()); | |
fd1d0cb9 | 156 | this->SetChi2FitMomentum(trk->Chi2perNDF()); |
157 | this->SetChi2MatchTrigger(trk->GetChi2MatchTrigger()); | |
1195bb6f | 158 | this->SetRabsEnd(trk->GetRAtAbsorberEnd()); |
d387f518 | 159 | |
fd1d0cb9 | 160 | return; |
161 | } | |
162 | ||
163 | ||
164 | //----------------------------------------------------------------------------- | |
165 | void AliMuonInfoStoreRD::FillMuonInfo(AliESDMuonTrack *trk) | |
166 | { | |
167 | // extract reco info of muon track from ESD | |
fd1d0cb9 | 168 | |
169 | Double_t arr[3]; | |
9bbc42ca | 170 | arr[0]=trk->Px(); arr[1]=trk->Py(); arr[2]=trk->Pz(); this->SetMomentumAtVtx(arr); |
171 | arr[0]=trk->PxAtDCA(); arr[1]=trk->PyAtDCA(); arr[2]=trk->PzAtDCA(); this->SetMomentumAtDCA(arr); | |
172 | arr[0]=trk->PxUncorrected(); arr[1]=trk->PyUncorrected(); arr[2]=trk->PzUncorrected(); this->SetMomentumUncor(arr); | |
173 | arr[0]=trk->GetNonBendingCoorAtDCA(); arr[1]=trk->GetBendingCoorAtDCA(); arr[2]=trk->GetZ(); this->SetDCA(arr); | |
fd1d0cb9 | 174 | this->SetCharge(trk->Charge()); |
175 | this->SetMatchTrigger(trk->GetMatchTrigger()); | |
fd1d0cb9 | 176 | this->SetChi2FitMomentum(trk->GetChi2()/(2.*trk->GetNHit()-5.)); |
177 | this->SetChi2MatchTrigger(trk->GetChi2MatchTrigger()); | |
1195bb6f | 178 | this->SetRabsEnd(trk->GetRAtAbsorberEnd()); |
d387f518 | 179 | |
fd1d0cb9 | 180 | return; |
181 | } |