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)
79 SetNameTitle("Dummy","Dummy");
83 //_____________________________________________________________________________
84 AliMUONRecoParam::~AliMUONRecoParam()
89 //_____________________________________________________________________________
91 AliMUONRecoParam::BypassSt45(Bool_t st4, Bool_t st5)
93 /// Set the bypass status
95 if ( st4 && st5 ) fBypassSt45 = 45;
96 else if ( st4 ) fBypassSt45 = 4;
97 else if ( st5 ) fBypassSt45 = 5;
101 //_____________________________________________________________________________
103 AliMUONRecoParam::GetCalibrationMode() const
105 /// Return the calibration mode. Can be :
106 /// NOGAIN : only do pedestal subtraction
107 /// GAIN : do pedestal subtraction, and apply gain correction, but with a
108 /// single capacitance value for all channels
109 /// GAINCONSTANTCAPA : as GAIN, but with a channel-dependent capacitance value
111 return fCalibrationMode.Data();
114 //_____________________________________________________________________________
115 AliMUONRecoParam *AliMUONRecoParam::GetLowFluxParam()
117 /// Return default reconstruction parameters for low flux environment
119 AliMUONRecoParam *param = new AliMUONRecoParam();
120 param->SetLowFluxParam();
125 //_____________________________________________________________________________
126 AliMUONRecoParam *AliMUONRecoParam::GetHighFluxParam()
128 /// Return default reconstruction parameters for high flux environment
130 AliMUONRecoParam *param = new AliMUONRecoParam();
131 param->SetHighFluxParam();
136 //_____________________________________________________________________________
137 AliMUONRecoParam *AliMUONRecoParam::GetCosmicParam()
139 /// Return default reconstruction parameters for high flux environment
141 AliMUONRecoParam *param = new AliMUONRecoParam();
142 param->SetCosmicParam();
147 //_____________________________________________________________________________
148 void AliMUONRecoParam::SetLowFluxParam()
150 /// Set reconstruction parameters for low flux environment
152 SetNameTitle("Low Flux","Low Flux");
153 SetEventSpecie(AliRecoParam::kLowMult);
154 fMinBendingMomentum = 1.;
155 fMaxBendingMomentum = 3000.;
156 fMaxNonBendingSlope = 0.3;
157 fMaxBendingSlope = 0.4;
158 fSelectTrackOnSlope = kFALSE;
159 fNonBendingVertexDispersion = 70.;
160 fBendingVertexDispersion = 70.;
161 fMaxNonBendingDistanceToTrack = 1.;
162 fMaxBendingDistanceToTrack = 1.;
163 fSigmaCutForTracking = 6.;
164 fSigmaCutForImprovement = 5.;
165 fSigmaCutForTrigger = 8.;
166 fStripCutForTrigger = 1.;
167 fMaxStripAreaForTrigger = 3.;
168 fMaxNormChi2MatchTrigger = 16.;
169 fCombinedClusterTrackReco = kFALSE;
170 fTrackAllTracks = kTRUE;
171 fRecoverTracks = kTRUE;
172 fMakeTrackCandidatesFast = kFALSE;
173 fMakeMoreTrackCandidates = kFALSE;
174 fComplementTracks = kTRUE;
175 fImproveTracks = kTRUE;
176 fRemoveConnectedTracksInSt12 = kTRUE;
177 fUseSmoother = kTRUE;
178 for (Int_t iCh = 0; iCh < 10; iCh++) {
179 fUseChamber[iCh] = kTRUE;
180 fDefaultNonBendingReso[iCh] = 0.144;
181 fDefaultBendingReso[iCh] = 0.01;
183 for (Int_t iSt = 0; iSt < 5; iSt++) fRequestStation[iSt] = kTRUE;
185 fMaxTriggerTracks = 100;
186 fMaxTrackCandidates = 10000;
190 //_____________________________________________________________________________
191 void AliMUONRecoParam::SetHighFluxParam()
193 /// Set reconstruction parameters for high flux environment
195 SetNameTitle("High Flux","High Flux");
196 SetEventSpecie(AliRecoParam::kHighMult);
197 fMinBendingMomentum = 1.;
198 fMaxBendingMomentum = 3000.;
199 fMaxNonBendingSlope = 0.3;
200 fMaxBendingSlope = 0.4;
201 fSelectTrackOnSlope = kFALSE;
202 fNonBendingVertexDispersion = 70.;
203 fBendingVertexDispersion = 70.;
204 fMaxNonBendingDistanceToTrack = 1.;
205 fMaxBendingDistanceToTrack = 1.;
206 fSigmaCutForTracking = 6.;
207 fSigmaCutForImprovement = 5.;
208 fSigmaCutForTrigger = 8.;
209 fStripCutForTrigger = 1.;
210 fMaxStripAreaForTrigger = 3.;
211 fMaxNormChi2MatchTrigger = 16.;
212 fCombinedClusterTrackReco = kFALSE;
213 fTrackAllTracks = kTRUE;
214 fRecoverTracks = kTRUE;
215 fMakeTrackCandidatesFast = kFALSE;
216 fMakeMoreTrackCandidates = kFALSE;
217 fComplementTracks = kTRUE;
218 fImproveTracks = kTRUE;
219 fRemoveConnectedTracksInSt12 = kFALSE;
220 fUseSmoother = kTRUE;
221 for (Int_t iCh = 0; iCh < 10; iCh++) {
222 fUseChamber[iCh] = kTRUE;
223 fDefaultNonBendingReso[iCh] = 0.144;
224 fDefaultBendingReso[iCh] = 0.01;
226 for (Int_t iSt = 0; iSt < 5; iSt++) fRequestStation[iSt] = kTRUE;
228 fMaxTriggerTracks = 100;
229 fMaxTrackCandidates = 10000;
233 //_____________________________________________________________________________
234 void AliMUONRecoParam::SetCosmicParam()
236 /// Set reconstruction parameters for high flux environment
238 SetNameTitle("Cosmic","Cosmic");
239 SetEventSpecie(AliRecoParam::kCosmic);
240 fMinBendingMomentum = 1.;
241 fMaxBendingMomentum = 10000000.;
242 fMaxNonBendingSlope = 0.4;
243 fMaxBendingSlope = 0.5;
244 fSelectTrackOnSlope = kTRUE;
245 fNonBendingVertexDispersion = 200.;
246 fBendingVertexDispersion = 200.;
247 fMaxNonBendingDistanceToTrack = 1.;
248 fMaxBendingDistanceToTrack = 1.;
249 fSigmaCutForTracking = 7.;
250 fSigmaCutForImprovement = 7.;
251 fSigmaCutForTrigger = 8.;
252 fStripCutForTrigger = 1.5;
253 fMaxStripAreaForTrigger = 3.;
254 fMaxNormChi2MatchTrigger = 16.;
255 fPercentOfFullClusterInESD = 100.;
256 fCombinedClusterTrackReco = kFALSE;
257 fTrackAllTracks = kTRUE;
258 fRecoverTracks = kTRUE;
259 fMakeTrackCandidatesFast = kFALSE;
260 fMakeMoreTrackCandidates = kFALSE;
261 fComplementTracks = kTRUE;
262 fImproveTracks = kTRUE;
263 fRemoveConnectedTracksInSt12 = kTRUE;
264 fUseSmoother = kTRUE;
265 fSaveFullClusterInESD = kTRUE;
266 for (Int_t iCh = 0; iCh < 10; iCh++) {
267 fUseChamber[iCh] = kTRUE;
268 fDefaultNonBendingReso[iCh] = 0.4;
269 fDefaultBendingReso[iCh] = 0.4;
271 for (Int_t iSt = 0; iSt < 5; iSt++) fRequestStation[iSt] = kTRUE;
273 fPadGoodnessMask = 0xC00BE80;
274 fMaxTriggerTracks = 100;
275 fMaxTrackCandidates = 10000;
279 //_____________________________________________________________________________
281 AliMUONRecoParam::RequestedStationMask() const
283 /// Get the mask of the requested station, i.e. an integer where
284 /// bit n is set to one if the station n was requested
288 for ( Int_t i = 0; i < 5; ++i )
290 if ( RequestStation(i) ) m |= ( 1 << i );
295 //_____________________________________________________________________________
296 void AliMUONRecoParam::Print(Option_t *option) const
298 /// print reconstruction parameters
299 /// if option = FULL then print also unused parameters
301 cout<<endl<<"\t------MUON Reconstruction parameters ("<<GetName()<<")------"<<endl;
303 if (IsDefault()) cout<<"\t\t*** Parameters used by default ***"<<endl;
305 cout<<Form("Calibration mode = %s",fCalibrationMode.Data())<<endl;
306 cout<<Form("Clustering mode = %s",fClusteringMode.Data())<<endl;
307 cout<<Form("Tracking mode = %s",fTrackingMode.Data())<<endl;
313 bypass = "stations 4 and 5";
315 else if ( BypassSt4() )
317 bypass = "station 4";
319 else if ( BypassSt5() )
321 bypass = "station 5";
324 if (bypass.Length()) cout << "Will bypass " << bypass.Data() << " (replacing real clusters by generated ones from trigger tracks)" << endl;
326 if (fCombinedClusterTrackReco) cout<<"Combined cluster/track reconstruction: ON"<<endl;
327 else cout<<"Combined cluster/track reconstruction: OFF"<<endl;
329 if (fSaveFullClusterInESD) cout<<Form("Save all cluster info in ESD for %5.2f %% of events",fPercentOfFullClusterInESD)<<endl;
330 else cout<<"Save partial cluster info in ESD"<<endl;
332 cout<<"Selection of track candidates:"<<endl;
333 if (fSelectTrackOnSlope) cout<<Form("\t- Non-bending slope < %5.2f",fMaxNonBendingSlope)<<endl;
334 else cout<<"\t- Impact parameter < 3 * vertex dispersion in the non-bending direction"<<endl;
335 cout<<Form("\t- if B!=0: Bending momentum > %5.2f",fMinBendingMomentum)<<endl;
336 if (fSelectTrackOnSlope) cout<<Form("\t if B==0: Bending slope < %5.2f",fMaxBendingSlope)<<endl;
337 else cout<<"\t if B==0: Impact parameter < 3 * vertex dispersion in the bending direction"<<endl;
339 cout<<Form("Vertex dispersion (used to estimate initial bending momentum resolution) = (%5.2f,%5.2f)",fNonBendingVertexDispersion,fBendingVertexDispersion)<<endl;
341 cout<<Form("Maximum distance to track = (%5.2f,%5.2f)",fMaxNonBendingDistanceToTrack,fMaxBendingDistanceToTrack)<<endl;
343 cout<<Form("Sigma cut for tracking = %5.2f",fSigmaCutForTracking)<<endl;
345 cout<<Form("Sigma cut for trigger hit pattern = %5.2f",fSigmaCutForTrigger)<<endl;
347 cout<<Form("Cut in strips for trigger chamber efficiency = %5.2f",fStripCutForTrigger)<<endl;
349 cout<<Form("Max search area in strips for trigger chamber efficiency = %5.2f",fMaxStripAreaForTrigger)<<endl;
351 if (fTrackAllTracks) cout<<"Track all the possible candidates"<<endl;
352 else cout<<"Track only the best candidates"<<endl;
354 if (strstr(option,"FULL")) {
355 cout<<"Make track candidates assuming linear propagation between stations 4 and 5: ";
356 if (fMakeTrackCandidatesFast) cout<<"ON"<<endl;
357 else cout<<"OFF"<<endl;
358 } else if (fMakeTrackCandidatesFast)
359 cout<<"Make track candidates assuming linear propagation between stations 4 and 5"<<endl;
361 if (strstr(option,"FULL")) {
362 cout<<"Make track candidates starting from 1 cluster in each of the stations 4 and 5: ";
363 if (fMakeMoreTrackCandidates) cout<<"ON"<<endl;
364 else cout<<"OFF"<<endl;
365 } else if (fMakeMoreTrackCandidates)
366 cout<<"Make track candidates starting from 1 cluster in each of the stations 4 and 5"<<endl;
368 if (strstr(option,"FULL")) {
369 cout<<"Try to recover tracks getting lost during tracking: ";
370 if (fRecoverTracks) cout<<"ON"<<endl;
371 else cout<<"OFF"<<endl;
372 } else if (fRecoverTracks)
373 cout<<"Try to recover tracks getting lost during tracking"<<endl;
375 if (strstr(option,"FULL")) {
376 cout<<"Try to complete the reconstructed tracks by adding missing clusters: ";
377 if (fComplementTracks) cout<<"ON"<<endl;
378 else cout<<"OFF"<<endl;
379 } else if (fComplementTracks)
380 cout<<"Try to complete the reconstructed tracks by adding missing clusters"<<endl;
382 if (strstr(option,"FULL")) {
383 cout<<"Try to improve the reconstructed tracks by removing bad clusters: ";
384 if (fImproveTracks) cout<<Form("ON (sigma cut = %5.2f)",fSigmaCutForImprovement)<<endl;
385 else cout<<"OFF"<<endl;
386 } else if (fImproveTracks)
387 cout<<Form("Try to improve the reconstructed tracks by removing bad clusters (sigma cut = %5.2f)",fSigmaCutForImprovement)<<endl;
389 if (fRemoveConnectedTracksInSt12) cout<<"Remove tracks sharing one cluster or more in any station"<<endl;
390 else cout<<"Remove tracks sharing one cluster or more in stations 3, 4 and 5"<<endl;
392 if (strstr(option,"FULL")) {
393 cout<<"Use smoother to compute final track parameters, etc, at each cluster (used for Kalman tracking only): ";
394 if (fUseSmoother) cout<<"ON"<<endl;
395 else cout<<"OFF"<<endl;
396 } else if (fUseSmoother)
397 cout<<"Use smoother to compute final track parameters, etc, at each cluster"<<endl;
399 cout<<Form("Maximum normalized chi2 of tracking/trigger track matching = %5.2f",fMaxNormChi2MatchTrigger)<<endl;
401 Bool_t discardedCh = kFALSE;
404 if (!UseChamber(ch)) {
406 cout<<"Discarded chambers(1..): "<<ch+1;
409 else cout<<" "<<ch+1;
412 if (discardedCh) cout<<endl;
414 Bool_t discardedSt = kFALSE;
417 if (!RequestStation(st)) {
419 cout<<"Not requested stations(1..): "<<st+1;
422 else cout<<" "<<st+1;
425 if (discardedSt) cout<<endl;
427 cout << Form("Pad goodness policy mask is 0x%x",PadGoodnessMask()) << endl;
428 cout << "Which means we reject pads having the condition = " <<
429 AliMUONPadStatusMaker::AsCondition(PadGoodnessMask()).Data() << endl;
431 cout << "The pad limits we are using are :" << endl;
433 cout << Form("%5.0f <= HVSt12 <= %5.0f Volts",HVSt12LowLimit(),HVSt12HighLimit()) << endl;
434 cout << Form("%5.0f <= HVSt345 <= %5.0f Volts",HVSt345LowLimit(),HVSt345HighLimit()) << endl;
435 cout << Form("%7.2f <= Pedestal mean <= %7.2f",PedMeanLowLimit(),PedMeanHighLimit()) << endl;
436 cout << Form("%7.2f <= Pedestal sigma <= %7.2f",PedSigmaLowLimit(),PedSigmaHighLimit()) << endl;
437 cout << Form("%e <= Gain linear term <= %e",GainA1LowLimit(),GainA1HighLimit()) << endl;
438 cout << Form("%e <= Gain quadratic term <= %e",GainA2LowLimit(),GainA2HighLimit()) << endl;
439 cout << Form("%5.0f <= Gain threshold term <= %5.0f",GainThresLowLimit(),GainThresHighLimit()) << endl;
441 cout << Form("And we cut on charge >= %7.2f x ( pedestal sigma ) ",ChargeSigmaCut()) << endl;
443 cout << "chamber non bending resolution = |";
444 for (Int_t iCh = 0; iCh < 10; iCh++) cout << Form(" %6.3f |",fDefaultNonBendingReso[iCh]);
446 cout << "chamber bending resolution = |";
447 for (Int_t iCh = 0; iCh < 10; iCh++) cout << Form(" %6.3f |",fDefaultBendingReso[iCh]);
449 cout<<Form("maximum number of trigger tracks above which the tracking is cancelled = %d",fMaxTriggerTracks)<<endl;
450 cout<<Form("maximum number of track candidates above which the tracking is abandonned = %d",fMaxTrackCandidates)<<endl;
452 cout<<"\t-----------------------------------------------------"<<endl<<endl;
456 //_____________________________________________________________________________
458 AliMUONRecoParam::SetDefaultLimits()
460 /// Set the default limits and pad goodness policy
462 fHVSt12Limits[0]=1500;
463 fHVSt12Limits[1]=2000;
465 fHVSt345Limits[0]=1500;
466 fHVSt345Limits[1]=2000;
468 fPedMeanLimits[0] = 50;
469 fPedMeanLimits[1] = 1024;
471 fPedSigmaLimits[0] = 0.6;
472 fPedSigmaLimits[1] = 100;
474 fGainA1Limits[0] = 0.1;
475 fGainA1Limits[1] = 10;
477 fGainA2Limits[0] = -1E30;
478 fGainA2Limits[1] = 1E30;
480 fGainThresLimits[0] = 0;
481 fGainThresLimits[1] = 4095;
483 fPadGoodnessMask = 0x8008080; // Ped is missing | HV is missing | killed
486 fChargeSigmaCut = 4.0;