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