1 /**************************************************************************
2 * Copyright(c) 1998-2007, ALICE Experiment at CERN, All rights reserved. *
4 * Author: The ALICE Off-line Project. *
5 * Contributors are mentioned in the code where appropriate. *
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 **************************************************************************/
18 //-----------------------------------------------------------------------------
19 /// \class AliMUONRecoParam
21 /// Class with MUON reconstruction parameters
23 /// \author Philippe Pillot
24 //-----------------------------------------------------------------------------
28 #include "AliMUONRecoParam.h"
29 #include "AliMUONPadStatusMaker.h"
31 #include "AliRecoParam.h"
34 #include <Riostream.h>
36 ClassImp(AliMUONRecoParam)
39 //_____________________________________________________________________________
40 AliMUONRecoParam::AliMUONRecoParam()
41 : AliDetectorRecoParam(),
42 fClusteringMode("MLEM"),
43 fTrackingMode("KALMAN"),
44 fMinBendingMomentum(0.),
45 fMaxBendingMomentum(0.),
46 fMaxNonBendingSlope(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),
67 fSaveFullClusterInESD(kTRUE),
68 fCalibrationMode("NOGAIN"),
72 fRemoveConnectedTracksInSt12(kFALSE),
74 fMaxTrackCandidates(0),
75 fSelectTrackOnSlope(kFALSE),
76 fMissingPadFractionLimit(0),
77 fFractionOfBuspatchOutsideOccupancyLimit(0),
78 fAverageNoisePadCharge(0.22875),
79 fClusterChargeCut(2.0)
83 SetNameTitle("Dummy","Dummy");
84 for (Int_t iCh = 0; iCh < 10; iCh++) {
85 fUseChamber[iCh] = kTRUE;
86 fDefaultNonBendingReso[iCh] = 0.;
87 fDefaultBendingReso[iCh] = 0.;
89 for (Int_t iSt = 0; iSt < 5; iSt++) fRequestStation[iSt] = kTRUE;
93 //_____________________________________________________________________________
94 AliMUONRecoParam::~AliMUONRecoParam()
99 //_____________________________________________________________________________
101 AliMUONRecoParam::BypassSt45(Bool_t st4, Bool_t st5)
103 /// Set the bypass status
105 if ( st4 && st5 ) fBypassSt45 = 45;
106 else if ( st4 ) fBypassSt45 = 4;
107 else if ( st5 ) fBypassSt45 = 5;
108 else fBypassSt45 = 0;
111 //_____________________________________________________________________________
113 AliMUONRecoParam::GetCalibrationMode() const
115 /// Return the calibration mode. Can be :
116 /// NOGAIN : only do pedestal subtraction
117 /// GAIN : do pedestal subtraction, and apply gain correction, but with a
118 /// single capacitance value for all channels
119 /// INJECTIONGAIN : as GAIN, but with gain values taken as EMELEC factory values
120 /// GAINCONSTANTCAPA : as GAIN, but with a channel-dependent capacitance value
122 return fCalibrationMode.Data();
125 //_____________________________________________________________________________
126 AliMUONRecoParam *AliMUONRecoParam::GetLowFluxParam()
128 /// Return default reconstruction parameters for low flux environment
130 AliMUONRecoParam *param = new AliMUONRecoParam();
131 param->SetLowFluxParam();
136 //_____________________________________________________________________________
137 AliMUONRecoParam *AliMUONRecoParam::GetHighFluxParam()
139 /// Return default reconstruction parameters for high flux environment
141 AliMUONRecoParam *param = new AliMUONRecoParam();
142 param->SetHighFluxParam();
147 //_____________________________________________________________________________
148 AliMUONRecoParam *AliMUONRecoParam::GetCosmicParam()
150 /// Return default reconstruction parameters for high flux environment
152 AliMUONRecoParam *param = new AliMUONRecoParam();
153 param->SetCosmicParam();
158 //_____________________________________________________________________________
159 AliMUONRecoParam *AliMUONRecoParam::GetCalibrationParam()
161 /// Return default (dummy) reconstruction parameters for calibration environment
163 AliMUONRecoParam *param = new AliMUONRecoParam();
164 param->SetCalibrationParam();
170 //_____________________________________________________________________________
171 void AliMUONRecoParam::SetLowFluxParam()
173 /// Set reconstruction parameters for low flux environment
175 SetNameTitle("Low Flux","Low Flux");
176 SetEventSpecie(AliRecoParam::kLowMult);
177 fMinBendingMomentum = 0.8;
178 fMaxBendingMomentum = 1.e10;
179 fMaxNonBendingSlope = 0.3;
180 fMaxBendingSlope = 0.4;
181 fSelectTrackOnSlope = kFALSE;
182 fNonBendingVertexDispersion = 70.;
183 fBendingVertexDispersion = 70.;
184 fMaxNonBendingDistanceToTrack = 1.;
185 fMaxBendingDistanceToTrack = 1.;
186 fSigmaCutForTracking = 6.;
187 fSigmaCutForImprovement = 5.;
188 fSigmaCutForTrigger = 4.;
189 fStripCutForTrigger = 1.;
190 fMaxStripAreaForTrigger = 3.;
191 fMaxNormChi2MatchTrigger = fSigmaCutForTrigger * fSigmaCutForTrigger;
192 fCombinedClusterTrackReco = kFALSE;
193 fTrackAllTracks = kTRUE;
194 fRecoverTracks = kTRUE;
195 fMakeTrackCandidatesFast = kFALSE;
196 fMakeMoreTrackCandidates = kFALSE;
197 fComplementTracks = kTRUE;
198 fImproveTracks = kTRUE;
199 fRemoveConnectedTracksInSt12 = kFALSE;
200 fUseSmoother = kTRUE;
201 for (Int_t iCh = 0; iCh < 10; iCh++) {
202 fUseChamber[iCh] = kTRUE;
203 fDefaultNonBendingReso[iCh] = 0.144;
204 fDefaultBendingReso[iCh] = 0.01;
206 for (Int_t iSt = 0; iSt < 5; iSt++) fRequestStation[iSt] = kTRUE;
208 fMaxTriggerTracks = 100;
209 fMaxTrackCandidates = 10000;
212 //_____________________________________________________________________________
213 void AliMUONRecoParam::SetHighFluxParam()
215 /// Set reconstruction parameters for high flux environment
217 SetNameTitle("High Flux","High Flux");
218 SetEventSpecie(AliRecoParam::kHighMult);
219 fMinBendingMomentum = 0.8;
220 fMaxBendingMomentum = 1.e10;
221 fMaxNonBendingSlope = 0.3;
222 fMaxBendingSlope = 0.4;
223 fSelectTrackOnSlope = kFALSE;
224 fNonBendingVertexDispersion = 70.;
225 fBendingVertexDispersion = 70.;
226 fMaxNonBendingDistanceToTrack = 1.;
227 fMaxBendingDistanceToTrack = 1.;
228 fSigmaCutForTracking = 6.;
229 fSigmaCutForImprovement = 5.;
230 fSigmaCutForTrigger = 4.;
231 fStripCutForTrigger = 1.;
232 fMaxStripAreaForTrigger = 3.;
233 fMaxNormChi2MatchTrigger = fSigmaCutForTrigger * fSigmaCutForTrigger;
234 fCombinedClusterTrackReco = kFALSE;
235 fTrackAllTracks = kTRUE;
236 fRecoverTracks = kTRUE;
237 fMakeTrackCandidatesFast = kFALSE;
238 fMakeMoreTrackCandidates = kFALSE;
239 fComplementTracks = kTRUE;
240 fImproveTracks = kTRUE;
241 fRemoveConnectedTracksInSt12 = kFALSE;
242 fUseSmoother = kTRUE;
243 for (Int_t iCh = 0; iCh < 10; iCh++) {
244 fUseChamber[iCh] = kTRUE;
245 fDefaultNonBendingReso[iCh] = 0.144;
246 fDefaultBendingReso[iCh] = 0.01;
248 for (Int_t iSt = 0; iSt < 5; iSt++) fRequestStation[iSt] = kTRUE;
250 fMaxTriggerTracks = 100;
251 fMaxTrackCandidates = 10000;
254 //_____________________________________________________________________________
255 void AliMUONRecoParam::SetCosmicParam()
257 /// Set reconstruction parameters for high flux environment
259 SetNameTitle("Cosmic","Cosmic");
260 SetEventSpecie(AliRecoParam::kCosmic);
261 fMinBendingMomentum = 0.8;
262 fMaxBendingMomentum = 1.e10;
263 fMaxNonBendingSlope = 0.3;
264 fMaxBendingSlope = 0.4;
265 fSelectTrackOnSlope = kTRUE;
266 fNonBendingVertexDispersion = 170.;
267 fBendingVertexDispersion = 170.;
268 fMaxNonBendingDistanceToTrack = 1.;
269 fMaxBendingDistanceToTrack = 1.;
270 fSigmaCutForTracking = 7.;
271 fSigmaCutForImprovement = 6.;
272 fSigmaCutForTrigger = 4.;
273 fStripCutForTrigger = 1.5;
274 fMaxStripAreaForTrigger = 3.;
275 fMaxNormChi2MatchTrigger = fSigmaCutForTrigger * fSigmaCutForTrigger;
276 fPercentOfFullClusterInESD = 100.;
277 fCombinedClusterTrackReco = kFALSE;
278 fTrackAllTracks = kTRUE;
279 fRecoverTracks = kTRUE;
280 fMakeTrackCandidatesFast = kFALSE;
281 fMakeMoreTrackCandidates = kFALSE;
282 fComplementTracks = kTRUE;
283 fImproveTracks = kTRUE;
284 fRemoveConnectedTracksInSt12 = kTRUE;
285 fUseSmoother = kTRUE;
286 fSaveFullClusterInESD = kTRUE;
287 for (Int_t iCh = 0; iCh < 10; iCh++) {
288 fUseChamber[iCh] = kTRUE;
289 fDefaultNonBendingReso[iCh] = 0.4;
290 fDefaultBendingReso[iCh] = 0.4;
292 fRequestStation[0] = kTRUE;
293 fRequestStation[1] = kTRUE;
294 fRequestStation[2] = kTRUE;
295 fRequestStation[3] = kTRUE;
296 fRequestStation[4] = kTRUE;
298 fPadGoodnessMask = 0x400BE80; // Ped Mean is Zero | Ped Mean Too Low | Ped Mean Too High | Ped Sigma Too Low | Ped Sigma Too High | Ped is missing | HV is missing | manu occupancy too high
299 fMaxTriggerTracks = 100;
300 fMaxTrackCandidates = 10000;
302 SetPedMeanLimits(20, 700);
303 SetManuOccupancyLimits(-1.,0.01); // reject manu above occ=1%
305 SetBuspatchOccupancyLimits(-1,0.01);
306 SetMissingPadFractionLimit(0.1); // 10 %
307 SetFractionOfBuspatchOutsideOccupancyLimit(0.05); // 5 %
311 //_____________________________________________________________________________
312 void AliMUONRecoParam::SetCalibrationParam()
314 /// Set (dummy) reconstruction parameters for calibration environment
316 SetNameTitle("Calibration","Calibration");
317 SetEventSpecie(AliRecoParam::kCalib);
319 fPedMeanLimits[0] = 5000;
320 fPedMeanLimits[1] = 0;
322 fPadGoodnessMask = 0x8C00; // Pedestal is missing | is too low | too high
326 //_____________________________________________________________________________
328 AliMUONRecoParam::RequestedStationMask() const
330 /// Get the mask of the requested station, i.e. an integer where
331 /// bit n is set to one if the station n was requested
335 for ( Int_t i = 0; i < 5; ++i )
337 if ( RequestStation(i) ) m |= ( 1 << i );
342 //_____________________________________________________________________________
343 void AliMUONRecoParam::Print(Option_t *option) const
345 /// print reconstruction parameters
346 /// if option = FULL then print also unused parameters
348 cout<<endl<<"\t------MUON Reconstruction parameters ("<<GetName()<<")------"<<endl;
350 if (IsDefault()) cout<<"\t\t*** Parameters used by default ***"<<endl;
352 cout<<Form("Calibration mode = %s",fCalibrationMode.Data())<<endl;
353 cout<<Form("Clustering mode = %s",fClusteringMode.Data())<<endl;
354 cout<<Form("Tracking mode = %s",fTrackingMode.Data())<<endl;
360 bypass = "stations 4 and 5";
362 else if ( BypassSt4() )
364 bypass = "station 4";
366 else if ( BypassSt5() )
368 bypass = "station 5";
371 if (bypass.Length()) cout << "Will bypass " << bypass.Data() << " (replacing real clusters by generated ones from trigger tracks)" << endl;
373 if (fCombinedClusterTrackReco) cout<<"Combined cluster/track reconstruction: ON"<<endl;
374 else cout<<"Combined cluster/track reconstruction: OFF"<<endl;
376 if (fSaveFullClusterInESD) cout<<Form("Save all cluster info in ESD for %5.2f %% of events",fPercentOfFullClusterInESD)<<endl;
377 else cout<<"Save partial cluster info in ESD"<<endl;
379 cout<<"Selection of track candidates:"<<endl;
380 if (fSelectTrackOnSlope) cout<<Form("\t- Non-bending slope < %5.2f",fMaxNonBendingSlope)<<endl;
381 else cout<<"\t- Impact parameter < 3 * vertex dispersion in the non-bending direction"<<endl;
382 cout<<Form("\t- if B!=0: Bending momentum > %5.2f",fMinBendingMomentum)<<endl;
383 if (fSelectTrackOnSlope) cout<<Form("\t if B==0: Bending slope < %5.2f",fMaxBendingSlope)<<endl;
384 else cout<<"\t if B==0: Impact parameter < 3 * vertex dispersion in the bending direction"<<endl;
386 cout<<Form("Vertex dispersion (used to estimate initial bending momentum resolution) = (%5.2f,%5.2f)",fNonBendingVertexDispersion,fBendingVertexDispersion)<<endl;
388 cout<<Form("Maximum distance to track = (%5.2f,%5.2f)",fMaxNonBendingDistanceToTrack,fMaxBendingDistanceToTrack)<<endl;
390 cout<<Form("Sigma cut for tracking = %5.2f",fSigmaCutForTracking)<<endl;
392 cout<<Form("Sigma cut for trigger hit pattern = %5.2f",fSigmaCutForTrigger)<<endl;
394 cout<<Form("Cut in strips for trigger chamber efficiency = %5.2f",fStripCutForTrigger)<<endl;
396 cout<<Form("Max search area in strips for trigger chamber efficiency = %5.2f",fMaxStripAreaForTrigger)<<endl;
398 if (fTrackAllTracks) cout<<"Track all the possible candidates"<<endl;
399 else cout<<"Track only the best candidates"<<endl;
401 if (strstr(option,"FULL")) {
402 cout<<"Make track candidates assuming linear propagation between stations 4 and 5: ";
403 if (fMakeTrackCandidatesFast) cout<<"ON"<<endl;
404 else cout<<"OFF"<<endl;
405 } else if (fMakeTrackCandidatesFast)
406 cout<<"Make track candidates assuming linear propagation between stations 4 and 5"<<endl;
408 if (strstr(option,"FULL")) {
409 cout<<"Make track candidates starting from 1 cluster in each of the stations 4 and 5: ";
410 if (fMakeMoreTrackCandidates) cout<<"ON"<<endl;
411 else cout<<"OFF"<<endl;
412 } else if (fMakeMoreTrackCandidates)
413 cout<<"Make track candidates starting from 1 cluster in each of the stations 4 and 5"<<endl;
415 if (strstr(option,"FULL")) {
416 cout<<"Try to recover tracks getting lost during tracking: ";
417 if (fRecoverTracks) cout<<"ON"<<endl;
418 else cout<<"OFF"<<endl;
419 } else if (fRecoverTracks)
420 cout<<"Try to recover tracks getting lost during tracking"<<endl;
422 if (strstr(option,"FULL")) {
423 cout<<"Try to complete the reconstructed tracks by adding missing clusters: ";
424 if (fComplementTracks) cout<<"ON"<<endl;
425 else cout<<"OFF"<<endl;
426 } else if (fComplementTracks)
427 cout<<"Try to complete the reconstructed tracks by adding missing clusters"<<endl;
429 if (strstr(option,"FULL")) {
430 cout<<"Try to improve the reconstructed tracks by removing bad clusters: ";
431 if (fImproveTracks) cout<<Form("ON (sigma cut = %5.2f)",fSigmaCutForImprovement)<<endl;
432 else cout<<"OFF"<<endl;
433 } else if (fImproveTracks)
434 cout<<Form("Try to improve the reconstructed tracks by removing bad clusters (sigma cut = %5.2f)",fSigmaCutForImprovement)<<endl;
436 if (fRemoveConnectedTracksInSt12) cout<<"Remove tracks sharing one cluster or more in any station"<<endl;
437 else cout<<"Remove tracks sharing one cluster or more in stations 3, 4 and 5"<<endl;
439 if (strstr(option,"FULL")) {
440 cout<<"Use smoother to compute final track parameters, etc, at each cluster (used for Kalman tracking only): ";
441 if (fUseSmoother) cout<<"ON"<<endl;
442 else cout<<"OFF"<<endl;
443 } else if (fUseSmoother)
444 cout<<"Use smoother to compute final track parameters, etc, at each cluster"<<endl;
446 cout<<Form("Maximum normalized chi2 of tracking/trigger track matching = %5.2f",fMaxNormChi2MatchTrigger)<<endl;
448 Bool_t discardedCh = kFALSE;
451 if (!UseChamber(ch)) {
453 cout<<"Discarded chambers(1..): "<<ch+1;
456 else cout<<" "<<ch+1;
459 if (discardedCh) cout<<endl;
461 Bool_t discardedSt = kFALSE;
464 if (!RequestStation(st)) {
466 cout<<"Not requested stations(1..): "<<st+1;
469 else cout<<" "<<st+1;
472 if (discardedSt) cout<<endl;
474 cout << Form("Pad goodness policy mask is 0x%x",PadGoodnessMask()) << endl;
475 cout << "Which means we reject pads having the condition = " <<
476 AliMUONPadStatusMaker::AsCondition(PadGoodnessMask()).Data() << endl;
478 cout << "The pad limits we are using are :" << endl;
480 cout << Form("%5.0f <= HVSt12 <= %5.0f Volts",HVSt12LowLimit(),HVSt12HighLimit()) << endl;
481 cout << Form("%5.0f <= HVSt345 <= %5.0f Volts",HVSt345LowLimit(),HVSt345HighLimit()) << endl;
482 cout << Form("%7.2f <= Pedestal mean <= %7.2f",PedMeanLowLimit(),PedMeanHighLimit()) << endl;
483 cout << Form("%7.2f <= Pedestal sigma <= %7.2f",PedSigmaLowLimit(),PedSigmaHighLimit()) << endl;
484 cout << Form("%e <= Gain linear term <= %e",GainA1LowLimit(),GainA1HighLimit()) << endl;
485 cout << Form("%e <= Gain quadratic term <= %e",GainA2LowLimit(),GainA2HighLimit()) << endl;
486 cout << Form("%5.0f <= Gain threshold term <= %5.0f",GainThresLowLimit(),GainThresHighLimit()) << endl;
488 cout << Form("And we cut on charge >= %7.2f x ( pedestal sigma ) ",ChargeSigmaCut()) << endl;
490 cout << "Occupancy limits are :" << endl;
492 cout << Form("%e <= Manu occupancy < %7.2f",ManuOccupancyLowLimit(),ManuOccupancyHighLimit()) << endl;
493 cout << Form("%e <= Buspatch occupancy < %7.2f",BuspatchOccupancyLowLimit(),BuspatchOccupancyHighLimit()) << endl;
494 cout << Form("%e <= DE occupancy < %7.2f",DEOccupancyLowLimit(),DEOccupancyHighLimit()) << endl;
496 cout << "'QAChecker' limits" << endl;
497 cout << Form("MissingPadFractionLimit = %5.2f %%",MissingPadFractionLimit()*100.0) << endl;
498 cout << Form("FractionOfBuspatchOutsideOccupancyLimit = %5.2f %%",FractionOfBuspatchOutsideOccupancyLimit()*100.0) << endl;
500 cout << "chamber non bending resolution = |";
501 for (Int_t iCh = 0; iCh < 10; iCh++) cout << Form(" %6.3f |",fDefaultNonBendingReso[iCh]);
503 cout << "chamber bending resolution = |";
504 for (Int_t iCh = 0; iCh < 10; iCh++) cout << Form(" %6.3f |",fDefaultBendingReso[iCh]);
506 cout<<Form("maximum number of trigger tracks above which the tracking is cancelled = %d",fMaxTriggerTracks)<<endl;
507 cout<<Form("maximum number of track candidates above which the tracking is abandonned = %d",fMaxTrackCandidates)<<endl;
509 cout << Form("The average noise pad charge is assumed to be %7.2f fC",AverageNoisePadCharge()) << endl;
510 cout << Form("and clusters above %5.2f times this noise charge (i.e. %7.2f fC) are discarded",
511 ClusterChargeCut(),ClusterChargeCut()*AverageNoisePadCharge()) << endl;
512 cout << Form("Note that LowestPadCharge is then %7.2f fC",LowestPadCharge()) << endl;
514 cout<<"\t-----------------------------------------------------"<<endl<<endl;
518 //_____________________________________________________________________________
520 AliMUONRecoParam::SetDefaultLimits()
522 /// Set the default limits and pad goodness policy
524 fHVSt12Limits[0]=1500;
525 fHVSt12Limits[1]=2000;
527 fHVSt345Limits[0]=1500;
528 fHVSt345Limits[1]=2000;
530 fPedMeanLimits[0] = 20;
531 fPedMeanLimits[1] = 1024;
533 fPedSigmaLimits[0] = 0.6;
534 fPedSigmaLimits[1] = 100;
536 fGainA1Limits[0] = 0.1;
537 fGainA1Limits[1] = 10;
539 fGainA2Limits[0] = -1E30;
540 fGainA2Limits[1] = 1E30;
542 fGainThresLimits[0] = 0;
543 fGainThresLimits[1] = 4095;
545 fPadGoodnessMask = 0x8080; // Ped is missing | HV is missing
547 fManuOccupancyLimits[0] = -1.0;
548 fManuOccupancyLimits[1] = 1.0;
550 fBuspatchOccupancyLimits[0] = 1E-6;
551 fBuspatchOccupancyLimits[1] = 1.0;
553 fDEOccupancyLimits[0] = -1.0;
554 fDEOccupancyLimits[1] = 1.0;
556 fMissingPadFractionLimit = 0.1; // 10 %
557 fFractionOfBuspatchOutsideOccupancyLimit = 0.05; // 5 %
559 ChargeSigmaCut(4.0); // pad with charge < 4.0 x sigma will be removed (where sigma is the actual noise of that very pad, i.e. not the average)
561 AverageNoisePadCharge(0.22875); // 0.22875 coulombs ~ 1.5 ADC channels
563 ClusterChargeCut(2.0); // will cut cluster below 2.0 x LowestPadCharge()