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