]> git.uio.no Git - u/mrichter/AliRoot.git/blame - EMCAL/AliEMCALCalibAbs.cxx
intermediate calibration class commit: struct changed to classes and added root i/o
[u/mrichter/AliRoot.git] / EMCAL / AliEMCALCalibAbs.cxx
CommitLineData
d81e6423 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
18// Objects of this class contain basis for absolute calibrations
19//
20
21#include <fstream>
22#include <TString.h>
61917ab3 23#include <TFile.h>
24#include <TTree.h>
d81e6423 25
26#include "AliEMCALCalibAbs.h"
27
28using namespace std;
29
30ClassImp(AliEMCALCalibAbs)
31
32//____________________________________________________________________________
33AliEMCALCalibAbs::AliEMCALCalibAbs() :
34 fNSuperModule(0),
35 fSuperModuleData(0)
36{
37 //Default constructor.
38}
39
40//____________________________________________________________________________
61917ab3 41void AliEMCALCalibAbs::ReadTextCalibAbsInfo(Int_t nSM, const TString &txtFileName,
42 Bool_t swapSides)
d81e6423 43{
44 //Read data from txt file. ; coordinates given on SuperModule basis
45
46 std::ifstream inputFile(txtFileName.Data());
47 if (!inputFile) {
48 printf("AliEMCALCalibAbs::ReadCalibAbsInfo - Cannot open the APD info file %s\n", txtFileName.Data());
49 return;
50 }
51
52 fNSuperModule = nSM;
53 if (fSuperModuleData) delete [] fSuperModuleData;
54 fSuperModuleData = new AliEMCALSuperModuleCalibAbs[fNSuperModule];
55
56 Int_t iSM = 0; // SuperModule index
57 Int_t iCol = 0;
58 Int_t iRow = 0;
59 Int_t id = 0;
60
61 // list of values to be read
62 // first: overall values for the whole SuperModule
63 Int_t CalibMethod;
64 Int_t CalibPass;
65 Int_t CalibTime;
66 Float_t AbsoluteGain;
67 // second: additional info for LED Reference and SM temperature
68 Float_t LEDRefAmp;
69 Float_t LEDRefAmpRMS;
70 Float_t LEDRefHighLowRatio;
71 Int_t LEDRefHighLow;
72 Float_t Temperature;
73 Float_t TemperatureRMS;
74 // third: info for each tower
75 Float_t RelativeGain; // (ADC>GeV relative gain/conversion), value around 1
76 Float_t HighLowRatio; // value around 16 or so
77 Int_t HighLow; //
78 Float_t LEDAmp; // low gain eq. amplitude
79 Float_t LEDAmpRMS; //
80 // end - all values
81
82 Int_t nAPDPerSM = AliEMCALGeoParams::fgkEMCALCols * AliEMCALGeoParams::fgkEMCALRows;
83
84 for (Int_t i = 0; i < fNSuperModule; i++) {
85 AliEMCALSuperModuleCalibAbs &t = fSuperModuleData[i];
86 if (!inputFile) {
87 printf("AliEMCALCalibAbs::ReadCalibAbsInfo - Error while reading input file; likely EOF..");
88 return;
89 }
90 inputFile >> iSM;
91 t.fSuperModuleNum = iSM;
92
93 // first: overall values for the whole SuperModule
94 inputFile >> CalibMethod >> CalibPass >> CalibTime >> AbsoluteGain;
95 t.fCalibMethod = CalibMethod;
96 t.fCalibPass = CalibPass;
97 t.fCalibTime = CalibTime;
98 t.fAbsoluteGain = AbsoluteGain;
99
100 // second: additional info for LED Reference and SM temperature
101 for (Int_t j=0; j<AliEMCALGeoParams::fgkEMCALLEDRefs; j++) {
102 inputFile >> id >> LEDRefAmp >> LEDRefAmpRMS >> LEDRefHighLowRatio >> LEDRefHighLow;
103 t.fLEDRefAmp[id] = LEDRefAmp;
104 t.fLEDRefAmpRMS[id] = LEDRefAmpRMS;
105 t.fLEDRefHighLowRatio[id] = LEDRefHighLowRatio;
106 t.fLEDRefHighLow[id] = LEDRefHighLow;
107 }
108 for (Int_t j=0; j<AliEMCALGeoParams::fgkEMCALTempSensors; j++) {
109 inputFile >> id >> Temperature >> TemperatureRMS;
110 t.fTemperature[id] = Temperature;
111 t.fTemperatureRMS[id] = TemperatureRMS;
112 }
113
114 // third: info for each tower
115 for (Int_t j=0; j<nAPDPerSM; j++) {
116 inputFile >> iCol >> iRow
117 >> RelativeGain >> HighLowRatio >> HighLow >> LEDAmp >> LEDAmpRMS;
118
119 // assume that this info is already swapped and done for this basis?
120 if (swapSides) {
121 // C side, oriented differently than A side: swap is requested
122 iCol = AliEMCALGeoParams::fgkEMCALCols-1 - iCol;
123 iRow = AliEMCALGeoParams::fgkEMCALRows-1 - iRow;
124 }
125
126 AliEMCALCalibAbsVal &v = t.fAPDVal[iCol][iRow];
127
128 v.fRelativeGain = RelativeGain;
129 v.fHighLowRatio = HighLowRatio;
130 v.fHighLow = HighLow;
131 v.fLEDAmp = LEDAmp;
132 v.fLEDAmpRMS = LEDAmpRMS;
133 }
134
135 } // i, SuperModule
136
137 inputFile.close();
138
139 return;
140}
141
142//____________________________________________________________________________
61917ab3 143void AliEMCALCalibAbs::WriteTextCalibAbsInfo(const TString &txtFileName,
144 Bool_t swapSides)
d81e6423 145{
146 // write data to txt file. ; coordinates given on SuperModule basis
147
148 std::ofstream outputFile(txtFileName.Data());
149 if (!outputFile) {
150 printf("AliEMCALCalibAbs::WriteCalibAbsInfo - Cannot open the APD output file %s\n", txtFileName.Data());
151 return;
152 }
153
154 Int_t iCol = 0;
155 Int_t iRow = 0;
156
157 Int_t nAPDPerSM = AliEMCALGeoParams::fgkEMCALCols * AliEMCALGeoParams::fgkEMCALRows;
158
159 for (Int_t i = 0; i < fNSuperModule; i++) {
160 AliEMCALSuperModuleCalibAbs &t = fSuperModuleData[i];
161 // first: overall values for the whole SuperModule
162 outputFile << t.fSuperModuleNum << endl;
163 outputFile << t.fCalibMethod << " "
164 << t.fCalibPass << " "
165 << t.fCalibTime << " "
166 << t.fAbsoluteGain << endl;
167
168 // second: additional info for LED Reference and SM temperature
169 for (Int_t j=0; j<AliEMCALGeoParams::fgkEMCALLEDRefs; j++) {
170 outputFile << j << " " << t.fLEDRefAmp[j] << " " << t.fLEDRefAmpRMS[j]
171 << " " << t.fLEDRefHighLowRatio[j] << " " << t.fLEDRefHighLow[j]
172 << endl;
173 }
174 for (Int_t j=0; j<AliEMCALGeoParams::fgkEMCALTempSensors; j++) {
175 outputFile << j << " " << t.fTemperature[j] << " " << t.fTemperatureRMS[j] << endl;
176 }
177
61917ab3 178 // third: info for each tower
d81e6423 179 for (Int_t j=0; j<nAPDPerSM; j++) {
180 iCol = j / AliEMCALGeoParams::fgkEMCALRows;
181 iRow = j % AliEMCALGeoParams::fgkEMCALRows;
182
183 AliEMCALCalibAbsVal &v = t.fAPDVal[iCol][iRow];
184
185 if (swapSides) {
186 // C side, oriented differently than A side: swap is requested
187 iCol = AliEMCALGeoParams::fgkEMCALCols-1 - iCol;
188 iRow = AliEMCALGeoParams::fgkEMCALRows-1 - iRow;
189 }
190
191 outputFile << iCol << " " << iRow
192 << " " << v.fRelativeGain
193 << " " << v.fHighLowRatio
194 << " " << v.fHighLow
195 << " " << v.fLEDAmp
196 << " " << v.fLEDAmpRMS << endl;
197 }
198
199 } // i, SuperModule
200
201 outputFile.close();
202
203 return;
204}
205
61917ab3 206//____________________________________________________________________________
207void AliEMCALCalibAbs::ReadRootCalibAbsInfo(const TString &rootFileName,
208 Bool_t swapSides)
209{
210 //Read data from root file. ; coordinates given on SuperModule basis
211 TFile inputFile(rootFileName, "read");
212
213 TTree *tree = (TTree*) inputFile.Get("tree");
214
215 ReadTreeCalibAbsInfo(tree, swapSides);
216
217 inputFile.Close();
218
219 return;
220}
221
222//____________________________________________________________________________
223void AliEMCALCalibAbs::ReadTreeCalibAbsInfo(TTree *tree,
224 Bool_t swapSides)
225{
226 // how many SuperModule's worth of entries / APDs do we have?
227 Int_t nAPDPerSM = AliEMCALGeoParams::fgkEMCALCols * AliEMCALGeoParams::fgkEMCALRows;
228 fNSuperModule = tree->GetEntries() / nAPDPerSM;
229
230 if (fSuperModuleData) delete [] fSuperModuleData;
231 fSuperModuleData = new AliEMCALSuperModuleCalibAbs[fNSuperModule];
232
233 Int_t iSM = 0; // SuperModule index
234 // list of values to be read
235 // first: overall values for the whole SuperModule
236 Int_t CalibMethod;
237 Int_t CalibPass= {0};
238 Int_t CalibTime= {0};
239 Float_t AbsoluteGain= {0};
240 // second: additional info for LED Reference and SM temperature
241 Float_t LEDRefAmp[AliEMCALGeoParams::fgkEMCALLEDRefs]= {0};
242 Float_t LEDRefAmpRMS[AliEMCALGeoParams::fgkEMCALLEDRefs]= {0};
243 Float_t LEDRefHighLowRatio[AliEMCALGeoParams::fgkEMCALLEDRefs]= {0};
244 Int_t LEDRefHighLow[AliEMCALGeoParams::fgkEMCALLEDRefs]= {0};
245 Float_t Temperature[AliEMCALGeoParams::fgkEMCALTempSensors]= {0};
246 Float_t TemperatureRMS[AliEMCALGeoParams::fgkEMCALTempSensors]= {0};
247 // third: info for each tower
248 Float_t RelativeGain[AliEMCALGeoParams::fgkEMCALCols][AliEMCALGeoParams::fgkEMCALRows]= {0};
249 Float_t HighLowRatio[AliEMCALGeoParams::fgkEMCALCols][AliEMCALGeoParams::fgkEMCALRows]= {0};
250 Int_t HighLow[AliEMCALGeoParams::fgkEMCALCols][AliEMCALGeoParams::fgkEMCALRows]= {0};
251 Float_t LEDAmp[AliEMCALGeoParams::fgkEMCALCols][AliEMCALGeoParams::fgkEMCALRows]= {0};
252 Float_t LEDAmpRMS[AliEMCALGeoParams::fgkEMCALCols][AliEMCALGeoParams::fgkEMCALRows]= {0};
253 // end - all values
254
255 // just to make the initializations of the arrays are done correctly, let's use memset
256 memset(LEDRefAmp, 0, sizeof(LEDRefAmp));
257 memset(LEDRefAmpRMS, 0, sizeof(LEDRefAmpRMS));
258 memset(LEDRefHighLowRatio, 0, sizeof(LEDRefHighLowRatio));
259 memset(LEDRefHighLow, 0, sizeof(LEDRefHighLow));
260 memset(Temperature, 0, sizeof(Temperature));
261 memset(TemperatureRMS, 0, sizeof(TemperatureRMS));
262 memset(RelativeGain, 0, sizeof(RelativeGain));
263 memset(HighLowRatio, 0, sizeof(HighLowRatio));
264 memset(HighLow, 0, sizeof(HighLow));
265 memset(LEDAmp, 0, sizeof(LEDAmp));
266 memset(LEDAmpRMS, 0, sizeof(LEDAmpRMS));
267
268 // declare the branches
269 tree->SetBranchAddress("iSM", &iSM);
270 tree->SetBranchAddress("CalibMethod", &CalibMethod);
271 tree->SetBranchAddress("CalibPass", &CalibPass);
272 tree->SetBranchAddress("CalibTime", &CalibTime);
273 tree->SetBranchAddress("AbsoluteGain", &AbsoluteGain);
274 //
275 tree->SetBranchAddress("LEDRefAmp", LEDRefAmp);
276 tree->SetBranchAddress("LEDRefAmpRMS", LEDRefAmpRMS);
277 tree->SetBranchAddress("LEDRefHighLowRatio", LEDRefHighLowRatio);
278 tree->SetBranchAddress("LEDRefHighLow", LEDRefHighLow);
279 tree->SetBranchAddress("Temperature", Temperature);
280 tree->SetBranchAddress("TemperatureRMS", TemperatureRMS);
281 //
282 tree->SetBranchAddress("RelativeGain", RelativeGain);
283 tree->SetBranchAddress("HighLowRatio", HighLowRatio);
284 tree->SetBranchAddress("HighLow", HighLow);
285 tree->SetBranchAddress("LEDAmp", LEDAmp);
286 tree->SetBranchAddress("LEDAmpRMS", LEDAmpRMS);
287
288 // indices for looping over the towers
289 Int_t iCol = 0;
290 Int_t iRow = 0;
291
292 for (int ient=0; ient<tree->GetEntries(); ient++) {
293 tree->GetEntry(ient);
294
295 // assume the index SuperModules come in order: i=iSM
296 AliEMCALSuperModuleCalibAbs &t = fSuperModuleData[iSM];
297 t.fSuperModuleNum = iSM;
298 // first, overall values
299 t.fCalibMethod = CalibMethod;
300 t.fCalibPass = CalibPass;
301 t.fCalibTime = CalibTime;
302 t.fAbsoluteGain = AbsoluteGain;
303
304 // second: additional info for LED references and SM temperatures
305 for (Int_t j=0; j<AliEMCALGeoParams::fgkEMCALLEDRefs; j++) {
306 t.fLEDRefAmp[j] = LEDRefAmp[j];
307 t.fLEDRefAmpRMS[j] = LEDRefAmpRMS[j];
308 t.fLEDRefHighLowRatio[j] = LEDRefHighLowRatio[j];
309 t.fLEDRefHighLow[j] = LEDRefHighLow[j];
310 }
311 for (Int_t j=0; j<AliEMCALGeoParams::fgkEMCALTempSensors; j++) {
312 t.fTemperature[j] = Temperature[j];
313 t.fTemperatureRMS[j] = TemperatureRMS[j];
314 }
315
316 // third: info for each tower
317 for (Int_t j=0; j<nAPDPerSM; j++) {
318 iCol = j / AliEMCALGeoParams::fgkEMCALRows;
319 iRow = j % AliEMCALGeoParams::fgkEMCALRows;
320
321 // help variables: possibly modified or swapped indices
322 int iColMod = iCol;
323 int iRowMod = iRow;
324 // assume that this info is already swapped and done for this basis?
325 if (swapSides) {
326 // C side, oriented differently than A side: swap is requested
327 iColMod = AliEMCALGeoParams::fgkEMCALCols-1 - iCol;
328 iRowMod = AliEMCALGeoParams::fgkEMCALRows-1 - iRow;
329 }
330
331 AliEMCALCalibAbsVal &v = t.fAPDVal[iColMod][iRowMod];
332
333 v.fRelativeGain = RelativeGain[iCol][iRow];
334 v.fHighLowRatio = HighLowRatio[iCol][iRow];
335 v.fHighLow = HighLow[iCol][iRow];
336 v.fLEDAmp = LEDAmp[iCol][iRow];
337 v.fLEDAmpRMS = LEDAmpRMS[iCol][iRow];
338 }
339
340 } // loop over entries
341
342 return;
343}
344
345//____________________________________________________________________________
346void AliEMCALCalibAbs::WriteRootCalibAbsInfo(const TString &rootFileName,
347 Bool_t swapSides)
348{
349 // write data to root file. ; coordinates given on SuperModule basis
350 TFile destFile(rootFileName, "recreate");
351 if (destFile.IsZombie()) {
352 return;
353 }
354 destFile.cd();
355
356 TTree *tree = new TTree("tree","");
357
358 // variables for filling the TTree
359 Int_t iSM = 0; // SuperModule index
360 // list of values to be written
361 // first: overall values for the whole SuperModule
362 Int_t CalibMethod = 0;
363 Int_t CalibPass = 0;
364 Int_t CalibTime = 0;
365 Float_t AbsoluteGain = 0;
366 // second: additional info for LED Reference and SM temperature
367 Float_t LEDRefAmp[AliEMCALGeoParams::fgkEMCALLEDRefs] = {0};
368 Float_t LEDRefAmpRMS[AliEMCALGeoParams::fgkEMCALLEDRefs]= {0};
369 Float_t LEDRefHighLowRatio[AliEMCALGeoParams::fgkEMCALLEDRefs]= {0};
370 Int_t LEDRefHighLow[AliEMCALGeoParams::fgkEMCALLEDRefs]= {0};
371 Float_t Temperature[AliEMCALGeoParams::fgkEMCALTempSensors]= {0};
372 Float_t TemperatureRMS[AliEMCALGeoParams::fgkEMCALTempSensors]= {0};
373 // third: info for each tower
374 Float_t RelativeGain[AliEMCALGeoParams::fgkEMCALCols][AliEMCALGeoParams::fgkEMCALRows]= {0};
375 Float_t HighLowRatio[AliEMCALGeoParams::fgkEMCALCols][AliEMCALGeoParams::fgkEMCALRows]= {0};
376 Int_t HighLow[AliEMCALGeoParams::fgkEMCALCols][AliEMCALGeoParams::fgkEMCALRows]= {0};
377 Float_t LEDAmp[AliEMCALGeoParams::fgkEMCALCols][AliEMCALGeoParams::fgkEMCALRows]= {0};
378 Float_t LEDAmpRMS[AliEMCALGeoParams::fgkEMCALCols][AliEMCALGeoParams::fgkEMCALRows]= {0};
379 // end - all values
380
381 // just to make the initializations of the arrays are done correctly, let's use memset
382 memset(LEDRefAmp, 0, sizeof(LEDRefAmp));
383 memset(LEDRefAmpRMS, 0, sizeof(LEDRefAmpRMS));
384 memset(LEDRefHighLowRatio, 0, sizeof(LEDRefHighLowRatio));
385 memset(LEDRefHighLow, 0, sizeof(LEDRefHighLow));
386 memset(Temperature, 0, sizeof(Temperature));
387 memset(TemperatureRMS, 0, sizeof(TemperatureRMS));
388 memset(RelativeGain, 0, sizeof(RelativeGain));
389 memset(HighLowRatio, 0, sizeof(HighLowRatio));
390 memset(HighLow, 0, sizeof(HighLow));
391 memset(LEDAmp, 0, sizeof(LEDAmp));
392 memset(LEDAmpRMS, 0, sizeof(LEDAmpRMS));
393
394 Int_t nAPDPerSM = AliEMCALGeoParams::fgkEMCALCols * AliEMCALGeoParams::fgkEMCALRows;
395 // for looping over towers
396 Int_t iCol = 0;
397 Int_t iRow = 0;
398
399 // declare the branches
400 // first
401 tree->Branch("iSM", &iSM, "iSM/I");
402 tree->Branch("CalibMethod", &CalibMethod, "CalibMethod/I");
403 tree->Branch("CalibPass", &CalibPass, "CalibPass/I");
404 tree->Branch("CalibTime", &CalibTime, "CalibTime/I");
405 tree->Branch("AbsoluteGain", &AbsoluteGain, "AbsoluteGain/F");
406 // second
407 tree->Branch( "LEDRefAmp", &LEDRefAmp, Form("LEDRefAmp[%d]/F", AliEMCALGeoParams::fgkEMCALLEDRefs) );
408 tree->Branch( "LEDRefAmpRMS", &LEDRefAmpRMS, Form("LEDRefAmpRMS[%d]/F", AliEMCALGeoParams::fgkEMCALLEDRefs) );
409 tree->Branch( "LEDRefHighLowRatio", &LEDRefHighLowRatio, Form("LEDRefHighLowRatio[%d]/F", AliEMCALGeoParams::fgkEMCALLEDRefs) );
410 tree->Branch( "LEDRefHighLow", &LEDRefHighLow, Form("LEDRefHighLow[%d]/I", AliEMCALGeoParams::fgkEMCALLEDRefs) );
411 tree->Branch( "Temperature", &Temperature, Form("Temperature[%d]/F", AliEMCALGeoParams::fgkEMCALTempSensors) );
412 tree->Branch( "TemperatureRMS", &TemperatureRMS, Form("TemperatureRMS[%d]/F", AliEMCALGeoParams::fgkEMCALTempSensors) );
413 // third: info for each tower; see if a 2D array works OK or if we'll have to use 1D arrays instead
414 tree->Branch( "RelativeGain", &RelativeGain, Form("RelativeGain[%d][%d]/F", AliEMCALGeoParams::fgkEMCALCols, AliEMCALGeoParams::fgkEMCALRows) );
415 tree->Branch( "HighLowRatio", &HighLowRatio, Form("HighLowRatio[%d][%d]/F", AliEMCALGeoParams::fgkEMCALCols, AliEMCALGeoParams::fgkEMCALRows) );
416 tree->Branch( "HighLow", &HighLow, Form("HighLow[%d][%d]/I", AliEMCALGeoParams::fgkEMCALCols, AliEMCALGeoParams::fgkEMCALRows) );
417 tree->Branch( "LEDAmp", &LEDAmp, Form("LEDAmp[%d][%d]/F", AliEMCALGeoParams::fgkEMCALCols, AliEMCALGeoParams::fgkEMCALRows) );
418 tree->Branch( "LEDAmpRMS", &LEDAmpRMS, Form("LEDAmpRMS[%d][%d]/F", AliEMCALGeoParams::fgkEMCALCols, AliEMCALGeoParams::fgkEMCALRows) );
419
420 for (iSM = 0; iSM < fNSuperModule; iSM++) {
421 AliEMCALSuperModuleCalibAbs &t = fSuperModuleData[iSM];
422
423 iSM = t.fSuperModuleNum;
424 // first, overall values
425 CalibMethod = t.fCalibMethod;
426 CalibPass = t.fCalibPass;
427 CalibTime = t.fCalibTime;
428 AbsoluteGain = t.fAbsoluteGain;
429
430 // second: additional info for LED references and SM temperatures
431 for (Int_t j=0; j<AliEMCALGeoParams::fgkEMCALLEDRefs; j++) {
432 LEDRefAmp[j] = t.fLEDRefAmp[j];
433 LEDRefAmpRMS[j] = t.fLEDRefAmpRMS[j];
434 LEDRefHighLowRatio[j] = t.fLEDRefHighLowRatio[j];
435 LEDRefHighLow[j] = t.fLEDRefHighLow[j];
436 }
437 for (Int_t j=0; j<AliEMCALGeoParams::fgkEMCALTempSensors; j++) {
438 Temperature[j] = t.fTemperature[j];
439 TemperatureRMS[j] = t.fTemperatureRMS[j];
440 }
441
442 // third: info for each tower
443 for (Int_t j=0; j<nAPDPerSM; j++) {
444 iCol = j / AliEMCALGeoParams::fgkEMCALRows;
445 iRow = j % AliEMCALGeoParams::fgkEMCALRows;
446
447 // help variables: possibly modified or swapped indices
448 int iColMod = iCol;
449 int iRowMod = iRow;
450 // assume that this info is already swapped and done for this basis?
451 if (swapSides) {
452 // C side, oriented differently than A side: swap is requested
453 iColMod = AliEMCALGeoParams::fgkEMCALCols-1 - iCol;
454 iRowMod = AliEMCALGeoParams::fgkEMCALRows-1 - iRow;
455 }
456
457 AliEMCALCalibAbsVal &v = t.fAPDVal[iColMod][iRowMod];
458
459 RelativeGain[iCol][iRow] = v.fRelativeGain;
460 HighLowRatio[iCol][iRow] = v.fHighLowRatio;
461 HighLow[iCol][iRow] = v.fHighLow;
462 LEDAmp[iCol][iRow] = v.fLEDAmp;
463 LEDAmpRMS[iCol][iRow] = v.fLEDAmpRMS;
464 }
465
466 tree->Fill();
467 } // i, SuperModule
468
469 tree->Write();
470 destFile.Close();
471
472 return;
473}
474
d81e6423 475//____________________________________________________________________________
476AliEMCALCalibAbs::~AliEMCALCalibAbs()
477{
478 delete [] fSuperModuleData;
479}
480
481//____________________________________________________________________________
61917ab3 482AliEMCALSuperModuleCalibAbs AliEMCALCalibAbs::GetSuperModuleCalibAbsId(Int_t supModIndex)const
d81e6423 483{
484 AliEMCALSuperModuleCalibAbs t; // just to maybe prevent a crash, but we are returning something not-initialized so maybe not better really..
485 if (!fSuperModuleData)
486 return t;
487
488 return fSuperModuleData[supModIndex];
489}
490
491//____________________________________________________________________________
61917ab3 492AliEMCALSuperModuleCalibAbs AliEMCALCalibAbs::GetSuperModuleCalibAbsNum(Int_t supModIndex)const
d81e6423 493{
494 AliEMCALSuperModuleCalibAbs t; // just to maybe prevent a crash, but we are returning something not-initialized so maybe not better really..
495 if (!fSuperModuleData)
496 return t;
497
498 for (int i=0; i<fNSuperModule; i++) {
499 if (fSuperModuleData[i].fSuperModuleNum == supModIndex) {
500 return fSuperModuleData[i];
501 }
502 }
503
504 return t;
505}
506