Line data Source code
1 : /**************************************************************************
2 : * Copyright(c) 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 :
16 : /* $Id$ */
17 :
18 : // Base class for the PHOS reconstruction parameters.
19 : // Do not use in the reconstruction; use derivative classes instead.
20 : // Author: Boris Polichtchouk.
21 :
22 : // --- AliRoot header files ---
23 : #include "AliCDBManager.h"
24 : #include "AliCDBEntry.h"
25 : #include "AliLog.h"
26 : #include "AliPHOSRecoParam.h"
27 :
28 22 : ClassImp(AliPHOSRecoParam)
29 :
30 : TObjArray* AliPHOSRecoParam::fgkMaps =0; //ALTRO mappings
31 : TObject* AliPHOSRecoParam::fgkTrigParams =0; // Trigger parameters
32 :
33 : //-----------------------------------------------------------------------------
34 : AliPHOSRecoParam::AliPHOSRecoParam() :
35 8 : AliDetectorRecoParam(),
36 8 : fNonLinearityParams(3),
37 8 : fEMCClusteringThreshold(0.2),
38 8 : fEMCLocMaxCut(0.03),
39 8 : fEMCRawDigitThreshold(2),
40 8 : fEMCMinE(0.012),
41 8 : fEMCW0(4.5),
42 8 : fEMCSampleQualityCut(1.),
43 8 : fTimeGateAmpThresh(10.),
44 8 : fTimeGateLow(1.e-6),
45 8 : fTimeGateHigh(1.e-6),
46 8 : fEMCEcoreRadius(3.),
47 8 : fEMCEcore2ESD(kFALSE),
48 8 : fEMCSubtractPedestals(kTRUE),
49 8 : fEMCUnfold(kTRUE),
50 8 : fEMCEnergyCorrectionOn(kTRUE),
51 8 : fSubtractL1phase(kTRUE),
52 8 : fEMCFitterVersion(""),
53 8 : fNonlinearityCorrVersion(""),
54 8 : fGlobalAltroOffset(0),
55 8 : fGlobalAltroThreshold(0),
56 8 : fCPVClusteringThreshold(0.0),
57 8 : fCPVLocMaxCut(0.03),
58 8 : fCPVMinE(0.0),
59 8 : fCPVW0(4.0),
60 8 : fCPVUnfold(kTRUE)
61 40 : {
62 : //Default constructor.
63 8 : SetNonlinearityCorrectionVersion("Gustavo2005") ;
64 16 : }
65 :
66 : //-----------------------------------------------------------------------------
67 : AliPHOSRecoParam::AliPHOSRecoParam(const AliPHOSRecoParam& ):
68 0 : AliDetectorRecoParam(),
69 0 : fNonLinearityParams(3),
70 0 : fEMCClusteringThreshold(0.2),
71 0 : fEMCLocMaxCut(0.03),
72 0 : fEMCRawDigitThreshold(2),
73 0 : fEMCMinE(0.012),
74 0 : fEMCW0(4.5),
75 0 : fEMCSampleQualityCut(1.),
76 0 : fTimeGateAmpThresh(10.),
77 0 : fTimeGateLow(1.e-6),
78 0 : fTimeGateHigh(1.e-6),
79 0 : fEMCEcoreRadius(3.),
80 0 : fEMCEcore2ESD(kFALSE),
81 0 : fEMCSubtractPedestals(kTRUE),
82 0 : fEMCUnfold(kTRUE),
83 0 : fEMCEnergyCorrectionOn(kTRUE),
84 0 : fSubtractL1phase(kTRUE),
85 0 : fEMCFitterVersion(""),
86 0 : fNonlinearityCorrVersion(""),
87 0 : fGlobalAltroOffset(0),
88 0 : fGlobalAltroThreshold(0),
89 0 : fCPVClusteringThreshold(0.0),
90 0 : fCPVLocMaxCut(0.03),
91 0 : fCPVMinE(0.0),
92 0 : fCPVW0(4.0),
93 0 : fCPVUnfold(kTRUE)
94 0 : {
95 : //Copy constructor.
96 0 : }
97 :
98 : //-----------------------------------------------------------------------------
99 : AliPHOSRecoParam& AliPHOSRecoParam::operator = (const AliPHOSRecoParam& recoParam)
100 : {
101 : //Assignment operator.
102 :
103 0 : if(this != &recoParam) {
104 0 : fNonLinearityParams = recoParam.fNonLinearityParams;
105 0 : fEMCClusteringThreshold = recoParam.fEMCClusteringThreshold;
106 0 : fEMCLocMaxCut = recoParam.fEMCLocMaxCut;
107 0 : fEMCRawDigitThreshold = recoParam.fEMCRawDigitThreshold;
108 0 : fEMCMinE = recoParam.fEMCMinE;
109 0 : fEMCW0 = recoParam.fEMCW0;
110 0 : fEMCSampleQualityCut = recoParam.fEMCSampleQualityCut;
111 0 : fTimeGateAmpThresh = recoParam.fTimeGateAmpThresh ;
112 0 : fTimeGateLow = recoParam.fTimeGateLow ;
113 0 : fTimeGateHigh = recoParam.fTimeGateHigh ;
114 0 : fEMCEcoreRadius = recoParam.fEMCEcoreRadius;
115 0 : fEMCEcore2ESD = recoParam.fEMCEcore2ESD;
116 0 : fEMCSubtractPedestals = recoParam.fEMCSubtractPedestals;
117 0 : fEMCUnfold = recoParam.fEMCUnfold;
118 0 : fEMCEnergyCorrectionOn = recoParam.fEMCEnergyCorrectionOn;
119 0 : fSubtractL1phase = recoParam.fSubtractL1phase ;
120 0 : fEMCFitterVersion = recoParam.fEMCFitterVersion;
121 0 : fNonlinearityCorrVersion= recoParam.fNonlinearityCorrVersion;
122 0 : fGlobalAltroOffset = recoParam.fGlobalAltroOffset;
123 0 : fGlobalAltroThreshold = recoParam.fGlobalAltroThreshold;
124 0 : fCPVClusteringThreshold = recoParam.fCPVClusteringThreshold;
125 0 : fCPVLocMaxCut = recoParam.fCPVLocMaxCut;
126 0 : fCPVMinE = recoParam.fCPVMinE;
127 0 : fCPVW0 = recoParam.fCPVW0;
128 0 : fCPVUnfold = recoParam.fCPVUnfold;
129 0 : fNonLinearityParams = recoParam.fNonLinearityParams ;
130 0 : }
131 :
132 0 : return *this;
133 : }
134 :
135 : //-----------------------------------------------------------------------------
136 : void AliPHOSRecoParam::Print(Option_t * /*option*/) const
137 : {
138 32 : AliDebug(2,Form("PHOS reconstruction parameters:\n"
139 : "\tEventSpecie = %d (%s)\n"
140 : "\tEMCClusteringThreshold = %f\n"
141 : "\tEMCLocMaxCut = %f\n"
142 : "\tEMCRawDigitThreshold = %f\n"
143 : "\tEMCMinE = %f\n"
144 : "\tEMCW0 = %f\n"
145 : "\tEMCSampleQualityCut = %f\n"
146 : "\tEMCEcoreRadius = %f\n"
147 : "\tEMCEcore2ESD = %d\n"
148 : "\tEMCSubtractPedestals = %d\n"
149 : "\tEMCUnfold = %d\n"
150 : "\tEMCEnergyCorrectionOn = %d\n"
151 : "\tSubtractL1phase = %d\n"
152 : "\tEMCFitterVersion = %s\n"
153 : "\tGlobalAltroOffset = %d\n"
154 : "\tGlobalAltroThreshold = %d\n"
155 : "\tTimeGateAmpThresh = %f\n"
156 : "\tTimeGateLow = %f\n"
157 : "\tTimeGateHigh = %f\n"
158 : "\tNonLinCorrVersion = %s\n"
159 : "\tCPVClusteringThreshold = %f\n"
160 : "\tCPVLocMaxCut = %f\n"
161 : "\tCPVMinE = %f\n"
162 : "\tCPVW0 = %f\n"
163 : "\tCPVUnfold = %d\n",
164 : GetEventSpecie(),
165 : AliRecoParam::GetEventSpecieName(AliRecoParam::Convert(GetEventSpecie())),
166 : fEMCClusteringThreshold,
167 : fEMCLocMaxCut,
168 : fEMCRawDigitThreshold,
169 : fEMCMinE,
170 : fEMCW0,
171 : fEMCSampleQualityCut,
172 : fEMCEcoreRadius,
173 : fEMCEcore2ESD,
174 : fEMCSubtractPedestals,
175 : fEMCUnfold,
176 : fEMCEnergyCorrectionOn,
177 : fSubtractL1phase,
178 : fEMCFitterVersion.Data(),
179 : fGlobalAltroOffset,
180 : fGlobalAltroThreshold,
181 : fTimeGateAmpThresh,
182 : fTimeGateLow,
183 : fTimeGateHigh,
184 : fNonlinearityCorrVersion.Data(),
185 : fCPVClusteringThreshold,
186 : fCPVLocMaxCut,
187 : fCPVMinE,
188 : fCPVW0,
189 : fCPVUnfold));
190 :
191 8 : }
192 :
193 : //-----------------------------------------------------------------------------
194 : AliPHOSRecoParam* AliPHOSRecoParam::GetDefaultParameters()
195 : {
196 : //Default parameters for the reconstruction
197 :
198 0 : AliPHOSRecoParam* params = new AliPHOSRecoParam();
199 0 : return params;
200 0 : }
201 :
202 : //-----------------------------------------------------------------------------
203 : const TObjArray* AliPHOSRecoParam::GetMappings()
204 : {
205 : //Returns array of AliAltroMappings for RCU0..RCU3.
206 : //If not found, read it from OCDB.
207 :
208 : //Quick check as follows:
209 : // root [0] AliCDBManager::Instance()->SetDefaultStorage("local://$ALICE_ROOT/OCDB");
210 : // root [1] AliCDBManager::Instance()->SetRun(1);
211 : // root [2] TObjArray* maps = AliPHOSRecoParam::GetMappings();
212 : // root [3] maps->Print();
213 :
214 22 : if(fgkMaps) return fgkMaps;
215 :
216 4 : AliCDBEntry* entry = AliCDBManager::Instance()->Get("PHOS/Calib/Mapping");
217 2 : if(entry)
218 2 : fgkMaps = (TObjArray*)entry->GetObject();
219 :
220 2 : return fgkMaps;
221 :
222 8 : }
223 : //-----------------------------------------------------------------------------
224 : void AliPHOSRecoParam::SetNonlinearityCorrectionVersion(const char * ver){
225 : //Set non-linearity correction version and adjust parameters
226 :
227 16 : if(strcmp(ver,"NoCorrection")==0){
228 0 : fNonLinearityParams.Set(1) ;
229 0 : fNonLinearityParams.AddAt(0.,0) ;
230 0 : fNonlinearityCorrVersion=ver ;
231 0 : return ;
232 : }
233 8 : if(strcmp(ver,"Henrik2010")==0){
234 0 : Float_t pars[7]={1.051,2.54e-003,-1.737e-002,5.69e-002,3.3e-001,1.42e-001,1.50e-002} ;
235 0 : fNonLinearityParams.Set(7,pars) ;
236 0 : fNonlinearityCorrVersion=ver ;
237 : return ;
238 0 : }
239 8 : if(strcmp(ver,"Gustavo2005")==0){
240 8 : Float_t pars[3]={0.0241, 1.0504, 0.000249} ;
241 8 : fNonLinearityParams.Set(3,pars) ;
242 8 : fNonlinearityCorrVersion=ver ;
243 : return ;
244 8 : }
245 0 : AliError(Form("Non known correction version: %s, still using default \n",ver)) ;
246 :
247 :
248 8 : }
249 :
250 : //-----------------------------------------------------------------------------
251 : const TObject* AliPHOSRecoParam::GetTriggerParameters()
252 : {
253 : //Returns trigger parameters.
254 :
255 : //Quick check as follows:
256 : // root [0] AliCDBManager::Instance()->SetDefaultStorage("local://$ALICE_ROOT/OCDB");
257 : // root [1] AliCDBManager::Instance()->SetRun(158171);
258 : // root [2] TObject* parameters = AliPHOSRecoParam::GetTriggerParameters();
259 : // root [3] parameters->Print();
260 :
261 11 : if(fgkTrigParams) return fgkTrigParams;
262 :
263 2 : AliCDBEntry* entry = AliCDBManager::Instance()->Get("PHOS/Trigger/Parameters");
264 1 : if(entry)
265 1 : fgkTrigParams = entry->GetObject();
266 :
267 1 : return fgkTrigParams;
268 :
269 4 : }
|