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 fNonLinearityParams(3),
36 fEMCClusteringThreshold(0.2),
38 fEMCRawDigitThreshold(2),
41 fEMCSampleQualityCut(1.),
42 fTimeGateAmpThresh(10.),
46 fEMCEcore2ESD(kFALSE),
47 fEMCSubtractPedestals(kTRUE),
49 fEMCEnergyCorrectionOn(kTRUE),
50 fEMCFitterVersion(""),
51 fNonlinearityCorrVersion(""),
52 fGlobalAltroOffset(0),
53 fGlobalAltroThreshold(0),
54 fCPVClusteringThreshold(0.0),
60 //Default constructor.
61 SetNonlinearityCorrectionVersion("Gustavo2005") ;
64 //-----------------------------------------------------------------------------
65 AliPHOSRecoParam::AliPHOSRecoParam(const AliPHOSRecoParam& ):
66 AliDetectorRecoParam(),
67 fNonLinearityParams(3),
68 fEMCClusteringThreshold(0.2),
70 fEMCRawDigitThreshold(2),
73 fEMCSampleQualityCut(1.),
74 fTimeGateAmpThresh(10.),
78 fEMCEcore2ESD(kFALSE),
79 fEMCSubtractPedestals(kTRUE),
81 fEMCEnergyCorrectionOn(kTRUE),
82 fEMCFitterVersion(""),
83 fNonlinearityCorrVersion(""),
84 fGlobalAltroOffset(0),
85 fGlobalAltroThreshold(0),
86 fCPVClusteringThreshold(0.0),
95 //-----------------------------------------------------------------------------
96 AliPHOSRecoParam& AliPHOSRecoParam::operator = (const AliPHOSRecoParam& recoParam)
98 //Assignment operator.
100 if(this != &recoParam) {
101 fNonLinearityParams = recoParam.fNonLinearityParams;
102 fEMCClusteringThreshold = recoParam.fEMCClusteringThreshold;
103 fEMCLocMaxCut = recoParam.fEMCLocMaxCut;
104 fEMCRawDigitThreshold = recoParam.fEMCRawDigitThreshold;
105 fEMCMinE = recoParam.fEMCMinE;
106 fEMCW0 = recoParam.fEMCW0;
107 fEMCSampleQualityCut = recoParam.fEMCSampleQualityCut;
108 fTimeGateAmpThresh = recoParam.fTimeGateAmpThresh ;
109 fTimeGateLow = recoParam.fTimeGateLow ;
110 fTimeGateHigh = recoParam.fTimeGateHigh ;
111 fEMCEcoreRadius = recoParam.fEMCEcoreRadius;
112 fEMCEcore2ESD = recoParam.fEMCEcore2ESD;
113 fEMCSubtractPedestals = recoParam.fEMCSubtractPedestals;
114 fEMCUnfold = recoParam.fEMCUnfold;
115 fEMCEnergyCorrectionOn = recoParam.fEMCEnergyCorrectionOn;
116 fEMCFitterVersion = recoParam.fEMCFitterVersion;
117 fNonlinearityCorrVersion= recoParam.fNonlinearityCorrVersion;
118 fGlobalAltroOffset = recoParam.fGlobalAltroOffset;
119 fGlobalAltroThreshold = recoParam.fGlobalAltroThreshold;
120 fCPVClusteringThreshold = recoParam.fCPVClusteringThreshold;
121 fCPVLocMaxCut = recoParam.fCPVLocMaxCut;
122 fCPVMinE = recoParam.fCPVMinE;
123 fCPVW0 = recoParam.fCPVW0;
124 fCPVUnfold = recoParam.fCPVUnfold;
125 fNonLinearityParams = recoParam.fNonLinearityParams ;
131 //-----------------------------------------------------------------------------
132 void AliPHOSRecoParam::Print(Option_t * /*option*/) const
134 AliDebug(2,Form("PHOS reconstruction parameters:\n"
135 "\tEMCClusteringThreshold = %f\n"
136 "\tEMCLocMaxCut = %f\n"
137 "\tEMCRawDigitThreshold = %f\n"
140 "\tEMCSampleQualityCut = %f\n"
141 "\tEMCEcoreRadius = %f\n"
142 "\tEMCEcore2ESD = %d\n"
143 "\tEMCSubtractPedestals = %d\n"
145 "\tEMCEnergyCorrectionOn = %d\n"
146 "\tEMCFitterVersion = \"%s\"\n"
147 "\tGlobalAltroOffset = %d\n"
148 "\tGlobalAltroThreshold = %d",
149 fEMCClusteringThreshold,
151 fEMCRawDigitThreshold,
154 fEMCSampleQualityCut,
157 fEMCSubtractPedestals,
159 fEMCEnergyCorrectionOn,
160 fEMCFitterVersion.Data(),
162 fGlobalAltroThreshold));
166 //-----------------------------------------------------------------------------
167 AliPHOSRecoParam* AliPHOSRecoParam::GetDefaultParameters()
169 //Default parameters for the reconstruction
171 AliPHOSRecoParam* params = new AliPHOSRecoParam();
175 //-----------------------------------------------------------------------------
176 const TObjArray* AliPHOSRecoParam::GetMappings()
178 //Returns array of AliAltroMappings for RCU0..RCU3.
179 //If not found, read it from OCDB.
181 //Quick check as follows:
182 // root [0] AliCDBManager::Instance()->SetDefaultStorage("local://$ALICE_ROOT/OCDB");
183 // root [1] AliCDBManager::Instance()->SetRun(1);
184 // root [2] TObjArray* maps = AliPHOSRecoParam::GetMappings();
185 // root [3] maps->Print();
187 if(fgkMaps) return fgkMaps;
189 AliCDBEntry* entry = AliCDBManager::Instance()->Get("PHOS/Calib/Mapping");
191 fgkMaps = (TObjArray*)entry->GetObject();
196 //-----------------------------------------------------------------------------
197 void AliPHOSRecoParam::SetNonlinearityCorrectionVersion(const char * ver){
198 //Set non-linearity correction version and adjust parameters
200 if(strcmp(ver,"NoCorrection")==0){
201 fNonLinearityParams.Set(1) ;
202 fNonLinearityParams.AddAt(0.,0) ;
203 fNonlinearityCorrVersion=ver ;
206 if(strcmp(ver,"Henrik2010")==0){
207 Float_t pars[7]={1.051,2.54e-003,-1.737e-002,5.69e-002,3.3e-001,1.42e-001,1.50e-002} ;
208 fNonLinearityParams.Set(7,pars) ;
209 fNonlinearityCorrVersion=ver ;
212 if(strcmp(ver,"Gustavo2005")==0){
213 Float_t pars[3]={0.0241, 1.0504, 0.000249} ;
214 fNonLinearityParams.Set(3,pars) ;
215 fNonlinearityCorrVersion=ver ;
218 AliError(Form("Non known correction version: %s, still using default \n",ver)) ;