1 /**************************************************************************
2 * Copyright(c) 1998-1999, 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 **************************************************************************/
16 Based on the QA code for PHOS written by Yves Schutz July 2007
18 Authors: J.Klay (Cal Poly) May 2008
19 S. Salur LBL April 2008
21 Created one histogram for QA shifter;-- Yaxian Mao: 11/2009
22 The idea:average counts for all the towers should be flat
23 Change all existing histograms as experts
25 Change histograms for DQM shifter: -- Yaxian Mao 04/2010
26 Calcuate the amplitude ratio from current run and the LED reference, for QAChecker use
27 Also calculate the ratio of amplitude from LED Monitor system (current/Reference), to check LED system
31 // --- ROOT system ---
32 #include <TClonesArray.h>
41 // --- Standard library ---
44 // --- AliRoot header files ---
46 #include "AliESDCaloCluster.h"
47 #include "AliESDCaloCells.h"
48 #include "AliESDEvent.h"
50 #include "AliEMCALQADataMakerRec.h"
51 #include "AliQAChecker.h"
52 #include "AliEMCALDigit.h"
53 #include "AliEMCALRecPoint.h"
54 #include "AliEMCALRawUtils.h"
55 #include "AliEMCALReconstructor.h"
56 #include "AliEMCALRecParam.h"
57 #include "AliRawReader.h"
58 #include "AliCaloRawStreamV3.h"
59 #include "AliEMCALGeoParams.h"
60 #include "AliRawEventHeaderBase.h"
61 #include "AliQAManager.h"
62 #include "AliCDBEntry.h"
64 #include "AliCaloBunchInfo.h"
65 #include "AliCaloFitResults.h"
66 #include "AliCaloRawAnalyzerFastFit.h"
67 #include "AliCaloRawAnalyzerNN.h"
68 //#include "AliCaloRawAnalyzerLMS.h"
69 #include "AliCaloRawAnalyzerKStandard.h"
70 #include "AliCaloRawAnalyzerPeakFinder.h"
71 #include "AliCaloRawAnalyzerCrude.h"
73 #include "AliCaloRawAnalyzerFactory.h"
77 ClassImp(AliEMCALQADataMakerRec)
79 //____________________________________________________________________________
80 AliEMCALQADataMakerRec::AliEMCALQADataMakerRec(fitAlgorithm fitAlgo) :
81 AliQADataMakerRec(AliQAv1::GetDetName(AliQAv1::kEMCAL), "EMCAL Quality Assurance Data Maker"),
85 fSuperModules(10), // FIXME!!! number of SuperModules; 10 for 2011; update default for later runs
86 fFirstPedestalSample(0),
87 fLastPedestalSample(3),
88 fFirstPedestalSampleTRU(0),
89 fLastPedestalSampleTRU(3),
91 fMaxSignalLG(AliEMCALGeoParams::fgkSampleMax),
93 fMaxSignalHG(AliEMCALGeoParams::fgkSampleMax),
95 fMaxSignalTRU(AliEMCALGeoParams::fgkSampleMax),
96 fMinSignalLGLEDMon(0),
97 fMaxSignalLGLEDMon(AliEMCALGeoParams::fgkSampleMax),
98 fMinSignalHGLEDMon(0),
99 fMaxSignalHGLEDMon(AliEMCALGeoParams::fgkSampleMax),
100 fCalibRefHistoPro(NULL),
101 fCalibRefHistoH2F(NULL),
102 fLEDMonRefHistoPro(NULL),
103 fHighEmcHistoH2F(NULL)
104 // fTextSM(new TText*[fSuperModules]) ,
110 SetFittingAlgorithm(fitAlgo);
112 //fRawAnalyzerTRU = new AliCaloRawAnalyzerLMS();
114 fRawAnalyzerTRU = ( AliCaloRawAnalyzerKStandard*)AliCaloRawAnalyzerFactory::CreateAnalyzer(kLMS);
116 fRawAnalyzerTRU->SetFixTau(kTRUE);
117 fRawAnalyzerTRU->SetTau(2.5); // default for TRU shaper
118 // for (Int_t sm = 0 ; sm < fSuperModules ; sm++){
119 // fTextSM[sm] = NULL ;
123 //____________________________________________________________________________
124 AliEMCALQADataMakerRec::AliEMCALQADataMakerRec(const AliEMCALQADataMakerRec& qadm) :
126 fFittingAlgorithm(0),
129 fSuperModules(qadm.GetSuperModules()),
130 fFirstPedestalSample(qadm.GetFirstPedestalSample()),
131 fLastPedestalSample(qadm.GetLastPedestalSample()),
132 fFirstPedestalSampleTRU(qadm.GetFirstPedestalSampleTRU()),
133 fLastPedestalSampleTRU(qadm.GetLastPedestalSampleTRU()),
134 fMinSignalLG(qadm.GetMinSignalLG()),
135 fMaxSignalLG(qadm.GetMaxSignalLG()),
136 fMinSignalHG(qadm.GetMinSignalHG()),
137 fMaxSignalHG(qadm.GetMaxSignalHG()),
138 fMinSignalTRU(qadm.GetMinSignalTRU()),
139 fMaxSignalTRU(qadm.GetMaxSignalTRU()),
140 fMinSignalLGLEDMon(qadm.GetMinSignalLGLEDMon()),
141 fMaxSignalLGLEDMon(qadm.GetMaxSignalLGLEDMon()),
142 fMinSignalHGLEDMon(qadm.GetMinSignalHGLEDMon()),
143 fMaxSignalHGLEDMon(qadm.GetMaxSignalHGLEDMon()),
144 fCalibRefHistoPro(NULL),
145 fCalibRefHistoH2F(NULL),
146 fLEDMonRefHistoPro(NULL),
147 fHighEmcHistoH2F(NULL)
148 // fTextSM(new TText*[fSuperModules]) ,
153 SetName((const char*)qadm.GetName()) ;
154 SetTitle((const char*)qadm.GetTitle());
155 SetFittingAlgorithm(qadm.GetFittingAlgorithm());
157 //fRawAnalyzerTRU = new AliCaloRawAnalyzerLMS();
158 fRawAnalyzerTRU = (AliCaloRawAnalyzerKStandard*)AliCaloRawAnalyzerFactory::CreateAnalyzer(kLMS);
159 fRawAnalyzerTRU->SetFixTau(kTRUE);
160 fRawAnalyzerTRU->SetTau(2.5); // default for TRU shaper
161 // for (Int_t sm = 0 ; sm < fSuperModules ; sm++){
162 // fTextSM[sm] = qadm.fTextSM[sm] ;
166 //__________________________________________________________________
167 AliEMCALQADataMakerRec& AliEMCALQADataMakerRec::operator = (const AliEMCALQADataMakerRec& qadm )
170 this->~AliEMCALQADataMakerRec();
171 new(this) AliEMCALQADataMakerRec(qadm);
174 // for (Int_t sm = 0 ; sm < fSuperModules ; sm++){
175 // fTextSM[sm] = qadm.fTextSM[sm] ;
180 //____________________________________________________________________________
181 void AliEMCALQADataMakerRec::EndOfDetectorCycle(AliQAv1::TASKINDEX_t task, TObjArray ** list)
183 //Detector specific actions at end of cycle
186 // GetRawsData(kNEventsPerTower)->Scale(1./fCycleCounter);
188 // do the QA checking
189 ResetEventTrigClasses(); // reset triggers list to select all histos
190 AliQAChecker::Instance()->Run(AliQAv1::kEMCAL, task, list) ;
193 //____________________________________________________________________________
194 void AliEMCALQADataMakerRec::GetCalibRefFromOCDB()
196 //Get the reference histogram from OCDB
197 TString sName1("hHighEmcalRawMaxMinusMin") ;
198 TString sName2("hLowLEDMonEmcalRawMaxMinusMin") ;
199 sName1.Prepend(Form("%s_", AliRecoParam::GetEventSpecieName(AliRecoParam::kCalib))) ;
200 sName2.Prepend(Form("%s_", AliRecoParam::GetEventSpecieName(AliRecoParam::kCalib))) ;
202 TString refStorage(AliQAv1::GetQARefStorage()) ;
203 if (!refStorage.Contains(AliQAv1::GetLabLocalOCDB()) && !refStorage.Contains(AliQAv1::GetLabAliEnOCDB())) {
204 AliFatal(Form("%s is not a valid location for reference data", refStorage.Data())) ;
206 AliQAManager* manQA = AliQAManager::QAManager(AliQAv1::kRAWS) ;
207 AliQAv1::SetQARefDataDirName(AliRecoParam::kCalib) ;
208 if ( ! manQA->GetLock() ) {
209 manQA->SetDefaultStorage(AliQAv1::GetQARefStorage()) ;
210 manQA->SetSpecificStorage("*", AliQAv1::GetQARefStorage()) ;
211 manQA->SetRun(AliCDBManager::Instance()->GetRun()) ;
214 char * detOCDBDir = Form("%s/%s/%s", GetName(), AliQAv1::GetRefOCDBDirName(), AliQAv1::GetRefDataDirName()) ;
215 AliCDBEntry * entry = manQA->Get(detOCDBDir, manQA->GetRun()) ;
217 TList * listDetQAD =static_cast<TList *>(entry->GetObject()) ;
218 if ( strcmp(listDetQAD->ClassName(), "TList") != 0 ) {
219 AliError(Form("Expected a Tlist and found a %s for detector %s", listDetQAD->ClassName(), GetName())) ;
222 TObjArray * dirOCDB= NULL ;
224 dirOCDB = static_cast<TObjArray *>(listDetQAD->FindObject(Form("%s/%s", AliQAv1::GetTaskName(AliQAv1::kRAWS).Data(), AliRecoParam::GetEventSpecieName(AliRecoParam::kCalib)))) ;
226 fCalibRefHistoPro = dynamic_cast<TProfile *>(dirOCDB->FindObject(sName1.Data())) ;
227 fLEDMonRefHistoPro = dynamic_cast<TProfile *>(dirOCDB->FindObject(sName2.Data())) ;
232 if(fCalibRefHistoPro && fLEDMonRefHistoPro){
234 //Defining histograms binning, each 2D histogram covers all SMs
235 Int_t nSMSectors = fSuperModules / 2; // 2 SMs per sector
236 Int_t nbinsZ = 2*AliEMCALGeoParams::fgkEMCALCols;
237 Int_t nbinsPhi = nSMSectors * AliEMCALGeoParams::fgkEMCALRows;
239 if(!fCalibRefHistoH2F)
240 fCalibRefHistoH2F = new TH2F("hCalibRefHisto", "hCalibRefHisto", nbinsZ, -0.5, nbinsZ - 0.5, nbinsPhi, -0.5, nbinsPhi -0.5);
241 ConvertProfile2H(fCalibRefHistoPro,fCalibRefHistoH2F) ;
243 AliFatal(Form("No reference object with name %s or %s found", sName1.Data(), sName2.Data())) ;
246 //____________________________________________________________________________
247 void AliEMCALQADataMakerRec::InitESDs()
249 //Create histograms to controll ESD
250 const Bool_t expert = kTRUE ;
251 const Bool_t image = kTRUE ;
253 TH1F * h1 = new TH1F("hESDCaloClusterE", "ESDs CaloCluster energy in EMCAL;Energy [GeV];Counts", 200, 0., 100.) ;
255 Add2ESDsList(h1, kESDCaloClusE, !expert, image) ;
257 TH1I * h2 = new TH1I("hESDCaloClusterM", "ESDs CaloCluster multiplicity in EMCAL;# of Clusters;Entries", 100, 0, 100) ;
259 Add2ESDsList(h2, kESDCaloClusM, !expert, image) ;
261 TH1F * h3 = new TH1F("hESDCaloCellA", "ESDs CaloCell amplitude in EMCAL;Energy [GeV];Counts", 500, 0., 50.) ;
263 Add2ESDsList(h3, kESDCaloCellA, !expert, image) ;
265 TH1I * h4 = new TH1I("hESDCaloCellM", "ESDs CaloCell multiplicity in EMCAL;# of Clusters;Entries", 200, 0, 1000) ;
267 Add2ESDsList(h4, kESDCaloCellM, !expert, image) ;
269 ClonePerTrigClass(AliQAv1::kESDS); // this should be the last line
272 //____________________________________________________________________________
273 void AliEMCALQADataMakerRec::InitDigits()
275 // create Digits histograms in Digits subdir
276 const Bool_t expert = kTRUE ;
277 const Bool_t image = kTRUE ;
279 TH1I * h0 = new TH1I("hEmcalDigits", "Digits amplitude distribution in EMCAL;Amplitude [ADC counts];Counts", 500, 0, 500) ;
281 Add2DigitsList(h0, 0, !expert, image) ;
282 TH1I * h1 = new TH1I("hEmcalDigitsMul", "Digits multiplicity distribution in EMCAL;# of Digits;Entries", 200, 0, 2000) ;
284 Add2DigitsList(h1, 1, !expert, image) ;
286 ClonePerTrigClass(AliQAv1::kDIGITS); // this should be the last line
289 //____________________________________________________________________________
290 void AliEMCALQADataMakerRec::InitRecPoints()
292 // create Reconstructed PoInt_ts histograms in RecPoints subdir
293 const Bool_t expert = kTRUE ;
294 const Bool_t image = kTRUE ;
296 TH1F* h0 = new TH1F("hEMCALRpE","EMCAL RecPoint energies;Energy [GeV];Counts",200, 0.,20.); //GeV
298 Add2RecPointsList(h0,kRecPE, !expert, image);
300 TH1I* h1 = new TH1I("hEMCALRpM","EMCAL RecPoint multiplicities;# of Clusters;Entries",100,0,100);
302 Add2RecPointsList(h1,kRecPM, !expert, image);
304 TH1I* h2 = new TH1I("hEMCALRpDigM","EMCAL RecPoint Digit Multiplicities;# of Digits;Entries",20,0,20);
306 Add2RecPointsList(h2,kRecPDigM, !expert, image);
308 ClonePerTrigClass(AliQAv1::kRECPOINTS); // this should be the last line
311 //____________________________________________________________________________
312 void AliEMCALQADataMakerRec::InitRaws()
314 // create Raws histograms in Raws subdir
315 const Bool_t expert = kTRUE ;
316 const Bool_t saveCorr = kTRUE ;
317 const Bool_t image = kTRUE ;
318 const Option_t *profileOption = "s";
320 Int_t nTowersPerSM = AliEMCALGeoParams::fgkEMCALRows * AliEMCALGeoParams::fgkEMCALCols; // number of towers in a SuperModule; 24x48
321 Int_t nTot = fSuperModules * nTowersPerSM; // max number of towers in all SuperModules
323 //Defining histograms binning, each 2D histogram covers all SMs
324 Int_t nSMSectors = fSuperModules / 2; // 2 SMs per sector
325 Int_t nbinsZ = 2*AliEMCALGeoParams::fgkEMCALCols;
326 Int_t nbinsPhi = nSMSectors * AliEMCALGeoParams::fgkEMCALRows;
328 // counter info: number of channels per event (bins are SM index)
329 TProfile * h0 = new TProfile("hLowEmcalSupermodules", "Low Gain EMC: # of towers vs SuperMod;SM Id;# of towers",
330 fSuperModules, -0.5, fSuperModules-0.5, profileOption) ;
331 Add2RawsList(h0, kNsmodLG, expert, !image, !saveCorr) ;
332 TProfile * h1 = new TProfile("hHighEmcalSupermodules", "High Gain EMC: # of towers vs SuperMod;SM Id;# of towers",
333 fSuperModules, -0.5, fSuperModules-0.5, profileOption) ;
334 Add2RawsList(h1, kNsmodHG, expert, !image, !saveCorr) ;
336 // where did max sample occur? (bins are towers)
337 TProfile * h2 = new TProfile("hLowEmcalRawtime", "Low Gain EMC: Time at Max vs towerId;Tower Id;Time [ticks]",
338 nTot, -0.5, nTot-0.5, profileOption) ;
339 Add2RawsList(h2, kTimeLG, expert, !image, !saveCorr) ;
340 TProfile * h3 = new TProfile("hHighEmcalRawtime", "High Gain EMC: Time at Max vs towerId;Tower Id;Time [ticks]",
341 nTot, -0.5, nTot-0.5, profileOption) ;
342 Add2RawsList(h3, kTimeHG, expert, !image, !saveCorr) ;
344 // how much above pedestal was the max sample? (bins are towers)
345 TProfile * h4 = new TProfile("hLowEmcalRawMaxMinusMin", "Low Gain EMC: Max - Min vs towerId;Tower Id;Max-Min [ADC counts]",
346 nTot, -0.5, nTot-0.5, profileOption) ;
347 Add2RawsList(h4, kSigLG, expert, !image, !saveCorr) ;
348 TProfile * h5 = new TProfile("hHighEmcalRawMaxMinusMin", "High Gain EMC: Max - Min vs towerId;Tower Id;Max-Min [ADC counts]",
349 nTot, -0.5, nTot-0.5, profileOption) ;
350 Add2RawsList(h5, kSigHG, expert, !image, !saveCorr) ;
352 // total counter: channels per event
353 TH1I * h6 = new TH1I("hLowNtot", "Low Gain EMC: Total Number of found towers;# of Towers;Counts", 200, 0, nTot) ;
355 Add2RawsList(h6, kNtotLG, expert, !image, !saveCorr) ;
356 TH1I * h7 = new TH1I("hHighNtot", "High Gain EMC: Total Number of found towers;# of Towers;Counts", 200,0, nTot) ;
358 Add2RawsList(h7, kNtotHG, expert, !image, !saveCorr) ;
360 // pedestal (bins are towers)
361 TProfile * h8 = new TProfile("hLowEmcalRawPed", "Low Gain EMC: Pedestal vs towerId;Tower Id;Pedestal [ADC counts]",
362 nTot, -0.5, nTot-0.5, profileOption) ;
363 Add2RawsList(h8, kPedLG, expert, !image, !saveCorr) ;
364 TProfile * h9 = new TProfile("hHighEmcalRawPed", "High Gain EMC: Pedestal vs towerId;Tower Id;Pedestal [ADC counts]",
365 nTot, -0.5, nTot-0.5, profileOption) ;
366 Add2RawsList(h9, kPedHG, expert, !image, !saveCorr) ;
369 // now repeat the same for TRU and LEDMon data
370 Int_t nTot2x2 = fSuperModules * AliEMCALGeoParams::fgkEMCALTRUsPerSM * AliEMCALGeoParams::fgkEMCAL2x2PerTRU; // max number of TRU channels for all SuperModules
372 // counter info: number of channels per event (bins are SM index)
373 TProfile * hT0 = new TProfile("hTRUEmcalSupermodules", "TRU EMC: # of TRU channels vs SuperMod;SM Id;# of TRU channels",
374 fSuperModules, -0.5, fSuperModules-0.5, profileOption) ;
375 Add2RawsList(hT0, kNsmodTRU, expert, !image, !saveCorr) ;
377 // how much above pedestal was the max sample? (bins are TRU channels)
378 TProfile * hT1 = new TProfile("hTRUEmcalRawMaxMinusMin", "TRU EMC: Max - Min vs 2x2Id;2x2 Id;Max-Min [ADC counts]",
379 nTot2x2, -0.5, nTot2x2-0.5, profileOption) ;
380 Add2RawsList(hT1, kSigTRU, expert, !image, !saveCorr) ;
382 // total counter: channels per event
383 TH1I * hT2 = new TH1I("hTRUNtot", "TRU EMC: Total Number of found TRU channels;# of TRU Channels;Counts", 200, 0, nTot2x2) ;
385 Add2RawsList(hT2, kNtotTRU, expert, !image, !saveCorr) ;
387 // L0 trigger hits: # of hits (bins are TRU channels)
388 TH1I * hT3 = new TH1I("hTRUEmcalL0hits", "L0 trigger hits: Total number of 2x2 L0 generated", nTot2x2, -0.5, nTot2x2);
390 Add2RawsList(hT3, kNL0TRU, !expert, image, !saveCorr);
392 // L0 trigger hits: average time (bins are TRU channels)
393 TProfile * hT4 = new TProfile("hTRUEmcalL0hitsAvgTime", "L0 trigger hits: average time bin", nTot2x2, -0.5, nTot2x2, profileOption);
394 Add2RawsList(hT4, kTimeL0TRU, !expert, image, !saveCorr);
396 // L0 trigger hits: first in the event (bins are TRU channels)
397 TH1I * hT5 = new TH1I("hTRUEmcalL0hitsFirst", "L0 trigger hits: First hit in the event", nTot2x2, -0.5, nTot2x2);
399 Add2RawsList(hT5, kNL0FirstTRU, expert, !image, !saveCorr);
401 // L0 trigger hits: average time of first hit in the event (bins are TRU channels)
402 TProfile * hT6 = new TProfile("hTRUEmcalL0hitsFirstAvgTime", "L0 trigger hits: average time of first hit", nTot2x2, -0.5, nTot2x2, profileOption);
403 Add2RawsList(hT6, kTimeL0FirstTRU, expert, !image, !saveCorr);
405 // and also LED Mon..
406 // LEDMon has both high and low gain channels, just as regular FEE/towers
407 Int_t nTotLEDMon = fSuperModules * AliEMCALGeoParams::fgkEMCALLEDRefs; // max number of LEDMon channels for all SuperModules
409 // counter info: number of channels per event (bins are SM index)
410 TProfile * hL0 = new TProfile("hLowLEDMonEmcalSupermodules", "LowLEDMon Gain EMC: # of strips vs SuperMod;SM Id;# of strips",
411 fSuperModules, -0.5, fSuperModules-0.5, profileOption) ;
412 Add2RawsList(hL0, kNsmodLGLEDMon, expert, !image, !saveCorr) ;
413 TProfile * hL1 = new TProfile("hHighLEDMonEmcalSupermodules", "HighLEDMon Gain EMC: # of strips vs SuperMod;SM Id;# of strips",
414 fSuperModules, -0.5, fSuperModules-0.5, profileOption) ;
415 Add2RawsList(hL1, kNsmodHGLEDMon, expert, !image, !saveCorr) ;
417 // where did max sample occur? (bins are strips)
418 TProfile * hL2 = new TProfile("hLowLEDMonEmcalRawtime", "LowLEDMon Gain EMC: Time at Max vs stripId;Strip Id;Time [ticks]",
419 nTotLEDMon, -0.5, nTotLEDMon-0.5, profileOption) ;
420 Add2RawsList(hL2, kTimeLGLEDMon, expert, !image, !saveCorr) ;
421 TProfile * hL3 = new TProfile("hHighLEDMonEmcalRawtime", "HighLEDMon Gain EMC: Time at Max vs stripId;Strip Id;Time [ticks]",
422 nTotLEDMon, -0.5, nTotLEDMon-0.5, profileOption) ;
423 Add2RawsList(hL3, kTimeHGLEDMon, expert, !image, !saveCorr) ;
425 // how much above pedestal was the max sample? (bins are strips)
426 TProfile * hL4 = new TProfile("hLowLEDMonEmcalRawMaxMinusMin", "LowLEDMon Gain EMC: Max - Min vs stripId;Strip Id;Max-Min [ADC counts]",
427 nTotLEDMon, -0.5, nTotLEDMon-0.5, profileOption) ;
428 Add2RawsList(hL4, kSigLGLEDMon, expert, !image, !saveCorr) ;
429 TProfile * hL5 = new TProfile("hHighLEDMonEmcalRawMaxMinusMin", "HighLEDMon Gain EMC: Max - Min vs stripId;Strip Id;Max-Min [ADC counts]",
430 nTotLEDMon, -0.5, nTotLEDMon-0.5, profileOption) ;
431 Add2RawsList(hL5, kSigHGLEDMon, expert, !image, !saveCorr) ;
433 // total counter: channels per event
434 TH1I * hL6 = new TH1I("hLowLEDMonNtot", "LowLEDMon Gain EMC: Total Number of found strips;# of Strips;Counts", 200, 0, nTotLEDMon) ;
436 Add2RawsList(hL6, kNtotLGLEDMon, expert, !image, !saveCorr) ;
437 TH1I * hL7 = new TH1I("hHighLEDMonNtot", "HighLEDMon Gain EMC: Total Number of found strips;# of Strips;Counts", 200,0, nTotLEDMon) ;
439 Add2RawsList(hL7, kNtotHGLEDMon, expert, !image, !saveCorr) ;
441 // pedestal (bins are strips)
442 TProfile * hL8 = new TProfile("hLowLEDMonEmcalRawPed", "LowLEDMon Gain EMC: Pedestal vs stripId;Strip Id;Pedestal [ADC counts]",
443 nTotLEDMon, -0.5, nTotLEDMon-0.5, profileOption) ;
444 Add2RawsList(hL8, kPedLGLEDMon, expert, !image, !saveCorr) ;
445 TProfile * hL9 = new TProfile("hHighLEDMonEmcalRawPed", "HighLEDMon Gain EMC: Pedestal vs stripId;Strip Id;Pedestal [ADC counts]",
446 nTotLEDMon, -0.5, nTotLEDMon-0.5, profileOption) ;
447 Add2RawsList(hL9, kPedHGLEDMon, expert, !image, !saveCorr) ;
449 //temp 2D amplitude histogram for the current run
450 fHighEmcHistoH2F = new TH2F("h2DHighEC2", "High Gain EMC:Max - Min [ADC counts]", nbinsZ, -0.5 , nbinsZ-0.5, nbinsPhi, -0.5, nbinsPhi-0.5);
451 fHighEmcHistoH2F->SetDirectory(0) ; // this histo must be memory resident
452 //add ratio histograms: to comapre the current run with the reference data
453 TH2F * h15 = new TH2F("h2DRatioAmp", "High Gain Ratio to Reference:Amplitude_{current run}/Amplitude_{reference run}", nbinsZ, -0.5 , nbinsZ-0.5,
454 nbinsPhi, -0.5, nbinsPhi-0.5);
455 //settings for display in amore
456 h15->SetTitle("Amplitude_{current run}/Amplitude_{reference run}");
457 h15->SetMaximum(2.0);
458 h15->SetMinimum(0.1);
459 h15->SetOption("COLZ");
460 gStyle->SetOptStat(0);
461 Int_t color[] = {4,3,2} ;
462 gStyle->SetPalette(3,color);
463 h15->GetZaxis()->SetNdivisions(3);
464 h15->UseCurrentStyle();
465 h15->SetDirectory(0);
466 Add2RawsList(h15, k2DRatioAmp, !expert, image, !saveCorr) ;
468 TH1F * h16 = new TH1F("hRatioDist", "Amplitude_{current run}/Amplitude_{reference run} ratio distribution", nTot, 0., 2.);
469 h16->SetMinimum(0.1);
470 h16->SetMaximum(100.);
471 gStyle->SetOptStat(0);
472 h16->UseCurrentStyle();
473 h16->SetDirectory(0);
474 Add2RawsList(h16, kRatioDist, !expert, image, !saveCorr) ;
476 //add two histograms for shifter from the LED monitor system: comapre LED monitor with the reference run
477 //to be used for decision whether we need to change reference data
478 TH1F * hL10 = new TH1F("hMaxMinusMinLEDMonRatio", "LEDMon amplitude, Ratio to reference run", nTotLEDMon, -0.5, nTotLEDMon-0.5) ;
479 //settings for display in amore
480 hL10->SetTitle("Amplitude_{LEDMon current}/Amplitude_{LEDMon reference}");
481 hL10->SetMaximum(2.0);
482 hL10->SetMinimum(0.1);
483 gStyle->SetOptStat(0);
484 hL10->UseCurrentStyle();
485 hL10->SetDirectory(0);
486 // hL10->SetOption("E");
487 Add2RawsList(hL10, kLEDMonRatio, !expert, image, !saveCorr) ;
489 TH1F * hL11 = new TH1F("hMaxMinusMinLEDMonRatioDist", "LEDMon amplitude, Ratio distribution", nTotLEDMon, 0, 2);
490 hL11->SetMinimum(0.1) ;
491 gStyle->SetOptStat(0);
492 hL11->UseCurrentStyle();
493 hL11->SetDirectory(0);
494 Add2RawsList(hL11, kLEDMonRatioDist, !expert, image, !saveCorr) ;
496 GetCalibRefFromOCDB();
498 ClonePerTrigClass(AliQAv1::kRAWS); // this should be the last line
501 //____________________________________________________________________________
502 void AliEMCALQADataMakerRec::MakeESDs(AliESDEvent * esd)
504 // make QA data from ESDs
507 for ( Int_t index = 0; index < esd->GetNumberOfCaloClusters() ; index++ ) {
508 AliESDCaloCluster * clu = esd->GetCaloCluster(index) ;
509 if( clu->IsEMCAL() ) {
510 FillESDsData(kESDCaloClusE,clu->E()) ;
514 FillESDsData(kESDCaloClusM,nTot) ;
517 AliESDCaloCells* cells = esd->GetEMCALCells();
518 FillESDsData(kESDCaloCellM,cells->GetNumberOfCells()) ;
520 for ( Int_t index = 0; index < cells->GetNumberOfCells() ; index++ ) {
521 FillESDsData(kESDCaloCellA,cells->GetAmplitude(index)) ;
524 IncEvCountCycleESDs();
525 IncEvCountTotalESDs();
528 //____________________________________________________________________________
529 void AliEMCALQADataMakerRec::MakeRaws(AliRawReader* rawReader)
531 // Check that all the reference histograms exist before we try to use them - otherwise call InitRaws
532 // RS: Attention: the counters are increments after custom modification of eventSpecie
533 if (!fCalibRefHistoPro || !fCalibRefHistoH2F || !fLEDMonRefHistoPro || !fHighEmcHistoH2F) {
537 // make sure EMCal was readout during the event
538 Int_t emcID = AliDAQ::DetectorID("EMCAL"); // bit 18..
539 const UInt_t *detPattern = rawReader->GetDetectorPattern();
540 UInt_t emcInReadout = ( ((1 << emcID) & detPattern[0]) >> emcID);
541 if (! emcInReadout) return; // no poInt_t in looking at this event, if no EMCal data
545 AliCaloRawStreamV3 in(rawReader,"EMCAL");
546 rawReader->Select("EMCAL", 0, AliEMCALGeoParams::fgkLastAltroDDL) ; //select EMCAL DDL's
548 AliRecoParam::EventSpecie_t saveSpecie = fEventSpecie ;
549 if (rawReader->GetType() == AliRawEventHeaderBase::kCalibrationEvent) {
550 SetEventSpecie(AliRecoParam::kCalib) ;
553 const Int_t nTowersPerSM = AliEMCALGeoParams::fgkEMCALRows * AliEMCALGeoParams::fgkEMCALCols; // number of towers in a SuperModule; 24x48
554 const Int_t nRows = AliEMCALGeoParams::fgkEMCALRows; // number of rows per SuperModule
555 const Int_t nStripsPerSM = AliEMCALGeoParams::fgkEMCALLEDRefs; // number of strips per SuperModule
556 const Int_t n2x2PerSM = AliEMCALGeoParams::fgkEMCALTRUsPerSM * AliEMCALGeoParams::fgkEMCAL2x2PerTRU; // number of TRU 2x2's per SuperModule
557 const Int_t n2x2PerTRU = AliEMCALGeoParams::fgkEMCAL2x2PerTRU;
558 const Int_t nTot2x2 = fSuperModules * n2x2PerSM; // total TRU channels
561 // SM counters; decl. should be safe, assuming we don't get more than expected SuperModules..
562 Int_t nTotalSMLG[AliEMCALGeoParams::fgkEMCALModules] = {0};
563 Int_t nTotalSMHG[AliEMCALGeoParams::fgkEMCALModules] = {0};
564 Int_t nTotalSMTRU[AliEMCALGeoParams::fgkEMCALModules] = {0};
565 Int_t nTotalSMLGLEDMon[AliEMCALGeoParams::fgkEMCALModules] = {0};
566 Int_t nTotalSMHGLEDMon[AliEMCALGeoParams::fgkEMCALModules] = {0};
568 const Int_t nTRUL0ChannelBits = 10; // used for L0 trigger bits checks
569 int firstL0TimeBin = 999;
570 int triggers[nTot2x2][24]; //auxiliary array for L0 trigger - TODO remove hardcoded 24
571 memset(triggers, 0, sizeof(int) * 24 * nTot2x2);
573 Int_t iSM = 0; // SuperModule index
574 // start loop over input stream
575 while (in.NextDDL()) {
576 Int_t iRCU = in.GetDDLNumber() % 2; // RCU0 or RCU1, within SuperModule
577 fRawAnalyzer->SetIsZeroSuppressed( in.GetZeroSupp() );
579 while (in.NextChannel()) {
580 iSM = in.GetModule(); // SuperModule
581 //prInt_tf("iSM %d DDL %d", iSM, in.GetDDLNumber());
582 if (iSM>=0 && iSM<fSuperModules) { // valid module reading
585 vector<AliCaloBunchInfo> bunchlist;
586 while (in.NextBunch()) {
587 nsamples += in.GetBunchLength();
588 bunchlist.push_back( AliCaloBunchInfo(in.GetStartTimeBin(), in.GetBunchLength(), in.GetSignals() ) );
591 if (nsamples > 0) { // this check is needed for when we have zero-supp. on, but not sparse readout
594 // indices for pedestal calc.
595 Int_t firstPedSample = 0;
596 Int_t lastPedSample = 0;
597 bool isTRUL0IdData = false;
599 if (! in.IsTRUData() ) { // high gain, low gain, LED Mon data - all have the same shaper/sampling
600 AliCaloFitResults fitResults = fRawAnalyzer->Evaluate( bunchlist, in.GetAltroCFG1(), in.GetAltroCFG2());
601 amp = fitResults.GetAmp();
602 time = fitResults.GetTof();
603 firstPedSample = fFirstPedestalSample;
604 lastPedSample = fLastPedestalSample;
606 else { // TRU data is special, needs its own analyzer
607 AliCaloFitResults fitResults = fRawAnalyzerTRU->Evaluate( bunchlist, in.GetAltroCFG1(), in.GetAltroCFG2());
608 amp = fitResults.GetAmp();
609 time = fitResults.GetTof();
610 firstPedSample = fFirstPedestalSampleTRU;
611 lastPedSample = fLastPedestalSampleTRU;
612 if (in.GetColumn() >= n2x2PerTRU) {
613 isTRUL0IdData = true;
619 vector<Int_t> pedSamples;
621 // select earliest bunch
622 unsigned int bunchIndex = 0;
623 unsigned int startBin = bunchlist.at(0).GetStartBin();
624 if (bunchlist.size() > 0) {
625 for(unsigned int ui=1; ui < bunchlist.size(); ui++ ) {
626 if (startBin > bunchlist.at(ui).GetStartBin() ) {
627 startBin = bunchlist.at(ui).GetStartBin();
633 // check bunch for entries in the pedestal sample range
634 Int_t bunchLength = bunchlist.at(bunchIndex).GetLength();
635 const UShort_t *sig = bunchlist.at(bunchIndex).GetData();
638 if (! isTRUL0IdData) { // regular data, can look at pedestals
639 for (Int_t i = 0; i<bunchLength; i++) {
640 timebin = startBin--;
641 if ( firstPedSample<=timebin && timebin<=lastPedSample ) {
642 pedSamples.push_back( sig[i] );
647 else { // TRU L0 Id Data
648 // which TRU the channel belongs to?
649 Int_t iTRUId = in.GetModule()*3 + (iRCU*in.GetBranch() + iRCU);
651 for (Int_t i = 0; i< bunchLength; i++) {
652 for( Int_t j = 0; j < nTRUL0ChannelBits; j++ ){
653 // check if the bit j is 1
654 if( (sig[i] & ( 1 << j )) > 0 ){
655 Int_t iTRUIdInSM = (in.GetColumn() - n2x2PerTRU)*nTRUL0ChannelBits+j;
656 if(iTRUIdInSM < n2x2PerTRU) {
657 Int_t iTRUAbsId = iTRUIdInSM + n2x2PerTRU * iTRUId;
658 // Fill the histograms
659 FillRawsData(kNL0TRU,iTRUAbsId);
660 FillRawsData(kTimeL0TRU,iTRUAbsId, startBin);
661 triggers[iTRUAbsId][startBin] = 1;
663 if((int)startBin < firstL0TimeBin) firstL0TimeBin = startBin;
672 if ( in.IsLowGain() || in.IsHighGain() ) { // regular towers
673 Int_t towerId = iSM*nTowersPerSM + in.GetColumn()*nRows + in.GetRow();
674 if ( in.IsLowGain() ) {
676 if ( (amp > fMinSignalLG) && (amp < fMaxSignalLG) ) {
677 FillRawsData(kSigLG,towerId, amp);
678 FillRawsData(kTimeLG,towerId, time);
681 for (Int_t i=0; i<nPed; i++) {
682 FillRawsData(kPedLG,towerId, pedSamples[i]);
686 else if ( in.IsHighGain() ) {
688 if ( (amp > fMinSignalHG) && (amp < fMaxSignalHG) ) {
689 FillRawsData(kSigHG,towerId, amp);
690 FillRawsData(kTimeHG,towerId, time);
693 for (Int_t i=0; i<nPed; i++) {
694 FillRawsData(kPedHG,towerId, pedSamples[i]);
698 } // low or high gain
700 else if ( in.IsTRUData() && in.GetColumn()<AliEMCALGeoParams::fgkEMCAL2x2PerTRU) {
701 // for TRU data, the mapping class holds the TRU Int_ternal 2x2 number (0..95) in the Column var..
702 Int_t iTRU = (iRCU*in.GetBranch() + iRCU); //TRU0 is from RCU0, TRU1 from RCU1, TRU2 is from branch B on RCU1
703 Int_t iTRU2x2Id = iSM*n2x2PerSM + iTRU*AliEMCALGeoParams::fgkEMCAL2x2PerTRU
706 if ( (amp > fMinSignalTRU) && (amp < fMaxSignalTRU) ) {
707 FillRawsData(kSigTRU,iTRU2x2Id, amp);
708 //FillRawsData(kTimeTRU,iTRU2x2Id, time);
711 //for (Int_t i=0; i<nPed; i++) {
712 //FillRawsData(kPedTRU,iTRU2x2Id, pedSamples[i]);
717 else if ( in.IsLEDMonData() ) {
718 // for LED Mon data, the mapping class holds the gain info in the Row variable
719 // and the Strip number in the Column..
720 Int_t gain = in.GetRow();
721 Int_t stripId = iSM*nStripsPerSM + in.GetColumn();
724 nTotalSMLGLEDMon[iSM]++;
725 if ( (amp > fMinSignalLGLEDMon) && (amp < fMaxSignalLGLEDMon) ) {
726 FillRawsData(kSigLGLEDMon,stripId, amp);
727 FillRawsData(kTimeLGLEDMon,stripId, time);
730 for (Int_t i=0; i<nPed; i++) {
731 FillRawsData(kPedLGLEDMon,stripId, pedSamples[i]);
735 else if ( gain == 1 ) {
736 nTotalSMHGLEDMon[iSM]++;
737 if ( (amp > fMinSignalHGLEDMon) && (amp < fMaxSignalHGLEDMon) ) {
738 FillRawsData(kSigHGLEDMon,stripId, amp);
739 FillRawsData(kTimeHGLEDMon,stripId, time);
742 for (Int_t i=0; i<nPed; i++) {
743 FillRawsData(kPedHGLEDMon,stripId, pedSamples[i]);
746 } // low or high gain
751 } // nsamples>0 check, some data found for this channel; not only trailer/header
752 }// end while over channel
754 }//end while over DDL's, of input stream
755 //filling some L0 trigger histos
756 if( firstL0TimeBin < 999 ){
757 for(Int_t i = 0; i < nTot2x2; i++) {
758 if( triggers[i][firstL0TimeBin] > 0 ) {
760 FillRawsData(kNL0FirstTRU, i);
761 FillRawsData(kTimeL0FirstTRU, i, firstL0TimeBin);
766 //calculate the ratio of the amplitude and fill the histograms, only if the events type is Calib
767 // RS: operation on the group of histos kSigHG,k2DRatioAmp,kRatioDist,kLEDMonRatio,kLEDMonRatio,kSigLGLEDMon
768 const int hGrp[] = {kSigHG,k2DRatioAmp,kRatioDist,kLEDMonRatio,kLEDMonRatioDist,kSigLGLEDMon};
769 if ( rawReader->GetType() == AliRawEventHeaderBase::kCalibrationEvent &&
770 CheckCloningConsistency(fRawsQAList, hGrp, sizeof(hGrp)/sizeof(int)) ) { // RS converting original code to loop over all matching triggers
771 int nTrig =IsClonedPerTrigClass(kSigHG,fRawsQAList) ? GetNEventTrigClasses() : 0; // loop over triggers only if histos were cloned
773 for (int itr=-1;itr<nTrig;itr++) { // start from -1 to acknowledge original histos if they were kept
774 TObjArray* trArr = GetMatchingRawsHistosSet(hGrp, sizeof(hGrp)/sizeof(int) ,itr);
775 if (!trArr) continue; // no histos for current trigger
777 Double_t binContent = 0.;
778 TProfile* prSigHG = (TProfile *)trArr->At(0); //kSigHG
779 TH1* th2DRatioAmp = (TH1*) trArr->At(1); //k2DRatioAmp
780 TH1* thRatioDist = (TH1*) trArr->At(2); //kRatioDist
781 TH1* thLEDMonRatio = (TH1*) trArr->At(3); //kLEDMonRatio
782 TH1* thLEDMonRatioDist = (TH1*) trArr->At(4); //kLEDMonRatio
783 TH1* hSigLGLEDMon = (TH1*) trArr->At(5); //kSigLGLEDMon
784 th2DRatioAmp->Reset("ICE");
785 thRatioDist->Reset("ICE");
786 thLEDMonRatio->Reset("ICE");
787 thLEDMonRatioDist->Reset("ICE");
788 th2DRatioAmp->ResetStats();
789 thRatioDist->ResetStats();
790 thLEDMonRatio->ResetStats();
791 thLEDMonRatioDist->ResetStats();
792 ConvertProfile2H(prSigHG, fHighEmcHistoH2F);
794 for(Int_t ix = 1; ix <= fHighEmcHistoH2F->GetNbinsX(); ix++) {
795 for(Int_t iy = 1; iy <= fHighEmcHistoH2F->GetNbinsY(); iy++) {
796 if(fCalibRefHistoH2F->GetBinContent(ix, iy))
797 binContent = fHighEmcHistoH2F->GetBinContent(ix, iy)/fCalibRefHistoH2F->GetBinContent(ix, iy);
798 th2DRatioAmp->SetBinContent(ix, iy, binContent);
799 thRatioDist->Fill(binContent);
803 //Now for LED monitor system, to calculate the ratio as well
804 Double_t binError = 0. ;
805 // for the binError, we add the relative errors, squared
806 Double_t relativeErrorSqr = 0. ;
808 for(int ib = 1; ib <= fLEDMonRefHistoPro->GetNbinsX(); ib++) {
810 if(fLEDMonRefHistoPro->GetBinContent(ib) != 0) {
811 binContent = hSigLGLEDMon->GetBinContent(ib) / fLEDMonRefHistoPro->GetBinContent(ib);
813 relativeErrorSqr = TMath::Power( (fLEDMonRefHistoPro->GetBinError(ib) / fLEDMonRefHistoPro->GetBinContent(ib)), 2);
814 if( hSigLGLEDMon->GetBinContent(ib) != 0) {
815 relativeErrorSqr += TMath::Power( (hSigLGLEDMon->GetBinError(ib)/hSigLGLEDMon->GetBinContent(ib)), 2);
818 else { // ref. run info is zero
820 relativeErrorSqr = 1;
822 thLEDMonRatio->SetBinContent(ib, binContent);
824 binError = sqrt(relativeErrorSqr) * binContent;
825 thLEDMonRatio->SetBinError(ib, binError);
826 thLEDMonRatioDist->Fill(thLEDMonRatio->GetBinContent(ib));
828 } // loop over eventual trigger clones
830 // let's also fill the SM and event counter histograms
834 Int_t nTotalHGLEDMon = 0;
835 Int_t nTotalLGLEDMon = 0;
836 for (iSM=0; iSM<fSuperModules; iSM++) {
837 nTotalLG += nTotalSMLG[iSM];
838 nTotalHG += nTotalSMHG[iSM];
839 nTotalTRU += nTotalSMTRU[iSM];
840 nTotalLGLEDMon += nTotalSMLGLEDMon[iSM];
841 nTotalHGLEDMon += nTotalSMHGLEDMon[iSM];
842 FillRawsData(kNsmodLG,iSM, nTotalSMLG[iSM]);
843 FillRawsData(kNsmodHG,iSM, nTotalSMHG[iSM]);
844 FillRawsData(kNsmodTRU,iSM, nTotalSMTRU[iSM]);
845 FillRawsData(kNsmodLGLEDMon,iSM, nTotalSMLGLEDMon[iSM]);
846 FillRawsData(kNsmodHGLEDMon,iSM, nTotalSMHGLEDMon[iSM]);
849 FillRawsData(kNtotLG,nTotalLG);
850 FillRawsData(kNtotHG,nTotalHG);
851 FillRawsData(kNtotTRU,nTotalTRU);
852 FillRawsData(kNtotLGLEDMon,nTotalLGLEDMon);
853 FillRawsData(kNtotHGLEDMon,nTotalHGLEDMon);
855 IncEvCountCycleESDs();
856 IncEvCountTotalESDs();
857 SetEventSpecie(saveSpecie) ;
858 // just in case the next rawreader consumer forgets to reset; let's do it here again..
864 //____________________________________________________________________________
865 void AliEMCALQADataMakerRec::MakeDigits()
867 // makes data from Digits
868 FillDigitsData(1,fDigitsArray->GetEntriesFast()) ;
869 TIter next(fDigitsArray) ;
870 AliEMCALDigit * digit ;
871 while ( (digit = dynamic_cast<AliEMCALDigit *>(next())) ) {
872 FillDigitsData(0, digit->GetAmplitude()) ;
877 //____________________________________________________________________________
878 void AliEMCALQADataMakerRec::MakeDigits(TTree * digitTree)
880 // makes data from Digit Tree
881 // RS: Attention: the counters are increments in the MakeDigits()
883 fDigitsArray->Clear("C") ;
885 fDigitsArray = new TClonesArray("AliEMCALDigit", 1000) ;
887 TBranch * branch = digitTree->GetBranch("EMCAL") ;
888 if ( ! branch ) { AliWarning("EMCAL branch in Digit Tree not found"); return; }
890 branch->SetAddress(&fDigitsArray) ;
891 branch->GetEntry(0) ;
894 IncEvCountCycleDigits();
895 IncEvCountTotalDigits();
899 //____________________________________________________________________________
900 void AliEMCALQADataMakerRec::MakeRecPoints(TTree * clustersTree)
902 // makes data from RecPoints
903 TBranch *emcbranch = clustersTree->GetBranch("EMCALECARP");
905 AliError("can't get the branch with the EMCAL clusters !");
909 TObjArray * emcRecPoints = new TObjArray(100) ;
910 emcbranch->SetAddress(&emcRecPoints);
911 emcbranch->GetEntry(0);
913 FillRecPointsData(kRecPM,emcRecPoints->GetEntriesFast()) ;
914 TIter next(emcRecPoints) ;
915 AliEMCALRecPoint * rp ;
916 while ( (rp = dynamic_cast<AliEMCALRecPoint *>(next())) ) {
917 FillRecPointsData(kRecPE,rp->GetEnergy()) ;
918 FillRecPointsData(kRecPDigM,rp->GetMultiplicity());
920 emcRecPoints->Delete();
922 IncEvCountCycleRecPoints();
923 IncEvCountTotalRecPoints();
926 //____________________________________________________________________________
927 void AliEMCALQADataMakerRec::StartOfDetectorCycle()
929 //Detector specific actions at start of cycle
933 //____________________________________________________________________________
934 void AliEMCALQADataMakerRec::SetFittingAlgorithm(Int_t fitAlgo)
936 //Set fitting algorithm and initialize it if this same algorithm was not set before.
937 //printf("**** Set Algorithm , number %d ****\n",fitAlgo);
940 fRawAnalyzer = AliCaloRawAnalyzerFactory::CreateAnalyzer(fitAlgo);
941 fFittingAlgorithm = fitAlgo;
944 if(fitAlgo == fFittingAlgorithm && fRawAnalyzer) {
945 //Do nothing, this same algorithm already set before.
946 //printf("**** Algorithm already set before, number %d, %s ****\n",fitAlgo, fRawAnalyzer->GetName());
949 //Initialize the requested algorithm
950 if(fitAlgo != fFittingAlgorithm || !fRawAnalyzer) {
951 //printf("**** Init Algorithm , number %d ****\n",fitAlgo);
953 fFittingAlgorithm = fitAlgo;
954 if (fRawAnalyzer) delete fRawAnalyzer; // delete prev. analyzer if existed.
956 if (fitAlgo == kFastFit) {
957 fRawAnalyzer = new AliCaloRawAnalyzerFastFit();
959 else if (fitAlgo == kNeuralNet) {
960 fRawAnalyzer = new AliCaloRawAnalyzerNN();
962 else if (fitAlgo == kLMS) {
963 fRawAnalyzer = new AliCaloRawAnalyzerLMS();
965 else if (fitAlgo == kPeakFinder) {
966 fRawAnalyzer = new AliCaloRawAnalyzerPeakFinder();
968 else if (fitAlgo == kCrude) {
969 fRawAnalyzer = new AliCaloRawAnalyzerCrude();
972 AliWarning("EMCAL QA invalid fit algorithm choice") ;
980 //_____________________________________________________________________________________
981 void AliEMCALQADataMakerRec::ConvertProfile2H(TProfile * p, TH2 * histo)
984 histo->Reset("ICE") ;
987 Int_t nbinsProf = p->GetNbinsX();
989 // loop through the TProfile p and fill the TH2F histo
992 Double_t binContent = 0;
993 Int_t towerNum = 0; // global tower Id
994 // i = 0; // tower Id within SuperModule
995 Int_t iSM = 0; // SuperModule index
996 Int_t iSMSide = 0; // 0=A, 1=C side
997 Int_t iSMSector = 0; // 2 SM's per sector
999 // indices for 2D plots
1003 for (Int_t ibin = 1; ibin <= nbinsProf; ibin++) {
1004 towerNum = (Int_t) p->GetBinCenter(ibin);
1005 binContent = p->GetBinContent(ibin);
1007 // figure out what the tower indices are: col, row within a SuperModule
1008 iSM = towerNum/(AliEMCALGeoParams::fgkEMCALRows * AliEMCALGeoParams::fgkEMCALCols);
1009 col = (towerNum/AliEMCALGeoParams::fgkEMCALRows) % (AliEMCALGeoParams::fgkEMCALCols);
1010 row = towerNum % (AliEMCALGeoParams::fgkEMCALRows);
1012 //DecodeTowerNum(towerNum, &SM, &col, &row);
1013 // then we calculate what the global 2D coord are, based on which SM
1015 iSMSector = iSM / 2;
1018 if (iSMSide == 1) { // C side, shown to the right
1019 col2d = col + AliEMCALGeoParams::fgkEMCALCols;
1021 else { // A side, shown to the left
1025 row2d = row + iSMSector * AliEMCALGeoParams::fgkEMCALRows;
1027 histo->SetBinContent(col2d+1, row2d+1, binContent);