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