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