]> git.uio.no Git - u/mrichter/AliRoot.git/blob - MUON/AliMUONRecoParam.cxx
Memory leaks
[u/mrichter/AliRoot.git] / MUON / AliMUONRecoParam.cxx
1 /**************************************************************************
2 * Copyright(c) 1998-2007, 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
17 //-----------------------------------------------------------------------------
18 /// \class AliMUONRecoParam
19 ///
20 /// Class with MUON reconstruction parameters
21 ///
22 ///  \author Philippe Pillot
23 //-----------------------------------------------------------------------------
24
25
26
27 #include "AliMUONRecoParam.h"
28
29 #include "AliLog.h"
30
31 #include <Riostream.h>
32
33 ClassImp(AliMUONRecoParam)
34
35
36 //_____________________________________________________________________________
37 AliMUONRecoParam::AliMUONRecoParam()
38 : AliDetectorRecoParam(),
39   fClusteringMode("MLEM"),
40   fTrackingMode("KALMAN"),
41   fMostProbBendingMomentum(0.),
42   fMinBendingMomentum(0.),
43   fMaxBendingMomentum(0.),
44   fMaxNonBendingSlope(0.),
45   fMaxBendingSlope(0.),
46   fNonBendingVertexDispersion(0.),
47   fBendingVertexDispersion(0.),
48   fMaxNonBendingDistanceToTrack(0.),
49   fMaxBendingDistanceToTrack(0.),
50   fSigmaCutForTracking(0.),
51   fSigmaCutForImprovement(0.),
52   fSigmaCutForTrigger(0.),
53   fMaxNormChi2MatchTrigger(0.),
54   fPercentOfFullClusterInESD(10.),
55   fCombinedClusterTrackReco(kFALSE),
56   fTrackAllTracks(kFALSE),
57   fRecoverTracks(kFALSE),
58   fMakeTrackCandidatesFast(kFALSE),
59   fMakeMoreTrackCandidates(kFALSE),
60   fComplementTracks(kFALSE),
61   fImproveTracks(kFALSE),
62   fUseSmoother(kFALSE),
63   fSaveFullClusterInESD(kTRUE),
64   fCalibrationMode("NOGAIN"),
65   fBypassSt45(kFALSE)
66 {
67   /// Constructor
68   SetNameTitle("MUON","MUON");
69   
70   // use the default parameters for low flux environment
71   SetLowFluxParam();
72 }
73
74 //_____________________________________________________________________________
75 AliMUONRecoParam::~AliMUONRecoParam() 
76 {
77   /// Destructor
78 }
79
80 //_____________________________________________________________________________
81 Option_t*
82 AliMUONRecoParam::GetCalibrationMode() const
83 {
84   /// Return the calibration mode. Can be : 
85   /// NOGAIN : only do pedestal subtraction
86   /// GAIN : do pedestal subtraction, and apply gain correction, but with a
87   ///        single capacitance value for all channels
88   /// GAINCONSTANTCAPA : as GAIN, but with a channel-dependent capacitance value
89   
90   return fCalibrationMode.Data();
91 }
92
93 //_____________________________________________________________________________
94 AliMUONRecoParam *AliMUONRecoParam::GetLowFluxParam() 
95 {
96   /// Return default reconstruction parameters for low flux environment
97   
98   AliMUONRecoParam *param = new AliMUONRecoParam();
99   param->SetLowFluxParam();
100   
101   return param;
102 }
103
104 //_____________________________________________________________________________
105 AliMUONRecoParam *AliMUONRecoParam::GetHighFluxParam() 
106 {
107   /// Return default reconstruction parameters for high flux environment
108   
109   AliMUONRecoParam *param = new AliMUONRecoParam();
110   param->SetHighFluxParam();
111  
112   return param;
113 }
114
115 //_____________________________________________________________________________
116 AliMUONRecoParam *AliMUONRecoParam::GetCosmicParam() 
117 {
118   /// Return default reconstruction parameters for high flux environment
119   
120   AliMUONRecoParam *param = new AliMUONRecoParam();
121   param->SetCosmicParam();
122   
123   return param;
124 }
125
126 //_____________________________________________________________________________
127 void AliMUONRecoParam::SetLowFluxParam() 
128 {
129   /// Set reconstruction parameters for low flux environment
130   
131   fMostProbBendingMomentum = 2.;
132   fMinBendingMomentum = 1.;
133   fMaxBendingMomentum = 3000.;
134   fMaxNonBendingSlope = 0.3;
135   fMaxBendingSlope = 0.4;
136   fNonBendingVertexDispersion = 10.;
137   fBendingVertexDispersion = 10.;
138   fMaxNonBendingDistanceToTrack = 1.;
139   fMaxBendingDistanceToTrack = 1.;
140   fSigmaCutForTracking = 6.;
141   fSigmaCutForImprovement = 5.;
142   fSigmaCutForTrigger = 8.;
143   fMaxNormChi2MatchTrigger = 16.;
144   fCombinedClusterTrackReco = kFALSE;
145   fTrackAllTracks = kTRUE;
146   fRecoverTracks = kTRUE;
147   fMakeTrackCandidatesFast = kFALSE;
148   fMakeMoreTrackCandidates = kFALSE;
149   fComplementTracks = kTRUE;
150   fImproveTracks = kTRUE;
151   fUseSmoother = kTRUE;
152   for (Int_t iCh = 0; iCh < 10; iCh++) fUseChamber[iCh] = kTRUE;
153   for (Int_t iSt = 0; iSt < 5; iSt++) fRequestStation[iSt] = kTRUE;
154   fBypassSt45 = kFALSE;
155   
156 }
157
158 //_____________________________________________________________________________
159 void AliMUONRecoParam::SetHighFluxParam() 
160 {
161   /// Set reconstruction parameters for high flux environment
162   
163   fMostProbBendingMomentum = 2.;
164   fMinBendingMomentum = 1.;
165   fMaxBendingMomentum = 3000.;
166   fMaxNonBendingSlope = 0.3;
167   fMaxBendingSlope = 0.4;
168   fNonBendingVertexDispersion = 10.;
169   fBendingVertexDispersion = 10.;
170   fMaxNonBendingDistanceToTrack = 1.;
171   fMaxBendingDistanceToTrack = 1.;
172   fSigmaCutForTracking = 6.;
173   fSigmaCutForImprovement = 5.;
174   fSigmaCutForTrigger = 8.;
175   fMaxNormChi2MatchTrigger = 16.;
176   fCombinedClusterTrackReco = kFALSE;
177   fTrackAllTracks = kTRUE;
178   fRecoverTracks = kTRUE;
179   fMakeTrackCandidatesFast = kFALSE;
180   fMakeMoreTrackCandidates = kFALSE;
181   fComplementTracks = kTRUE;
182   fImproveTracks = kTRUE;
183   fUseSmoother = kTRUE;
184   for (Int_t iCh = 0; iCh < 10; iCh++) fUseChamber[iCh] = kTRUE;
185   for (Int_t iSt = 0; iSt < 5; iSt++) fRequestStation[iSt] = kTRUE;
186   fBypassSt45 = kFALSE;
187   
188 }
189
190 //_____________________________________________________________________________
191 void AliMUONRecoParam::SetCosmicParam() 
192 {
193   /// Set reconstruction parameters for high flux environment
194   
195   fMostProbBendingMomentum = 2.;
196   fMinBendingMomentum = 1.;
197   fMaxBendingMomentum = 10000000.;
198   fMaxNonBendingSlope = 0.3;
199   fMaxBendingSlope = 0.4;
200   fNonBendingVertexDispersion = 10.;
201   fBendingVertexDispersion = 10.;
202   fMaxNonBendingDistanceToTrack = 10.;
203   fMaxBendingDistanceToTrack = 10.;
204   fSigmaCutForTracking = 20.;
205   fSigmaCutForImprovement = 20.;
206   fSigmaCutForTrigger = 8.;
207   fMaxNormChi2MatchTrigger = 16.;
208   fPercentOfFullClusterInESD = 100.;
209   fCombinedClusterTrackReco = kFALSE;
210   fTrackAllTracks = kTRUE;
211   fRecoverTracks = kTRUE;
212   fMakeTrackCandidatesFast = kFALSE;
213   fMakeMoreTrackCandidates = kFALSE;
214   fComplementTracks = kTRUE;
215   fImproveTracks = kTRUE;
216   fUseSmoother = kTRUE;
217   fSaveFullClusterInESD = kTRUE;
218   for (Int_t iCh = 0; iCh < 10; iCh++) fUseChamber[iCh] = kTRUE;
219   for (Int_t iSt = 0; iSt < 5; iSt++) fRequestStation[iSt] = kTRUE;
220   fBypassSt45 = kFALSE;
221   
222 }
223
224 //_____________________________________________________________________________
225 void AliMUONRecoParam::Print(Option_t *option) const
226 {
227   /// print reconstruction parameters
228   /// if option = FULL then print also unused parameters
229   
230   cout<<endl<<"\t------Reconstruction parameters------"<<endl;
231   
232   cout<<Form("Calibration mode = %s",fCalibrationMode.Data())<<endl;
233   cout<<Form("Clustering mode = %s",fClusteringMode.Data())<<endl;
234   cout<<Form("Tracking mode = %s",fTrackingMode.Data())<<endl;
235
236   if (BypassSt45()) cout << "Will bypass St45 (replacing their clusters by generated ones from trigger tracks)" << endl;
237   
238   if (fCombinedClusterTrackReco) cout<<"Combined cluster/track reconstruction: ON"<<endl;
239   else cout<<"Combined cluster/track reconstruction: OFF"<<endl;
240   
241   if (fSaveFullClusterInESD) cout<<Form("Save all cluster info in ESD for %5.2f %% of events",fPercentOfFullClusterInESD)<<endl;
242   else cout<<"Save partial cluster info in ESD"<<endl;
243   
244   cout<<Form("Most probable bending momentum (used only if B=0) = %5.2f",fMostProbBendingMomentum)<<endl;
245   
246   cout<<Form("Bending momentum range = [%5.2f,%5.2f]",fMinBendingMomentum,fMaxBendingMomentum)<<endl;
247   
248   cout<<Form("Maximum non bending slope = %5.2f",fMaxNonBendingSlope)<<endl;
249   
250   cout<<Form("Maximum bending slope (used only if B=0) = %5.2f",fMaxBendingSlope)<<endl;
251   
252   if (strstr(fTrackingMode,"ORIGINAL"))
253     cout<<Form("Vertex dispertion = (%5.2f,%5.2f)",fNonBendingVertexDispersion,fBendingVertexDispersion)<<endl;
254   else if (strstr(option,"FULL"))
255     cout<<Form("Vertex dispertion (used for original tracking only) = (%5.2f,%5.2f)",fNonBendingVertexDispersion,fBendingVertexDispersion)<<endl;
256   
257   cout<<Form("Maximum distance to track = (%5.2f,%5.2f)",fMaxNonBendingDistanceToTrack,fMaxBendingDistanceToTrack)<<endl;
258   
259   cout<<Form("Sigma cut for tracking = %5.2f",fSigmaCutForTracking)<<endl;
260
261   cout<<Form("Sigma cut for trigger hit pattern = %5.2f",fSigmaCutForTrigger)<<endl;
262   
263   if (fTrackAllTracks) cout<<"Track all the possible candidates"<<endl;
264   else cout<<"Track only the best candidates"<<endl;
265   
266   if (strstr(option,"FULL")) {
267     cout<<"Make track candidates assuming linear propagation between stations 4 and 5: ";
268     if (fMakeTrackCandidatesFast) cout<<"ON"<<endl;
269     else cout<<"OFF"<<endl;
270   } else if (fMakeTrackCandidatesFast)
271     cout<<"Make track candidates assuming linear propagation between stations 4 and 5"<<endl;
272   
273   if (strstr(option,"FULL")) {
274     cout<<"Make track candidates starting from 1 cluster in each of the stations 4 and 5: ";
275     if (fMakeMoreTrackCandidates) cout<<"ON"<<endl;
276     else cout<<"OFF"<<endl;
277   } else if (fMakeMoreTrackCandidates)
278     cout<<"Make track candidates starting from 1 cluster in each of the stations 4 and 5"<<endl;
279   
280   if (strstr(option,"FULL")) {
281     cout<<"Try to recover tracks getting lost during tracking: ";
282     if (fRecoverTracks) cout<<"ON"<<endl;
283     else cout<<"OFF"<<endl;
284   } else if (fRecoverTracks)
285     cout<<"Try to recover tracks getting lost during tracking"<<endl;
286   
287   if (strstr(option,"FULL")) {
288     cout<<"Try to complete the reconstructed tracks by adding missing clusters: ";
289     if (fComplementTracks) cout<<"ON"<<endl;
290     else cout<<"OFF"<<endl;
291   } else if (fComplementTracks)
292     cout<<"Try to complete the reconstructed tracks by adding missing clusters"<<endl;
293   
294   if (strstr(option,"FULL")) {
295     cout<<"Try to improve the reconstructed tracks by removing bad clusters: ";
296     if (fImproveTracks) cout<<Form("ON (sigma cut = %5.2f)",fSigmaCutForImprovement)<<endl;
297     else cout<<"OFF"<<endl;
298   } else if (fImproveTracks)
299     cout<<Form("Try to improve the reconstructed tracks by removing bad clusters (sigma cut = %5.2f)",fSigmaCutForImprovement)<<endl;
300   
301   if (strstr(option,"FULL")) {
302     cout<<"Use smoother to compute final track parameters, etc, at each cluster (used for Kalman tracking only): ";
303     if (fUseSmoother) cout<<"ON"<<endl;
304     else cout<<"OFF"<<endl;
305   } else if (fUseSmoother)
306     cout<<"Use smoother to compute final track parameters, etc, at each cluster"<<endl;
307   
308   cout<<Form("Maximum normalized chi2 of tracking/trigger track matching = %5.2f",fMaxNormChi2MatchTrigger)<<endl;
309   
310   Bool_t discardedCh = kFALSE;
311   Int_t ch = 0;
312   do {
313     if (!UseChamber(ch)) {
314       if (!discardedCh) {
315         cout<<"Discarded chambers(1..): "<<ch+1;
316         discardedCh = kTRUE;
317       }
318       else cout<<" "<<ch+1;
319     }
320   } while (++ch < 10);
321   if (discardedCh) cout<<endl;
322   
323   Bool_t discardedSt = kFALSE;
324   Int_t st = 0;
325   do {
326     if (!RequestStation(st)) {
327       if (!discardedSt) {
328         cout<<"Not requested stations(1..): "<<st+1;
329         discardedSt = kTRUE;
330       }
331       else cout<<" "<<st+1;
332     }
333   } while (++st < 5);
334   if (discardedSt) cout<<endl;
335   
336   cout<<"\t-------------------------------------"<<endl<<endl;
337   
338 }
339