]> git.uio.no Git - u/mrichter/AliRoot.git/blob - EMCAL/AliEMCALRecParam.cxx
Changed AliRunLoader::GetRunLoader() into AliRunLoader::Instance()
[u/mrichter/AliRoot.git] / EMCAL / AliEMCALRecParam.cxx
1  /**************************************************************************
2  * Copyright(c) 1998-1999, 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 // --- AliRoot header files ---
18 #include "TObjArray.h"
19 #include "AliCDBManager.h"
20 #include "AliCDBEntry.h"
21 #include "AliEMCALRecParam.h"
22 #include "AliLog.h"
23
24 ClassImp(AliEMCALRecParam)
25
26 TObjArray* AliEMCALRecParam::fgkMaps =0; //ALTRO mappings 
27
28 //-----------------------------------------------------------------------------
29 // Container of EMCAL reconstruction parameters
30 // The purpose of this object is to store it to OCDB
31 // and retrieve it in AliEMCALClusterizerv1
32 // Author: Yuri Kharlov
33 //-----------------------------------------------------------------------------
34
35 AliEMCALRecParam::AliEMCALRecParam() :
36   AliDetectorRecoParam(),
37   fClusteringThreshold(0.5),
38   fW0(4.5),
39   fMinECut(0.45), 
40   fUnfold(kFALSE), 
41   fLocMaxCut(0.03), //clustering
42   fTrkCutX(6.0), 
43   fTrkCutY(6.0), 
44   fTrkCutZ(6.0),  
45   fTrkCutR(10.0),
46   fTrkCutAlphaMin(-50.0), 
47   fTrkCutAlphaMax(50.0), 
48   fTrkCutAngle(10000.0), //track matching
49   fHighLowGainFactor(16.0), 
50   fOrderParameter(2), 
51   fTau(2.35), 
52   fNoiseThreshold(3), 
53   fNPedSamples(5) //raw signal
54 {
55   // default reco values
56
57   //PID parameters (Guenole)
58
59   // as a first step, all array elements are initialized to 0.0
60   Int_t i, j;
61   for (i = 0; i < 6; i++) {
62     for (j = 0; j < 6; j++) {
63       fGamma[i][j] = fHadron[i][j] = fPiZero5to10[i][j] = fPiZero10to60[i][j] = 0.;
64     }
65   }
66
67   // then, only the ones which must be not zero are initialized
68   // while the others will remain to the value 0.0
69
70   fGamma[0][0] =  0.038022;
71   fGamma[0][1] = -0.0001883;
72   fGamma[0][2] =  5.449e-06;
73
74   fGamma[1][0] =  0.207313;
75   fGamma[1][1] = -0.000978;
76   fGamma[1][2] =  0.00001634;
77
78   fGamma[2][0] =  0.043364;
79   fGamma[2][1] = -0.0002048;
80   fGamma[2][2] =  8.661e-06;
81   fGamma[2][3] = -1.353e-07;
82
83   fGamma[3][0] =  0.265004;
84   fGamma[3][1] =  0.061298;
85   fGamma[3][2] = -0.003203;
86   fGamma[3][3] =  4.73e-05;
87
88   fGamma[4][0] =  0.243579;
89   fGamma[4][1] = -1.614e-05;
90
91   fGamma[5][0] =  0.002942;
92   fGamma[5][1] = -3.976e-05;
93
94   fHadron[0][0] =  0.011945 / 3.;
95   fHadron[0][1] =  0.000386 / 3.;
96   fHadron[0][2] = -0.000014 / 3.;
97   fHadron[0][3] =  1.336e-07 / 3.;
98
99   fHadron[1][0] =  0.496544;
100   fHadron[1][1] = -0.003226;
101   fHadron[1][2] =  0.00001678;
102
103   fHadron[2][0] =  0.144838;
104   fHadron[2][1] = -0.002954;
105   fHadron[2][2] =  0.00008754;
106   fHadron[2][3] = -7.587e-07;
107
108   fHadron[3][0] =  1.264461 / 7.;
109   fHadron[3][1] =  0.002097 / 7.;
110
111   fHadron[4][0] =  0.261950;
112   fHadron[4][1] = -0.001078;
113   fHadron[4][2] =  0.00003237;
114   fHadron[4][3] = -3.241e-07;
115   fHadron[4][4] =  0.;
116   fHadron[4][5] =  0.;
117   fHadron[5][0] =  0.010317;
118   fHadron[5][1] =  0.;
119   fHadron[5][2] =  0.;
120   fHadron[5][3] =  0.;
121   fHadron[5][4] =  0.;
122   fHadron[5][5] =  0.;
123
124   fPiZero5to10[0][0] = 0.009138;
125   fPiZero5to10[0][1] = 0.0006377;
126
127   fPiZero5to10[1][0] = 0.08;
128
129   fPiZero5to10[2][0] = -0.061119;
130   fPiZero5to10[2][1] =  0.019013;
131
132   fPiZero5to10[3][0] =  0.2;
133
134   fPiZero5to10[4][0] =  0.252044;
135   fPiZero5to10[4][1] = -0.002315;
136
137   fPiZero5to10[5][0] =  0.002942;
138   fPiZero5to10[5][1] = -3.976e-05;
139   
140   fPiZero10to60[0][0] =  0.009138;
141   fPiZero10to60[0][1] =  0.0006377;
142
143   fPiZero10to60[1][0] =  1.272837;
144   fPiZero10to60[1][1] = -0.069708;
145   fPiZero10to60[1][2] =  0.001568;
146   fPiZero10to60[1][3] = -1.162e-05;
147
148   fPiZero10to60[2][0] =  0.139703;
149   fPiZero10to60[2][1] =  0.003687;
150   fPiZero10to60[2][2] = -0.000568;
151   fPiZero10to60[2][3] =  1.498e-05;
152   fPiZero10to60[2][4] = -1.174e-07;
153
154   fPiZero10to60[3][0] = -0.826367;
155   fPiZero10to60[3][1] =  0.096951;
156   fPiZero10to60[3][2] = -0.002215;
157   fPiZero10to60[3][3] =  2.523e-05;
158
159   fPiZero10to60[4][0] =  0.249890;
160   fPiZero10to60[4][1] = -0.000063;
161
162   fPiZero10to60[5][0] =  0.002942;
163   fPiZero10to60[5][1] = -3.976e-05;
164
165 }
166
167 //-----------------------------------------------------------------------------
168 AliEMCALRecParam::AliEMCALRecParam(const AliEMCALRecParam& rp) :
169   AliDetectorRecoParam(),
170   fClusteringThreshold(rp.fClusteringThreshold),
171   fW0(rp.fW0),
172   fMinECut(rp.fMinECut), 
173   fUnfold(rp.fUnfold), 
174   fLocMaxCut(rp.fLocMaxCut), //clustering
175   fTrkCutX(rp.fTrkCutX), 
176   fTrkCutY(rp.fTrkCutY), 
177   fTrkCutZ(rp.fTrkCutZ),  
178   fTrkCutR(rp.fTrkCutR),
179   fTrkCutAlphaMin(rp.fTrkCutAlphaMin), 
180   fTrkCutAlphaMax(rp.fTrkCutAlphaMax), 
181   fTrkCutAngle(rp.fTrkCutAngle), //track matching
182   fHighLowGainFactor(rp.fHighLowGainFactor), 
183   fOrderParameter(rp.fOrderParameter), 
184   fTau(rp.fTau), 
185   fNoiseThreshold(rp.fNoiseThreshold), 
186   fNPedSamples(rp.fNPedSamples) //raw signal
187 {
188   //copy constructor
189
190   //PID values
191   Int_t i, j;
192   for (i = 0; i < 6; i++) {
193     for (j = 0; j < 6; j++) {
194       fGamma[i][j] = rp.fGamma[i][j];
195       fHadron[i][j] = rp.fHadron[i][j];
196       fPiZero5to10[i][j] = rp.fPiZero5to10[i][j];
197       fPiZero10to60[i][j] = rp.fPiZero10to60[i][j];
198     }
199   }
200
201 }
202
203 //-----------------------------------------------------------------------------
204 AliEMCALRecParam& AliEMCALRecParam::operator = (const AliEMCALRecParam& rp)
205 {
206   //assignment operator
207
208   if(this != &rp) {
209     fClusteringThreshold = rp.fClusteringThreshold;
210     fW0 = rp.fW0;
211     fMinECut = rp.fMinECut;
212     fUnfold = rp.fUnfold;
213     fLocMaxCut = rp.fLocMaxCut; //clustering
214     fTrkCutX = rp.fTrkCutX;
215     fTrkCutY = rp.fTrkCutY;
216     fTrkCutZ = rp.fTrkCutZ;
217     fTrkCutR = rp.fTrkCutR;
218     fTrkCutAlphaMin = rp.fTrkCutAlphaMin;
219     fTrkCutAlphaMax = rp.fTrkCutAlphaMax;
220     fTrkCutAngle = rp.fTrkCutAngle; //track matching
221     fHighLowGainFactor = rp.fHighLowGainFactor; 
222     fOrderParameter = rp.fOrderParameter;
223     fTau = rp.fTau;
224     fNoiseThreshold = rp.fNoiseThreshold;
225     fNPedSamples = rp.fNPedSamples; //raw signal
226
227     //PID values
228     Int_t i, j;
229     for (i = 0; i < 6; i++) {
230       for (j = 0; j < 6; j++) {
231         fGamma[i][j] = rp.fGamma[i][j];
232         fHadron[i][j] = rp.fHadron[i][j];
233         fPiZero5to10[i][j] = rp.fPiZero5to10[i][j];
234         fPiZero10to60[i][j] = rp.fPiZero10to60[i][j];
235       }
236     }
237
238   }    
239   
240   return *this;
241
242 }
243
244 //-----------------------------------------------------------------------------
245 AliEMCALRecParam* AliEMCALRecParam::GetDefaultParameters()
246 {
247   //default parameters for the reconstruction
248   AliEMCALRecParam* params = new AliEMCALRecParam();
249   params->SetName("Default - Pb+Pb");
250   params->SetTitle("Default - Pb+Pb");
251   return params;
252
253 }
254
255
256 //-----------------------------------------------------------------------------
257 AliEMCALRecParam* AliEMCALRecParam::GetLowFluxParam()
258 {
259   //low flux/multiplicity ("p+p") parameters for the reconstruction
260   AliEMCALRecParam* params = new AliEMCALRecParam();
261   params->SetClusteringThreshold(0.2); // 200 MeV                                             
262   params->SetMinECut(0.01);  //10 MeV       
263   params->SetName("Low Flux - p+p");
264   params->SetTitle("Low Flux - p+p");
265   params->SetEventSpecie(AliRecoParam::kLowMult);
266
267   return params;
268
269 }
270
271
272 //-----------------------------------------------------------------------------
273 AliEMCALRecParam* AliEMCALRecParam::GetHighFluxParam()
274 {
275   //high flux/multiplicity ("Pb+Pb") parameters for the reconstruction
276   AliEMCALRecParam* params = new AliEMCALRecParam();
277   //For now, same as default
278   //if later these need to be modified, here's where it is done
279   params->SetName("High Flux - Pb+Pb");
280   params->SetTitle("High Flux - Pb+Pb");
281   params->SetEventSpecie(AliRecoParam::kHighMult);
282
283   return params;
284
285 }
286
287 //-----------------------------------------------------------------------------
288 void AliEMCALRecParam::Print(Option_t *) const
289 {
290   // Print reconstruction parameters to stdout
291   AliInfo(Form("Clusterization parameters :\n fClusteringThreshold=%.3f,\n fW0=%.3f,\n fMinECut=%.3f,\n fUnfold=%d,\n fLocMaxCut=%.3f \n",
292                fClusteringThreshold,fW0,fMinECut,fUnfold,fLocMaxCut));
293
294   AliInfo(Form("Track-matching cuts :\n x %f, y %f, z %f, R %f \n alphaMin %f, alphaMax %f, Angle %f\n", fTrkCutX, fTrkCutY, fTrkCutZ, fTrkCutR,fTrkCutAlphaMin,fTrkCutAlphaMax, fTrkCutAngle));
295
296   AliInfo(Form("PID parameters, Gamma :\n"));
297   for(Int_t i = 0; i < 6; i++){
298     for(Int_t j = 0; j < 6; j++){
299       printf(" %f, ", fGamma[i][j]);
300     }
301     printf("\n");
302   }
303
304   printf("\n");
305
306   AliInfo(Form("PID parameters, Hadron :\n"));
307   for(Int_t i = 0; i < 6; i++){
308     for(Int_t j = 0; j < 6; j++){
309       printf(" %f, ", fHadron[i][j]);
310     }
311     printf("\n");
312   }
313
314   printf("\n");
315
316   AliInfo(Form("PID parameters, Pi0zero5to10 :\n"));
317   for(Int_t i = 0; i < 6; i++){
318     for(Int_t j = 0; j < 6; j++){
319       printf(" %f, ", fPiZero5to10[i][j]);
320     }
321     printf("\n");
322   }
323
324   printf("\n");
325
326   AliInfo(Form("PID parameters, Pi0zero10to60 :\n"));
327   for(Int_t i = 0; i < 6; i++){
328     for(Int_t j = 0; j < 6; j++){
329       printf(" %f, ", fPiZero10to60[i][j]);
330     }
331     printf("\n");
332   }
333
334   printf("\n");
335
336   AliInfo(Form("Raw signal parameters: \n gain factor=%f, order=%d, tau=%f, noise threshold=%d, nped samples=%d \n",
337                fHighLowGainFactor,fOrderParameter,fTau,fNoiseThreshold,fNPedSamples));
338
339 }
340
341 //-----------------------------------------------------------------------------
342 const TObjArray* AliEMCALRecParam::GetMappings()
343 {
344   //Returns array of AliAltroMappings for RCU0..RCUX.
345   //If not found, read it from OCDB.                                           
346
347   //Quick check as follows:                                                   
348   //  root [0] AliCDBManager::Instance()->SetDefaultStorage("local://$ALICE_ROOT"
349   //  root [1] AliCDBManager::Instance()->SetRun(1);                             
350   //  root [2] TObjArray* maps = AliEMCALRecParam::GetMappings();                
351   //  root [3] maps->Print();                                                    
352
353   if(fgkMaps) return fgkMaps;
354
355   AliCDBEntry* entry = AliCDBManager::Instance()->Get("EMCAL/Calib/Mapping");
356   if(entry)
357     fgkMaps = (TObjArray*)entry->GetObject();
358
359   return fgkMaps;
360
361 }
362