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(-1),
77 fFractionOfBuspatchOutsideOccupancyLimit(0),
78 fAverageNoisePadCharge(0.22875),
79 fClusterChargeCut(2.0),
80 fEventSizeSoftLimit(35.0),
81 fEventSizeHardLimit(45.0),
86 SetNameTitle("Dummy","Dummy");
87 for (Int_t iCh = 0; iCh < 10; iCh++) {
88 fUseChamber[iCh] = kTRUE;
89 fDefaultNonBendingReso[iCh] = 0.;
90 fDefaultBendingReso[iCh] = 0.;
92 for (Int_t iSt = 0; iSt < 5; iSt++) fRequestStation[iSt] = kTRUE;
96 //_____________________________________________________________________________
97 AliMUONRecoParam::~AliMUONRecoParam()
102 //_____________________________________________________________________________
104 AliMUONRecoParam::BypassSt45(Bool_t st4, Bool_t st5)
106 /// Set the bypass status
108 if ( st4 && st5 ) fBypassSt45 = 45;
109 else if ( st4 ) fBypassSt45 = 4;
110 else if ( st5 ) fBypassSt45 = 5;
111 else fBypassSt45 = 0;
114 //_____________________________________________________________________________
116 AliMUONRecoParam::GetCalibrationMode() const
118 /// Return the calibration mode. Can be :
119 /// NOGAIN : only do pedestal subtraction
120 /// GAIN : do pedestal subtraction, and apply gain correction, but with a
121 /// single capacitance value for all channels
122 /// INJECTIONGAIN : as GAIN, but with gain values taken as EMELEC factory values
123 /// GAINCONSTANTCAPA : as GAIN, but with a channel-dependent capacitance value
125 return fCalibrationMode.Data();
128 //_____________________________________________________________________________
129 AliMUONRecoParam *AliMUONRecoParam::GetLowFluxParam()
131 /// Return default reconstruction parameters for low flux environment
133 AliMUONRecoParam *param = new AliMUONRecoParam();
134 param->SetLowFluxParam();
139 //_____________________________________________________________________________
140 AliMUONRecoParam *AliMUONRecoParam::GetHighFluxParam()
142 /// Return default reconstruction parameters for high flux environment
144 AliMUONRecoParam *param = new AliMUONRecoParam();
145 param->SetHighFluxParam();
150 //_____________________________________________________________________________
151 AliMUONRecoParam *AliMUONRecoParam::GetCosmicParam()
153 /// Return default reconstruction parameters for high flux environment
155 AliMUONRecoParam *param = new AliMUONRecoParam();
156 param->SetCosmicParam();
161 //_____________________________________________________________________________
162 AliMUONRecoParam *AliMUONRecoParam::GetCalibrationParam()
164 /// Return default (dummy) reconstruction parameters for calibration environment
166 AliMUONRecoParam *param = new AliMUONRecoParam();
167 param->SetCalibrationParam();
173 //_____________________________________________________________________________
174 void AliMUONRecoParam::SetLowFluxParam()
176 /// Set reconstruction parameters for low flux environment
178 SetNameTitle("Low Flux","Low Flux");
179 SetEventSpecie(AliRecoParam::kLowMult);
180 fMinBendingMomentum = 0.8;
181 fMaxBendingMomentum = 1.e10;
182 fMaxNonBendingSlope = 0.3;
183 fMaxBendingSlope = 0.4;
184 fSelectTrackOnSlope = kFALSE;
185 fNonBendingVertexDispersion = 70.;
186 fBendingVertexDispersion = 70.;
187 fMaxNonBendingDistanceToTrack = 1.;
188 fMaxBendingDistanceToTrack = 1.;
189 fSigmaCutForTracking = 6.;
190 fSigmaCutForImprovement = 5.;
191 fSigmaCutForTrigger = 4.;
192 fStripCutForTrigger = 1.;
193 fMaxStripAreaForTrigger = 3.;
194 fMaxNormChi2MatchTrigger = fSigmaCutForTrigger * fSigmaCutForTrigger;
195 fCombinedClusterTrackReco = kFALSE;
196 fTrackAllTracks = kTRUE;
197 fRecoverTracks = kTRUE;
198 fMakeTrackCandidatesFast = kFALSE;
199 fMakeMoreTrackCandidates = kFALSE;
200 fComplementTracks = kTRUE;
201 fImproveTracks = kTRUE;
202 fRemoveConnectedTracksInSt12 = kFALSE;
203 fUseSmoother = kTRUE;
204 for (Int_t iCh = 0; iCh < 10; iCh++) {
205 fUseChamber[iCh] = kTRUE;
206 fDefaultNonBendingReso[iCh] = 0.144;
207 fDefaultBendingReso[iCh] = 0.01;
209 for (Int_t iSt = 0; iSt < 5; iSt++) fRequestStation[iSt] = kTRUE;
211 fMaxTriggerTracks = 100;
212 fMaxTrackCandidates = 10000;
215 //_____________________________________________________________________________
216 void AliMUONRecoParam::SetHighFluxParam()
218 /// Set reconstruction parameters for high flux environment
220 SetNameTitle("High Flux","High Flux");
221 SetEventSpecie(AliRecoParam::kHighMult);
222 fMinBendingMomentum = 0.8;
223 fMaxBendingMomentum = 1.e10;
224 fMaxNonBendingSlope = 0.3;
225 fMaxBendingSlope = 0.4;
226 fSelectTrackOnSlope = kFALSE;
227 fNonBendingVertexDispersion = 70.;
228 fBendingVertexDispersion = 70.;
229 fMaxNonBendingDistanceToTrack = 1.;
230 fMaxBendingDistanceToTrack = 1.;
231 fSigmaCutForTracking = 6.;
232 fSigmaCutForImprovement = 5.;
233 fSigmaCutForTrigger = 4.;
234 fStripCutForTrigger = 1.;
235 fMaxStripAreaForTrigger = 3.;
236 fMaxNormChi2MatchTrigger = fSigmaCutForTrigger * fSigmaCutForTrigger;
237 fCombinedClusterTrackReco = kFALSE;
238 fTrackAllTracks = kTRUE;
239 fRecoverTracks = kTRUE;
240 fMakeTrackCandidatesFast = kFALSE;
241 fMakeMoreTrackCandidates = kFALSE;
242 fComplementTracks = kTRUE;
243 fImproveTracks = kTRUE;
244 fRemoveConnectedTracksInSt12 = kFALSE;
245 fUseSmoother = kTRUE;
246 for (Int_t iCh = 0; iCh < 10; iCh++) {
247 fUseChamber[iCh] = kTRUE;
248 fDefaultNonBendingReso[iCh] = 0.144;
249 fDefaultBendingReso[iCh] = 0.01;
251 for (Int_t iSt = 0; iSt < 5; iSt++) fRequestStation[iSt] = kTRUE;
253 fMaxTriggerTracks = 100;
254 fMaxTrackCandidates = 10000;
257 //_____________________________________________________________________________
258 void AliMUONRecoParam::SetCosmicParam()
260 /// Set reconstruction parameters for high flux environment
262 SetNameTitle("Cosmic","Cosmic");
263 SetEventSpecie(AliRecoParam::kCosmic);
264 fMinBendingMomentum = 0.8;
265 fMaxBendingMomentum = 1.e10;
266 fMaxNonBendingSlope = 0.3;
267 fMaxBendingSlope = 0.4;
268 fSelectTrackOnSlope = kTRUE;
269 fNonBendingVertexDispersion = 170.;
270 fBendingVertexDispersion = 170.;
271 fMaxNonBendingDistanceToTrack = 1.;
272 fMaxBendingDistanceToTrack = 1.;
273 fSigmaCutForTracking = 7.;
274 fSigmaCutForImprovement = 6.;
275 fSigmaCutForTrigger = 4.;
276 fStripCutForTrigger = 1.5;
277 fMaxStripAreaForTrigger = 3.;
278 fMaxNormChi2MatchTrigger = fSigmaCutForTrigger * fSigmaCutForTrigger;
279 fPercentOfFullClusterInESD = 100.;
280 fCombinedClusterTrackReco = kFALSE;
281 fTrackAllTracks = kTRUE;
282 fRecoverTracks = kTRUE;
283 fMakeTrackCandidatesFast = kFALSE;
284 fMakeMoreTrackCandidates = kFALSE;
285 fComplementTracks = kTRUE;
286 fImproveTracks = kTRUE;
287 fRemoveConnectedTracksInSt12 = kTRUE;
288 fUseSmoother = kTRUE;
289 fSaveFullClusterInESD = kTRUE;
290 for (Int_t iCh = 0; iCh < 10; iCh++) {
291 fUseChamber[iCh] = kTRUE;
292 fDefaultNonBendingReso[iCh] = 0.4;
293 fDefaultBendingReso[iCh] = 0.4;
295 fRequestStation[0] = kTRUE;
296 fRequestStation[1] = kTRUE;
297 fRequestStation[2] = kTRUE;
298 fRequestStation[3] = kTRUE;
299 fRequestStation[4] = kTRUE;
301 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
302 fMaxTriggerTracks = 100;
303 fMaxTrackCandidates = 10000;
305 SetPedMeanLimits(20, 700);
306 SetManuOccupancyLimits(-1.,0.01); // reject manu above occ=1%
308 SetBuspatchOccupancyLimits(-1,0.05);
309 SetFractionOfBuspatchOutsideOccupancyLimit(0.10); // 10 %
313 //_____________________________________________________________________________
314 void AliMUONRecoParam::SetCalibrationParam()
316 /// Set (dummy) reconstruction parameters for calibration environment
318 SetNameTitle("Calibration","Calibration");
319 SetEventSpecie(AliRecoParam::kCalib);
321 fPedMeanLimits[0] = 5000;
322 fPedMeanLimits[1] = 0;
324 fPadGoodnessMask = 0x8C00; // Pedestal is missing | is too low | too high
328 //_____________________________________________________________________________
330 AliMUONRecoParam::RequestedStationMask() const
332 /// Get the mask of the requested station, i.e. an integer where
333 /// bit n is set to one if the station n was requested
337 for ( Int_t i = 0; i < 5; ++i )
339 if ( RequestStation(i) ) m |= ( 1 << i );
344 //_____________________________________________________________________________
345 void AliMUONRecoParam::Print(Option_t *option) const
347 /// print reconstruction parameters
348 /// if option = FULL then print also unused parameters
350 cout<<endl<<"\t------MUON Reconstruction parameters ("<<GetName()<<")------"<<endl;
352 if (IsDefault()) cout<<"\t\t*** Parameters used by default ***"<<endl;
354 cout<<Form("Calibration mode = %s",fCalibrationMode.Data())<<endl;
355 cout<<Form("Clustering mode = %s",fClusteringMode.Data())<<endl;
356 cout<<Form("Tracking mode = %s",fTrackingMode.Data())<<endl;
362 bypass = "stations 4 and 5";
364 else if ( BypassSt4() )
366 bypass = "station 4";
368 else if ( BypassSt5() )
370 bypass = "station 5";
373 if (bypass.Length()) cout << "Will bypass " << bypass.Data() << " (replacing real clusters by generated ones from trigger tracks)" << endl;
375 if (fCombinedClusterTrackReco) cout<<"Combined cluster/track reconstruction: ON"<<endl;
376 else cout<<"Combined cluster/track reconstruction: OFF"<<endl;
378 if (fSaveFullClusterInESD) cout<<Form("Save all cluster info in ESD for %5.2f %% of events",fPercentOfFullClusterInESD)<<endl;
379 else cout<<"Save partial cluster info in ESD"<<endl;
381 cout<<"Selection of track candidates:"<<endl;
382 if (fSelectTrackOnSlope) cout<<Form("\t- Non-bending slope < %5.2f",fMaxNonBendingSlope)<<endl;
383 else cout<<"\t- Impact parameter < 3 * vertex dispersion in the non-bending direction"<<endl;
384 cout<<Form("\t- if B!=0: Bending momentum > %5.2f",fMinBendingMomentum)<<endl;
385 if (fSelectTrackOnSlope) cout<<Form("\t if B==0: Bending slope < %5.2f",fMaxBendingSlope)<<endl;
386 else cout<<"\t if B==0: Impact parameter < 3 * vertex dispersion in the bending direction"<<endl;
388 cout<<Form("Vertex dispersion (used to estimate initial bending momentum resolution) = (%5.2f,%5.2f)",fNonBendingVertexDispersion,fBendingVertexDispersion)<<endl;
390 cout<<Form("Maximum distance to track = (%5.2f,%5.2f)",fMaxNonBendingDistanceToTrack,fMaxBendingDistanceToTrack)<<endl;
392 cout<<Form("Sigma cut for tracking = %5.2f",fSigmaCutForTracking)<<endl;
394 cout<<Form("Sigma cut for trigger hit pattern = %5.2f",fSigmaCutForTrigger)<<endl;
396 cout<<Form("Cut in strips for trigger chamber efficiency = %5.2f",fStripCutForTrigger)<<endl;
398 cout<<Form("Max search area in strips for trigger chamber efficiency = %5.2f",fMaxStripAreaForTrigger)<<endl;
400 if (fTrackAllTracks) cout<<"Track all the possible candidates"<<endl;
401 else cout<<"Track only the best candidates"<<endl;
403 if (strstr(option,"FULL")) {
404 cout<<"Make track candidates assuming linear propagation between stations 4 and 5: ";
405 if (fMakeTrackCandidatesFast) cout<<"ON"<<endl;
406 else cout<<"OFF"<<endl;
407 } else if (fMakeTrackCandidatesFast)
408 cout<<"Make track candidates assuming linear propagation between stations 4 and 5"<<endl;
410 if (strstr(option,"FULL")) {
411 cout<<"Make track candidates starting from 1 cluster in each of the stations 4 and 5: ";
412 if (fMakeMoreTrackCandidates) cout<<"ON"<<endl;
413 else cout<<"OFF"<<endl;
414 } else if (fMakeMoreTrackCandidates)
415 cout<<"Make track candidates starting from 1 cluster in each of the stations 4 and 5"<<endl;
417 if (strstr(option,"FULL")) {
418 cout<<"Try to recover tracks getting lost during tracking: ";
419 if (fRecoverTracks) cout<<"ON"<<endl;
420 else cout<<"OFF"<<endl;
421 } else if (fRecoverTracks)
422 cout<<"Try to recover tracks getting lost during tracking"<<endl;
424 if (strstr(option,"FULL")) {
425 cout<<"Try to complete the reconstructed tracks by adding missing clusters: ";
426 if (fComplementTracks) cout<<"ON"<<endl;
427 else cout<<"OFF"<<endl;
428 } else if (fComplementTracks)
429 cout<<"Try to complete the reconstructed tracks by adding missing clusters"<<endl;
431 if (strstr(option,"FULL")) {
432 cout<<"Try to improve the reconstructed tracks by removing bad clusters: ";
433 if (fImproveTracks) cout<<Form("ON (sigma cut = %5.2f)",fSigmaCutForImprovement)<<endl;
434 else cout<<"OFF"<<endl;
435 } else if (fImproveTracks)
436 cout<<Form("Try to improve the reconstructed tracks by removing bad clusters (sigma cut = %5.2f)",fSigmaCutForImprovement)<<endl;
438 if (fRemoveConnectedTracksInSt12) cout<<"Remove tracks sharing one cluster or more in any station"<<endl;
439 else cout<<"Remove tracks sharing one cluster or more in stations 3, 4 and 5"<<endl;
441 if (strstr(option,"FULL")) {
442 cout<<"Use smoother to compute final track parameters, etc, at each cluster (used for Kalman tracking only): ";
443 if (fUseSmoother) cout<<"ON"<<endl;
444 else cout<<"OFF"<<endl;
445 } else if (fUseSmoother)
446 cout<<"Use smoother to compute final track parameters, etc, at each cluster"<<endl;
448 cout<<Form("Maximum normalized chi2 of tracking/trigger track matching = %5.2f",fMaxNormChi2MatchTrigger)<<endl;
450 Bool_t discardedCh = kFALSE;
453 if (!UseChamber(ch)) {
455 cout<<"Discarded chambers(1..): "<<ch+1;
458 else cout<<" "<<ch+1;
461 if (discardedCh) cout<<endl;
463 Bool_t discardedSt = kFALSE;
466 if (!RequestStation(st)) {
468 cout<<"Not requested stations(1..): "<<st+1;
471 else cout<<" "<<st+1;
474 if (discardedSt) cout<<endl;
476 cout << Form("Pad goodness policy mask is 0x%x",PadGoodnessMask()) << endl;
477 cout << "Which means we reject pads having the condition = " <<
478 AliMUONPadStatusMaker::AsCondition(PadGoodnessMask()).Data() << endl;
480 cout << "The pad limits we are using are :" << endl;
482 cout << Form("%5.0f <= HVSt12 <= %5.0f Volts",HVSt12LowLimit(),HVSt12HighLimit()) << endl;
483 cout << Form("%5.0f <= HVSt345 <= %5.0f Volts",HVSt345LowLimit(),HVSt345HighLimit()) << endl;
484 cout << Form("%7.2f <= Pedestal mean <= %7.2f",PedMeanLowLimit(),PedMeanHighLimit()) << endl;
485 cout << Form("%7.2f <= Pedestal sigma <= %7.2f",PedSigmaLowLimit(),PedSigmaHighLimit()) << endl;
486 cout << Form("%e <= Gain linear term <= %e",GainA1LowLimit(),GainA1HighLimit()) << endl;
487 cout << Form("%e <= Gain quadratic term <= %e",GainA2LowLimit(),GainA2HighLimit()) << endl;
488 cout << Form("%5.0f <= Gain threshold term <= %5.0f",GainThresLowLimit(),GainThresHighLimit()) << endl;
490 cout << Form("And we cut on charge >= %7.2f x ( pedestal sigma ) ",ChargeSigmaCut()) << endl;
492 cout << "Occupancy limits are :" << endl;
494 cout << Form("%e <= Manu occupancy < %7.2f",ManuOccupancyLowLimit(),ManuOccupancyHighLimit()) << endl;
495 cout << Form("%e <= Buspatch occupancy < %7.2f",BuspatchOccupancyLowLimit(),BuspatchOccupancyHighLimit()) << endl;
496 cout << Form("%e <= DE occupancy < %7.2f",DEOccupancyLowLimit(),DEOccupancyHighLimit()) << endl;
498 cout << "'QAChecker' limits" << endl;
499 cout << Form("FractionOfBuspatchOutsideOccupancyLimit = %5.2f %%",FractionOfBuspatchOutsideOccupancyLimit()*100.0) << endl;
500 cout << Form("Event size limit = %5.2f KB/event (soft) and %5.2f KB/event (hard)",fEventSizeSoftLimit,fEventSizeHardLimit) << endl;
501 if ( fTokenLostLimit > 0 )
503 cout << Form("We tolerate up to %5.2f %% token lost errors per event",fTokenLostLimit) << endl;
507 cout << "We dot not tolerate any token lost error !" << endl;
510 cout << "chamber non bending resolution = |";
511 for (Int_t iCh = 0; iCh < 10; iCh++) cout << Form(" %6.3f |",fDefaultNonBendingReso[iCh]);
513 cout << "chamber bending resolution = |";
514 for (Int_t iCh = 0; iCh < 10; iCh++) cout << Form(" %6.3f |",fDefaultBendingReso[iCh]);
516 cout<<Form("maximum number of trigger tracks above which the tracking is cancelled = %d",fMaxTriggerTracks)<<endl;
517 cout<<Form("maximum number of track candidates above which the tracking is abandonned = %d",fMaxTrackCandidates)<<endl;
519 cout << Form("The average noise pad charge is assumed to be %7.2f fC",AverageNoisePadCharge()) << endl;
520 cout << Form("and clusters below %5.2f times this noise charge (i.e. %7.2f fC) are discarded",
521 ClusterChargeCut(),ClusterChargeCut()*AverageNoisePadCharge()) << endl;
522 cout << Form("Note that LowestPadCharge is then %7.2f fC",LowestPadCharge()) << endl;
524 cout<<"\t-----------------------------------------------------"<<endl<<endl;
528 //_____________________________________________________________________________
530 AliMUONRecoParam::SetDefaultLimits()
532 /// Set the default limits and pad goodness policy
534 fHVSt12Limits[0]=1500;
535 fHVSt12Limits[1]=2000;
537 fHVSt345Limits[0]=1500;
538 fHVSt345Limits[1]=2000;
540 fPedMeanLimits[0] = 20;
541 fPedMeanLimits[1] = 1024;
543 fPedSigmaLimits[0] = 0.6;
544 fPedSigmaLimits[1] = 100;
546 fGainA1Limits[0] = 0.1;
547 fGainA1Limits[1] = 10;
549 fGainA2Limits[0] = -1E30;
550 fGainA2Limits[1] = 1E30;
552 fGainThresLimits[0] = 0;
553 fGainThresLimits[1] = 4095;
555 fPadGoodnessMask = 0x8080; // Ped is missing | HV is missing
557 fManuOccupancyLimits[0] = -1.0;
558 fManuOccupancyLimits[1] = 1.0;
560 fBuspatchOccupancyLimits[0] = 1E-6;
561 fBuspatchOccupancyLimits[1] = 1.0;
563 fDEOccupancyLimits[0] = -1.0;
564 fDEOccupancyLimits[1] = 1.0;
566 fMissingPadFractionLimit = -1; // DEPRECATED
567 fFractionOfBuspatchOutsideOccupancyLimit = 0.10; // 10 %
569 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)
571 AverageNoisePadCharge(0.22875); // 0.22875 coulombs ~ 1.5 ADC channels
573 ClusterChargeCut(2.0); // will cut cluster below 2.0 x LowestPadCharge()
575 SetEventSizeLimits(35.0,45.0);
577 SetTokenLostLimit(0.0);