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)
81 SetNameTitle("Dummy","Dummy");
82 for (Int_t iCh = 0; iCh < 10; iCh++) {
83 fUseChamber[iCh] = kTRUE;
84 fDefaultNonBendingReso[iCh] = 0.;
85 fDefaultBendingReso[iCh] = 0.;
87 for (Int_t iSt = 0; iSt < 5; iSt++) fRequestStation[iSt] = kTRUE;
91 //_____________________________________________________________________________
92 AliMUONRecoParam::~AliMUONRecoParam()
97 //_____________________________________________________________________________
99 AliMUONRecoParam::BypassSt45(Bool_t st4, Bool_t st5)
101 /// Set the bypass status
103 if ( st4 && st5 ) fBypassSt45 = 45;
104 else if ( st4 ) fBypassSt45 = 4;
105 else if ( st5 ) fBypassSt45 = 5;
106 else fBypassSt45 = 0;
109 //_____________________________________________________________________________
111 AliMUONRecoParam::GetCalibrationMode() const
113 /// Return the calibration mode. Can be :
114 /// NOGAIN : only do pedestal subtraction
115 /// GAIN : do pedestal subtraction, and apply gain correction, but with a
116 /// single capacitance value for all channels
117 /// INJECTIONGAIN : as GAIN, but with gain values taken as EMELEC factory values
118 /// GAINCONSTANTCAPA : as GAIN, but with a channel-dependent capacitance value
120 return fCalibrationMode.Data();
123 //_____________________________________________________________________________
124 AliMUONRecoParam *AliMUONRecoParam::GetLowFluxParam()
126 /// Return default reconstruction parameters for low flux environment
128 AliMUONRecoParam *param = new AliMUONRecoParam();
129 param->SetLowFluxParam();
134 //_____________________________________________________________________________
135 AliMUONRecoParam *AliMUONRecoParam::GetHighFluxParam()
137 /// Return default reconstruction parameters for high flux environment
139 AliMUONRecoParam *param = new AliMUONRecoParam();
140 param->SetHighFluxParam();
145 //_____________________________________________________________________________
146 AliMUONRecoParam *AliMUONRecoParam::GetCosmicParam()
148 /// Return default reconstruction parameters for high flux environment
150 AliMUONRecoParam *param = new AliMUONRecoParam();
151 param->SetCosmicParam();
156 //_____________________________________________________________________________
157 AliMUONRecoParam *AliMUONRecoParam::GetCalibrationParam()
159 /// Return default (dummy) reconstruction parameters for calibration environment
161 AliMUONRecoParam *param = new AliMUONRecoParam();
162 param->SetCalibrationParam();
168 //_____________________________________________________________________________
169 void AliMUONRecoParam::SetLowFluxParam()
171 /// Set reconstruction parameters for low flux environment
173 SetNameTitle("Low Flux","Low Flux");
174 SetEventSpecie(AliRecoParam::kLowMult);
175 fMinBendingMomentum = 0.8;
176 fMaxBendingMomentum = 1.e10;
177 fMaxNonBendingSlope = 0.3;
178 fMaxBendingSlope = 0.4;
179 fSelectTrackOnSlope = kFALSE;
180 fNonBendingVertexDispersion = 70.;
181 fBendingVertexDispersion = 70.;
182 fMaxNonBendingDistanceToTrack = 1.;
183 fMaxBendingDistanceToTrack = 1.;
184 fSigmaCutForTracking = 6.;
185 fSigmaCutForImprovement = 5.;
186 fSigmaCutForTrigger = 8.;
187 fStripCutForTrigger = 1.;
188 fMaxStripAreaForTrigger = 3.;
189 fMaxNormChi2MatchTrigger = 16.;
190 fCombinedClusterTrackReco = kFALSE;
191 fTrackAllTracks = kTRUE;
192 fRecoverTracks = kTRUE;
193 fMakeTrackCandidatesFast = kFALSE;
194 fMakeMoreTrackCandidates = kFALSE;
195 fComplementTracks = kTRUE;
196 fImproveTracks = kTRUE;
197 fRemoveConnectedTracksInSt12 = kTRUE;
198 fUseSmoother = kTRUE;
199 for (Int_t iCh = 0; iCh < 10; iCh++) {
200 fUseChamber[iCh] = kTRUE;
201 fDefaultNonBendingReso[iCh] = 0.144;
202 fDefaultBendingReso[iCh] = 0.01;
204 for (Int_t iSt = 0; iSt < 5; iSt++) fRequestStation[iSt] = kTRUE;
206 fMaxTriggerTracks = 100;
207 fMaxTrackCandidates = 10000;
210 //_____________________________________________________________________________
211 void AliMUONRecoParam::SetHighFluxParam()
213 /// Set reconstruction parameters for high flux environment
215 SetNameTitle("High Flux","High Flux");
216 SetEventSpecie(AliRecoParam::kHighMult);
217 fMinBendingMomentum = 0.8;
218 fMaxBendingMomentum = 1.e10;
219 fMaxNonBendingSlope = 0.3;
220 fMaxBendingSlope = 0.4;
221 fSelectTrackOnSlope = kFALSE;
222 fNonBendingVertexDispersion = 70.;
223 fBendingVertexDispersion = 70.;
224 fMaxNonBendingDistanceToTrack = 1.;
225 fMaxBendingDistanceToTrack = 1.;
226 fSigmaCutForTracking = 6.;
227 fSigmaCutForImprovement = 5.;
228 fSigmaCutForTrigger = 8.;
229 fStripCutForTrigger = 1.;
230 fMaxStripAreaForTrigger = 3.;
231 fMaxNormChi2MatchTrigger = 16.;
232 fCombinedClusterTrackReco = kFALSE;
233 fTrackAllTracks = kTRUE;
234 fRecoverTracks = kTRUE;
235 fMakeTrackCandidatesFast = kFALSE;
236 fMakeMoreTrackCandidates = kFALSE;
237 fComplementTracks = kTRUE;
238 fImproveTracks = kTRUE;
239 fRemoveConnectedTracksInSt12 = kFALSE;
240 fUseSmoother = kTRUE;
241 for (Int_t iCh = 0; iCh < 10; iCh++) {
242 fUseChamber[iCh] = kTRUE;
243 fDefaultNonBendingReso[iCh] = 0.144;
244 fDefaultBendingReso[iCh] = 0.01;
246 for (Int_t iSt = 0; iSt < 5; iSt++) fRequestStation[iSt] = kTRUE;
248 fMaxTriggerTracks = 100;
249 fMaxTrackCandidates = 10000;
253 //_____________________________________________________________________________
254 void AliMUONRecoParam::SetCosmicParam()
256 /// Set reconstruction parameters for high flux environment
258 SetNameTitle("Cosmic","Cosmic");
259 SetEventSpecie(AliRecoParam::kCosmic);
260 fMinBendingMomentum = 0.8;
261 fMaxBendingMomentum = 1.e10;
262 fMaxNonBendingSlope = 0.3;
263 fMaxBendingSlope = 0.4;
264 fSelectTrackOnSlope = kTRUE;
265 fNonBendingVertexDispersion = 170.;
266 fBendingVertexDispersion = 170.;
267 fMaxNonBendingDistanceToTrack = 1.;
268 fMaxBendingDistanceToTrack = 1.;
269 fSigmaCutForTracking = 7.;
270 fSigmaCutForImprovement = 6.;
271 fSigmaCutForTrigger = 8.;
272 fStripCutForTrigger = 1.5;
273 fMaxStripAreaForTrigger = 3.;
274 fMaxNormChi2MatchTrigger = 16.;
275 fPercentOfFullClusterInESD = 100.;
276 fCombinedClusterTrackReco = kFALSE;
277 fTrackAllTracks = kTRUE;
278 fRecoverTracks = kTRUE;
279 fMakeTrackCandidatesFast = kFALSE;
280 fMakeMoreTrackCandidates = kFALSE;
281 fComplementTracks = kTRUE;
282 fImproveTracks = kTRUE;
283 fRemoveConnectedTracksInSt12 = kTRUE;
284 fUseSmoother = kTRUE;
285 fSaveFullClusterInESD = kTRUE;
286 for (Int_t iCh = 0; iCh < 10; iCh++) {
287 fUseChamber[iCh] = kTRUE;
288 fDefaultNonBendingReso[iCh] = 0.4;
289 fDefaultBendingReso[iCh] = 0.4;
291 fRequestStation[0] = kTRUE;
292 fRequestStation[1] = kTRUE;
293 fRequestStation[2] = kTRUE;
294 fRequestStation[3] = kTRUE;
295 fRequestStation[4] = kTRUE;
297 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
298 fMaxTriggerTracks = 100;
299 fMaxTrackCandidates = 10000;
300 SetPedMeanLimits(20, 700);
301 SetManuOccupancyLimits(-1.,0.01); // reject manu above occ=1%
303 SetBuspatchOccupancyLimits(-1,0.01);
304 SetMissingPadFractionLimit(0.1); // 10 %
305 SetFractionOfBuspatchOutsideOccupancyLimit(0.05); // 5 %
309 //_____________________________________________________________________________
310 void AliMUONRecoParam::SetCalibrationParam()
312 /// Set (dummy) reconstruction parameters for calibration environment
314 SetNameTitle("Calibration","Calibration");
315 SetEventSpecie(AliRecoParam::kCalib);
317 fPedMeanLimits[0] = 5000;
318 fPedMeanLimits[1] = 0;
320 fPadGoodnessMask = 0x8C00; // Pedestal is missing | is too low | too high
324 //_____________________________________________________________________________
326 AliMUONRecoParam::RequestedStationMask() const
328 /// Get the mask of the requested station, i.e. an integer where
329 /// bit n is set to one if the station n was requested
333 for ( Int_t i = 0; i < 5; ++i )
335 if ( RequestStation(i) ) m |= ( 1 << i );
340 //_____________________________________________________________________________
341 void AliMUONRecoParam::Print(Option_t *option) const
343 /// print reconstruction parameters
344 /// if option = FULL then print also unused parameters
346 cout<<endl<<"\t------MUON Reconstruction parameters ("<<GetName()<<")------"<<endl;
348 if (IsDefault()) cout<<"\t\t*** Parameters used by default ***"<<endl;
350 cout<<Form("Calibration mode = %s",fCalibrationMode.Data())<<endl;
351 cout<<Form("Clustering mode = %s",fClusteringMode.Data())<<endl;
352 cout<<Form("Tracking mode = %s",fTrackingMode.Data())<<endl;
358 bypass = "stations 4 and 5";
360 else if ( BypassSt4() )
362 bypass = "station 4";
364 else if ( BypassSt5() )
366 bypass = "station 5";
369 if (bypass.Length()) cout << "Will bypass " << bypass.Data() << " (replacing real clusters by generated ones from trigger tracks)" << endl;
371 if (fCombinedClusterTrackReco) cout<<"Combined cluster/track reconstruction: ON"<<endl;
372 else cout<<"Combined cluster/track reconstruction: OFF"<<endl;
374 if (fSaveFullClusterInESD) cout<<Form("Save all cluster info in ESD for %5.2f %% of events",fPercentOfFullClusterInESD)<<endl;
375 else cout<<"Save partial cluster info in ESD"<<endl;
377 cout<<"Selection of track candidates:"<<endl;
378 if (fSelectTrackOnSlope) cout<<Form("\t- Non-bending slope < %5.2f",fMaxNonBendingSlope)<<endl;
379 else cout<<"\t- Impact parameter < 3 * vertex dispersion in the non-bending direction"<<endl;
380 cout<<Form("\t- if B!=0: Bending momentum > %5.2f",fMinBendingMomentum)<<endl;
381 if (fSelectTrackOnSlope) cout<<Form("\t if B==0: Bending slope < %5.2f",fMaxBendingSlope)<<endl;
382 else cout<<"\t if B==0: Impact parameter < 3 * vertex dispersion in the bending direction"<<endl;
384 cout<<Form("Vertex dispersion (used to estimate initial bending momentum resolution) = (%5.2f,%5.2f)",fNonBendingVertexDispersion,fBendingVertexDispersion)<<endl;
386 cout<<Form("Maximum distance to track = (%5.2f,%5.2f)",fMaxNonBendingDistanceToTrack,fMaxBendingDistanceToTrack)<<endl;
388 cout<<Form("Sigma cut for tracking = %5.2f",fSigmaCutForTracking)<<endl;
390 cout<<Form("Sigma cut for trigger hit pattern = %5.2f",fSigmaCutForTrigger)<<endl;
392 cout<<Form("Cut in strips for trigger chamber efficiency = %5.2f",fStripCutForTrigger)<<endl;
394 cout<<Form("Max search area in strips for trigger chamber efficiency = %5.2f",fMaxStripAreaForTrigger)<<endl;
396 if (fTrackAllTracks) cout<<"Track all the possible candidates"<<endl;
397 else cout<<"Track only the best candidates"<<endl;
399 if (strstr(option,"FULL")) {
400 cout<<"Make track candidates assuming linear propagation between stations 4 and 5: ";
401 if (fMakeTrackCandidatesFast) cout<<"ON"<<endl;
402 else cout<<"OFF"<<endl;
403 } else if (fMakeTrackCandidatesFast)
404 cout<<"Make track candidates assuming linear propagation between stations 4 and 5"<<endl;
406 if (strstr(option,"FULL")) {
407 cout<<"Make track candidates starting from 1 cluster in each of the stations 4 and 5: ";
408 if (fMakeMoreTrackCandidates) cout<<"ON"<<endl;
409 else cout<<"OFF"<<endl;
410 } else if (fMakeMoreTrackCandidates)
411 cout<<"Make track candidates starting from 1 cluster in each of the stations 4 and 5"<<endl;
413 if (strstr(option,"FULL")) {
414 cout<<"Try to recover tracks getting lost during tracking: ";
415 if (fRecoverTracks) cout<<"ON"<<endl;
416 else cout<<"OFF"<<endl;
417 } else if (fRecoverTracks)
418 cout<<"Try to recover tracks getting lost during tracking"<<endl;
420 if (strstr(option,"FULL")) {
421 cout<<"Try to complete the reconstructed tracks by adding missing clusters: ";
422 if (fComplementTracks) cout<<"ON"<<endl;
423 else cout<<"OFF"<<endl;
424 } else if (fComplementTracks)
425 cout<<"Try to complete the reconstructed tracks by adding missing clusters"<<endl;
427 if (strstr(option,"FULL")) {
428 cout<<"Try to improve the reconstructed tracks by removing bad clusters: ";
429 if (fImproveTracks) cout<<Form("ON (sigma cut = %5.2f)",fSigmaCutForImprovement)<<endl;
430 else cout<<"OFF"<<endl;
431 } else if (fImproveTracks)
432 cout<<Form("Try to improve the reconstructed tracks by removing bad clusters (sigma cut = %5.2f)",fSigmaCutForImprovement)<<endl;
434 if (fRemoveConnectedTracksInSt12) cout<<"Remove tracks sharing one cluster or more in any station"<<endl;
435 else cout<<"Remove tracks sharing one cluster or more in stations 3, 4 and 5"<<endl;
437 if (strstr(option,"FULL")) {
438 cout<<"Use smoother to compute final track parameters, etc, at each cluster (used for Kalman tracking only): ";
439 if (fUseSmoother) cout<<"ON"<<endl;
440 else cout<<"OFF"<<endl;
441 } else if (fUseSmoother)
442 cout<<"Use smoother to compute final track parameters, etc, at each cluster"<<endl;
444 cout<<Form("Maximum normalized chi2 of tracking/trigger track matching = %5.2f",fMaxNormChi2MatchTrigger)<<endl;
446 Bool_t discardedCh = kFALSE;
449 if (!UseChamber(ch)) {
451 cout<<"Discarded chambers(1..): "<<ch+1;
454 else cout<<" "<<ch+1;
457 if (discardedCh) cout<<endl;
459 Bool_t discardedSt = kFALSE;
462 if (!RequestStation(st)) {
464 cout<<"Not requested stations(1..): "<<st+1;
467 else cout<<" "<<st+1;
470 if (discardedSt) cout<<endl;
472 cout << Form("Pad goodness policy mask is 0x%x",PadGoodnessMask()) << endl;
473 cout << "Which means we reject pads having the condition = " <<
474 AliMUONPadStatusMaker::AsCondition(PadGoodnessMask()).Data() << endl;
476 cout << "The pad limits we are using are :" << endl;
478 cout << Form("%5.0f <= HVSt12 <= %5.0f Volts",HVSt12LowLimit(),HVSt12HighLimit()) << endl;
479 cout << Form("%5.0f <= HVSt345 <= %5.0f Volts",HVSt345LowLimit(),HVSt345HighLimit()) << endl;
480 cout << Form("%7.2f <= Pedestal mean <= %7.2f",PedMeanLowLimit(),PedMeanHighLimit()) << endl;
481 cout << Form("%7.2f <= Pedestal sigma <= %7.2f",PedSigmaLowLimit(),PedSigmaHighLimit()) << endl;
482 cout << Form("%e <= Gain linear term <= %e",GainA1LowLimit(),GainA1HighLimit()) << endl;
483 cout << Form("%e <= Gain quadratic term <= %e",GainA2LowLimit(),GainA2HighLimit()) << endl;
484 cout << Form("%5.0f <= Gain threshold term <= %5.0f",GainThresLowLimit(),GainThresHighLimit()) << endl;
486 cout << Form("And we cut on charge >= %7.2f x ( pedestal sigma ) ",ChargeSigmaCut()) << endl;
488 cout << "Occupancy limits are :" << endl;
490 cout << Form("%e <= Manu occupancy < %7.2f",ManuOccupancyLowLimit(),ManuOccupancyHighLimit()) << endl;
491 cout << Form("%e <= Buspatch occupancy < %7.2f",BuspatchOccupancyLowLimit(),BuspatchOccupancyHighLimit()) << endl;
492 cout << Form("%e <= DE occupancy < %7.2f",DEOccupancyLowLimit(),DEOccupancyHighLimit()) << endl;
494 cout << "'QAChecker' limits" << endl;
495 cout << Form("MissingPadFractionLimit = %5.2f %%",MissingPadFractionLimit()*100.0) << endl;
496 cout << Form("FractionOfBuspatchOutsideOccupancyLimit = %5.2f %%",FractionOfBuspatchOutsideOccupancyLimit()*100.0) << endl;
498 cout << "chamber non bending resolution = |";
499 for (Int_t iCh = 0; iCh < 10; iCh++) cout << Form(" %6.3f |",fDefaultNonBendingReso[iCh]);
501 cout << "chamber bending resolution = |";
502 for (Int_t iCh = 0; iCh < 10; iCh++) cout << Form(" %6.3f |",fDefaultBendingReso[iCh]);
504 cout<<Form("maximum number of trigger tracks above which the tracking is cancelled = %d",fMaxTriggerTracks)<<endl;
505 cout<<Form("maximum number of track candidates above which the tracking is abandonned = %d",fMaxTrackCandidates)<<endl;
507 cout<<"\t-----------------------------------------------------"<<endl<<endl;
511 //_____________________________________________________________________________
513 AliMUONRecoParam::SetDefaultLimits()
515 /// Set the default limits and pad goodness policy
517 fHVSt12Limits[0]=1500;
518 fHVSt12Limits[1]=2000;
520 fHVSt345Limits[0]=1500;
521 fHVSt345Limits[1]=2000;
523 fPedMeanLimits[0] = 20;
524 fPedMeanLimits[1] = 1024;
526 fPedSigmaLimits[0] = 0.6;
527 fPedSigmaLimits[1] = 100;
529 fGainA1Limits[0] = 0.1;
530 fGainA1Limits[1] = 10;
532 fGainA2Limits[0] = -1E30;
533 fGainA2Limits[1] = 1E30;
535 fGainThresLimits[0] = 0;
536 fGainThresLimits[1] = 4095;
538 fPadGoodnessMask = 0x8080; // Ped is missing | HV is missing
540 fManuOccupancyLimits[0] = -1.0;
541 fManuOccupancyLimits[1] = 1.0;
543 fBuspatchOccupancyLimits[0] = 1E-6;
544 fBuspatchOccupancyLimits[1] = 1.0;
546 fDEOccupancyLimits[0] = -1.0;
547 fDEOccupancyLimits[1] = 1.0;
549 fChargeSigmaCut = 4.0;
551 fMissingPadFractionLimit = 0.1; // 10 %
552 fFractionOfBuspatchOutsideOccupancyLimit = 0.05; // 5 %