]> git.uio.no Git - u/mrichter/AliRoot.git/blob - MUON/AliMUONRecoParam.h
ConsistencyCheck() rewritten.
[u/mrichter/AliRoot.git] / MUON / AliMUONRecoParam.h
1 #ifndef ALIMUONRECOPARAM_H
2 #define ALIMUONRECOPARAM_H
3 /* Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
4 * See cxx source for full Copyright notice                               */
5
6 // $Id$
7
8 /// \ingroup rec
9 /// \class AliMUONRecoParam
10 /// \brief Class with MUON reconstruction parameters
11 ///
12 //  Author: Philippe Pillot
13
14 #include "AliDetectorRecoParam.h"
15 #include "TString.h"
16 #include <TMath.h>
17
18 class AliMUONRecoParam : public AliDetectorRecoParam
19 {
20  public: 
21   AliMUONRecoParam();
22   virtual ~AliMUONRecoParam();
23   
24   static AliMUONRecoParam *GetLowFluxParam();
25   static AliMUONRecoParam *GetHighFluxParam();
26   static AliMUONRecoParam *GetCosmicParam();
27   
28   /// set the calibration mode (see GetCalibrationMode() for possible modes)
29   void SetCalibrationMode(Option_t* mode) { fCalibrationMode = mode; fCalibrationMode.ToUpper();}
30   
31   Option_t* GetCalibrationMode() const;
32   
33   /// set the clustering (pre-clustering) mode
34   void      SetClusteringMode(Option_t* mode) {fClusteringMode = mode; fClusteringMode.ToUpper();}
35   /// get the clustering (pre-clustering) mode
36   Option_t* GetClusteringMode() const {return fClusteringMode.Data();}
37   
38   /// set the tracking mode
39   void      SetTrackingMode(Option_t* mode) {fTrackingMode = mode; fTrackingMode.ToUpper();}
40   /// get the tracking mode
41   Option_t* GetTrackingMode() const {return fTrackingMode.Data();}
42   
43   /// switch on/off the combined cluster/track reconstruction
44   void      CombineClusterTrackReco(Bool_t flag) {fCombinedClusterTrackReco = flag;}
45   /// return kTRUE/kFALSE if the combined cluster/track reconstruction is on/off
46   Bool_t    CombineClusterTrackReco() const {return fCombinedClusterTrackReco;}
47   
48   /// save all cluster info (including pads) in ESD, for the given percentage of events
49   void      SaveFullClusterInESD(Bool_t flag, Double_t percentOfEvent = 100.) {fSaveFullClusterInESD = flag;
50                                  fPercentOfFullClusterInESD = (fSaveFullClusterInESD) ? percentOfEvent : 0.;}
51   /// return kTRUE/kFALSE depending on whether we save all cluster info in ESD or not
52   Bool_t    SaveFullClusterInESD() const {return fSaveFullClusterInESD;}
53   /// return the percentage of events for which all cluster info are stored in ESD
54   Double_t  GetPercentOfFullClusterInESD() const {return fPercentOfFullClusterInESD;}
55   
56   /// set the minimum value (GeV/c) of momentum in bending plane
57   void     SetMinBendingMomentum(Double_t val) {fMinBendingMomentum = val;}
58   /// return the minimum value (GeV/c) of momentum in bending plane
59   Double_t GetMinBendingMomentum() const {return fMinBendingMomentum;}
60   /// set the maximum value (GeV/c) of momentum in bending plane
61   void     SetMaxBendingMomentum(Double_t val) {fMaxBendingMomentum = val;}
62   /// return the maximum value (GeV/c) of momentum in bending plane
63   Double_t GetMaxBendingMomentum() const {return fMaxBendingMomentum;}
64   
65   /// set the maximum value of the non bending slope
66   void     SetMaxNonBendingSlope(Double_t val) {fMaxNonBendingSlope = val;}
67   /// return the maximum value of the non bending slope
68   Double_t GetMaxNonBendingSlope() const {return fMaxNonBendingSlope;}
69   /// set the maximum value of the bending slope
70   void     SetMaxBendingSlope(Double_t val) {fMaxBendingSlope = val;}
71   /// return the maximum value of the bending slope
72   Double_t GetMaxBendingSlope() const {return fMaxBendingSlope;}
73   
74   /// switch on/off the track selection according to their slope (instead of their impact parameter)
75   void     SelectOnTrackSlope(Bool_t flag) {fSelectTrackOnSlope = flag;}
76   /// return kTRUE/kFALSE if tracks are selected according to their slope/impact parameter
77   Bool_t   SelectOnTrackSlope() const {return fSelectTrackOnSlope;}
78   
79   /// set the vertex dispersion (cm) in non bending plane (used for original tracking only)
80   void     SetNonBendingVertexDispersion(Double_t val) {fNonBendingVertexDispersion = val;} 
81   /// return the vertex dispersion (cm) in non bending plane (used for original tracking only)
82   Double_t GetNonBendingVertexDispersion() const {return fNonBendingVertexDispersion;}
83   /// set the vertex dispersion (cm) in bending plane (used for original tracking only)
84   void     SetBendingVertexDispersion(Double_t val) {fBendingVertexDispersion = val;} 
85   /// return the vertex dispersion (cm) in bending plane (used for original tracking only)
86   Double_t GetBendingVertexDispersion() const {return fBendingVertexDispersion;}
87   
88   /// set the maximum distance to the track to search for compatible cluster(s) in non bending direction
89   void     SetMaxNonBendingDistanceToTrack(Double_t val) {fMaxNonBendingDistanceToTrack = val;} 
90   /// return the maximum distance to the track to search for compatible cluster(s) in non bending direction
91   Double_t GetMaxNonBendingDistanceToTrack() const {return fMaxNonBendingDistanceToTrack;}
92   /// set the maximum distance to the track to search for compatible cluster(s) in bending direction
93   void     SetMaxBendingDistanceToTrack(Double_t val) {fMaxBendingDistanceToTrack = val;} 
94   /// return the maximum distance to the track to search for compatible cluster(s) in bending direction
95   Double_t GetMaxBendingDistanceToTrack() const {return fMaxBendingDistanceToTrack;}
96   
97   /// set the cut in sigma to apply on cluster (local chi2) and track (global chi2) during tracking
98   void     SetSigmaCutForTracking(Double_t val) {fSigmaCutForTracking = val;} 
99   /// return the cut in sigma to apply on cluster (local chi2) and track (global chi2) during tracking
100   Double_t GetSigmaCutForTracking() const {return fSigmaCutForTracking;}
101   
102   /// switch on/off the track improvement and keep the default cut in sigma to apply on cluster (local chi2)
103   void     ImproveTracks(Bool_t flag) {fImproveTracks = flag;} 
104   /// switch on/off the track improvement and set the cut in sigma to apply on cluster (local chi2)
105   void     ImproveTracks(Bool_t flag, Double_t sigmaCut) {fImproveTracks = flag; fSigmaCutForImprovement = sigmaCut;} 
106   /// return kTRUE/kFALSE if the track improvement is switch on/off
107   Bool_t   ImproveTracks() const {return fImproveTracks;}
108   /// return the cut in sigma to apply on cluster (local chi2) during track improvement
109   Double_t GetSigmaCutForImprovement() const {return fSigmaCutForImprovement;}
110   
111   /// set the cut in sigma to apply on track during trigger hit pattern search
112   void     SetSigmaCutForTrigger(Double_t val) {fSigmaCutForTrigger = val;} 
113   /// return the cut in sigma to apply on track during trigger hit pattern search
114   Double_t GetSigmaCutForTrigger() const {return fSigmaCutForTrigger;}
115   /// set the cut in strips to apply on trigger track during trigger chamber efficiency
116   void     SetStripCutForTrigger(Double_t val) {fStripCutForTrigger = val;} 
117   /// return the cut in strips to apply on trigger track during trigger chamber efficiency
118   Double_t GetStripCutForTrigger() const {return fStripCutForTrigger;}
119   /// set the maximum search area in strips to apply on trigger track during trigger chamber efficiency
120   void     SetMaxStripAreaForTrigger(Double_t val) {fMaxStripAreaForTrigger = val;} 
121   /// return the maximum search area in strips to apply on trigger track during trigger chamber efficiency
122   Double_t GetMaxStripAreaForTrigger() const {return fMaxStripAreaForTrigger;}
123   
124   /// set the maximum normalized chi2 of tracking/trigger track matching
125   void     SetMaxNormChi2MatchTrigger(Double_t val) {fMaxNormChi2MatchTrigger = val;} 
126   /// return the maximum normalized chi2 of tracking/trigger track matching
127   Double_t GetMaxNormChi2MatchTrigger() const {return fMaxNormChi2MatchTrigger;}
128   
129   /// switch on/off the tracking of all the possible candidates (track only the best one if switched off)
130   void     TrackAllTracks(Bool_t flag) {fTrackAllTracks = flag;} 
131   /// return kTRUE/kFALSE if the tracking of all the possible candidates is switched on/off
132   Bool_t   TrackAllTracks() const {return fTrackAllTracks;}
133   
134   /// switch on/off the recovering of tracks being lost during reconstruction
135   void     RecoverTracks(Bool_t flag) {fRecoverTracks = flag;} 
136   /// return kTRUE/kFALSE if the recovering of tracks being lost during reconstruction is switched on/off
137   Bool_t   RecoverTracks() const {return fRecoverTracks;}
138   
139   /// switch on/off the fast building of track candidates (assuming linear propagation between stations 4 and 5)
140   void     MakeTrackCandidatesFast(Bool_t flag) {fMakeTrackCandidatesFast = flag;} 
141   /// return kTRUE/kFALSE if the fast building of track candidates is switched on/off
142   Bool_t   MakeTrackCandidatesFast() const {return fMakeTrackCandidatesFast;}
143   
144   /// switch on/off the building of track candidates starting from 1 cluster in each of the stations 4 and 5
145   void     MakeMoreTrackCandidates(Bool_t flag) {fMakeMoreTrackCandidates = flag;} 
146   /// return kTRUE/kFALSE if the building of extra track candidates is switched on/off
147   Bool_t   MakeMoreTrackCandidates() const {return fMakeMoreTrackCandidates;}
148   
149   /// switch on/off the completion of reconstructed track
150   void     ComplementTracks(Bool_t flag) {fComplementTracks = flag;} 
151   /// return kTRUE/kFALSE if completion of the reconstructed track is switched on/off
152   Bool_t   ComplementTracks() const {return fComplementTracks;}
153   
154   /// remove tracks sharing cluster in stations 1 or 2
155   void     RemoveConnectedTracksInSt12(Bool_t flag) {fRemoveConnectedTracksInSt12 = flag;} 
156   /// return kTRUE/kFALSE whether tracks sharing cluster in station 1 and 2 must be removed or not
157   Bool_t   RemoveConnectedTracksInSt12() const {return fRemoveConnectedTracksInSt12;}
158   
159   /// switch on/off the use of the smoother
160   void     UseSmoother(Bool_t flag) {fUseSmoother = flag;} 
161   /// return kTRUE/kFALSE if the use of the smoother is switched on/off
162   Bool_t   UseSmoother() const {return fUseSmoother;}
163   
164   /// switch on/off a chamber in the reconstruction
165   void     UseChamber(Int_t iCh, Bool_t flag) {if (iCh >= 0 && iCh < 10) fUseChamber[iCh] = flag;}
166   /// return kTRUE/kFALSE whether the chamber must be used or not
167   Bool_t   UseChamber(Int_t iCh) const {return (iCh >= 0 && iCh < 10) ? fUseChamber[iCh] : kFALSE;}
168   
169   /// request or not at least one cluster in the station to validate the track
170   void     RequestStation(Int_t iSt, Bool_t flag) {if (iSt >= 0 && iSt < 5) fRequestStation[iSt] = flag;}
171   /// return kTRUE/kFALSE whether at least one cluster is requested in the station to validate the track
172   Bool_t   RequestStation(Int_t iSt) const {return (iSt >= 0 && iSt < 5) ? fRequestStation[iSt] : kFALSE;}
173   /// return an integer where first 5 bits are set to 1 if the corresponding station is requested
174   UInt_t   RequestedStationMask() const;
175   
176   /// set the bypassSt45 value
177   void   BypassSt45(Bool_t st4, Bool_t st5);
178   
179   /// return kTRUE if we should replace clusters in St 4 and 5 by generated clusters from trigger tracks
180   Bool_t BypassSt45() const { return fBypassSt45==45; }
181   
182   /// return kTRUE if we should replace clusters in St 4 by generated clusters from trigger tracks
183   Bool_t BypassSt4() const { return BypassSt45() || fBypassSt45==4 ; }
184   
185   /// return kTRUE if we should replace clusters in St 5 by generated clusters from trigger tracks
186   Bool_t BypassSt5() const { return BypassSt45() || fBypassSt45==5 ; }
187   
188   /// Set Low and High threshold for St12 HV
189   void    SetHVSt12Limits(float low, float high) { fHVSt12Limits[0]=low; fHVSt12Limits[1]=high; }
190   /// Retrieve low limit for St12's HV
191   Float_t HVSt12LowLimit() const { return fHVSt12Limits[0]; }
192   /// Retrieve high limit for St12's HV
193   Float_t HVSt12HighLimit() const { return fHVSt12Limits[1]; }
194   
195   /// Set Low and High threshold for St345 HV
196   void    SetHVSt345Limits(float low, float high) { fHVSt345Limits[0]=low; fHVSt345Limits[1]=high; } 
197   /// Retrieve low limit for St345's HV
198   Float_t HVSt345LowLimit() const { return fHVSt345Limits[0]; }
199   /// Retrieve high limit for St345's HV
200   Float_t HVSt345HighLimit() const { return fHVSt345Limits[1]; }
201   
202   /// Set Low and High threshold for pedestal mean
203   void    SetPedMeanLimits(float low, float high) { fPedMeanLimits[0]=low; fPedMeanLimits[1]=high; }
204   /// Retrieve low limit of ped mean
205   Float_t PedMeanLowLimit() const { return fPedMeanLimits[0]; }
206   /// Retrieve high limit of ped mean
207   Float_t PedMeanHighLimit() const { return fPedMeanLimits[1]; }
208   
209   /// Set Low and High threshold for pedestal sigma 
210   void    SetPedSigmaLimits(float low, float high) { fPedSigmaLimits[0]=low; fPedSigmaLimits[1]=high; }
211   /// Retrieve low limit of ped sigma
212   Float_t PedSigmaLowLimit() const { return fPedSigmaLimits[0]; }
213   /// Retrieve high limit of ped sigma
214   Float_t PedSigmaHighLimit() const { return fPedSigmaLimits[1]; }
215   
216   /// Set Low and High threshold for gain a0 term
217   void    SetGainA1Limits(float low, float high) { fGainA1Limits[0]=low; fGainA1Limits[1]=high; }
218   /// Retrieve low limit of a1 (linear term) gain parameter
219   Float_t GainA1LowLimit() const { return fGainA1Limits[0]; }
220   /// Retrieve high limit of a1 (linear term) gain parameter
221   Float_t GainA1HighLimit() const { return fGainA1Limits[1]; }
222   
223   /// Set Low and High threshold for gain a1 term
224   void    SetGainA2Limits(float low, float high) { fGainA2Limits[0]=low; fGainA2Limits[1]=high; }
225   /// Retrieve low limit of a2 (quadratic term) gain parameter
226   Float_t GainA2LowLimit() const { return fGainA2Limits[0]; }
227   /// Retrieve high limit of a2 (quadratic term) gain parameter
228   Float_t GainA2HighLimit() const { return fGainA2Limits[1]; }
229   
230   /// Set Low and High threshold for gain threshold term
231   void    SetGainThresLimits(float low, float high) { fGainThresLimits[0]=low; fGainThresLimits[1]=high; }
232   /// Retrieve low limit on threshold gain parameter
233   Float_t GainThresLowLimit() const { return fGainThresLimits[0]; }
234   /// Retrieve high limit on threshold gain parameter
235   Float_t GainThresHighLimit() const { return fGainThresLimits[1]; }
236   
237   /// Set the goodness mask (see AliMUONPadStatusMapMaker)
238   void   SetPadGoodnessMask(UInt_t mask) { fPadGoodnessMask=mask; }
239   /// Get the goodness mask
240   UInt_t PadGoodnessMask() const { return fPadGoodnessMask; }
241   
242   /// Number of sigma cut we must apply when cutting on adc-ped
243   Double_t ChargeSigmaCut() const { return fChargeSigmaCut; }
244   
245   /// Number of sigma cut we must apply when cutting on adc-ped
246   void ChargeSigmaCut(Double_t value) { fChargeSigmaCut=value; }
247   
248   /// Set the default non bending resolution of chamber iCh
249   void     SetDefaultNonBendingReso(Int_t iCh, Double_t val) {if (iCh >= 0 && iCh < 10) fDefaultNonBendingReso[iCh] = val;}
250   /// Get the default non bending resolution of chamber iCh
251   Double_t GetDefaultNonBendingReso(Int_t iCh) const {return (iCh >= 0 && iCh < 10) ? fDefaultNonBendingReso[iCh] : FLT_MAX;}
252   /// Set the default bending resolution of chamber iCh
253   void     SetDefaultBendingReso(Int_t iCh, Double_t val) {if (iCh >= 0 && iCh < 10) fDefaultBendingReso[iCh] = val;}
254   /// Get the default bending resolution of chamber iCh
255   Double_t GetDefaultBendingReso(Int_t iCh) const {return (iCh >= 0 && iCh < 10) ? fDefaultBendingReso[iCh] : FLT_MAX;}
256   
257   /// Set the maximum number of trigger tracks above which the tracking is cancelled
258   void SetMaxTriggerTracks(Int_t maxTriggerTracks) {fMaxTriggerTracks = maxTriggerTracks;}
259   /// Get the maximum number of trigger tracks above which the tracking is cancelled
260   Int_t GetMaxTriggerTracks() const {return fMaxTriggerTracks;}
261   
262   /// Set the maximum number of track candidates above which the tracking abort
263   void SetMaxTrackCandidates(Int_t maxTrackCandidates) {fMaxTrackCandidates = maxTrackCandidates;}
264   /// Get the maximum number of track candidates above which the tracking abort
265   Int_t GetMaxTrackCandidates() const {return fMaxTrackCandidates;}
266   
267   virtual void Print(Option_t *option = "") const;
268   
269   
270  private:
271   
272   void SetDefaultLimits();
273   
274         
275  private:
276   
277   /// clustering mode:  NOCLUSTERING, PRECLUSTER, PRECLUSTERV2, PRECLUSTERV3, COG, <pre>
278   ///                   SIMPLEFIT, SIMPLEFITV3, MLEM:DRAW, MLEM, MLEMV2, MLEMV3   </pre>
279   TString fClusteringMode; ///< \brief name of the clustering (+ pre-clustering) mode
280   
281   /// tracking mode: ORIGINAL, KALMAN
282   TString fTrackingMode; ///< \brief name of the tracking mode
283   
284   Double32_t fMinBendingMomentum; ///< minimum value (GeV/c) of momentum in bending plane
285   Double32_t fMaxBendingMomentum; ///< maximum value (GeV/c) of momentum in bending plane
286   Double32_t fMaxNonBendingSlope; ///< maximum value of the non bending slope
287   Double32_t fMaxBendingSlope;    ///< maximum value of the bending slope (used only if B = 0)
288   
289   Double32_t fNonBendingVertexDispersion; ///< vertex dispersion (cm) in non bending plane (used for original tracking only)
290   Double32_t fBendingVertexDispersion;    ///< vertex dispersion (cm) in bending plane (used for original tracking only)
291   
292   Double32_t fMaxNonBendingDistanceToTrack; ///< maximum distance to the track to search for compatible cluster(s) in non bending direction
293   Double32_t fMaxBendingDistanceToTrack;    ///< maximum distance to the track to search for compatible cluster(s) in bending direction
294   
295   Double32_t fSigmaCutForTracking; ///< cut in sigma to apply on cluster (local chi2) and track (global chi2) during tracking
296
297   Double32_t fSigmaCutForImprovement; ///< cut in sigma to apply on cluster (local chi2) during track improvement
298   
299   Double32_t fSigmaCutForTrigger; ///< cut in sigma to apply on track during trigger hit pattern search
300
301   Double32_t fStripCutForTrigger; ///< cut in strips to apply on trigger track during trigger chamber efficiency
302
303   Double32_t fMaxStripAreaForTrigger; ///< max. search area in strips to apply on trigger track during trigger chamber efficiency
304   
305   Double32_t fMaxNormChi2MatchTrigger; ///< maximum normalized chi2 of tracking/trigger track matching
306   
307   Double32_t fPercentOfFullClusterInESD; ///< percentage of events for which all cluster info are stored in ESD
308   
309   Bool_t     fCombinedClusterTrackReco; ///< switch on/off the combined cluster/track reconstruction
310   
311   Bool_t     fTrackAllTracks; ///< kTRUE to track all the possible candidates; kFALSE to track only the best ones
312   
313   Bool_t     fRecoverTracks; ///< kTRUE to try to recover the tracks getting lost during reconstruction
314   
315   Bool_t     fMakeTrackCandidatesFast; ///< kTRUE to make candidate tracks assuming linear propagation between stations 4 and 5
316   
317   Bool_t     fMakeMoreTrackCandidates; ///< kTRUE to make candidate tracks starting from 1 cluster in each of the stations 4 and 5
318   
319   Bool_t     fComplementTracks; ///< kTRUE to try to complete the reconstructed tracks by adding missing clusters
320   
321   Bool_t     fImproveTracks; ///< kTRUE to try to improve the reconstructed tracks by removing bad clusters
322   
323   Bool_t     fUseSmoother; ///< kTRUE to use the smoother to compute track parameters/covariances and local chi2 at each cluster (used for Kalman tracking only)
324   
325   Bool_t     fSaveFullClusterInESD; ///< kTRUE to save all cluster info (including pads) in ESD
326   
327   /// calibration mode:  GAIN, NOGAIN, GAINCONSTANTCAPA
328   TString    fCalibrationMode; ///<\brief calibration mode
329   
330   Int_t      fBypassSt45; ///< non-zero to use trigger tracks to generate "fake" clusters in St 4 and 5. Can be 0, 4, 5 or 45 only
331   
332   Bool_t     fUseChamber[10]; ///< kTRUE to use the chamber i in the tracking algorithm
333   
334   Bool_t     fRequestStation[5]; ///< kTRUE to request at least one cluster in station i to validate the track
335   
336   Double32_t fGainA1Limits[2]; ///< Low and High threshold for gain a0 parameter
337   Double32_t fGainA2Limits[2]; ///< Low and High threshold for gain a1 parameter
338   Double32_t fGainThresLimits[2]; ///< Low and High threshold for gain threshold parameter
339   Double32_t fHVSt12Limits[2]; ///< Low and High threshold for St12 HV
340   Double32_t fHVSt345Limits[2]; ///< Low and High threshold for St345 HV
341   Double32_t fPedMeanLimits[2]; ///< Low and High threshold for pedestal mean
342   Double32_t fPedSigmaLimits[2]; ///< Low and High threshold for pedestal sigma
343   
344   UInt_t     fPadGoodnessMask; ///< goodness mask (see AliMUONPadStatusMaker)
345   
346   Double32_t fChargeSigmaCut; ///< number of sigma to cut on adc-ped 
347   
348   Double32_t fDefaultNonBendingReso[10]; ///< default chamber resolution in the non-bending direction
349   Double32_t fDefaultBendingReso[10]; ///< default chamber resolution in the bending direction
350   
351   Bool_t     fRemoveConnectedTracksInSt12; ///< kTRUE to remove tracks sharing cluster in station 1 and 2
352   
353   Int_t      fMaxTriggerTracks; ///< maximum number of trigger tracks above which the tracking is cancelled
354   Int_t      fMaxTrackCandidates; ///< maximum number of track candidates above which the tracking abort
355   
356   Bool_t     fSelectTrackOnSlope; ///< select track candidates according to their slope (instead of their impact parameter)
357   
358   // functions
359   void SetLowFluxParam();
360   void SetHighFluxParam();
361   void SetCosmicParam();
362   
363   
364   ClassDef(AliMUONRecoParam,13) // MUON reco parameters
365 };
366
367 #endif
368