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