]> git.uio.no Git - u/mrichter/AliRoot.git/blob - MUON/AliMUONRecoParam.cxx
AliMUONRecoParam.cxx
[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 // $Id$
17
18 //-----------------------------------------------------------------------------
19 /// \class AliMUONRecoParam
20 ///
21 /// Class with MUON reconstruction parameters
22 ///
23 ///  \author Philippe Pillot
24 //-----------------------------------------------------------------------------
25
26
27
28 #include "AliMUONRecoParam.h"
29
30 #include "AliLog.h"
31 #include "AliMUONPadStatusMaker.h"
32
33 #include <Riostream.h>
34
35 ClassImp(AliMUONRecoParam)
36
37
38 //_____________________________________________________________________________
39 AliMUONRecoParam::AliMUONRecoParam()
40 : AliDetectorRecoParam(),
41   fClusteringMode("MLEM"),
42   fTrackingMode("KALMAN"),
43   fMostProbBendingMomentum(0.),
44   fMinBendingMomentum(0.),
45   fMaxBendingMomentum(0.),
46   fMaxNonBendingSlope(0.),
47   fMaxBendingSlope(0.),
48   fNonBendingVertexDispersion(0.),
49   fBendingVertexDispersion(0.),
50   fMaxNonBendingDistanceToTrack(0.),
51   fMaxBendingDistanceToTrack(0.),
52   fSigmaCutForTracking(0.),
53   fSigmaCutForImprovement(0.),
54   fSigmaCutForTrigger(0.),
55   fStripCutForTrigger(0.),
56   fMaxStripAreaForTrigger(0.),
57   fMaxNormChi2MatchTrigger(0.),
58   fPercentOfFullClusterInESD(10.),
59   fCombinedClusterTrackReco(kFALSE),
60   fTrackAllTracks(kFALSE),
61   fRecoverTracks(kFALSE),
62   fMakeTrackCandidatesFast(kFALSE),
63   fMakeMoreTrackCandidates(kFALSE),
64   fComplementTracks(kFALSE),
65   fImproveTracks(kFALSE),
66   fUseSmoother(kFALSE),
67   fSaveFullClusterInESD(kTRUE),
68   fCalibrationMode("NOGAIN"),
69   fBypassSt45(0),
70   fPadGoodnessMask(0)
71 {
72   /// Constructor
73   SetNameTitle("MUON","MUON");
74   
75         SetDefaultLimits();
76         
77   // use the default parameters for low flux environment
78   SetLowFluxParam();
79 }
80
81 //_____________________________________________________________________________
82 AliMUONRecoParam::~AliMUONRecoParam() 
83 {
84   /// Destructor
85 }
86
87 //_____________________________________________________________________________
88 void
89 AliMUONRecoParam::BypassSt45(Bool_t st4, Bool_t st5)
90 {
91         /// Set the bypass status
92         
93         if ( st4 && st5 ) fBypassSt45 = 45;
94         else if ( st4 ) fBypassSt45 = 4;
95         else if ( st5 ) fBypassSt45 = 5;
96         else fBypassSt45 = 0;
97 }
98
99 //_____________________________________________________________________________
100 Option_t*
101 AliMUONRecoParam::GetCalibrationMode() const
102 {
103   /// Return the calibration mode. Can be : 
104   /// NOGAIN : only do pedestal subtraction
105   /// GAIN : do pedestal subtraction, and apply gain correction, but with a
106   ///        single capacitance value for all channels
107   /// GAINCONSTANTCAPA : as GAIN, but with a channel-dependent capacitance value
108   
109   return fCalibrationMode.Data();
110 }
111
112 //_____________________________________________________________________________
113 AliMUONRecoParam *AliMUONRecoParam::GetLowFluxParam() 
114 {
115   /// Return default reconstruction parameters for low flux environment
116   
117   AliMUONRecoParam *param = new AliMUONRecoParam();
118   param->SetLowFluxParam();
119   
120   return param;
121 }
122
123 //_____________________________________________________________________________
124 AliMUONRecoParam *AliMUONRecoParam::GetHighFluxParam() 
125 {
126   /// Return default reconstruction parameters for high flux environment
127   
128   AliMUONRecoParam *param = new AliMUONRecoParam();
129   param->SetHighFluxParam();
130  
131   return param;
132 }
133
134 //_____________________________________________________________________________
135 AliMUONRecoParam *AliMUONRecoParam::GetCosmicParam() 
136 {
137   /// Return default reconstruction parameters for high flux environment
138   
139   AliMUONRecoParam *param = new AliMUONRecoParam();
140   param->SetCosmicParam();
141   
142   return param;
143 }
144
145 //_____________________________________________________________________________
146 void AliMUONRecoParam::SetLowFluxParam() 
147 {
148   /// Set reconstruction parameters for low flux environment
149   
150   fMostProbBendingMomentum = 2.;
151   fMinBendingMomentum = 1.;
152   fMaxBendingMomentum = 3000.;
153   fMaxNonBendingSlope = 0.3;
154   fMaxBendingSlope = 0.4;
155   fNonBendingVertexDispersion = 10.;
156   fBendingVertexDispersion = 10.;
157   fMaxNonBendingDistanceToTrack = 1.;
158   fMaxBendingDistanceToTrack = 1.;
159   fSigmaCutForTracking = 6.;
160   fSigmaCutForImprovement = 5.;
161   fSigmaCutForTrigger = 8.;
162   fStripCutForTrigger = 1.;
163   fMaxStripAreaForTrigger = 3.;
164   fMaxNormChi2MatchTrigger = 16.;
165   fCombinedClusterTrackReco = kFALSE;
166   fTrackAllTracks = kTRUE;
167   fRecoverTracks = kTRUE;
168   fMakeTrackCandidatesFast = kFALSE;
169   fMakeMoreTrackCandidates = kFALSE;
170   fComplementTracks = kTRUE;
171   fImproveTracks = kTRUE;
172   fUseSmoother = kTRUE;
173   for (Int_t iCh = 0; iCh < 10; iCh++) fUseChamber[iCh] = kTRUE;
174   for (Int_t iSt = 0; iSt < 5; iSt++) fRequestStation[iSt] = kTRUE;
175   fBypassSt45 = 0;
176   
177 }
178
179 //_____________________________________________________________________________
180 void AliMUONRecoParam::SetHighFluxParam() 
181 {
182   /// Set reconstruction parameters for high flux environment
183   
184   fMostProbBendingMomentum = 2.;
185   fMinBendingMomentum = 1.;
186   fMaxBendingMomentum = 3000.;
187   fMaxNonBendingSlope = 0.3;
188   fMaxBendingSlope = 0.4;
189   fNonBendingVertexDispersion = 10.;
190   fBendingVertexDispersion = 10.;
191   fMaxNonBendingDistanceToTrack = 1.;
192   fMaxBendingDistanceToTrack = 1.;
193   fSigmaCutForTracking = 6.;
194   fSigmaCutForImprovement = 5.;
195   fSigmaCutForTrigger = 8.;
196   fStripCutForTrigger = 1.;
197   fMaxStripAreaForTrigger = 3.;
198   fMaxNormChi2MatchTrigger = 16.;
199   fCombinedClusterTrackReco = kFALSE;
200   fTrackAllTracks = kTRUE;
201   fRecoverTracks = kTRUE;
202   fMakeTrackCandidatesFast = kFALSE;
203   fMakeMoreTrackCandidates = kFALSE;
204   fComplementTracks = kTRUE;
205   fImproveTracks = kTRUE;
206   fUseSmoother = kTRUE;
207   for (Int_t iCh = 0; iCh < 10; iCh++) fUseChamber[iCh] = kTRUE;
208   for (Int_t iSt = 0; iSt < 5; iSt++) fRequestStation[iSt] = kTRUE;
209   fBypassSt45 = 0;
210   
211 }
212
213 //_____________________________________________________________________________
214 void AliMUONRecoParam::SetCosmicParam() 
215 {
216   /// Set reconstruction parameters for high flux environment
217   
218   fMostProbBendingMomentum = 2.;
219   fMinBendingMomentum = 1.;
220   fMaxBendingMomentum = 10000000.;
221   fMaxNonBendingSlope = 0.3;
222   fMaxBendingSlope = 0.4;
223   fNonBendingVertexDispersion = 10.;
224   fBendingVertexDispersion = 10.;
225   fMaxNonBendingDistanceToTrack = 10.;
226   fMaxBendingDistanceToTrack = 10.;
227   fSigmaCutForTracking = 20.;
228   fSigmaCutForImprovement = 20.;
229   fSigmaCutForTrigger = 8.;
230   fMaxNormChi2MatchTrigger = 16.;
231   fPercentOfFullClusterInESD = 100.;
232   fCombinedClusterTrackReco = kFALSE;
233   fTrackAllTracks = kTRUE;
234   fRecoverTracks = kTRUE;
235   fMakeTrackCandidatesFast = kFALSE;
236   fMakeMoreTrackCandidates = kFALSE;
237   fComplementTracks = kTRUE;
238   fImproveTracks = kTRUE;
239   fUseSmoother = kTRUE;
240   fSaveFullClusterInESD = kTRUE;
241   for (Int_t iCh = 0; iCh < 10; iCh++) fUseChamber[iCh] = kTRUE;
242   for (Int_t iSt = 0; iSt < 5; iSt++) fRequestStation[iSt] = kTRUE;
243   fBypassSt45 = 0;
244   
245 }
246
247 //_____________________________________________________________________________
248 void AliMUONRecoParam::Print(Option_t *option) const
249 {
250   /// print reconstruction parameters
251   /// if option = FULL then print also unused parameters
252   
253   cout<<endl<<"\t------Reconstruction parameters------"<<endl;
254   
255   cout<<Form("Calibration mode = %s",fCalibrationMode.Data())<<endl;
256   cout<<Form("Clustering mode = %s",fClusteringMode.Data())<<endl;
257   cout<<Form("Tracking mode = %s",fTrackingMode.Data())<<endl;
258
259         TString bypass;
260         
261         if ( BypassSt45() )
262         {
263                 bypass = "stations 4 and 5";
264         }
265         else if ( BypassSt4() ) 
266         {
267                 bypass = "station 4";
268         }
269         else if ( BypassSt5() ) 
270         {
271                 bypass = "station 5";
272         }
273         
274   if (bypass.Length()) cout << "Will bypass " << bypass.Data() << " (replacing real clusters by generated ones from trigger tracks)" << endl;
275   
276   if (fCombinedClusterTrackReco) cout<<"Combined cluster/track reconstruction: ON"<<endl;
277   else cout<<"Combined cluster/track reconstruction: OFF"<<endl;
278   
279   if (fSaveFullClusterInESD) cout<<Form("Save all cluster info in ESD for %5.2f %% of events",fPercentOfFullClusterInESD)<<endl;
280   else cout<<"Save partial cluster info in ESD"<<endl;
281   
282   cout<<Form("Most probable bending momentum (used only if B=0) = %5.2f",fMostProbBendingMomentum)<<endl;
283   
284   cout<<Form("Bending momentum range = [%5.2f,%5.2f]",fMinBendingMomentum,fMaxBendingMomentum)<<endl;
285   
286   cout<<Form("Maximum non bending slope = %5.2f",fMaxNonBendingSlope)<<endl;
287   
288   cout<<Form("Maximum bending slope (used only if B=0) = %5.2f",fMaxBendingSlope)<<endl;
289   
290   if (strstr(fTrackingMode,"ORIGINAL"))
291     cout<<Form("Vertex dispertion = (%5.2f,%5.2f)",fNonBendingVertexDispersion,fBendingVertexDispersion)<<endl;
292   else if (strstr(option,"FULL"))
293     cout<<Form("Vertex dispertion (used for original tracking only) = (%5.2f,%5.2f)",fNonBendingVertexDispersion,fBendingVertexDispersion)<<endl;
294   
295   cout<<Form("Maximum distance to track = (%5.2f,%5.2f)",fMaxNonBendingDistanceToTrack,fMaxBendingDistanceToTrack)<<endl;
296   
297   cout<<Form("Sigma cut for tracking = %5.2f",fSigmaCutForTracking)<<endl;
298
299   cout<<Form("Sigma cut for trigger hit pattern = %5.2f",fSigmaCutForTrigger)<<endl;
300
301   cout<<Form("Cut in strips for trigger chamber efficiency = %5.2f",fStripCutForTrigger)<<endl;
302
303   cout<<Form("Max search area in strips for trigger chamber efficiency = %5.2f",fMaxStripAreaForTrigger)<<endl;
304
305   if (fTrackAllTracks) cout<<"Track all the possible candidates"<<endl;
306   else cout<<"Track only the best candidates"<<endl;
307   
308   if (strstr(option,"FULL")) {
309     cout<<"Make track candidates assuming linear propagation between stations 4 and 5: ";
310     if (fMakeTrackCandidatesFast) cout<<"ON"<<endl;
311     else cout<<"OFF"<<endl;
312   } else if (fMakeTrackCandidatesFast)
313     cout<<"Make track candidates assuming linear propagation between stations 4 and 5"<<endl;
314   
315   if (strstr(option,"FULL")) {
316     cout<<"Make track candidates starting from 1 cluster in each of the stations 4 and 5: ";
317     if (fMakeMoreTrackCandidates) cout<<"ON"<<endl;
318     else cout<<"OFF"<<endl;
319   } else if (fMakeMoreTrackCandidates)
320     cout<<"Make track candidates starting from 1 cluster in each of the stations 4 and 5"<<endl;
321   
322   if (strstr(option,"FULL")) {
323     cout<<"Try to recover tracks getting lost during tracking: ";
324     if (fRecoverTracks) cout<<"ON"<<endl;
325     else cout<<"OFF"<<endl;
326   } else if (fRecoverTracks)
327     cout<<"Try to recover tracks getting lost during tracking"<<endl;
328   
329   if (strstr(option,"FULL")) {
330     cout<<"Try to complete the reconstructed tracks by adding missing clusters: ";
331     if (fComplementTracks) cout<<"ON"<<endl;
332     else cout<<"OFF"<<endl;
333   } else if (fComplementTracks)
334     cout<<"Try to complete the reconstructed tracks by adding missing clusters"<<endl;
335   
336   if (strstr(option,"FULL")) {
337     cout<<"Try to improve the reconstructed tracks by removing bad clusters: ";
338     if (fImproveTracks) cout<<Form("ON (sigma cut = %5.2f)",fSigmaCutForImprovement)<<endl;
339     else cout<<"OFF"<<endl;
340   } else if (fImproveTracks)
341     cout<<Form("Try to improve the reconstructed tracks by removing bad clusters (sigma cut = %5.2f)",fSigmaCutForImprovement)<<endl;
342   
343   if (strstr(option,"FULL")) {
344     cout<<"Use smoother to compute final track parameters, etc, at each cluster (used for Kalman tracking only): ";
345     if (fUseSmoother) cout<<"ON"<<endl;
346     else cout<<"OFF"<<endl;
347   } else if (fUseSmoother)
348     cout<<"Use smoother to compute final track parameters, etc, at each cluster"<<endl;
349   
350   cout<<Form("Maximum normalized chi2 of tracking/trigger track matching = %5.2f",fMaxNormChi2MatchTrigger)<<endl;
351   
352   Bool_t discardedCh = kFALSE;
353   Int_t ch = 0;
354   do {
355     if (!UseChamber(ch)) {
356       if (!discardedCh) {
357         cout<<"Discarded chambers(1..): "<<ch+1;
358         discardedCh = kTRUE;
359       }
360       else cout<<" "<<ch+1;
361     }
362   } while (++ch < 10);
363   if (discardedCh) cout<<endl;
364   
365   Bool_t discardedSt = kFALSE;
366   Int_t st = 0;
367   do {
368     if (!RequestStation(st)) {
369       if (!discardedSt) {
370         cout<<"Not requested stations(1..): "<<st+1;
371         discardedSt = kTRUE;
372       }
373       else cout<<" "<<st+1;
374     }
375   } while (++st < 5);
376   if (discardedSt) cout<<endl;
377   
378         cout << Form("Pad goodness policy mask is 0x%x",PadGoodnessMask()) << endl;
379         cout << "Which means we reject pads having the condition = " <<
380         AliMUONPadStatusMaker::AsCondition(PadGoodnessMask()).Data() << endl;
381         
382         cout << "The pad limits we are using are :" << endl;
383         
384         cout << Form("%5.0f <= HVSt12 <= %5.0f Volts",HVSt12LowLimit(),HVSt12HighLimit()) << endl;
385         cout << Form("%5.0f <= HVSt345 <= %5.0f Volts",HVSt345LowLimit(),HVSt345HighLimit()) << endl;
386         cout << Form("%7.2f <= Pedestal mean <= %7.2f",PedMeanLowLimit(),PedMeanHighLimit()) << endl;
387         cout << Form("%7.2f <= Pedestal sigma <= %7.2f",PedSigmaLowLimit(),PedSigmaHighLimit()) << endl;
388         cout << Form("%e <= Gain linear term <= %e",GainA1LowLimit(),GainA1HighLimit()) << endl;
389         cout << Form("%e <= Gain quadratic term <= %e",GainA2LowLimit(),GainA2HighLimit()) << endl;
390         cout << Form("%5.0f <= Gain threshold term <= %5.0f",GainThresLowLimit(),GainThresHighLimit()) << endl;
391         
392   cout<<"\t-------------------------------------"<<endl<<endl;
393   
394 }
395
396 //_____________________________________________________________________________
397 void
398 AliMUONRecoParam::SetDefaultLimits()
399 {
400         /// Set the default limits and pad goodness policy
401
402         fHVSt12Limits[0]=1500;
403         fHVSt12Limits[1]=2000;
404
405         fHVSt345Limits[0]=1500;
406         fHVSt345Limits[1]=2000;
407
408         fPedMeanLimits[0] = 50;
409         fPedMeanLimits[1] = 1024;
410         
411         fPedSigmaLimits[0] = 0.1;
412         fPedSigmaLimits[1] = 100;
413
414         fGainA1Limits[0] = 0.1;
415         fGainA1Limits[1] = 10;
416
417         fGainA2Limits[0] = -1E30;
418         fGainA2Limits[1] = 1E30;
419         
420         fGainThresLimits[0] = 0;
421         fGainThresLimits[1] = 4095;
422         
423         fPadGoodnessMask = 0x8080;
424 }
425