]> git.uio.no Git - u/mrichter/AliRoot.git/blame - MUON/AliMUONRecoParam.cxx
Filling residuals (GlobalQA) only for tracks with kTPCin
[u/mrichter/AliRoot.git] / MUON / AliMUONRecoParam.cxx
CommitLineData
3304fa09 1/**************************************************************************
2* Copyright(c) 1998-2007, ALICE Experiment at CERN, All rights reserved. *
3* *
4* Author: The ALICE Off-line Project. *
5* Contributors are mentioned in the code where appropriate. *
6* *
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**************************************************************************/
15
bf4d93eb 16// $Id$
3304fa09 17
18//-----------------------------------------------------------------------------
19/// \class AliMUONRecoParam
20///
21/// Class with MUON reconstruction parameters
22///
23/// \author Philippe Pillot
24//-----------------------------------------------------------------------------
25
26
27
28#include "AliMUONRecoParam.h"
ad3c6eda 29#include "AliMUONPadStatusMaker.h"
3304fa09 30
ad3c6eda 31#include "AliRecoParam.h"
3304fa09 32#include "AliLog.h"
33
34#include <Riostream.h>
35
36ClassImp(AliMUONRecoParam)
37
38
39//_____________________________________________________________________________
40AliMUONRecoParam::AliMUONRecoParam()
15d30ed4 41: AliDetectorRecoParam(),
3304fa09 42 fClusteringMode("MLEM"),
43 fTrackingMode("KALMAN"),
44 fMinBendingMomentum(0.),
45 fMaxBendingMomentum(0.),
9bf6860b 46 fMaxNonBendingSlope(0.),
9f093251 47 fMaxBendingSlope(0.),
3304fa09 48 fNonBendingVertexDispersion(0.),
49 fBendingVertexDispersion(0.),
50 fMaxNonBendingDistanceToTrack(0.),
51 fMaxBendingDistanceToTrack(0.),
52 fSigmaCutForTracking(0.),
53 fSigmaCutForImprovement(0.),
fda59e58 54 fSigmaCutForTrigger(0.),
b5270f21 55 fStripCutForTrigger(0.),
56 fMaxStripAreaForTrigger(0.),
3304fa09 57 fMaxNormChi2MatchTrigger(0.),
0a18ba02 58 fPercentOfFullClusterInESD(10.),
38bcf0ef 59 fCombinedClusterTrackReco(kFALSE),
3304fa09 60 fTrackAllTracks(kFALSE),
61 fRecoverTracks(kFALSE),
62 fMakeTrackCandidatesFast(kFALSE),
9bf6860b 63 fMakeMoreTrackCandidates(kFALSE),
3304fa09 64 fComplementTracks(kFALSE),
65 fImproveTracks(kFALSE),
0a18ba02 66 fUseSmoother(kFALSE),
de98fdc9 67 fSaveFullClusterInESD(kTRUE),
9bf6860b 68 fCalibrationMode("NOGAIN"),
004a9ccd 69 fBypassSt45(0),
170f4046 70 fPadGoodnessMask(0),
c59f70b9 71 fChargeSigmaCut(4.0),
89c8d66d 72 fRemoveConnectedTracksInSt12(kFALSE),
73 fMaxTriggerTracks(0),
74 fMaxTrackCandidates(0)
3304fa09 75{
76 /// Constructor
77
ad3c6eda 78 SetNameTitle("Dummy","Dummy");
79 SetDefaultLimits();
3304fa09 80}
81
82//_____________________________________________________________________________
83AliMUONRecoParam::~AliMUONRecoParam()
84{
85 /// Destructor
86}
87
004a9ccd 88//_____________________________________________________________________________
89void
90AliMUONRecoParam::BypassSt45(Bool_t st4, Bool_t st5)
91{
92 /// Set the bypass status
93
94 if ( st4 && st5 ) fBypassSt45 = 45;
95 else if ( st4 ) fBypassSt45 = 4;
96 else if ( st5 ) fBypassSt45 = 5;
97 else fBypassSt45 = 0;
98}
99
9bf6860b 100//_____________________________________________________________________________
101Option_t*
102AliMUONRecoParam::GetCalibrationMode() const
103{
104 /// Return the calibration mode. Can be :
105 /// NOGAIN : only do pedestal subtraction
106 /// GAIN : do pedestal subtraction, and apply gain correction, but with a
107 /// single capacitance value for all channels
108 /// GAINCONSTANTCAPA : as GAIN, but with a channel-dependent capacitance value
109
110 return fCalibrationMode.Data();
111}
112
3304fa09 113//_____________________________________________________________________________
114AliMUONRecoParam *AliMUONRecoParam::GetLowFluxParam()
115{
116 /// Return default reconstruction parameters for low flux environment
117
118 AliMUONRecoParam *param = new AliMUONRecoParam();
119 param->SetLowFluxParam();
120
121 return param;
122}
123
124//_____________________________________________________________________________
125AliMUONRecoParam *AliMUONRecoParam::GetHighFluxParam()
126{
127 /// Return default reconstruction parameters for high flux environment
128
129 AliMUONRecoParam *param = new AliMUONRecoParam();
130 param->SetHighFluxParam();
131
132 return param;
133}
134
0e894e58 135//_____________________________________________________________________________
136AliMUONRecoParam *AliMUONRecoParam::GetCosmicParam()
137{
138 /// Return default reconstruction parameters for high flux environment
139
140 AliMUONRecoParam *param = new AliMUONRecoParam();
141 param->SetCosmicParam();
142
143 return param;
144}
145
3304fa09 146//_____________________________________________________________________________
147void AliMUONRecoParam::SetLowFluxParam()
148{
149 /// Set reconstruction parameters for low flux environment
150
ad3c6eda 151 SetNameTitle("Low Flux","Low Flux");
152 SetEventSpecie(AliRecoParam::kLowMult);
9bf6860b 153 fMinBendingMomentum = 1.;
3304fa09 154 fMaxBendingMomentum = 3000.;
9bf6860b 155 fMaxNonBendingSlope = 0.3;
9f093251 156 fMaxBendingSlope = 0.4;
3304fa09 157 fNonBendingVertexDispersion = 10.;
158 fBendingVertexDispersion = 10.;
9bf6860b 159 fMaxNonBendingDistanceToTrack = 1.;
160 fMaxBendingDistanceToTrack = 1.;
3304fa09 161 fSigmaCutForTracking = 6.;
162 fSigmaCutForImprovement = 5.;
fda59e58 163 fSigmaCutForTrigger = 8.;
b5270f21 164 fStripCutForTrigger = 1.;
165 fMaxStripAreaForTrigger = 3.;
3304fa09 166 fMaxNormChi2MatchTrigger = 16.;
6cac085d 167 fCombinedClusterTrackReco = kFALSE;
3304fa09 168 fTrackAllTracks = kTRUE;
169 fRecoverTracks = kTRUE;
170 fMakeTrackCandidatesFast = kFALSE;
9bf6860b 171 fMakeMoreTrackCandidates = kFALSE;
3304fa09 172 fComplementTracks = kTRUE;
173 fImproveTracks = kTRUE;
c59f70b9 174 fRemoveConnectedTracksInSt12 = kTRUE;
3304fa09 175 fUseSmoother = kTRUE;
35be7ed7 176 for (Int_t iCh = 0; iCh < 10; iCh++) {
177 fUseChamber[iCh] = kTRUE;
178 fDefaultNonBendingReso[iCh] = 0.144;
179 fDefaultBendingReso[iCh] = 0.01;
180 }
9bf6860b 181 for (Int_t iSt = 0; iSt < 5; iSt++) fRequestStation[iSt] = kTRUE;
004a9ccd 182 fBypassSt45 = 0;
89c8d66d 183 fMaxTriggerTracks = 100;
184 fMaxTrackCandidates = 10000;
3304fa09 185
186}
187
188//_____________________________________________________________________________
189void AliMUONRecoParam::SetHighFluxParam()
190{
191 /// Set reconstruction parameters for high flux environment
192
ad3c6eda 193 SetNameTitle("High Flux","High Flux");
194 SetEventSpecie(AliRecoParam::kHighMult);
9bf6860b 195 fMinBendingMomentum = 1.;
3304fa09 196 fMaxBendingMomentum = 3000.;
9bf6860b 197 fMaxNonBendingSlope = 0.3;
9f093251 198 fMaxBendingSlope = 0.4;
3304fa09 199 fNonBendingVertexDispersion = 10.;
200 fBendingVertexDispersion = 10.;
9bf6860b 201 fMaxNonBendingDistanceToTrack = 1.;
202 fMaxBendingDistanceToTrack = 1.;
3304fa09 203 fSigmaCutForTracking = 6.;
204 fSigmaCutForImprovement = 5.;
fda59e58 205 fSigmaCutForTrigger = 8.;
b5270f21 206 fStripCutForTrigger = 1.;
207 fMaxStripAreaForTrigger = 3.;
3304fa09 208 fMaxNormChi2MatchTrigger = 16.;
6cac085d 209 fCombinedClusterTrackReco = kFALSE;
3304fa09 210 fTrackAllTracks = kTRUE;
211 fRecoverTracks = kTRUE;
212 fMakeTrackCandidatesFast = kFALSE;
9bf6860b 213 fMakeMoreTrackCandidates = kFALSE;
3304fa09 214 fComplementTracks = kTRUE;
215 fImproveTracks = kTRUE;
c59f70b9 216 fRemoveConnectedTracksInSt12 = kFALSE;
3304fa09 217 fUseSmoother = kTRUE;
35be7ed7 218 for (Int_t iCh = 0; iCh < 10; iCh++) {
219 fUseChamber[iCh] = kTRUE;
220 fDefaultNonBendingReso[iCh] = 0.144;
221 fDefaultBendingReso[iCh] = 0.01;
222 }
9bf6860b 223 for (Int_t iSt = 0; iSt < 5; iSt++) fRequestStation[iSt] = kTRUE;
004a9ccd 224 fBypassSt45 = 0;
89c8d66d 225 fMaxTriggerTracks = 100;
226 fMaxTrackCandidates = 10000;
3304fa09 227
228}
229
0e894e58 230//_____________________________________________________________________________
231void AliMUONRecoParam::SetCosmicParam()
232{
233 /// Set reconstruction parameters for high flux environment
234
ad3c6eda 235 SetNameTitle("Cosmic","Cosmic");
236 SetEventSpecie(AliRecoParam::kCosmic);
0e894e58 237 fMinBendingMomentum = 1.;
238 fMaxBendingMomentum = 10000000.;
239 fMaxNonBendingSlope = 0.3;
9f093251 240 fMaxBendingSlope = 0.4;
0e894e58 241 fNonBendingVertexDispersion = 10.;
242 fBendingVertexDispersion = 10.;
243 fMaxNonBendingDistanceToTrack = 10.;
244 fMaxBendingDistanceToTrack = 10.;
89c8d66d 245 fSigmaCutForTracking = 7.;
246 fSigmaCutForImprovement = 7.;
0e894e58 247 fSigmaCutForTrigger = 8.;
54355f2c 248 fStripCutForTrigger = 1.5;
249 fMaxStripAreaForTrigger = 3.;
0e894e58 250 fMaxNormChi2MatchTrigger = 16.;
251 fPercentOfFullClusterInESD = 100.;
252 fCombinedClusterTrackReco = kFALSE;
253 fTrackAllTracks = kTRUE;
254 fRecoverTracks = kTRUE;
255 fMakeTrackCandidatesFast = kFALSE;
256 fMakeMoreTrackCandidates = kFALSE;
257 fComplementTracks = kTRUE;
258 fImproveTracks = kTRUE;
c59f70b9 259 fRemoveConnectedTracksInSt12 = kTRUE;
0e894e58 260 fUseSmoother = kTRUE;
261 fSaveFullClusterInESD = kTRUE;
35be7ed7 262 for (Int_t iCh = 0; iCh < 10; iCh++) {
263 fUseChamber[iCh] = kTRUE;
89c8d66d 264 fDefaultNonBendingReso[iCh] = 0.4;
265 fDefaultBendingReso[iCh] = 0.4;
35be7ed7 266 }
0e894e58 267 for (Int_t iSt = 0; iSt < 5; iSt++) fRequestStation[iSt] = kTRUE;
004a9ccd 268 fBypassSt45 = 0;
89c8d66d 269 fPadGoodnessMask = 0x400BE80;
270 fMaxTriggerTracks = 100;
271 fMaxTrackCandidates = 10000;
0e894e58 272
273}
274
c59f70b9 275//_____________________________________________________________________________
276UInt_t
277AliMUONRecoParam::RequestedStationMask() const
278{
279 /// Get the mask of the requested station, i.e. an integer where
280 /// bit n is set to one if the station n was requested
281
282 UInt_t m(0);
283
284 for ( Int_t i = 0; i < 5; ++i )
285 {
286 if ( RequestStation(i) ) m |= ( 1 << i );
287 }
288 return m;
289}
290
3304fa09 291//_____________________________________________________________________________
292void AliMUONRecoParam::Print(Option_t *option) const
293{
294 /// print reconstruction parameters
295 /// if option = FULL then print also unused parameters
296
4348af6f 297 cout<<endl<<"\t------MUON Reconstruction parameters ("<<GetName()<<")------"<<endl;
ad3c6eda 298
299 if (IsDefault()) cout<<"\t\t*** Parameters used by default ***"<<endl;
3304fa09 300
de98fdc9 301 cout<<Form("Calibration mode = %s",fCalibrationMode.Data())<<endl;
3304fa09 302 cout<<Form("Clustering mode = %s",fClusteringMode.Data())<<endl;
3304fa09 303 cout<<Form("Tracking mode = %s",fTrackingMode.Data())<<endl;
9bf6860b 304
004a9ccd 305 TString bypass;
306
307 if ( BypassSt45() )
308 {
309 bypass = "stations 4 and 5";
310 }
311 else if ( BypassSt4() )
312 {
313 bypass = "station 4";
314 }
315 else if ( BypassSt5() )
316 {
317 bypass = "station 5";
318 }
319
320 if (bypass.Length()) cout << "Will bypass " << bypass.Data() << " (replacing real clusters by generated ones from trigger tracks)" << endl;
3304fa09 321
15d30ed4 322 if (fCombinedClusterTrackReco) cout<<"Combined cluster/track reconstruction: ON"<<endl;
323 else cout<<"Combined cluster/track reconstruction: OFF"<<endl;
38bcf0ef 324
0a18ba02 325 if (fSaveFullClusterInESD) cout<<Form("Save all cluster info in ESD for %5.2f %% of events",fPercentOfFullClusterInESD)<<endl;
326 else cout<<"Save partial cluster info in ESD"<<endl;
9bdbee64 327
3304fa09 328 cout<<Form("Bending momentum range = [%5.2f,%5.2f]",fMinBendingMomentum,fMaxBendingMomentum)<<endl;
329
9bf6860b 330 cout<<Form("Maximum non bending slope = %5.2f",fMaxNonBendingSlope)<<endl;
331
9f093251 332 cout<<Form("Maximum bending slope (used only if B=0) = %5.2f",fMaxBendingSlope)<<endl;
333
3304fa09 334 if (strstr(fTrackingMode,"ORIGINAL"))
335 cout<<Form("Vertex dispertion = (%5.2f,%5.2f)",fNonBendingVertexDispersion,fBendingVertexDispersion)<<endl;
336 else if (strstr(option,"FULL"))
337 cout<<Form("Vertex dispertion (used for original tracking only) = (%5.2f,%5.2f)",fNonBendingVertexDispersion,fBendingVertexDispersion)<<endl;
338
339 cout<<Form("Maximum distance to track = (%5.2f,%5.2f)",fMaxNonBendingDistanceToTrack,fMaxBendingDistanceToTrack)<<endl;
340
341 cout<<Form("Sigma cut for tracking = %5.2f",fSigmaCutForTracking)<<endl;
fda59e58 342
343 cout<<Form("Sigma cut for trigger hit pattern = %5.2f",fSigmaCutForTrigger)<<endl;
b5270f21 344
345 cout<<Form("Cut in strips for trigger chamber efficiency = %5.2f",fStripCutForTrigger)<<endl;
346
347 cout<<Form("Max search area in strips for trigger chamber efficiency = %5.2f",fMaxStripAreaForTrigger)<<endl;
348
3304fa09 349 if (fTrackAllTracks) cout<<"Track all the possible candidates"<<endl;
350 else cout<<"Track only the best candidates"<<endl;
351
352 if (strstr(option,"FULL")) {
353 cout<<"Make track candidates assuming linear propagation between stations 4 and 5: ";
354 if (fMakeTrackCandidatesFast) cout<<"ON"<<endl;
355 else cout<<"OFF"<<endl;
356 } else if (fMakeTrackCandidatesFast)
357 cout<<"Make track candidates assuming linear propagation between stations 4 and 5"<<endl;
358
9bf6860b 359 if (strstr(option,"FULL")) {
360 cout<<"Make track candidates starting from 1 cluster in each of the stations 4 and 5: ";
361 if (fMakeMoreTrackCandidates) cout<<"ON"<<endl;
362 else cout<<"OFF"<<endl;
363 } else if (fMakeMoreTrackCandidates)
364 cout<<"Make track candidates starting from 1 cluster in each of the stations 4 and 5"<<endl;
365
3304fa09 366 if (strstr(option,"FULL")) {
367 cout<<"Try to recover tracks getting lost during tracking: ";
368 if (fRecoverTracks) cout<<"ON"<<endl;
369 else cout<<"OFF"<<endl;
370 } else if (fRecoverTracks)
371 cout<<"Try to recover tracks getting lost during tracking"<<endl;
372
373 if (strstr(option,"FULL")) {
374 cout<<"Try to complete the reconstructed tracks by adding missing clusters: ";
375 if (fComplementTracks) cout<<"ON"<<endl;
376 else cout<<"OFF"<<endl;
377 } else if (fComplementTracks)
378 cout<<"Try to complete the reconstructed tracks by adding missing clusters"<<endl;
379
380 if (strstr(option,"FULL")) {
381 cout<<"Try to improve the reconstructed tracks by removing bad clusters: ";
382 if (fImproveTracks) cout<<Form("ON (sigma cut = %5.2f)",fSigmaCutForImprovement)<<endl;
383 else cout<<"OFF"<<endl;
384 } else if (fImproveTracks)
385 cout<<Form("Try to improve the reconstructed tracks by removing bad clusters (sigma cut = %5.2f)",fSigmaCutForImprovement)<<endl;
386
c59f70b9 387 if (fRemoveConnectedTracksInSt12) cout<<"Remove tracks sharing one cluster or more in any station"<<endl;
388 else cout<<"Remove tracks sharing one cluster or more in stations 3, 4 and 5"<<endl;
389
3304fa09 390 if (strstr(option,"FULL")) {
391 cout<<"Use smoother to compute final track parameters, etc, at each cluster (used for Kalman tracking only): ";
392 if (fUseSmoother) cout<<"ON"<<endl;
393 else cout<<"OFF"<<endl;
394 } else if (fUseSmoother)
395 cout<<"Use smoother to compute final track parameters, etc, at each cluster"<<endl;
396
397 cout<<Form("Maximum normalized chi2 of tracking/trigger track matching = %5.2f",fMaxNormChi2MatchTrigger)<<endl;
398
9bf6860b 399 Bool_t discardedCh = kFALSE;
400 Int_t ch = 0;
401 do {
402 if (!UseChamber(ch)) {
403 if (!discardedCh) {
404 cout<<"Discarded chambers(1..): "<<ch+1;
405 discardedCh = kTRUE;
406 }
407 else cout<<" "<<ch+1;
408 }
409 } while (++ch < 10);
410 if (discardedCh) cout<<endl;
411
412 Bool_t discardedSt = kFALSE;
413 Int_t st = 0;
414 do {
415 if (!RequestStation(st)) {
416 if (!discardedSt) {
417 cout<<"Not requested stations(1..): "<<st+1;
418 discardedSt = kTRUE;
419 }
420 else cout<<" "<<st+1;
421 }
422 } while (++st < 5);
423 if (discardedSt) cout<<endl;
424
35be7ed7 425 cout << Form("Pad goodness policy mask is 0x%x",PadGoodnessMask()) << endl;
426 cout << "Which means we reject pads having the condition = " <<
427 AliMUONPadStatusMaker::AsCondition(PadGoodnessMask()).Data() << endl;
428
429 cout << "The pad limits we are using are :" << endl;
430
431 cout << Form("%5.0f <= HVSt12 <= %5.0f Volts",HVSt12LowLimit(),HVSt12HighLimit()) << endl;
432 cout << Form("%5.0f <= HVSt345 <= %5.0f Volts",HVSt345LowLimit(),HVSt345HighLimit()) << endl;
433 cout << Form("%7.2f <= Pedestal mean <= %7.2f",PedMeanLowLimit(),PedMeanHighLimit()) << endl;
434 cout << Form("%7.2f <= Pedestal sigma <= %7.2f",PedSigmaLowLimit(),PedSigmaHighLimit()) << endl;
435 cout << Form("%e <= Gain linear term <= %e",GainA1LowLimit(),GainA1HighLimit()) << endl;
436 cout << Form("%e <= Gain quadratic term <= %e",GainA2LowLimit(),GainA2HighLimit()) << endl;
437 cout << Form("%5.0f <= Gain threshold term <= %5.0f",GainThresLowLimit(),GainThresHighLimit()) << endl;
170f4046 438
439 cout << Form("And we cut on charge >= %7.2f x ( pedestal sigma ) ",ChargeSigmaCut()) << endl;
440
35be7ed7 441 cout << "chamber non bending resolution = |";
442 for (Int_t iCh = 0; iCh < 10; iCh++) cout << Form(" %6.3f |",fDefaultNonBendingReso[iCh]);
443 cout << endl;
444 cout << "chamber bending resolution = |";
445 for (Int_t iCh = 0; iCh < 10; iCh++) cout << Form(" %6.3f |",fDefaultBendingReso[iCh]);
446 cout << endl;
89c8d66d 447 cout<<Form("maximum number of trigger tracks above which the tracking is cancelled = %d",fMaxTriggerTracks)<<endl;
448 cout<<Form("maximum number of track candidates above which the tracking abort = %d",fMaxTrackCandidates)<<endl;
35be7ed7 449
4348af6f 450 cout<<"\t-----------------------------------------------------"<<endl<<endl;
3304fa09 451
452}
453
004a9ccd 454//_____________________________________________________________________________
455void
456AliMUONRecoParam::SetDefaultLimits()
457{
458 /// Set the default limits and pad goodness policy
459
460 fHVSt12Limits[0]=1500;
461 fHVSt12Limits[1]=2000;
462
463 fHVSt345Limits[0]=1500;
464 fHVSt345Limits[1]=2000;
465
466 fPedMeanLimits[0] = 50;
467 fPedMeanLimits[1] = 1024;
468
89c8d66d 469 fPedSigmaLimits[0] = 0.6;
004a9ccd 470 fPedSigmaLimits[1] = 100;
471
472 fGainA1Limits[0] = 0.1;
473 fGainA1Limits[1] = 10;
474
475 fGainA2Limits[0] = -1E30;
476 fGainA2Limits[1] = 1E30;
477
478 fGainThresLimits[0] = 0;
479 fGainThresLimits[1] = 4095;
480
481 fPadGoodnessMask = 0x8080;
170f4046 482
483 fChargeSigmaCut = 4.0;
004a9ccd 484}
485