]> git.uio.no Git - u/mrichter/AliRoot.git/blob - PWG/muon/AliOADBMuonTrackCutsParam.cxx
Merge branch 'feature-movesplit'
[u/mrichter/AliRoot.git] / PWG / muon / AliOADBMuonTrackCutsParam.cxx
1 /**************************************************************************
2  * Copyright(c) 1998-1999, 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
16 #include "AliOADBMuonTrackCutsParam.h"
17
18 #include "TVector3.h"
19
20 #include "AliLog.h"
21
22 using namespace std;
23
24 ClassImp(AliOADBMuonTrackCutsParam)
25
26
27 //________________________________________________________________________
28 AliOADBMuonTrackCutsParam::AliOADBMuonTrackCutsParam () :
29 TNamed("AliOADBMuonTrackCutsParam", "OADB object for Muon track cuts"),
30 fMeanDcaX(0.),
31 fMeanDcaY(0.),
32 fMeanDcaZ(0.),
33 fMeanPCorr23(0.),
34 fMeanPCorr310(0.),
35 fSigmaPdca23(0.),
36 fSigmaPdca310(0.),
37 fNSigmaPdcaCut(0.),
38 fChi2NormCut(0.),
39 fRelPResolution(0.),
40 fSlopeResolution(0.),
41 fSharpPtApt(0.),
42 fSharpPtLpt(0.),
43 fSharpPtHpt(0.)
44 {
45   // default ctor
46 }
47
48
49 //________________________________________________________________________
50 AliOADBMuonTrackCutsParam::AliOADBMuonTrackCutsParam ( const char* name ) :
51 TNamed(name, "OADB object for Muon track cuts"),
52 fMeanDcaX(0.),
53 fMeanDcaY(0.),
54 fMeanDcaZ(0.),
55 fMeanPCorr23(0.),
56 fMeanPCorr310(0.),
57 fSigmaPdca23(0.),
58 fSigmaPdca310(0.),
59 fNSigmaPdcaCut(0.),
60 fChi2NormCut(0.),
61 fRelPResolution(0.),
62 fSlopeResolution(0.),
63 fSharpPtApt(0.),
64 fSharpPtLpt(0.),
65 fSharpPtHpt(0.)
66 {
67   // ctor, better use this one
68 }
69
70
71 //________________________________________________________________________
72 AliOADBMuonTrackCutsParam::~AliOADBMuonTrackCutsParam()
73 {
74   // dtor
75 }
76
77 //________________________________________________________________________
78 AliOADBMuonTrackCutsParam::AliOADBMuonTrackCutsParam ( const AliOADBMuonTrackCutsParam& other ) :
79 TNamed ( other ),
80 fMeanDcaX ( other.fMeanDcaX ),
81 fMeanDcaY ( other.fMeanDcaY ),
82 fMeanDcaZ ( other.fMeanDcaZ ),
83 fMeanPCorr23 ( other.fMeanPCorr23 ),
84 fMeanPCorr310 ( other.fMeanPCorr310 ),
85 fSigmaPdca23 ( other.fSigmaPdca23 ),
86 fSigmaPdca310 ( other.fSigmaPdca310 ),
87 fNSigmaPdcaCut ( other.fNSigmaPdcaCut ),
88 fChi2NormCut ( other.fChi2NormCut ),
89 fRelPResolution ( other.fRelPResolution ),
90 fSlopeResolution ( other.fSlopeResolution ),
91 fSharpPtApt ( other.fSharpPtApt ),
92 fSharpPtLpt ( other.fSharpPtLpt ),
93 fSharpPtHpt ( other.fSharpPtHpt )
94 {
95 // Copy ctor  
96 }
97
98
99 //________________________________________________________________________
100 AliOADBMuonTrackCutsParam& AliOADBMuonTrackCutsParam::operator=(const AliOADBMuonTrackCutsParam& other)
101 {
102   //Assignment operator
103   if ( &other == this ) return *this;
104   TNamed::operator=(other);
105
106   fMeanDcaX = other.fMeanDcaX;
107   fMeanDcaY = other.fMeanDcaY;
108   fMeanDcaZ = other.fMeanDcaZ;
109   fMeanPCorr23 = other.fMeanPCorr23;
110   fMeanPCorr310 = other.fMeanPCorr310;
111   fSigmaPdca23 = other.fSigmaPdca23;
112   fSigmaPdca310 = other.fSigmaPdca310;
113   fNSigmaPdcaCut = other.fNSigmaPdcaCut;
114   fChi2NormCut = other.fChi2NormCut;
115   fRelPResolution = other.fRelPResolution;
116   fSlopeResolution = other.fSlopeResolution;
117   fSharpPtApt = other.fSharpPtApt;
118   fSharpPtLpt = other.fSharpPtLpt;
119   fSharpPtHpt = other.fSharpPtHpt;
120
121   return *this;
122 }
123
124 //________________________________________________________________________
125 void AliOADBMuonTrackCutsParam::SetMeanDCA ( Double_t xAtDca, Double_t yAtDca, Double_t zAtDca )
126 {
127   /// Set mean DCA from track
128   fMeanDcaX = xAtDca;
129   fMeanDcaY = yAtDca;
130   fMeanDcaZ = zAtDca;
131 }
132
133 //________________________________________________________________________
134 TVector3 AliOADBMuonTrackCutsParam::GetMeanDCA () const
135
136   /// Get mean DCA from track
137   return TVector3 ( fMeanDcaX, fMeanDcaY, fMeanDcaZ );
138 }
139
140
141 //________________________________________________________________________
142 void AliOADBMuonTrackCutsParam::SetMeanPCorr ( Double_t pCorrThetaAbs23, Double_t pCorrThetaAbs310 )
143 {
144   /// Set mean p correction
145   fMeanPCorr23 = pCorrThetaAbs23;
146   fMeanPCorr310 = pCorrThetaAbs310;
147 }
148
149 //________________________________________________________________________
150 Double_t AliOADBMuonTrackCutsParam::GetMeanPCorr23 ( ) const
151 {
152   /// Get mean p correction in 2<theta_abs<3 deg
153   return fMeanPCorr23;
154 }
155
156 //________________________________________________________________________
157 Double_t AliOADBMuonTrackCutsParam::GetMeanPCorr310 ( ) const
158 {
159   /// Get mean p correction in 3<theta_abs<10 deg
160   return fMeanPCorr310;
161 }
162
163 //________________________________________________________________________
164 void AliOADBMuonTrackCutsParam::SetSigmaPdca ( Double_t sigmaThetaAbs23, Double_t sigmaThetaAbs310 )
165
166   /// Set sigma pdca
167   fSigmaPdca23 = sigmaThetaAbs23;
168   fSigmaPdca310 = sigmaThetaAbs310;
169 }
170
171 //________________________________________________________________________
172 Double_t AliOADBMuonTrackCutsParam::GetSigmaPdca23 ( ) const
173
174   /// Get mean pdca in 2<theta_abs<3 deg
175   return fSigmaPdca23;
176 }
177
178 //________________________________________________________________________
179 Double_t AliOADBMuonTrackCutsParam::GetSigmaPdca310 ( ) const
180
181   /// Get mean pdca in 3<theta_abs<10 deg
182   return fSigmaPdca310;
183 }
184
185 //________________________________________________________________________
186 void AliOADBMuonTrackCutsParam::SetNSigmaPdca ( Double_t nSigmas )
187
188   /// Set N sigma pdca cut
189   fNSigmaPdcaCut = nSigmas;
190 }
191
192 //________________________________________________________________________
193 Double_t AliOADBMuonTrackCutsParam::GetNSigmaPdca () const
194 {
195   /// Get N sigma pdca cut
196   return fNSigmaPdcaCut;
197 }
198
199 //________________________________________________________________________
200 void AliOADBMuonTrackCutsParam::SetChi2NormCut ( Double_t chi2normCut )
201 {
202   /// Set cut on normalized chi2 of tracks
203   fChi2NormCut = chi2normCut;
204 }
205
206 //________________________________________________________________________
207 Double_t AliOADBMuonTrackCutsParam::GetChi2NormCut () const
208 {
209   /// Get cut on normalized chi2 of tracks
210   return fChi2NormCut;
211 }
212
213 //________________________________________________________________________
214 void AliOADBMuonTrackCutsParam::SetRelPResolution ( Double_t relPResolution )
215 {
216   /// Set relative momentum resolution
217   fRelPResolution = relPResolution;
218 }
219
220 //________________________________________________________________________
221 Double_t AliOADBMuonTrackCutsParam::GetRelPResolution () const
222 {
223   /// Get relative momentum resolution
224   return fRelPResolution;
225 }
226
227
228 //________________________________________________________________________
229 void AliOADBMuonTrackCutsParam::SetSlopeResolution ( Double_t slopeResolution )
230 {
231   /// Set slope resolution
232   fSlopeResolution = slopeResolution;
233 }
234
235 //________________________________________________________________________
236 Double_t AliOADBMuonTrackCutsParam::GetSlopeResolution () const
237 {
238   /// Get slope resolution
239   return fSlopeResolution;
240 }
241
242 //________________________________________________________________________
243 void AliOADBMuonTrackCutsParam::SetSharpPtCut ( Double_t valueApt, Double_t valueLpt, Double_t valueHpt  )
244 {
245   /// Set sharp tracker cut matching the trigger level
246   
247   fSharpPtApt = valueApt;
248   fSharpPtLpt = valueLpt;
249   fSharpPtHpt = valueHpt;
250 }
251
252 //________________________________________________________________________
253 Double_t AliOADBMuonTrackCutsParam::GetSharpPtCut ( Int_t trigPtCut, Bool_t warn ) const
254 {
255   /// Get sharp tracker cut matching the trigger level
256   /// trigPtCut can be 0 (Apt), 1 (Lpt) or 2 (Hpt)
257   switch ( trigPtCut ) {
258   case 0:
259     return fSharpPtApt;
260   case 1:
261     return fSharpPtLpt;
262   case 2:
263     return fSharpPtHpt;
264   }
265   
266   if ( warn ) AliError("Allowed values for trigPtCut are 0 (Apt), 1 (Lpt), 2 (Hpt)");
267   return 0.;
268 }
269
270 //________________________________________________________________________
271 void AliOADBMuonTrackCutsParam::Print ( Option_t* /*option*/ ) const
272 {
273   /// Print info
274   printf(" *** Muon track parameter summary: ***\n");
275   printf("  Mean vertex DCA: (%g, %g, %g)\n", fMeanDcaX, fMeanDcaY, fMeanDcaZ);
276   printf("  Mean p correction (GeV/c): theta2-3 = %g  theta3-10 = %g\n", fMeanPCorr23, fMeanPCorr310);
277   printf("  Sigma p x DCA (cm x GeV/c): theta2-3 = %g  theta3-10 = %g\n", fSigmaPdca23, fSigmaPdca310);
278   printf("  Cut p x DCA in units of sigma: %g\n", fNSigmaPdcaCut);
279   printf("  Cut on track chi2/NDF: %g\n", fChi2NormCut);
280   printf("  Momentum resolution: %g\n", fRelPResolution);
281   printf("  Slope resolution: %g\n", fSlopeResolution);
282   printf("  Sharp pt cut: %g (Apt)  %g (Lpt)  %g (Hpt)\n", fSharpPtApt, fSharpPtLpt, fSharpPtHpt);
283   printf(" ********************************\n");
284 }