1 /**************************************************************************
2 * Copyright(c) 2007, ALICE Experiment at CERN, All rights reserved. *
4 * Author: The ALICE Off-line Project. *
5 * Contributors are mentioned in the code where appropriate. *
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 **************************************************************************/
18 // Base class for the PHOS reconstruction parameters.
19 // Do not use in the reconstruction; use derivative classes instead.
20 // Author: Boris Polichtchouk.
22 // --- AliRoot header files ---
23 #include "AliCDBManager.h"
24 #include "AliCDBEntry.h"
26 #include "AliPHOSRecoParam.h"
28 ClassImp(AliPHOSRecoParam)
30 TObjArray* AliPHOSRecoParam::fgkMaps =0; //ALTRO mappings
32 //-----------------------------------------------------------------------------
33 AliPHOSRecoParam::AliPHOSRecoParam() :
34 AliDetectorRecoParam(),
35 fEMCClusteringThreshold(0.2),
37 fEMCRawDigitThreshold(2),
40 fEMCSampleQualityCut(1.),
42 fEMCEcore2ESD(kFALSE),
43 fEMCSubtractPedestals(kTRUE),
45 fEMCEnergyCorrectionOn(kTRUE),
46 fEMCDecoderVersion(""),
47 fGlobalAltroOffset(0),
48 fCPVClusteringThreshold(0.0),
54 //Default constructor.
57 //-----------------------------------------------------------------------------
58 AliPHOSRecoParam::AliPHOSRecoParam(const AliPHOSRecoParam& ):
59 AliDetectorRecoParam(),
60 fEMCClusteringThreshold(0.2),
62 fEMCRawDigitThreshold(2),
65 fEMCSampleQualityCut(1.),
67 fEMCEcore2ESD(kFALSE),
68 fEMCSubtractPedestals(kTRUE),
70 fEMCEnergyCorrectionOn(kTRUE),
71 fEMCDecoderVersion(""),
72 fGlobalAltroOffset(0),
73 fCPVClusteringThreshold(0.0),
82 //-----------------------------------------------------------------------------
83 AliPHOSRecoParam& AliPHOSRecoParam::operator = (const AliPHOSRecoParam& recoParam)
85 //Assignment operator.
87 if(this != &recoParam) {
88 fEMCClusteringThreshold = recoParam.fEMCClusteringThreshold;
89 fEMCLocMaxCut = recoParam.fEMCLocMaxCut;
90 fEMCRawDigitThreshold = recoParam.fEMCRawDigitThreshold;
91 fEMCMinE = recoParam.fEMCMinE;
92 fEMCW0 = recoParam.fEMCW0;
93 fEMCSampleQualityCut = recoParam.fEMCSampleQualityCut;
94 fEMCEcoreRadius = recoParam.fEMCEcoreRadius;
95 fEMCEcore2ESD = recoParam.fEMCEcore2ESD;
96 fEMCSubtractPedestals = recoParam.fEMCSubtractPedestals;
97 fEMCUnfold = recoParam.fEMCUnfold;
98 fEMCEnergyCorrectionOn = recoParam.fEMCEnergyCorrectionOn;
99 fEMCDecoderVersion = recoParam.fEMCDecoderVersion;
100 fGlobalAltroOffset = recoParam.fGlobalAltroOffset;
101 fCPVClusteringThreshold = recoParam.fCPVClusteringThreshold;
102 fCPVLocMaxCut = recoParam.fCPVLocMaxCut;
103 fCPVMinE = recoParam.fCPVMinE;
104 fCPVW0 = recoParam.fCPVW0;
105 fCPVUnfold = recoParam.fCPVUnfold;
111 //-----------------------------------------------------------------------------
112 void AliPHOSRecoParam::Print(Option_t * /*option*/) const
114 AliDebug(2,Form("PHOS reconstruction parameters:\n"
115 "\tEMCClusteringThreshold = %f\n"
116 "\tEMCLocMaxCut = %f\n"
117 "\tEMCRawDigitThreshold = %f\n"
120 "\tEMCSampleQualityCut = %f\n"
121 "\tEMCEcoreRadius = %f\n"
122 "\tEMCEcore2ESD = %d\n"
123 "\tEMCSubtractPedestals = %d\n"
125 "\tEMCEnergyCorrectionOn = %d\n"
126 "\tEMCDecoderVersion = \"%s\"\n"
127 "\tGlobalAltroOffset = %d",
128 fEMCClusteringThreshold,
130 fEMCRawDigitThreshold,
133 fEMCSampleQualityCut,
136 fEMCSubtractPedestals,
138 fEMCEnergyCorrectionOn,
139 fEMCDecoderVersion.Data(),
140 fGlobalAltroOffset));
144 //-----------------------------------------------------------------------------
145 AliPHOSRecoParam* AliPHOSRecoParam::GetDefaultParameters()
147 //Default parameters for the reconstruction
149 AliPHOSRecoParam* params = new AliPHOSRecoParam();
153 //-----------------------------------------------------------------------------
154 const TObjArray* AliPHOSRecoParam::GetMappings()
156 //Returns array of AliAltroMappings for RCU0..RCU3.
157 //If not found, read it from OCDB.
159 //Quick check as follows:
160 // root [0] AliCDBManager::Instance()->SetDefaultStorage("local://$ALICE_ROOT");
161 // root [1] AliCDBManager::Instance()->SetRun(1);
162 // root [2] TObjArray* maps = AliPHOSRecoParam::GetMappings();
163 // root [3] maps->Print();
165 if(fgkMaps) return fgkMaps;
167 AliCDBEntry* entry = AliCDBManager::Instance()->Get("PHOS/Calib/Mapping");
169 fgkMaps = (TObjArray*)entry->GetObject();