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