]> git.uio.no Git - u/mrichter/AliRoot.git/blob - EMCAL/AliEMCALRecParam.cxx
Digit header added
[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 //-----------------------------------------------------------------------------
263 AliEMCALRecParam* AliEMCALRecParam::GetLowFluxParam()
264 {
265   //low flux/multiplicity ("p+p") parameters for the reconstruction
266   AliEMCALRecParam* params = new AliEMCALRecParam();
267   params->SetClusteringThreshold(0.2); // 200 MeV                                             
268   params->SetMinECut(0.01);  //10 MeV       
269   params->SetName("Low Flux - p+p");
270   params->SetTitle("Low Flux - p+p");
271   params->SetEventSpecie(AliRecoParam::kLowMult);
272
273   return params;
274
275 }
276
277
278 //-----------------------------------------------------------------------------
279 AliEMCALRecParam* AliEMCALRecParam::GetHighFluxParam()
280 {
281   //high flux/multiplicity ("Pb+Pb") parameters for the reconstruction
282   AliEMCALRecParam* params = new AliEMCALRecParam();
283   //For now, same as default
284   //if later these need to be modified, here's where it is done
285   params->SetName("High Flux - Pb+Pb");
286   params->SetTitle("High Flux - Pb+Pb");
287   params->SetEventSpecie(AliRecoParam::kHighMult);
288
289   return params;
290
291 }
292
293 //-----------------------------------------------------------------------------
294 void AliEMCALRecParam::Print(Option_t *) const
295 {
296   // Print reconstruction parameters to stdout
297   AliInfo(Form("Clusterization parameters :\n fClusteringThreshold=%.3f,\n fW0=%.3f,\n fMinECut=%.3f,\n fUnfold=%d,\n fLocMaxCut=%.3f \n",
298                fClusteringThreshold,fW0,fMinECut,fUnfold,fLocMaxCut));
299
300   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));
301
302   AliInfo(Form("PID parameters, Gamma :\n"));
303   for(Int_t i = 0; i < 6; i++){
304     for(Int_t j = 0; j < 6; j++){
305       printf(" %f, ", fGamma[i][j]);
306     }
307     printf("\n");
308   }
309
310   printf("\n");
311
312   AliInfo(Form("PID parameters, Hadron :\n"));
313   for(Int_t i = 0; i < 6; i++){
314     for(Int_t j = 0; j < 6; j++){
315       printf(" %f, ", fHadron[i][j]);
316     }
317     printf("\n");
318   }
319
320   printf("\n");
321
322   AliInfo(Form("PID parameters, Pi0zero5to10 :\n"));
323   for(Int_t i = 0; i < 6; i++){
324     for(Int_t j = 0; j < 6; j++){
325       printf(" %f, ", fPiZero5to10[i][j]);
326     }
327     printf("\n");
328   }
329
330   printf("\n");
331
332   AliInfo(Form("PID parameters, Pi0zero10to60 :\n"));
333   for(Int_t i = 0; i < 6; i++){
334     for(Int_t j = 0; j < 6; j++){
335       printf(" %f, ", fPiZero10to60[i][j]);
336     }
337     printf("\n");
338   }
339
340   printf("\n");
341
342   AliInfo(Form("Raw signal parameters: \n gain factor=%f, order=%d, tau=%f, noise threshold=%d, nped samples=%d \n",
343                fHighLowGainFactor,fOrderParameter,fTau,fNoiseThreshold,fNPedSamples));
344
345 }
346
347 //-----------------------------------------------------------------------------
348 const TObjArray* AliEMCALRecParam::GetMappings()
349 {
350   //Returns array of AliAltroMappings for RCU0..RCUX.
351   //If not found, read it from OCDB.                                           
352
353   //Quick check as follows:                                                   
354   //  root [0] AliCDBManager::Instance()->SetDefaultStorage("local://$ALICE_ROOT/OCDB"
355   //  root [1] AliCDBManager::Instance()->SetRun(1);                             
356   //  root [2] TObjArray* maps = AliEMCALRecParam::GetMappings();                
357   //  root [3] maps->Print();                                                    
358
359   if(fgkMaps) return fgkMaps;
360
361   AliCDBEntry* entry = AliCDBManager::Instance()->Get("EMCAL/Calib/Mapping");
362   if(entry)
363     fgkMaps = (TObjArray*)entry->GetObject();
364
365   return fgkMaps;
366
367 }
368