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