]> git.uio.no Git - u/mrichter/AliRoot.git/blame - MUON/AliMUONRecoParam.cxx
Fix for the dumps in the test script
[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
9074a9a9 34#include "AliCDBManager.h"
35#include "AliCDBEntry.h"
36
3304fa09 37#include <Riostream.h>
38
39ClassImp(AliMUONRecoParam)
40
41
42//_____________________________________________________________________________
43AliMUONRecoParam::AliMUONRecoParam()
15d30ed4 44: AliDetectorRecoParam(),
3304fa09 45 fClusteringMode("MLEM"),
46 fTrackingMode("KALMAN"),
47 fMinBendingMomentum(0.),
48 fMaxBendingMomentum(0.),
9bf6860b 49 fMaxNonBendingSlope(0.),
9f093251 50 fMaxBendingSlope(0.),
3304fa09 51 fNonBendingVertexDispersion(0.),
52 fBendingVertexDispersion(0.),
53 fMaxNonBendingDistanceToTrack(0.),
54 fMaxBendingDistanceToTrack(0.),
55 fSigmaCutForTracking(0.),
56 fSigmaCutForImprovement(0.),
fda59e58 57 fSigmaCutForTrigger(0.),
b5270f21 58 fStripCutForTrigger(0.),
59 fMaxStripAreaForTrigger(0.),
3304fa09 60 fMaxNormChi2MatchTrigger(0.),
0a18ba02 61 fPercentOfFullClusterInESD(10.),
38bcf0ef 62 fCombinedClusterTrackReco(kFALSE),
3304fa09 63 fTrackAllTracks(kFALSE),
64 fRecoverTracks(kFALSE),
65 fMakeTrackCandidatesFast(kFALSE),
9bf6860b 66 fMakeMoreTrackCandidates(kFALSE),
3304fa09 67 fComplementTracks(kFALSE),
68 fImproveTracks(kFALSE),
0a18ba02 69 fUseSmoother(kFALSE),
de98fdc9 70 fSaveFullClusterInESD(kTRUE),
9bf6860b 71 fCalibrationMode("NOGAIN"),
004a9ccd 72 fBypassSt45(0),
170f4046 73 fPadGoodnessMask(0),
c59f70b9 74 fChargeSigmaCut(4.0),
89c8d66d 75 fRemoveConnectedTracksInSt12(kFALSE),
76 fMaxTriggerTracks(0),
6b191dea 77 fMaxTrackCandidates(0),
ece56eb9 78 fSelectTrackOnSlope(kFALSE),
b3d57767 79 fMissingPadFractionLimit(-1),
110edb51 80 fFractionOfBuspatchOutsideOccupancyLimit(0),
81 fAverageNoisePadCharge(0.22875),
b3d57767 82 fClusterChargeCut(2.0),
83 fEventSizeSoftLimit(35.0),
84 fEventSizeHardLimit(45.0),
9074a9a9 85 fTokenLostLimit(0.0),
86 fTryRecover(kFALSE)
110edb51 87{
3304fa09 88 /// Constructor
89
ad3c6eda 90 SetNameTitle("Dummy","Dummy");
c6e702f8 91 for (Int_t iCh = 0; iCh < 10; iCh++) {
92 fUseChamber[iCh] = kTRUE;
93 fDefaultNonBendingReso[iCh] = 0.;
94 fDefaultBendingReso[iCh] = 0.;
95 }
96 for (Int_t iSt = 0; iSt < 5; iSt++) fRequestStation[iSt] = kTRUE;
ad3c6eda 97 SetDefaultLimits();
3304fa09 98}
99
100//_____________________________________________________________________________
101AliMUONRecoParam::~AliMUONRecoParam()
102{
103 /// Destructor
104}
105
004a9ccd 106//_____________________________________________________________________________
107void
108AliMUONRecoParam::BypassSt45(Bool_t st4, Bool_t st5)
109{
110 /// Set the bypass status
111
112 if ( st4 && st5 ) fBypassSt45 = 45;
113 else if ( st4 ) fBypassSt45 = 4;
114 else if ( st5 ) fBypassSt45 = 5;
115 else fBypassSt45 = 0;
116}
117
9bf6860b 118//_____________________________________________________________________________
119Option_t*
120AliMUONRecoParam::GetCalibrationMode() const
121{
122 /// Return the calibration mode. Can be :
123 /// NOGAIN : only do pedestal subtraction
124 /// GAIN : do pedestal subtraction, and apply gain correction, but with a
125 /// single capacitance value for all channels
66cdf5b3 126 /// INJECTIONGAIN : as GAIN, but with gain values taken as EMELEC factory values
9bf6860b 127 /// GAINCONSTANTCAPA : as GAIN, but with a channel-dependent capacitance value
128
129 return fCalibrationMode.Data();
130}
131
3304fa09 132//_____________________________________________________________________________
133AliMUONRecoParam *AliMUONRecoParam::GetLowFluxParam()
134{
135 /// Return default reconstruction parameters for low flux environment
136
137 AliMUONRecoParam *param = new AliMUONRecoParam();
138 param->SetLowFluxParam();
139
140 return param;
141}
142
143//_____________________________________________________________________________
144AliMUONRecoParam *AliMUONRecoParam::GetHighFluxParam()
145{
146 /// Return default reconstruction parameters for high flux environment
147
148 AliMUONRecoParam *param = new AliMUONRecoParam();
149 param->SetHighFluxParam();
150
151 return param;
152}
153
0e894e58 154//_____________________________________________________________________________
155AliMUONRecoParam *AliMUONRecoParam::GetCosmicParam()
156{
157 /// Return default reconstruction parameters for high flux environment
158
159 AliMUONRecoParam *param = new AliMUONRecoParam();
160 param->SetCosmicParam();
161
162 return param;
163}
164
c6e702f8 165//_____________________________________________________________________________
166AliMUONRecoParam *AliMUONRecoParam::GetCalibrationParam()
167{
168 /// Return default (dummy) reconstruction parameters for calibration environment
169
170 AliMUONRecoParam *param = new AliMUONRecoParam();
171 param->SetCalibrationParam();
172
173 return param;
174}
175
176
3304fa09 177//_____________________________________________________________________________
178void AliMUONRecoParam::SetLowFluxParam()
179{
180 /// Set reconstruction parameters for low flux environment
181
ad3c6eda 182 SetNameTitle("Low Flux","Low Flux");
183 SetEventSpecie(AliRecoParam::kLowMult);
e8ec0154 184 fMinBendingMomentum = 0.8;
185 fMaxBendingMomentum = 1.e10;
9bf6860b 186 fMaxNonBendingSlope = 0.3;
9f093251 187 fMaxBendingSlope = 0.4;
6b191dea 188 fSelectTrackOnSlope = kFALSE;
189 fNonBendingVertexDispersion = 70.;
190 fBendingVertexDispersion = 70.;
9bf6860b 191 fMaxNonBendingDistanceToTrack = 1.;
192 fMaxBendingDistanceToTrack = 1.;
3304fa09 193 fSigmaCutForTracking = 6.;
194 fSigmaCutForImprovement = 5.;
bdfb6eef 195 fSigmaCutForTrigger = 4.;
b5270f21 196 fStripCutForTrigger = 1.;
197 fMaxStripAreaForTrigger = 3.;
bdfb6eef 198 fMaxNormChi2MatchTrigger = fSigmaCutForTrigger * fSigmaCutForTrigger;
6cac085d 199 fCombinedClusterTrackReco = kFALSE;
3304fa09 200 fTrackAllTracks = kTRUE;
201 fRecoverTracks = kTRUE;
202 fMakeTrackCandidatesFast = kFALSE;
9bf6860b 203 fMakeMoreTrackCandidates = kFALSE;
3304fa09 204 fComplementTracks = kTRUE;
205 fImproveTracks = kTRUE;
5c15a68b 206 fRemoveConnectedTracksInSt12 = kFALSE;
3304fa09 207 fUseSmoother = kTRUE;
35be7ed7 208 for (Int_t iCh = 0; iCh < 10; iCh++) {
209 fUseChamber[iCh] = kTRUE;
210 fDefaultNonBendingReso[iCh] = 0.144;
211 fDefaultBendingReso[iCh] = 0.01;
212 }
9bf6860b 213 for (Int_t iSt = 0; iSt < 5; iSt++) fRequestStation[iSt] = kTRUE;
004a9ccd 214 fBypassSt45 = 0;
89c8d66d 215 fMaxTriggerTracks = 100;
ece56eb9 216 fMaxTrackCandidates = 10000;
3304fa09 217}
218
219//_____________________________________________________________________________
220void AliMUONRecoParam::SetHighFluxParam()
221{
222 /// Set reconstruction parameters for high flux environment
223
ad3c6eda 224 SetNameTitle("High Flux","High Flux");
225 SetEventSpecie(AliRecoParam::kHighMult);
e8ec0154 226 fMinBendingMomentum = 0.8;
227 fMaxBendingMomentum = 1.e10;
9bf6860b 228 fMaxNonBendingSlope = 0.3;
9f093251 229 fMaxBendingSlope = 0.4;
6b191dea 230 fSelectTrackOnSlope = kFALSE;
231 fNonBendingVertexDispersion = 70.;
232 fBendingVertexDispersion = 70.;
9bf6860b 233 fMaxNonBendingDistanceToTrack = 1.;
234 fMaxBendingDistanceToTrack = 1.;
3304fa09 235 fSigmaCutForTracking = 6.;
236 fSigmaCutForImprovement = 5.;
bdfb6eef 237 fSigmaCutForTrigger = 4.;
b5270f21 238 fStripCutForTrigger = 1.;
239 fMaxStripAreaForTrigger = 3.;
bdfb6eef 240 fMaxNormChi2MatchTrigger = fSigmaCutForTrigger * fSigmaCutForTrigger;
6cac085d 241 fCombinedClusterTrackReco = kFALSE;
3304fa09 242 fTrackAllTracks = kTRUE;
243 fRecoverTracks = kTRUE;
244 fMakeTrackCandidatesFast = kFALSE;
9bf6860b 245 fMakeMoreTrackCandidates = kFALSE;
3304fa09 246 fComplementTracks = kTRUE;
247 fImproveTracks = kTRUE;
c59f70b9 248 fRemoveConnectedTracksInSt12 = kFALSE;
3304fa09 249 fUseSmoother = kTRUE;
35be7ed7 250 for (Int_t iCh = 0; iCh < 10; iCh++) {
251 fUseChamber[iCh] = kTRUE;
252 fDefaultNonBendingReso[iCh] = 0.144;
253 fDefaultBendingReso[iCh] = 0.01;
254 }
9bf6860b 255 for (Int_t iSt = 0; iSt < 5; iSt++) fRequestStation[iSt] = kTRUE;
004a9ccd 256 fBypassSt45 = 0;
89c8d66d 257 fMaxTriggerTracks = 100;
258 fMaxTrackCandidates = 10000;
3304fa09 259}
260
0e894e58 261//_____________________________________________________________________________
262void AliMUONRecoParam::SetCosmicParam()
263{
264 /// Set reconstruction parameters for high flux environment
265
ad3c6eda 266 SetNameTitle("Cosmic","Cosmic");
267 SetEventSpecie(AliRecoParam::kCosmic);
e8ec0154 268 fMinBendingMomentum = 0.8;
269 fMaxBendingMomentum = 1.e10;
270 fMaxNonBendingSlope = 0.3;
271 fMaxBendingSlope = 0.4;
6b191dea 272 fSelectTrackOnSlope = kTRUE;
e8ec0154 273 fNonBendingVertexDispersion = 170.;
274 fBendingVertexDispersion = 170.;
6b191dea 275 fMaxNonBendingDistanceToTrack = 1.;
276 fMaxBendingDistanceToTrack = 1.;
89c8d66d 277 fSigmaCutForTracking = 7.;
6dbd970f 278 fSigmaCutForImprovement = 6.;
bdfb6eef 279 fSigmaCutForTrigger = 4.;
54355f2c 280 fStripCutForTrigger = 1.5;
281 fMaxStripAreaForTrigger = 3.;
bdfb6eef 282 fMaxNormChi2MatchTrigger = fSigmaCutForTrigger * fSigmaCutForTrigger;
0e894e58 283 fPercentOfFullClusterInESD = 100.;
284 fCombinedClusterTrackReco = kFALSE;
285 fTrackAllTracks = kTRUE;
286 fRecoverTracks = kTRUE;
287 fMakeTrackCandidatesFast = kFALSE;
288 fMakeMoreTrackCandidates = kFALSE;
289 fComplementTracks = kTRUE;
290 fImproveTracks = kTRUE;
c59f70b9 291 fRemoveConnectedTracksInSt12 = kTRUE;
0e894e58 292 fUseSmoother = kTRUE;
293 fSaveFullClusterInESD = kTRUE;
35be7ed7 294 for (Int_t iCh = 0; iCh < 10; iCh++) {
295 fUseChamber[iCh] = kTRUE;
e8ec0154 296 fDefaultNonBendingReso[iCh] = 0.4;
297 fDefaultBendingReso[iCh] = 0.4;
35be7ed7 298 }
e8ec0154 299 fRequestStation[0] = kTRUE;
300 fRequestStation[1] = kTRUE;
301 fRequestStation[2] = kTRUE;
6dbd970f 302 fRequestStation[3] = kTRUE;
303 fRequestStation[4] = kTRUE;
004a9ccd 304 fBypassSt45 = 0;
7eafe398 305 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
89c8d66d 306 fMaxTriggerTracks = 100;
307 fMaxTrackCandidates = 10000;
110edb51 308
6dbd970f 309 SetPedMeanLimits(20, 700);
310 SetManuOccupancyLimits(-1.,0.01); // reject manu above occ=1%
ece56eb9 311
b3d57767 312 SetBuspatchOccupancyLimits(-1,0.05);
313 SetFractionOfBuspatchOutsideOccupancyLimit(0.10); // 10 %
0e894e58 314}
315
c6e702f8 316
317//_____________________________________________________________________________
318void AliMUONRecoParam::SetCalibrationParam()
319{
320 /// Set (dummy) reconstruction parameters for calibration environment
321
322 SetNameTitle("Calibration","Calibration");
323 SetEventSpecie(AliRecoParam::kCalib);
324
325 fPedMeanLimits[0] = 5000;
326 fPedMeanLimits[1] = 0;
327
328 fPadGoodnessMask = 0x8C00; // Pedestal is missing | is too low | too high
329
330}
331
c59f70b9 332//_____________________________________________________________________________
333UInt_t
334AliMUONRecoParam::RequestedStationMask() const
335{
336 /// Get the mask of the requested station, i.e. an integer where
337 /// bit n is set to one if the station n was requested
338
339 UInt_t m(0);
340
341 for ( Int_t i = 0; i < 5; ++i )
342 {
343 if ( RequestStation(i) ) m |= ( 1 << i );
344 }
345 return m;
346}
347
3304fa09 348//_____________________________________________________________________________
349void AliMUONRecoParam::Print(Option_t *option) const
350{
351 /// print reconstruction parameters
352 /// if option = FULL then print also unused parameters
353
4348af6f 354 cout<<endl<<"\t------MUON Reconstruction parameters ("<<GetName()<<")------"<<endl;
ad3c6eda 355
356 if (IsDefault()) cout<<"\t\t*** Parameters used by default ***"<<endl;
3304fa09 357
05315e71 358 cout << "Event Specie=" << GetEventSpecie() << endl;
359
de98fdc9 360 cout<<Form("Calibration mode = %s",fCalibrationMode.Data())<<endl;
3304fa09 361 cout<<Form("Clustering mode = %s",fClusteringMode.Data())<<endl;
3304fa09 362 cout<<Form("Tracking mode = %s",fTrackingMode.Data())<<endl;
9bf6860b 363
004a9ccd 364 TString bypass;
365
366 if ( BypassSt45() )
367 {
368 bypass = "stations 4 and 5";
369 }
370 else if ( BypassSt4() )
371 {
372 bypass = "station 4";
373 }
374 else if ( BypassSt5() )
375 {
376 bypass = "station 5";
377 }
378
379 if (bypass.Length()) cout << "Will bypass " << bypass.Data() << " (replacing real clusters by generated ones from trigger tracks)" << endl;
3304fa09 380
15d30ed4 381 if (fCombinedClusterTrackReco) cout<<"Combined cluster/track reconstruction: ON"<<endl;
382 else cout<<"Combined cluster/track reconstruction: OFF"<<endl;
38bcf0ef 383
0a18ba02 384 if (fSaveFullClusterInESD) cout<<Form("Save all cluster info in ESD for %5.2f %% of events",fPercentOfFullClusterInESD)<<endl;
385 else cout<<"Save partial cluster info in ESD"<<endl;
9bdbee64 386
6b191dea 387 cout<<"Selection of track candidates:"<<endl;
388 if (fSelectTrackOnSlope) cout<<Form("\t- Non-bending slope < %5.2f",fMaxNonBendingSlope)<<endl;
389 else cout<<"\t- Impact parameter < 3 * vertex dispersion in the non-bending direction"<<endl;
390 cout<<Form("\t- if B!=0: Bending momentum > %5.2f",fMinBendingMomentum)<<endl;
391 if (fSelectTrackOnSlope) cout<<Form("\t if B==0: Bending slope < %5.2f",fMaxBendingSlope)<<endl;
392 else cout<<"\t if B==0: Impact parameter < 3 * vertex dispersion in the bending direction"<<endl;
9f093251 393
6b191dea 394 cout<<Form("Vertex dispersion (used to estimate initial bending momentum resolution) = (%5.2f,%5.2f)",fNonBendingVertexDispersion,fBendingVertexDispersion)<<endl;
3304fa09 395
396 cout<<Form("Maximum distance to track = (%5.2f,%5.2f)",fMaxNonBendingDistanceToTrack,fMaxBendingDistanceToTrack)<<endl;
397
398 cout<<Form("Sigma cut for tracking = %5.2f",fSigmaCutForTracking)<<endl;
fda59e58 399
400 cout<<Form("Sigma cut for trigger hit pattern = %5.2f",fSigmaCutForTrigger)<<endl;
b5270f21 401
402 cout<<Form("Cut in strips for trigger chamber efficiency = %5.2f",fStripCutForTrigger)<<endl;
403
404 cout<<Form("Max search area in strips for trigger chamber efficiency = %5.2f",fMaxStripAreaForTrigger)<<endl;
405
3304fa09 406 if (fTrackAllTracks) cout<<"Track all the possible candidates"<<endl;
407 else cout<<"Track only the best candidates"<<endl;
408
409 if (strstr(option,"FULL")) {
410 cout<<"Make track candidates assuming linear propagation between stations 4 and 5: ";
411 if (fMakeTrackCandidatesFast) cout<<"ON"<<endl;
412 else cout<<"OFF"<<endl;
413 } else if (fMakeTrackCandidatesFast)
414 cout<<"Make track candidates assuming linear propagation between stations 4 and 5"<<endl;
415
9bf6860b 416 if (strstr(option,"FULL")) {
417 cout<<"Make track candidates starting from 1 cluster in each of the stations 4 and 5: ";
418 if (fMakeMoreTrackCandidates) cout<<"ON"<<endl;
419 else cout<<"OFF"<<endl;
420 } else if (fMakeMoreTrackCandidates)
421 cout<<"Make track candidates starting from 1 cluster in each of the stations 4 and 5"<<endl;
422
3304fa09 423 if (strstr(option,"FULL")) {
424 cout<<"Try to recover tracks getting lost during tracking: ";
425 if (fRecoverTracks) cout<<"ON"<<endl;
426 else cout<<"OFF"<<endl;
427 } else if (fRecoverTracks)
428 cout<<"Try to recover tracks getting lost during tracking"<<endl;
429
430 if (strstr(option,"FULL")) {
431 cout<<"Try to complete the reconstructed tracks by adding missing clusters: ";
432 if (fComplementTracks) cout<<"ON"<<endl;
433 else cout<<"OFF"<<endl;
434 } else if (fComplementTracks)
435 cout<<"Try to complete the reconstructed tracks by adding missing clusters"<<endl;
436
437 if (strstr(option,"FULL")) {
438 cout<<"Try to improve the reconstructed tracks by removing bad clusters: ";
439 if (fImproveTracks) cout<<Form("ON (sigma cut = %5.2f)",fSigmaCutForImprovement)<<endl;
440 else cout<<"OFF"<<endl;
441 } else if (fImproveTracks)
442 cout<<Form("Try to improve the reconstructed tracks by removing bad clusters (sigma cut = %5.2f)",fSigmaCutForImprovement)<<endl;
443
c59f70b9 444 if (fRemoveConnectedTracksInSt12) cout<<"Remove tracks sharing one cluster or more in any station"<<endl;
445 else cout<<"Remove tracks sharing one cluster or more in stations 3, 4 and 5"<<endl;
446
3304fa09 447 if (strstr(option,"FULL")) {
448 cout<<"Use smoother to compute final track parameters, etc, at each cluster (used for Kalman tracking only): ";
449 if (fUseSmoother) cout<<"ON"<<endl;
450 else cout<<"OFF"<<endl;
451 } else if (fUseSmoother)
452 cout<<"Use smoother to compute final track parameters, etc, at each cluster"<<endl;
453
454 cout<<Form("Maximum normalized chi2 of tracking/trigger track matching = %5.2f",fMaxNormChi2MatchTrigger)<<endl;
455
9bf6860b 456 Bool_t discardedCh = kFALSE;
457 Int_t ch = 0;
458 do {
459 if (!UseChamber(ch)) {
460 if (!discardedCh) {
461 cout<<"Discarded chambers(1..): "<<ch+1;
462 discardedCh = kTRUE;
463 }
464 else cout<<" "<<ch+1;
465 }
466 } while (++ch < 10);
467 if (discardedCh) cout<<endl;
468
469 Bool_t discardedSt = kFALSE;
470 Int_t st = 0;
471 do {
472 if (!RequestStation(st)) {
473 if (!discardedSt) {
474 cout<<"Not requested stations(1..): "<<st+1;
475 discardedSt = kTRUE;
476 }
477 else cout<<" "<<st+1;
478 }
479 } while (++st < 5);
480 if (discardedSt) cout<<endl;
481
35be7ed7 482 cout << Form("Pad goodness policy mask is 0x%x",PadGoodnessMask()) << endl;
483 cout << "Which means we reject pads having the condition = " <<
484 AliMUONPadStatusMaker::AsCondition(PadGoodnessMask()).Data() << endl;
485
486 cout << "The pad limits we are using are :" << endl;
487
32f1b761 488 for ( int ichamber = 0; ichamber < 10; ++ichamber )
489 {
490 cout << Form("HV Ch %d must be >= %5.2f",ichamber,HVLimit(ichamber)) << endl;
491 }
492
35be7ed7 493 cout << Form("%7.2f <= Pedestal mean <= %7.2f",PedMeanLowLimit(),PedMeanHighLimit()) << endl;
494 cout << Form("%7.2f <= Pedestal sigma <= %7.2f",PedSigmaLowLimit(),PedSigmaHighLimit()) << endl;
495 cout << Form("%e <= Gain linear term <= %e",GainA1LowLimit(),GainA1HighLimit()) << endl;
496 cout << Form("%e <= Gain quadratic term <= %e",GainA2LowLimit(),GainA2HighLimit()) << endl;
497 cout << Form("%5.0f <= Gain threshold term <= %5.0f",GainThresLowLimit(),GainThresHighLimit()) << endl;
7eafe398 498
170f4046 499 cout << Form("And we cut on charge >= %7.2f x ( pedestal sigma ) ",ChargeSigmaCut()) << endl;
500
7eafe398 501 cout << "Occupancy limits are :" << endl;
502
ece56eb9 503 cout << Form("%e <= Manu occupancy < %7.2f",ManuOccupancyLowLimit(),ManuOccupancyHighLimit()) << endl;
504 cout << Form("%e <= Buspatch occupancy < %7.2f",BuspatchOccupancyLowLimit(),BuspatchOccupancyHighLimit()) << endl;
505 cout << Form("%e <= DE occupancy < %7.2f",DEOccupancyLowLimit(),DEOccupancyHighLimit()) << endl;
506
507 cout << "'QAChecker' limits" << endl;
ece56eb9 508 cout << Form("FractionOfBuspatchOutsideOccupancyLimit = %5.2f %%",FractionOfBuspatchOutsideOccupancyLimit()*100.0) << endl;
b3d57767 509 cout << Form("Event size limit = %5.2f KB/event (soft) and %5.2f KB/event (hard)",fEventSizeSoftLimit,fEventSizeHardLimit) << endl;
510 if ( fTokenLostLimit > 0 )
511 {
512 cout << Form("We tolerate up to %5.2f %% token lost errors per event",fTokenLostLimit) << endl;
513 }
514 else
515 {
516 cout << "We dot not tolerate any token lost error !" << endl;
517 }
7eafe398 518
35be7ed7 519 cout << "chamber non bending resolution = |";
520 for (Int_t iCh = 0; iCh < 10; iCh++) cout << Form(" %6.3f |",fDefaultNonBendingReso[iCh]);
521 cout << endl;
522 cout << "chamber bending resolution = |";
523 for (Int_t iCh = 0; iCh < 10; iCh++) cout << Form(" %6.3f |",fDefaultBendingReso[iCh]);
524 cout << endl;
89c8d66d 525 cout<<Form("maximum number of trigger tracks above which the tracking is cancelled = %d",fMaxTriggerTracks)<<endl;
aa2b81a1 526 cout<<Form("maximum number of track candidates above which the tracking is abandonned = %d",fMaxTrackCandidates)<<endl;
110edb51 527
528 cout << Form("The average noise pad charge is assumed to be %7.2f fC",AverageNoisePadCharge()) << endl;
c11ea7d4 529 cout << Form("and clusters below %5.2f times this noise charge (i.e. %7.2f fC) are discarded",
110edb51 530 ClusterChargeCut(),ClusterChargeCut()*AverageNoisePadCharge()) << endl;
531 cout << Form("Note that LowestPadCharge is then %7.2f fC",LowestPadCharge()) << endl;
35be7ed7 532
9074a9a9 533 if (TryRecover())
534 {
535 cout << "!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!" << endl;
536 cout << "!!! WILL TRY TO RECOVER CORRUPTED RAW DATA !!!" << endl;
537 cout << "!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!" << endl;
538 }
4348af6f 539 cout<<"\t-----------------------------------------------------"<<endl<<endl;
3304fa09 540
541}
542
004a9ccd 543//_____________________________________________________________________________
544void
32f1b761 545AliMUONRecoParam::SetHVLimit(Int_t chamberId, Double_t value)
004a9ccd 546{
32f1b761 547 /// Set the HV limit for a given chamber (or all chambers
548 /// if chamberId==-1
549
550 if ( chamberId == -1 )
551 {
552 for ( Int_t i = 0; i < 10; ++i )
553 {
554 fHVLimit[i] = value;
555 }
556 }
557 else if ( chamberId >= 0 && chamberId < 10 )
558 {
559 fHVLimit[chamberId]=value;
560 }
561 else
562 {
563 AliError(Form("chamberId = %d is not a valid chamberId",chamberId));
564 }
565}
004a9ccd 566
32f1b761 567//_____________________________________________________________________________
568Double_t AliMUONRecoParam::HVLimit(Int_t chamberId) const
569{
570 /// Get the HV limit for a given chamber
571 if ( chamberId >= 0 && chamberId < 10 )
572 {
573 return fHVLimit[chamberId];
574 }
575 AliError(Form("chamberId = %d is not a valid chamberId",chamberId));
004a9ccd 576
32f1b761 577 return 0.0;
578}
004a9ccd 579
32f1b761 580//_____________________________________________________________________________
581void
582AliMUONRecoParam::SetDefaultLimits()
583{
584 /// Set the default limits and pad goodness policy
585
586 fHVSt12Limits[0]=1500; // kept for backward compatibility only
587 fHVSt12Limits[1]=2000; // kept for backward compatibility only
588 fHVSt345Limits[0]=1500; // kept for backward compatibility only
589 fHVSt345Limits[1]=2000; // kept for backward compatibility only
590
03400d69 591 SetHVLimit(-1,1590); // this one is the real HV limit used now
32f1b761 592
6dbd970f 593 fPedMeanLimits[0] = 20;
004a9ccd 594 fPedMeanLimits[1] = 1024;
595
89c8d66d 596 fPedSigmaLimits[0] = 0.6;
004a9ccd 597 fPedSigmaLimits[1] = 100;
598
599 fGainA1Limits[0] = 0.1;
600 fGainA1Limits[1] = 10;
601
602 fGainA2Limits[0] = -1E30;
603 fGainA2Limits[1] = 1E30;
604
605 fGainThresLimits[0] = 0;
606 fGainThresLimits[1] = 4095;
607
7eafe398 608 fPadGoodnessMask = 0x8080; // Ped is missing | HV is missing
609
610 fManuOccupancyLimits[0] = -1.0;
611 fManuOccupancyLimits[1] = 1.0;
612
ece56eb9 613 fBuspatchOccupancyLimits[0] = 1E-6;
7eafe398 614 fBuspatchOccupancyLimits[1] = 1.0;
615
616 fDEOccupancyLimits[0] = -1.0;
617 fDEOccupancyLimits[1] = 1.0;
2b8a1212 618
b3d57767 619 fMissingPadFractionLimit = -1; // DEPRECATED
32f1b761 620 fFractionOfBuspatchOutsideOccupancyLimit = 0.05; // 5 %
ece56eb9 621
110edb51 622 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)
623
624 AverageNoisePadCharge(0.22875); // 0.22875 coulombs ~ 1.5 ADC channels
625
626 ClusterChargeCut(2.0); // will cut cluster below 2.0 x LowestPadCharge()
b3d57767 627
628 SetEventSizeLimits(35.0,45.0);
629
630 SetTokenLostLimit(0.0);
9074a9a9 631
632 fTryRecover = kFALSE;
633}
634
635
636//-----------------------------------------------------------------------
637TObjArray*
638AliMUONRecoParam::Create(const char* settings)
639{
640 /// Create pre-defined recoparam array, according to settings.
641 /// settings is case-insensitive.
642 ///
643 /// Currently defined are :
644 ///
645 /// "cosmics" :
646 /// Cosmic (default)
647 /// Calibration
648 /// "ppideal"
649 /// LowFlux (default)
650 /// Calibration
651 /// "ppreal"
652 /// LowFlux (modified to reconstruct real p-p data)
653 /// Calibration
654 /// "pprealsim"
655 /// LowFlux (modified to reconstruct realistic p-p simulation)
656 /// Calibration
03400d69 657 /// "pbpbreal"
658 /// HighFlux (modified to reconstruct real Pb-Pb data)
659 /// Calibration
9074a9a9 660
661 AliMUONRecoParam* param(0x0);
662
663 AliRecoParam::EventSpecie_t defaultParam = AliRecoParam::kLowMult;
664
665 TString stype(settings);
666 stype.ToLower();
667
668 if ( stype == "cosmics" )
669 {
670 // set parameters for cosmic runs
671 param = AliMUONRecoParam::GetCosmicParam();
672 defaultParam = AliRecoParam::kCosmic;
673 }
674 else if ( stype == "ppideal" )
675 {
676 // set default lowFlux parameters
677 param = AliMUONRecoParam::GetLowFluxParam();
678 }
1678f090 679 else if ( stype == "ppreal" || stype == "pprealsim" || stype == "pprealnofield" )
9074a9a9 680 {
681 // common parameters for p-p data and realistic p-p simu
682 param = AliMUONRecoParam::GetLowFluxParam();
683 param->SaveFullClusterInESD(kTRUE, 100.);
684 for (Int_t iCh=0; iCh<10; iCh++)
685 {
686 param->SetDefaultNonBendingReso(iCh,0.4);
687 param->SetDefaultBendingReso(iCh,0.4);
688 }
689 param->SetSigmaCutForTracking(7.);
690 param->SetStripCutForTrigger(1.5);
691 param->SetSigmaCutForTrigger(6.);
692 param->ImproveTracks(kTRUE, 6.);
693 param->SetPedMeanLimits(20, 700);
694 param->SetManuOccupancyLimits(-1.,0.01);
695 param->SetBuspatchOccupancyLimits(-1.,0.01);
696 param->SetFractionOfBuspatchOutsideOccupancyLimit(0.05); // 5 %
32f1b761 697 param->SetEventSizeLimits(45., 65.);
9074a9a9 698
699 // specific parameters for p-p data or realistic p-p simu
700 if ( stype == "ppreal" || stype == "pprealnofield" )
701 {
32f1b761 702 param->SetPadGoodnessMask(0x400BE9B);
9074a9a9 703 }
704 else
705 {
706 param->SetPadGoodnessMask(0x8080);
707 }
708
709 if ( stype == "pprealnofield" )
710 {
711 param->TryRecover(kTRUE);
712 }
713 }
32f1b761 714 else if ( stype == "pbpbreal" || stype == "pbpbrealsim" )
715 {
716 // common parameters for Pb-Pb data and realistic Pb-Pb simu
717 param = AliMUONRecoParam::GetHighFluxParam();
718 defaultParam = AliRecoParam::kHighMult;
719 param->SaveFullClusterInESD(kTRUE, 100.);
720 for (Int_t iCh=0; iCh<10; iCh++)
721 {
722 param->SetDefaultNonBendingReso(iCh,0.2);
723 param->SetDefaultBendingReso(iCh,0.2);
724 }
725 param->SetSigmaCutForTracking(5.);
726 param->SetStripCutForTrigger(1.5);
727 param->SetSigmaCutForTrigger(4.);
728 param->ImproveTracks(kTRUE, 4.);
729 param->SetPedMeanLimits(20, 700);
03400d69 730 param->SetManuOccupancyLimits(-1.,0.03);
731 param->SetBuspatchOccupancyLimits(-1.,0.1); // 10 % (this cut not used for the reco anyway)
32f1b761 732 param->SetFractionOfBuspatchOutsideOccupancyLimit(0.05); // 5 %
733 param->SetEventSizeLimits(100., 150.);
734
735 // specific parameters for Pb-Pb data or realistic Pb-Pb simu
736 if ( stype == "pbpbreal" )
737 {
738 param->SetPadGoodnessMask(0x400BE9B);
739 }
740 else
741 {
742 param->SetPadGoodnessMask(0x8080);
743 }
744 }
9074a9a9 745 else
746 {
747 AliErrorClass("Unknown settings !");
748 return 0x0;
749 }
750
751 TObjArray* recoParams = new TObjArray;
752
753 recoParams->AddLast(param);
754
755 // set (dummy) parameters for calibration runs
756 param = AliMUONRecoParam::GetCalibrationParam();
757 recoParams->AddLast(param);
758
759 // set parameters for Pb-Pb runs
760 // param = AliMUONRecoParam::GetHighFluxParam();
761 // recoParams.AddLast(param);
762
763 // identify default parameters (exit if identification failed)
764 Bool_t defaultIsSet = kFALSE;
765 TIter next(recoParams);
766 while ( (param = static_cast<AliMUONRecoParam*>(next())) )
767 {
768 if (param->GetEventSpecie() == defaultParam)
769 {
770 param->SetAsDefault();
771 defaultIsSet = kTRUE;
772 }
773 param->Print("FULL");
774 }
775
776 if (!defaultIsSet)
777 {
778 AliErrorClass("The default reconstruction parameters are not set! Exiting...");
779 return 0x0;
780 }
781
782 return recoParams;
004a9ccd 783}
784
9074a9a9 785//______________________________________________________________________________
786void
787AliMUONRecoParam::Show(Int_t runNumber, const char* ocdb)
788{
789 /// Show what we have in the designated OCDB for that run, as far as RecoParams are concerned
790
791 AliCDBManager::Instance()->SetDefaultStorage(ocdb);
792 AliCDBManager::Instance()->SetRun(runNumber);
793
794 AliCDBEntry* entry = AliCDBManager::Instance()->Get("MUON/Calib/RecoParam");
795
796 if (!entry) return;
797
798 TObject* o = entry->GetObject();
799
800 if ( o->IsA() == TObjArray::Class() )
801 {
802 TObjArray* array = static_cast<TObjArray*>(o);
803 for ( Int_t i = 0; i <= array->GetLast(); ++i )
804 {
805 AliDetectorRecoParam* p = static_cast<AliDetectorRecoParam*>(array->At(i));
806 cout << Form("array[%d]=%s %s %s",i,
807 p ? p->ClassName() : "",
808 p ? AliRecoParam::GetEventSpecieName(AliRecoParam::Convert(p->GetEventSpecie())) :"",
809 p ? ( p->IsDefault() ? "default" : "") : "" ) << endl;
810 }
811 cout << "=========== dumps below ====== " << endl;
812
813 for ( Int_t i = 0; i <= array->GetLast(); ++i )
814 {
815 AliDetectorRecoParam* p = static_cast<AliDetectorRecoParam*>(array->At(i));
816 if ( p ) p->Print("");
817 }
818 }
819 else
820 {
821 o->Print();
822 }
823}