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
31 TObject* AliPHOSRecoParam::fgkTrigParams =0; // Trigger parameters
33 //-----------------------------------------------------------------------------
34 AliPHOSRecoParam::AliPHOSRecoParam() :
35 AliDetectorRecoParam(),
36 fNonLinearityParams(3),
37 fEMCClusteringThreshold(0.2),
39 fEMCRawDigitThreshold(2),
42 fEMCSampleQualityCut(1.),
43 fTimeGateAmpThresh(10.),
47 fEMCEcore2ESD(kFALSE),
48 fEMCSubtractPedestals(kTRUE),
50 fEMCEnergyCorrectionOn(kTRUE),
51 fEMCFitterVersion(""),
52 fNonlinearityCorrVersion(""),
53 fGlobalAltroOffset(0),
54 fGlobalAltroThreshold(0),
55 fCPVClusteringThreshold(0.0),
61 //Default constructor.
62 SetNonlinearityCorrectionVersion("Gustavo2005") ;
65 //-----------------------------------------------------------------------------
66 AliPHOSRecoParam::AliPHOSRecoParam(const AliPHOSRecoParam& ):
67 AliDetectorRecoParam(),
68 fNonLinearityParams(3),
69 fEMCClusteringThreshold(0.2),
71 fEMCRawDigitThreshold(2),
74 fEMCSampleQualityCut(1.),
75 fTimeGateAmpThresh(10.),
79 fEMCEcore2ESD(kFALSE),
80 fEMCSubtractPedestals(kTRUE),
82 fEMCEnergyCorrectionOn(kTRUE),
83 fEMCFitterVersion(""),
84 fNonlinearityCorrVersion(""),
85 fGlobalAltroOffset(0),
86 fGlobalAltroThreshold(0),
87 fCPVClusteringThreshold(0.0),
96 //-----------------------------------------------------------------------------
97 AliPHOSRecoParam& AliPHOSRecoParam::operator = (const AliPHOSRecoParam& recoParam)
99 //Assignment operator.
101 if(this != &recoParam) {
102 fNonLinearityParams = recoParam.fNonLinearityParams;
103 fEMCClusteringThreshold = recoParam.fEMCClusteringThreshold;
104 fEMCLocMaxCut = recoParam.fEMCLocMaxCut;
105 fEMCRawDigitThreshold = recoParam.fEMCRawDigitThreshold;
106 fEMCMinE = recoParam.fEMCMinE;
107 fEMCW0 = recoParam.fEMCW0;
108 fEMCSampleQualityCut = recoParam.fEMCSampleQualityCut;
109 fTimeGateAmpThresh = recoParam.fTimeGateAmpThresh ;
110 fTimeGateLow = recoParam.fTimeGateLow ;
111 fTimeGateHigh = recoParam.fTimeGateHigh ;
112 fEMCEcoreRadius = recoParam.fEMCEcoreRadius;
113 fEMCEcore2ESD = recoParam.fEMCEcore2ESD;
114 fEMCSubtractPedestals = recoParam.fEMCSubtractPedestals;
115 fEMCUnfold = recoParam.fEMCUnfold;
116 fEMCEnergyCorrectionOn = recoParam.fEMCEnergyCorrectionOn;
117 fEMCFitterVersion = recoParam.fEMCFitterVersion;
118 fNonlinearityCorrVersion= recoParam.fNonlinearityCorrVersion;
119 fGlobalAltroOffset = recoParam.fGlobalAltroOffset;
120 fGlobalAltroThreshold = recoParam.fGlobalAltroThreshold;
121 fCPVClusteringThreshold = recoParam.fCPVClusteringThreshold;
122 fCPVLocMaxCut = recoParam.fCPVLocMaxCut;
123 fCPVMinE = recoParam.fCPVMinE;
124 fCPVW0 = recoParam.fCPVW0;
125 fCPVUnfold = recoParam.fCPVUnfold;
126 fNonLinearityParams = recoParam.fNonLinearityParams ;
132 //-----------------------------------------------------------------------------
133 void AliPHOSRecoParam::Print(Option_t * /*option*/) const
135 AliDebug(2,Form("PHOS reconstruction parameters:\n"
136 "\tEMCClusteringThreshold = %f\n"
137 "\tEMCLocMaxCut = %f\n"
138 "\tEMCRawDigitThreshold = %f\n"
141 "\tEMCSampleQualityCut = %f\n"
142 "\tEMCEcoreRadius = %f\n"
143 "\tEMCEcore2ESD = %d\n"
144 "\tEMCSubtractPedestals = %d\n"
146 "\tEMCEnergyCorrectionOn = %d\n"
147 "\tEMCFitterVersion = \"%s\"\n"
148 "\tGlobalAltroOffset = %d\n"
149 "\tGlobalAltroThreshold = %d",
150 fEMCClusteringThreshold,
152 fEMCRawDigitThreshold,
155 fEMCSampleQualityCut,
158 fEMCSubtractPedestals,
160 fEMCEnergyCorrectionOn,
161 fEMCFitterVersion.Data(),
163 fGlobalAltroThreshold));
167 //-----------------------------------------------------------------------------
168 AliPHOSRecoParam* AliPHOSRecoParam::GetDefaultParameters()
170 //Default parameters for the reconstruction
172 AliPHOSRecoParam* params = new AliPHOSRecoParam();
176 //-----------------------------------------------------------------------------
177 const TObjArray* AliPHOSRecoParam::GetMappings()
179 //Returns array of AliAltroMappings for RCU0..RCU3.
180 //If not found, read it from OCDB.
182 //Quick check as follows:
183 // root [0] AliCDBManager::Instance()->SetDefaultStorage("local://$ALICE_ROOT/OCDB");
184 // root [1] AliCDBManager::Instance()->SetRun(1);
185 // root [2] TObjArray* maps = AliPHOSRecoParam::GetMappings();
186 // root [3] maps->Print();
188 if(fgkMaps) return fgkMaps;
190 AliCDBEntry* entry = AliCDBManager::Instance()->Get("PHOS/Calib/Mapping");
192 fgkMaps = (TObjArray*)entry->GetObject();
197 //-----------------------------------------------------------------------------
198 void AliPHOSRecoParam::SetNonlinearityCorrectionVersion(const char * ver){
199 //Set non-linearity correction version and adjust parameters
201 if(strcmp(ver,"NoCorrection")==0){
202 fNonLinearityParams.Set(1) ;
203 fNonLinearityParams.AddAt(0.,0) ;
204 fNonlinearityCorrVersion=ver ;
207 if(strcmp(ver,"Henrik2010")==0){
208 Float_t pars[7]={1.051,2.54e-003,-1.737e-002,5.69e-002,3.3e-001,1.42e-001,1.50e-002} ;
209 fNonLinearityParams.Set(7,pars) ;
210 fNonlinearityCorrVersion=ver ;
213 if(strcmp(ver,"Gustavo2005")==0){
214 Float_t pars[3]={0.0241, 1.0504, 0.000249} ;
215 fNonLinearityParams.Set(3,pars) ;
216 fNonlinearityCorrVersion=ver ;
219 AliError(Form("Non known correction version: %s, still using default \n",ver)) ;
224 //-----------------------------------------------------------------------------
225 const TObject* AliPHOSRecoParam::GetTriggerParameters()
227 //Returns trigger parameters.
229 //Quick check as follows:
230 // root [0] AliCDBManager::Instance()->SetDefaultStorage("local://$ALICE_ROOT/OCDB");
231 // root [1] AliCDBManager::Instance()->SetRun(158171);
232 // root [2] TObject* parameters = AliPHOSRecoParam::GetTriggerParameters();
233 // root [3] parameters->Print();
235 if(fgkTrigParams) return fgkTrigParams;
237 AliCDBEntry* entry = AliCDBManager::Instance()->Get("PHOS/Trigger/Parameters");
239 fgkTrigParams = entry->GetObject();
241 return fgkTrigParams;