AliPhysics  b24dc27 (b24dc27)
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
AliEMCALTriggerOfflineQAPP.cxx
Go to the documentation of this file.
1 /**************************************************************************
2  * Copyright(c) 1998-2016, 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 #include <cstring>
17 #include <fstream>
18 
19 #include <THashList.h>
20 #include <TH1D.h>
21 #include <TH2D.h>
22 #include <TH3D.h>
23 #include <TProfile.h>
24 #include <TObjString.h>
25 #include <TObjArray.h>
26 
27 #include <AliEMCALTriggerPatchInfo.h>
28 #include <AliEMCALTriggerFastOR.h>
29 #include <AliLog.h>
30 #include <AliEMCALGeometry.h>
31 #include <AliVCaloCells.h>
32 #include <AliEMCALTriggerConstants.h>
33 
35 
39 
42  AliEMCALTriggerQA(),
43  fOfflineBadChannels(),
44  fBadChannels(),
45  fDCalPlots(kTRUE),
46  fL0MinTime(7),
47  fL0MaxTime(10),
48  fMinCellAmp(0.),
49  fMinL0FastORAmp(0),
50  fMinL1FastORAmp(0),
51  fHistManager(),
52  fSumOfflineEMCal(0),
53  fSumL0EMCal(0),
54  fSumL1EMCal(0),
55  fSumOfflineDCal(0),
56  fSumL0DCal(0),
57  fSumL1DCal(0),
58  fNCellEMCal(0),
59  fNL0EMCal(0),
60  fNL1EMCal(0),
61  fNCellDCal(0),
62  fNL0DCal(0),
63  fNL1DCal(0),
64  fNTotTRU(0),
65  fMaxFORabsId(0)
66 {
67  for (Int_t i = 0; i < 3; i++) {
68  for (Int_t itype = 0; itype < 6; itype++) {
69  fMaxPatchEMCal[itype][i] = 0;
70  fMaxPatchDCal[itype][i] = 0;
71  }
72  }
73 
74  EnablePatchType(kOnlinePatch, EMCALTrigger::kTMEMCalLevel0, kTRUE);
75  EnablePatchType(kOnlinePatch, EMCALTrigger::kTMEMCalGammaL, kTRUE);
76  EnablePatchType(kOnlinePatch, EMCALTrigger::kTMEMCalGammaH, kTRUE);
77  EnablePatchType(kOnlinePatch, EMCALTrigger::kTMEMCalJetL, kTRUE);
78  EnablePatchType(kOnlinePatch, EMCALTrigger::kTMEMCalJetH, kTRUE);
79 
80  EnablePatchType(kRecalcPatch, EMCALTrigger::kTMEMCalLevel0, kTRUE);
81  EnablePatchType(kRecalcPatch, EMCALTrigger::kTMEMCalGammaH, kTRUE);
82  EnablePatchType(kRecalcPatch, EMCALTrigger::kTMEMCalJetH, kTRUE);
83 
84  EnablePatchType(kOfflinePatch, EMCALTrigger::kTMEMCalLevel0, kTRUE);
85  EnablePatchType(kOfflinePatch, EMCALTrigger::kTMEMCalGammaH, kTRUE);
86  EnablePatchType(kOfflinePatch, EMCALTrigger::kTMEMCalJetH, kTRUE);
87 }
88 
93  AliEMCALTriggerQA(name),
94  fOfflineBadChannels(),
95  fBadChannels(),
96  fDCalPlots(kTRUE),
97  fL0MinTime(7),
98  fL0MaxTime(10),
99  fMinCellAmp(0.),
100  fMinL0FastORAmp(0),
101  fMinL1FastORAmp(0),
102  fHistManager(name),
103  fSumOfflineEMCal(0),
104  fSumL0EMCal(0),
105  fSumL1EMCal(0),
106  fSumOfflineDCal(0),
107  fSumL0DCal(0),
108  fSumL1DCal(0),
109  fNCellEMCal(0),
110  fNL0EMCal(0),
111  fNL1EMCal(0),
112  fNCellDCal(0),
113  fNL0DCal(0),
114  fNL1DCal(0),
115  fNTotTRU(0),
116  fMaxFORabsId(0)
117 {
118  for (Int_t i = 0; i < 3; i++) {
119  for (Int_t itype = 0; itype < 6; itype++) {
120  fMaxPatchEMCal[itype][i] = 0;
121  fMaxPatchDCal[itype][i] = 0;
122  }
123  }
124 
125  EnablePatchType(kOnlinePatch, EMCALTrigger::kTMEMCalLevel0, kTRUE);
126  EnablePatchType(kOnlinePatch, EMCALTrigger::kTMEMCalGammaL, kTRUE);
127  EnablePatchType(kOnlinePatch, EMCALTrigger::kTMEMCalGammaH, kTRUE);
128  EnablePatchType(kOnlinePatch, EMCALTrigger::kTMEMCalJetL, kTRUE);
129  EnablePatchType(kOnlinePatch, EMCALTrigger::kTMEMCalJetH, kTRUE);
130 
131  EnablePatchType(kRecalcPatch, EMCALTrigger::kTMEMCalLevel0, kTRUE);
132  EnablePatchType(kRecalcPatch, EMCALTrigger::kTMEMCalGammaH, kTRUE);
133  EnablePatchType(kRecalcPatch, EMCALTrigger::kTMEMCalJetH, kTRUE);
134 
135  EnablePatchType(kOfflinePatch, EMCALTrigger::kTMEMCalLevel0, kTRUE);
136  EnablePatchType(kOfflinePatch, EMCALTrigger::kTMEMCalGammaH, kTRUE);
137  EnablePatchType(kOfflinePatch, EMCALTrigger::kTMEMCalJetH, kTRUE);
138 }
139 
144  AliEMCALTriggerQA(triggerQA),
145  fOfflineBadChannels(triggerQA.fOfflineBadChannels),
146  fBadChannels(),
147  fDCalPlots(kTRUE),
148  fL0MinTime(triggerQA.fL0MinTime),
149  fL0MaxTime(triggerQA.fL0MaxTime),
150  fMinCellAmp(triggerQA.fMinCellAmp),
151  fMinL0FastORAmp(triggerQA.fMinL0FastORAmp),
152  fMinL1FastORAmp(triggerQA.fMinL1FastORAmp),
153  fHistManager(triggerQA.GetName()),
154  fSumOfflineEMCal(0),
155  fSumL0EMCal(0),
156  fSumL1EMCal(0),
157  fSumOfflineDCal(0),
158  fSumL0DCal(0),
159  fSumL1DCal(0),
160  fNCellEMCal(0),
161  fNL0EMCal(0),
162  fNL1EMCal(0),
163  fNCellDCal(0),
164  fNL0DCal(0),
165  fNL1DCal(0),
166  fNTotTRU(0),
167  fMaxFORabsId(0)
168 {
169  for (Int_t i = 0; i < 3; i++) {
170  for (Int_t itype = 0; itype < 6; itype++) {
171  fMaxPatchEMCal[itype][i] = 0;
172  fMaxPatchDCal[itype][i] = 0;
173  }
174  }
175 }
176 
179 {
180 }
181 
186 {
187  Short_t absId = 0;
188 
189  while (stream.good()) {
190  stream >> absId;
191  AddOfflineBadChannel(absId);
192  }
193 }
194 
199 {
200  std::ifstream file(fname);
202 }
203 
208 {
209  Short_t absId = -1;
210 
211  while (stream.good()) {
212  stream >> absId;
213  AddFastORBadChannel(absId);
214  }
215 }
216 
221 {
222  std::ifstream file(fname);
224 }
225 
228 {
229  TString hname;
230  TString htitle;
231 
232  // Geometry object not available at this stage, so need to hardcode some numbers
233  fNTotTRU = 32; // there are 32 TRU in the EMCal (10 full SM * 3 TRU + 2 small SM * 1 TRU)
234  Int_t ndet = 1;
235  if (fDCalPlots) {
236  fNTotTRU += 20; // there are additional 14 TRU in DCal, some skip in between (see below)
237  ndet += 1;
238  }
239  fMaxFORabsId = fNTotTRU * 96; // there are 96 channels in each TRU
240 
241  if (fTimeStampBinWidth > 0) fHistManager.CreateHistoGroup("ByTimeStamp");
242  fHistManager.CreateHistoGroup("ByTRU");
243 
244  hname = "EMCTRQA_histFastORL0";
245  htitle = "EMCTRQA_histFastORL0;FastOR abs. ID;entries above 0";
246  fHistManager.CreateTH1(hname, htitle, fMaxFORabsId, 0, fMaxFORabsId);
247 
248  hname = "EMCTRQA_histLargeAmpFastORL0";
249  htitle = TString::Format("EMCTRQA_histLargeAmpFastORL0 (>%d);FastOR abs. ID;entries above %d", fFastorL0Th, fFastorL0Th);
250  fHistManager.CreateTH1(hname, htitle, fMaxFORabsId, 0, fMaxFORabsId);
251 
252  hname = "EMCTRQA_histFastORL0Amp";
253  htitle = "EMCTRQA_histFastORL0Amp;FastOR abs. ID;ADC counts";
254  fHistManager.CreateTH2(hname, htitle, fMaxFORabsId, 0, fMaxFORabsId, 1024, 0, 4096);
255 
256  hname = "EMCTRQA_histFastORL0Time";
257  htitle = "EMCTRQA_histFastORL0Time;FastOR abs. ID;time";
258  fHistManager.CreateTH2(hname, htitle, fMaxFORabsId, 0, fMaxFORabsId, 21, -1, 20);
259 
260  hname = "EMCTRQA_histFastORL0AmpVsTime";
261  htitle = "EMCTRQA_histFastORL0AmpVsTime;time;amplitude";
262  fHistManager.CreateTH2(hname, htitle, 21, -1, 20, 1024, 0, 4096);
263 
264  hname = "EMCTRQA_histFastORL0TimeOk";
265  htitle = TString::Format("EMCTRQA_histFastORL0TimeOk;FastOR abs. ID;entries (%d < time < %d)", fL0MinTime, fL0MaxTime);
266  fHistManager.CreateTH1(hname, htitle, fMaxFORabsId, 0, fMaxFORabsId);
267 
268  hname = "EMCTRQA_histFastORL0AmpTimeOk";
269  htitle = TString::Format("EMCTRQA_histFastORL0AmpTimeOk;FastOR abs. ID;ADC counts (%d < time < %d)", fL0MinTime, fL0MaxTime);
270  fHistManager.CreateTH2(hname, htitle, fMaxFORabsId, 0, fMaxFORabsId, 1024, 0, 4096);
271 
272  hname = "EMCTRQA_histFastORL1";
273  htitle = "EMCTRQA_histFastORL1;FastOR abs. ID;entries above 0";
274  fHistManager.CreateTH1(hname, htitle, fMaxFORabsId, 0, fMaxFORabsId);
275 
276  hname = "EMCTRQA_histLargeAmpFastORL1";
277  htitle = TString::Format("EMCTRQA_histLargeAmpFastORL1 (>%d);FastOR abs. ID;entries above %d", fFastorL1Th, fFastorL1Th);
278  fHistManager.CreateTH1(hname, htitle, fMaxFORabsId, 0, fMaxFORabsId);
279 
280  hname = "EMCTRQA_histFastORL1Amp";
281  htitle = "EMCTRQA_histFastORL1Amp;FastOR abs. ID;L1 time sum";
282  fHistManager.CreateTH2(hname, htitle, fMaxFORabsId, 0, fMaxFORabsId, 1024, 0, 4096);
283 
284  hname = "EMCTRQA_histFastORL1AmpVsL0Amp";
285  htitle = "EMCTRQA_histFastORL1AmpVsL0Amp;L0 amplitude;L1 time sum;entries";
286  fHistManager.CreateTH2(hname, htitle, 256, 0, 1024, 256, 0, 1024);
287 
288  hname = "EMCTRQA_histCellAmp";
289  htitle = "EMCTRQA_histCellAmp;cell abs. ID;energy (GeV)";
290  fHistManager.CreateTH2(hname, htitle, fMaxFORabsId*4, 0, fMaxFORabsId*4, 400, 0, 200);
291 
292  hname = "EMCTRQA_histCell";
293  htitle = "EMCTRQA_histCell;cell abs. ID;entries above 0 GeV";
294  fHistManager.CreateTH1(hname, htitle, fMaxFORabsId*4, 0, fMaxFORabsId*4);
295 
296  hname = "EMCTRQA_histLargeAmpCell";
297  htitle = TString::Format("EMCTRQA_histLargeAmpCell (>%.1f);cell abs. ID;entries above %.1f GeV", fFastorL1Th * EMCALTrigger::kEMCL1ADCtoGeV, fFastorL1Th * EMCALTrigger::kEMCL1ADCtoGeV);
298  fHistManager.CreateTH1(hname, htitle, fMaxFORabsId*4, 0, fMaxFORabsId*4);
299 
300  hname = "EMCTRQA_histCellAmpVsFastORL0Amp";
301  htitle = "EMCTRQA_histCellAmpVsFastORL0Amp;FastOR L0 amplitude;2x2 cell sum energy (GeV)";
302  fHistManager.CreateTH2(hname, htitle, 1024, 0, 4096, 400, 0, 200);
303 
304  hname = "EMCTRQA_histCellAmpVsFastORL0AmpTriggered";
305  htitle = "EMCTRQA_histCellAmpVsFastORL0AmpTriggered;FastOR L0 amplitude;2x2 cell sum energy (GeV)";
306  fHistManager.CreateTH2(hname, htitle, 1024, 0, 4096, 400, 0, 200);
307 
308  hname = "EMCTRQA_histCellAmpVsFastORL1Amp";
309  htitle = "EMCTRQA_histCellAmpVsFastORL1Amp;FastOR L1 amplitude;2x2 cell sum energy (GeV)";
310  fHistManager.CreateTH2(hname, htitle, 1024, 0, 4096, 400, 0, 200);
311 
312  for (Int_t nTRU = 0; nTRU < fNTotTRU; nTRU++) {
313  if (nTRU == 34 || nTRU == 35 ||
314  nTRU == 40 || nTRU == 41 ||
315  nTRU == 46 || nTRU == 47) continue;
316  hname = TString::Format("ByTRU/EMCTRQA_histCellAmpVsFastORL0AmpTRU%d", nTRU);
317  htitle = TString::Format("ByTRU/EMCTRQA_histCellAmpVsFastORL0Amp%d;FastOR L0 amplitude;2x2 cell sum energy (GeV)", nTRU);
318  fHistManager.CreateTH2(hname, htitle, 256, 0, 1024, 320, 0, 80);
319 
320  hname = TString::Format("ByTRU/EMCTRQA_histCellAmpVsFastORL0AmpTriggeredTRU%d", nTRU);
321  htitle = TString::Format("ByTRU/EMCTRQA_histCellAmpVsFastORL0AmpTriggeredTRU%d;FastOR L0 amplitude;2x2 cell sum energy (GeV)", nTRU);
322  fHistManager.CreateTH2(hname, htitle, 256, 0, 1024, 320, 0, 80);
323 
324  hname = TString::Format("ByTRU/EMCTRQA_histFastORAmpSTUVsTRU%d", nTRU);
325  htitle = TString::Format("ByTRU/EMCTRQA_histFastORAmpSTUVsTRU%d;TRU amplitude;STU amplitude", nTRU);
326  fHistManager.CreateTH2(hname, htitle, 256, 0, 1024, 256, 0, 1024);
327 
328  hname = TString::Format("ByTRU/EMCTRQA_histCellAmpVsFastORL1AmpSTU%d", nTRU);
329  htitle = TString::Format("ByTRU/EMCTRQA_histCellAmpVsFastORL0Amp%d;FastOR L1 amplitude;2x2 cell sum energy (GeV)", nTRU);
330  fHistManager.CreateTH2(hname, htitle, 256, 0, 1024, 320, 0, 80);
331  }
332 
333  hname = "EMCTRQA_histFastORNoOffline";
334  htitle = "EMCTRQA_histFastORNoOffline;FastOR abs. ID;entries with no offline energy";
335  fHistManager.CreateTH1(hname, htitle, fMaxFORabsId, 0, fMaxFORabsId);
336 
337  const char* det[2] = { "EMCal", "DCal" };
338 
339  for (Int_t itrig = 0; itrig < fgkNTriggerTypes; itrig++) {
340 
341  if (IsPatchTypeEnabled(kOfflinePatch, itrig) && IsPatchTypeEnabled(kRecalcPatch, itrig)) {
342  for (Int_t idet = 0; idet < ndet; idet++) {
343  hname = TString::Format("EMCTRQA_hist%s%sMaxOfflineVsRecalc", det[idet], EMCALTrigger::kEMCalTriggerNames[itrig].Data());
344  htitle = TString::Format("EMCTRQA_hist%s%sMaxOfflineVsRecalc;Recalc;Offline;entries", det[idet], EMCALTrigger::kEMCalTriggerNames[itrig].Data());
345  fHistManager.CreateTH2(hname, htitle, fgkMaxPatchAmp[itrig]/fADCperBin, 0, fgkMaxPatchAmp[itrig], fgkMaxPatchAmp[itrig]/fADCperBin, 0, fgkMaxPatchAmp[itrig]);
346 
347  hname = TString::Format("EMCTRQA_hist%s%sOfflineVsRecalc", det[idet], EMCALTrigger::kEMCalTriggerNames[itrig].Data());
348  htitle = TString::Format("EMCTRQA_hist%s%sOfflineVsRecalc;Recalc;Offline;entries", det[idet], EMCALTrigger::kEMCalTriggerNames[itrig].Data());
349  fHistManager.CreateTH2(hname, htitle, fgkMaxPatchAmp[itrig]/fADCperBin, 0, fgkMaxPatchAmp[itrig], fgkMaxPatchAmp[itrig]/fADCperBin, 0, fgkMaxPatchAmp[itrig]);
350  }
351  }
352 
353  for (Int_t itype = 0; itype < fgkNPatchTypes; itype++) {
354  if (!IsPatchTypeEnabled(itype, itrig)) continue;
355  for (Int_t idet = 0; idet < ndet; idet++) {
356  hname = TString::Format("EMCTRQA_hist%sPatchAmp%s%s", det[idet], EMCALTrigger::kEMCalTriggerNames[itrig].Data(), fgkPatchTypes[itype].Data());
357  htitle = TString::Format("EMCTRQA_hist%sPatchAmp%s%s;amplitude;entries", det[idet], EMCALTrigger::kEMCalTriggerNames[itrig].Data(), fgkPatchTypes[itype].Data());
358  fHistManager.CreateTH1(hname, htitle, fgkMaxPatchAmp[itrig]/fADCperBin, 0, fgkMaxPatchAmp[itrig]);
359 
360  hname = TString::Format("EMCTRQA_hist%sMaxPatchAmp%s%s", det[idet], EMCALTrigger::kEMCalTriggerNames[itrig].Data(), fgkPatchTypes[itype].Data());
361  htitle = TString::Format("EMCTRQA_hist%sMaxPatchAmp%s%s;amplitude;entries", det[idet], EMCALTrigger::kEMCalTriggerNames[itrig].Data(), fgkPatchTypes[itype].Data());
362  fHistManager.CreateTH1(hname, htitle, fgkMaxPatchAmp[itrig]/fADCperBin, 0, fgkMaxPatchAmp[itrig]);
363  }
364 
365  hname = TString::Format("EMCTRQA_histMaxEdgePos%s%s", EMCALTrigger::kEMCalTriggerNames[itrig].Data(), fgkPatchTypes[itype].Data());
366  htitle = TString::Format("EMCTRQA_histMaxEdgePos%s%s;col;row;entries", EMCALTrigger::kEMCalTriggerNames[itrig].Data(), fgkPatchTypes[itype].Data());
367  fHistManager.CreateTH2(hname, htitle, 48, 0, 48, 105, 0, 105);
368 
369  if (fDCalPlots) {
370  hname = TString::Format("EMCTRQA_histEMCal%sMaxVsDCal%sMax%s", EMCALTrigger::kEMCalTriggerNames[itrig].Data(), EMCALTrigger::kEMCalTriggerNames[itrig].Data(), fgkPatchTypes[itype].Data());
371  htitle = TString::Format("EMCTRQA_histEMCal%sMaxVsDCal%sMax%s;DCal %s max;EMCal %s max;entries", EMCALTrigger::kEMCalTriggerNames[itrig].Data(), EMCALTrigger::kEMCalTriggerNames[itrig].Data(), EMCALTrigger::kEMCalTriggerNames[itrig].Data(), EMCALTrigger::kEMCalTriggerNames[itrig].Data(), fgkPatchTypes[itype].Data());
372  fHistManager.CreateTH2(hname, htitle, fgkMaxPatchAmp[itrig]/fADCperBin, 0, fgkMaxPatchAmp[itrig], fgkMaxPatchAmp[itrig]/fADCperBin, 0, fgkMaxPatchAmp[itrig]);
373  }
374  }
375  }
376 
377  for (Int_t itype = 0; itype < fgkNPatchTypes; itype++) {
378  for (Int_t itrig = 0; itrig < fgkNTriggerTypes; itrig++) {
379  if (!IsPatchTypeEnabled(itype, itrig)) continue;
380  for (Int_t itrig2 = itrig+1; itrig2 < 6; itrig2++) {
381  if (!IsPatchTypeEnabled(itype, itrig2)) continue;
382 
383  hname = TString::Format("EMCTRQA_histEMCal%sMaxVsEMCal%sMax%s", EMCALTrigger::kEMCalTriggerNames[itrig].Data(), EMCALTrigger::kEMCalTriggerNames[itrig2].Data(), fgkPatchTypes[itype].Data());
384  htitle = TString::Format("EMCTRQA_histEMCal%sMaxVsEMCal%sMax%s;EMCal %s max;EMCal %s max;entries", EMCALTrigger::kEMCalTriggerNames[itrig].Data(), EMCALTrigger::kEMCalTriggerNames[itrig2].Data(), fgkPatchTypes[itype].Data(), EMCALTrigger::kEMCalTriggerNames[itrig2].Data(), EMCALTrigger::kEMCalTriggerNames[itrig].Data());
385  fHistManager.CreateTH2(hname, htitle, fgkMaxPatchAmp[itrig2]/fADCperBin, 0, fgkMaxPatchAmp[itrig2], fgkMaxPatchAmp[itrig]/fADCperBin, 0, fgkMaxPatchAmp[itrig]);
386 
387 
388  if (fDCalPlots) {
389  hname = TString::Format("EMCTRQA_histDCal%sMaxVsDCal%sMax%s", EMCALTrigger::kEMCalTriggerNames[itrig].Data(), EMCALTrigger::kEMCalTriggerNames[itrig2].Data(), fgkPatchTypes[itype].Data());
390  htitle = TString::Format("EMCTRQA_histDCal%sMaxVsDCal%sMax%s;DCal %s max;DCal %s max;entries", EMCALTrigger::kEMCalTriggerNames[itrig].Data(), EMCALTrigger::kEMCalTriggerNames[itrig2].Data(), fgkPatchTypes[itype].Data(), EMCALTrigger::kEMCalTriggerNames[itrig2].Data(), EMCALTrigger::kEMCalTriggerNames[itrig].Data());
391  fHistManager.CreateTH2(hname, htitle, fgkMaxPatchAmp[itrig2]/fADCperBin, 0, fgkMaxPatchAmp[itrig2], fgkMaxPatchAmp[itrig]/fADCperBin, 0, fgkMaxPatchAmp[itrig]);
392 
393  hname = TString::Format("EMCTRQA_histEMCal%sMaxVsDCal%sMax%s", EMCALTrigger::kEMCalTriggerNames[itrig].Data(), EMCALTrigger::kEMCalTriggerNames[itrig2].Data(), fgkPatchTypes[itype].Data());
394  htitle = TString::Format("EMCTRQA_histEMCal%sMaxVsDCal%sMax%s;DCal %s max;EMCal %s max;entries", EMCALTrigger::kEMCalTriggerNames[itrig].Data(), EMCALTrigger::kEMCalTriggerNames[itrig2].Data(), fgkPatchTypes[itype].Data(), EMCALTrigger::kEMCalTriggerNames[itrig2].Data(), EMCALTrigger::kEMCalTriggerNames[itrig].Data());
395  fHistManager.CreateTH2(hname, htitle, fgkMaxPatchAmp[itrig2]/fADCperBin, 0, fgkMaxPatchAmp[itrig2], fgkMaxPatchAmp[itrig]/fADCperBin, 0, fgkMaxPatchAmp[itrig]);
396 
397  hname = TString::Format("EMCTRQA_histDCal%sMaxVsEMCal%sMax%s", EMCALTrigger::kEMCalTriggerNames[itrig].Data(), EMCALTrigger::kEMCalTriggerNames[itrig2].Data(), fgkPatchTypes[itype].Data());
398  htitle = TString::Format("EMCTRQA_histDCal%sMaxVsEMCal%sMax%s;EMCal %s max;DCal %s max;entries", EMCALTrigger::kEMCalTriggerNames[itrig].Data(), EMCALTrigger::kEMCalTriggerNames[itrig2].Data(), fgkPatchTypes[itype].Data(), EMCALTrigger::kEMCalTriggerNames[itrig2].Data(), EMCALTrigger::kEMCalTriggerNames[itrig].Data());
399  fHistManager.CreateTH2(hname, htitle, fgkMaxPatchAmp[itrig2]/fADCperBin, 0, fgkMaxPatchAmp[itrig2], fgkMaxPatchAmp[itrig]/fADCperBin, 0, fgkMaxPatchAmp[itrig]);
400  }
401  }
402  }
403  }
404 
405  for (Int_t idet = 0; idet < ndet; idet++) {
406  hname = TString::Format("EMCTRQA_hist%sOfflineSumVsL0Sum", det[idet]);
407  htitle = hname + ";Sum of L0 amplitudes;Sum of cell energies (GeV)";
408  fHistManager.CreateTH2(hname, htitle, 250, 0, 5000, 400, 0, 200);
409 
410  hname = TString::Format("EMCTRQA_hist%sOfflineSumVsL1Sum", det[idet]);
411  htitle = hname + ";Sum of L1 amplitudes;Sum of cell energies (GeV)";
412  fHistManager.CreateTH2(hname, htitle, 250, 0, 5000, 400, 0, 200);
413 
414  hname = TString::Format("EMCTRQA_hist%sL1SumVsL0Sum", det[idet]);
415  htitle = hname + ";Sum of L0 amplitudes;Sum of L1 amplitudes";
416  fHistManager.CreateTH2(hname, htitle, 250, 0, 5000, 250, 0, 5000);
417 
418  hname = TString::Format("EMCTRQA_hist%sNCellVsNL0", det[idet]);
419  htitle = hname + ";Number of L0 FastORs;Number of cells";
420  fHistManager.CreateTH2(hname, htitle, 250, 0, 500, 250, 0, 2000);
421 
422  hname = TString::Format("EMCTRQA_hist%sNCellVsNL1", det[idet]);
423  htitle = hname + ";Number of L1 FastORs;Number of cells";
424  fHistManager.CreateTH2(hname, htitle, 250, 0, 500, 250, 0, 2000);
425 
426  hname = TString::Format("EMCTRQA_hist%sNL1VsNL0", det[idet]);
427  htitle = hname + ";Number of L0 FastORs;Number of L1 FastORs";
428  fHistManager.CreateTH2(hname, htitle, 250, 0, 500, 250, 0, 500);
429  }
430 }
431 
436 void AliEMCALTriggerOfflineQAPP::ProcessPatch(const AliEMCALTriggerPatchInfo* patch)
437 {
438  TString hname;
439 
440  Bool_t (AliEMCALTriggerPatchInfo::* triggerCheck[fgkNPatchTypes][fgkNTriggerTypes])(void) const = {
441  { &AliEMCALTriggerPatchInfo::IsLevel0,
442  &AliEMCALTriggerPatchInfo::IsGammaLow,
443  &AliEMCALTriggerPatchInfo::IsGammaHigh,
444  &AliEMCALTriggerPatchInfo::IsJetLow,
445  &AliEMCALTriggerPatchInfo::IsJetHigh,
446  &AliEMCALTriggerPatchInfo::IsBkg
447  },
448  { &AliEMCALTriggerPatchInfo::IsLevel0Recalc,
449  &AliEMCALTriggerPatchInfo::IsGammaLowRecalc,
450  &AliEMCALTriggerPatchInfo::IsGammaHighRecalc,
451  &AliEMCALTriggerPatchInfo::IsJetLowRecalc,
452  &AliEMCALTriggerPatchInfo::IsJetHighRecalc,
453  &AliEMCALTriggerPatchInfo::IsBkgRecalc
454  },
455  { &AliEMCALTriggerPatchInfo::IsLevel0Simple,
456  &AliEMCALTriggerPatchInfo::IsGammaLowSimple,
457  &AliEMCALTriggerPatchInfo::IsGammaHighSimple,
458  &AliEMCALTriggerPatchInfo::IsJetLowSimple,
459  &AliEMCALTriggerPatchInfo::IsJetHighSimple,
460  &AliEMCALTriggerPatchInfo::IsBkgSimple
461  }
462  };
463 
464  TString det;
465 
466  if (patch->IsEMCal()) {
467  det = "EMCal";
468  }
469  else if (patch->IsDCalPHOS()) {
470  if (!fDCalPlots) return;
471  det = "DCal";
472  }
473  else {
474  AliWarning(Form("Patch is not EMCal nor DCal/PHOS (pos: %d, %d)", patch->GetRowStart(), patch->GetColStart()));
475  }
476 
477  for (Int_t itrig = 0; itrig < fgkNTriggerTypes; itrig++) {
478  if (IsPatchTypeEnabled(kRecalcPatch, itrig) && IsPatchTypeEnabled(kOfflinePatch, itrig)) {
479  hname = TString::Format("EMCTRQA_hist%s%sOfflineVsRecalc", det.Data(), EMCALTrigger::kEMCalTriggerNames[itrig].Data());
480  fHistManager.FillTH2(hname, GetAmplitude(patch, kRecalcPatch) , GetAmplitude(patch, kOfflinePatch));
481  }
482 
483  for (Int_t itype = 0; itype < fgkNPatchTypes; itype++) {
484  if (!IsPatchTypeEnabled(itype, itrig)) continue;
485 
486  if (!(patch->*(triggerCheck[itype][itrig]))()) continue;
487 
488  if (patch->IsEMCal()) {
489  if (GetAmplitude(fMaxPatchEMCal[itrig][itype], itype) < GetAmplitude(patch, itype)) fMaxPatchEMCal[itrig][itype] = patch;
490  }
491  else if (patch->IsDCalPHOS()) {
492  if (GetAmplitude(fMaxPatchDCal[itrig][itype], itype) < GetAmplitude(patch, itype)) fMaxPatchDCal[itrig][itype] = patch;
493  }
494 
495  hname = Form("EMCTRQA_hist%sPatchAmp%s%s", det.Data(), EMCALTrigger::kEMCalTriggerNames[itrig].Data(), fgkPatchTypes[itype].Data());
496  fHistManager.FillTH1(hname, GetAmplitude(patch, itype));
497  }
498  if (fDebugLevel >= 2) {
499  Printf("Type = %s; global pos = (%d, %d); Amp (online) = %d; Amp (offline) = %d; Patch energy = %.3f\n"
500  "Position (CM): Eta=%.3f, Phi=%.3f\n"
501  "Position (Geo): Eta=%.3f, Phi=%.3f\n",
502  EMCALTrigger::kEMCalTriggerNames[itrig].Data(), patch->GetRowStart(), patch->GetColStart(), patch->GetADCAmp(), patch->GetADCOfflineAmp(), patch->GetPatchE(),
503  patch->GetEtaCM(), patch->GetPhiCM(),
504  patch->GetEtaGeo(), patch->GetPhiGeo());
505  }
506  }
507 }
508 
513 void AliEMCALTriggerOfflineQAPP::ProcessCell(const AliEMCALCellInfo& cell)
514 {
515  TString hname;
516 
517  if (fGeom) {
518  Double_t pos[3] = {0};
519  fGeom->GetGlobal(cell.fAbsId, pos);
520  if (fGeom->IsInDCAL(pos[0], pos[1], pos[2])) {
521  if (!fDCalPlots) return;
522  fSumOfflineDCal += cell.fEnergy;
523  fNCellDCal++;
524  }
525  else if (fGeom->IsInEMCAL(pos[0], pos[1], pos[2])) {
526  fSumOfflineEMCal += cell.fEnergy;
527  fNCellEMCal++;
528  }
529  else {
530  AliWarning(Form("Cell with absolute ID %hd was not identified as neither DCal or EMCal!!", cell.fAbsId));
531  }
532  }
533 
534  if (fOfflineBadChannels.find(cell.fAbsId) != fOfflineBadChannels.end()) return;
535 
536  if (cell.fEnergy < fMinCellAmp) return;
537 
538  hname = "EMCTRQA_histCell";
539  fHistManager.FillTH1(hname, cell.fAbsId);
540 
541  hname = "EMCTRQA_histCellAmp";
542  fHistManager.FillTH2(hname, cell.fAbsId, cell.fEnergy);
543 
544  if (cell.fEnergy > fFastorL1Th * EMCALTrigger::kEMCL1ADCtoGeV) {
545  hname = "EMCTRQA_histLargeAmpCell";
546  fHistManager.FillTH1(hname, cell.fAbsId);
547  }
548 }
549 
554 void AliEMCALTriggerOfflineQAPP::ProcessFastor(const AliEMCALTriggerFastOR* fastor, AliVCaloCells* cells)
555 {
556  TString hname;
557 
558  if (fBadChannels.find(fastor->GetAbsId()) != fBadChannels.end()) return;
559 
560  Bool_t isDCal = kFALSE;
561 
562  Double_t offlineAmp = 0;
563  Int_t nTRU = -1;
564  Int_t nADC = -1;
565  Int_t iSM = -1;
566  Int_t iEta = -1;
567  Int_t iPhi = -1;
568 
569  if (fGeom) {
570  fGeom->GetPositionInSMFromAbsFastORIndex(fastor->GetAbsId(), iSM, iEta, iPhi);
571  isDCal = fGeom->IsDCALSM(iSM);
572  if (isDCal && !fDCalPlots) return;
573 
574  Int_t idx[4] = {-1};
575  fGeom->GetCellIndexFromFastORIndex(fastor->GetAbsId(), idx);
576  fGeom->GetTRUFromAbsFastORIndex(fastor->GetAbsId(), nTRU, nADC);
577 
578  if (nTRU >= fNTotTRU || nTRU < 0 ||
579  nTRU == 34 || nTRU == 35 ||
580  nTRU == 40 || nTRU == 41 ||
581  nTRU == 46 || nTRU == 47) {
582  if (fastor->GetL0Amp() > 0) AliError(Form("FastOR with abs ID %d (amp = %u) and TRU number %d: this TRU does not exist!!", fastor->GetAbsId(), fastor->GetL0Amp(), nTRU));
583  return;
584  }
585 
586  if (idx[0] >= 0) {
587  if (fastor->GetL0Amp() > fMinL0FastORAmp) {
588  if (cells) {
589  for (Int_t i = 0; i < 4; i++) {
590  offlineAmp += cells->GetCellAmplitude(idx[i]);
591  }
592  }
593  }
594  }
595  }
596 
597  if (fastor->GetL0Amp() > fMinL0FastORAmp) {
598  if (fTimeStampBinWidth > 0) {
599  hname = TString::Format("ByTimeStamp/EMCTRQA_histFastORL0_%u_%u", fEventTimeStampBin, fEventTimeStampBin+fTimeStampBinWidth);
600  fHistManager.FillTH1(hname, fastor->GetAbsId());
601  }
602 
603  hname = "EMCTRQA_histFastORL0";
604  fHistManager.FillTH1(hname, fastor->GetAbsId());
605 
606  hname = "EMCTRQA_histFastORL0Amp";
607  fHistManager.FillTH2(hname, fastor->GetAbsId(), fastor->GetL0Amp());
608 
609  hname = "EMCTRQA_histFastORL0Time";
610  fHistManager.FillTH2(hname, fastor->GetAbsId(), fastor->GetL0Time());
611 
612  hname = "EMCTRQA_histFastORL0AmpVsTime";
613  fHistManager.FillTH2(hname, fastor->GetL0Time(), fastor->GetL0Amp());
614 
615  if (fastor->GetL0Time() > fL0MinTime && fastor->GetL0Time() < fL0MaxTime) {
616  hname = "EMCTRQA_histFastORL0TimeOk";
617  fHistManager.FillTH1(hname, fastor->GetAbsId());
618 
619  hname = "EMCTRQA_histFastORL0AmpTimeOk";
620  fHistManager.FillTH2(hname, fastor->GetAbsId(), fastor->GetL0Amp());
621 
622  hname = "EMCTRQA_histCellAmpVsFastORL0AmpTriggered";
623  fHistManager.FillTH2(hname, fastor->GetL0Amp(), offlineAmp);
624 
625  hname = TString::Format("ByTRU/EMCTRQA_histCellAmpVsFastORL0AmpTriggeredTRU%d",nTRU);
626  fHistManager.FillTH2(hname, fastor->GetL0Amp(), offlineAmp);
627  }
628 
629  hname = "EMCTRQA_histCellAmpVsFastORL0Amp";
630  fHistManager.FillTH2(hname, fastor->GetL0Amp(), offlineAmp);
631 
632  hname = TString::Format("ByTRU/EMCTRQA_histCellAmpVsFastORL0AmpTRU%d",nTRU);
633  fHistManager.FillTH2(hname, fastor->GetL0Amp(), offlineAmp);
634 
635  if (offlineAmp == 0) {
636  hname = "EMCTRQA_histFastORNoOffline";
637  fHistManager.FillTH1(hname, fastor->GetAbsId());
638  }
639 
640  if (isDCal) {
641  fSumL0DCal += fastor->GetL0Amp();
642  fNL0DCal++;
643  }
644  else {
645  fSumL0EMCal += fastor->GetL0Amp();
646  fNL0EMCal++;
647  }
648  }
649 
650  UInt_t L1ampChopped = (fastor->GetL1Amp() >> 2) * 4;
651  if (fastor->GetL0Amp() > fMinL0FastORAmp || L1ampChopped > fMinL1FastORAmp) {
652  hname = TString::Format("ByTRU/EMCTRQA_histFastORAmpSTUVsTRU%d",nTRU);
653  fHistManager.FillTH2(hname, fastor->GetL0Amp(), L1ampChopped);
654  }
655 
656  if (fastor->GetL0Amp() > fFastorL0Th) {
657  if (fTimeStampBinWidth > 0) {
658  hname = TString::Format("ByTimeStamp/EMCTRQA_histLargeAmpFastORL0_%u_%u", fEventTimeStampBin, fEventTimeStampBin+fTimeStampBinWidth);
659  fHistManager.FillTH1(hname, fastor->GetAbsId());
660  }
661 
662  hname = "EMCTRQA_histLargeAmpFastORL0";
663  fHistManager.FillTH1(hname, fastor->GetAbsId());
664  }
665 
666  if (fastor->GetL1Amp() > fMinL1FastORAmp) {
667  hname = "EMCTRQA_histFastORL1";
668  fHistManager.FillTH1(hname, fastor->GetAbsId());
669 
670  hname = "EMCTRQA_histFastORL1Amp";
671  fHistManager.FillTH2(hname, fastor->GetAbsId(), fastor->GetL1Amp());
672 
673  if (isDCal) {
674  fSumL1DCal += fastor->GetL1Amp();
675  fNL1DCal++;
676  }
677  else {
678  fSumL1EMCal += fastor->GetL1Amp();
679  fNL1EMCal++;
680  }
681 
682  hname = "EMCTRQA_histCellAmpVsFastORL1Amp";
683  fHistManager.FillTH2(hname, fastor->GetL1Amp(), offlineAmp);
684 
685  hname = TString::Format("ByTRU/EMCTRQA_histCellAmpVsFastORL1AmpSTU%d",nTRU);
686  fHistManager.FillTH2(hname, fastor->GetL1Amp(), offlineAmp);
687  }
688 
689  if (fastor->GetL1Amp() > fFastorL1Th) {
690  hname = "EMCTRQA_histLargeAmpFastORL1";
691  fHistManager.FillTH1(hname, fastor->GetAbsId());
692  }
693 
694  if (fastor->GetL1Amp() > fMinL1FastORAmp || fastor->GetL0Amp() > fMinL0FastORAmp) {
695  hname = "EMCTRQA_histFastORL1AmpVsL0Amp";
696  fHistManager.FillTH2(hname, fastor->GetL0Amp(), fastor->GetL1Amp());
697  }
698 }
699 
700 
705 {
706  AliDebug(2, Form("Entering AliEmcalTriggerQAAP::EventCompleted"));
707 
708  TString hname;
709 
710  for (Int_t itrig = 0; itrig < fgkNTriggerTypes; itrig++) {
711  AliDebug(2, Form("Trigger type: %s", EMCALTrigger::kEMCalTriggerNames[itrig].Data()));
712 
713  if (IsPatchTypeEnabled(itrig, kOfflinePatch) && IsPatchTypeEnabled(itrig, kRecalcPatch)) {
714  hname = TString::Format("EMCTRQA_histEMCal%sMaxOfflineVsRecalc", EMCALTrigger::kEMCalTriggerNames[itrig].Data());
715  fHistManager.FillTH2(hname, GetAmplitude(fMaxPatchEMCal[itrig][1], 1), GetAmplitude(fMaxPatchEMCal[itrig][2], 2));
716 
717  if (fDCalPlots) {
718  hname = TString::Format("EMCTRQA_histDCal%sMaxOfflineVsRecalc", EMCALTrigger::kEMCalTriggerNames[itrig].Data());
719  fHistManager.FillTH2(hname, GetAmplitude(fMaxPatchDCal[itrig][1], 1), GetAmplitude(fMaxPatchDCal[itrig][2], 2));
720  }
721  }
722 
723  for (Int_t itype = 0; itype < fgkNPatchTypes; itype++) {
724  if (!IsPatchTypeEnabled(itype, itrig)) continue;
725 
726  AliDebug(2, Form("Patch type %s", fgkPatchTypes[itype].Data()));
727 
728  if (fMaxPatchEMCal[itrig][itype]) {
729  hname = TString::Format("EMCTRQA_histMaxEdgePos%s%s", EMCALTrigger::kEMCalTriggerNames[itrig].Data(), fgkPatchTypes[itype].Data());
730  fHistManager.FillTH2(hname, fMaxPatchEMCal[itrig][itype]->GetColStart(), fMaxPatchEMCal[itrig][itype]->GetRowStart());
731  }
732 
733  hname = TString::Format("EMCTRQA_histEMCalMaxPatchAmp%s%s", EMCALTrigger::kEMCalTriggerNames[itrig].Data(), fgkPatchTypes[itype].Data());
734  fHistManager.FillTH1(hname, GetAmplitude(fMaxPatchEMCal[itrig][itype], itype));
735 
736  if (fDCalPlots) {
737  if (fMaxPatchDCal[itrig][itype]) {
738  hname = TString::Format("EMCTRQA_histMaxEdgePos%s%s", EMCALTrigger::kEMCalTriggerNames[itrig].Data(), fgkPatchTypes[itype].Data());
739  fHistManager.FillTH2(hname, fMaxPatchDCal[itrig][itype]->GetColStart(), fMaxPatchDCal[itrig][itype]->GetRowStart());
740  }
741 
742  hname = TString::Format("EMCTRQA_histDCalMaxPatchAmp%s%s", EMCALTrigger::kEMCalTriggerNames[itrig].Data(), fgkPatchTypes[itype].Data());
743  fHistManager.FillTH1(hname, GetAmplitude(fMaxPatchDCal[itrig][itype], itype));
744 
745  hname = TString::Format("EMCTRQA_histEMCal%sMaxVsDCal%sMax%s", EMCALTrigger::kEMCalTriggerNames[itrig].Data(), EMCALTrigger::kEMCalTriggerNames[itrig].Data(), fgkPatchTypes[itype].Data());
746  fHistManager.FillTH2(hname, GetAmplitude(fMaxPatchDCal[itrig][itype], itype), GetAmplitude(fMaxPatchEMCal[itrig][itype], itype));
747  }
748  }
749  }
750 
751  for (Int_t itype = 0; itype < fgkNPatchTypes; itype++) {
752  for (Int_t itrig = 0; itrig < fgkNTriggerTypes; itrig++) {
753  if (!IsPatchTypeEnabled(itype, itrig)) continue;
754 
755  for (Int_t itrig2 = itrig+1; itrig2 < fgkNTriggerTypes; itrig2++) {
756  if (!IsPatchTypeEnabled(itype, itrig2)) continue;
757 
758  hname = TString::Format("EMCTRQA_histEMCal%sMaxVsEMCal%sMax%s", EMCALTrigger::kEMCalTriggerNames[itrig].Data(), EMCALTrigger::kEMCalTriggerNames[itrig2].Data(), fgkPatchTypes[itype].Data());
759  fHistManager.FillTH2(hname, GetAmplitude(fMaxPatchEMCal[itrig2][itype], itype), GetAmplitude(fMaxPatchEMCal[itrig][itype], itype));
760 
761  if (fDCalPlots) {
762  hname = TString::Format("EMCTRQA_histDCal%sMaxVsDCal%sMax%s", EMCALTrigger::kEMCalTriggerNames[itrig].Data(), EMCALTrigger::kEMCalTriggerNames[itrig2].Data(), fgkPatchTypes[itype].Data());
763  fHistManager.FillTH2(hname, GetAmplitude(fMaxPatchDCal[itrig2][itype], itype), GetAmplitude(fMaxPatchDCal[itrig][itype], itype));
764 
765  hname = TString::Format("EMCTRQA_histEMCal%sMaxVsDCal%sMax%s", EMCALTrigger::kEMCalTriggerNames[itrig].Data(), EMCALTrigger::kEMCalTriggerNames[itrig2].Data(), fgkPatchTypes[itype].Data());
766  fHistManager.FillTH2(hname, GetAmplitude(fMaxPatchDCal[itrig2][itype], itype), GetAmplitude(fMaxPatchEMCal[itrig][itype], itype));
767 
768  hname = TString::Format("EMCTRQA_histDCal%sMaxVsEMCal%sMax%s", EMCALTrigger::kEMCalTriggerNames[itrig].Data(), EMCALTrigger::kEMCalTriggerNames[itrig2].Data(), fgkPatchTypes[itype].Data());
769  fHistManager.FillTH2(hname, GetAmplitude(fMaxPatchEMCal[itrig2][itype], itype), GetAmplitude(fMaxPatchDCal[itrig][itype], itype));
770 
771  }
772  }
773  }
774  }
775 
776  for (Int_t itype = 0; itype < fgkNPatchTypes; itype++) {
777  for (Int_t itrig = 0; itrig < fgkNTriggerTypes; itrig++) {
778  fMaxPatchEMCal[itrig][itype] = 0;
779  fMaxPatchDCal[itrig][itype] = 0;
780  }
781  }
782 
783  fHistManager.FillTH2("EMCTRQA_histEMCalOfflineSumVsL0Sum", fSumL0EMCal, fSumOfflineEMCal);
784  fHistManager.FillTH2("EMCTRQA_histEMCalOfflineSumVsL1Sum", fSumL1EMCal, fSumOfflineEMCal);
785  fHistManager.FillTH2("EMCTRQA_histEMCalL1SumVsL0Sum", fSumL0EMCal, fSumL1EMCal);
786  fHistManager.FillTH2("EMCTRQA_histEMCalNCellVsNL0", fNL0EMCal, fNCellEMCal);
787  fHistManager.FillTH2("EMCTRQA_histEMCalNCellVsNL1", fNL1EMCal, fNCellEMCal);
788  fHistManager.FillTH2("EMCTRQA_histEMCalNL1VsNL0", fNL0EMCal, fNL1EMCal);
789 
790  if (fDCalPlots) {
791  fHistManager.FillTH2("EMCTRQA_histDCalOfflineSumVsL0Sum", fSumL0DCal, fSumOfflineDCal);
792  fHistManager.FillTH2("EMCTRQA_histDCalOfflineSumVsL1Sum", fSumL1DCal, fSumOfflineDCal);
793  fHistManager.FillTH2("EMCTRQA_histDCalL1SumVsL0Sum", fSumL0DCal, fSumL1DCal);
794  fHistManager.FillTH2("EMCTRQA_histDCalNCellVsNL0", fNL0DCal, fNCellDCal);
795  fHistManager.FillTH2("EMCTRQA_histDCalNCellVsNL1", fNL1DCal, fNCellDCal);
796  fHistManager.FillTH2("EMCTRQA_histDCalNL1VsNL0", fNL0DCal, fNL1DCal);
797  }
798 
799  fSumOfflineEMCal = 0;
800  fSumL0EMCal = 0;
801  fSumL1EMCal = 0;
802  fSumOfflineDCal = 0;
803  fSumL0DCal = 0;
804  fSumL1DCal = 0;
805 
806  fNCellEMCal = 0;
807  fNL0EMCal = 0;
808  fNL1EMCal = 0;
809  fNCellDCal = 0;
810  fNL0DCal = 0;
811  fNL1DCal = 0;
812 }
813 
821 {
822  AliEMCALTriggerQA::EventTimeStamp(timeStamp);
823 
824  if (fTimeStampBinWidth > 0) {
825  TString hname = TString::Format("ByTimeStamp/EMCTRQA_histEvents_%u_%u", fEventTimeStampBin, fEventTimeStampBin+fTimeStampBinWidth);
826  if (!fHistManager.FindObject(hname)) {
827  TString htitle;
828 
829  hname = TString::Format("ByTimeStamp/EMCTRQA_histEvents_%u_%u", fEventTimeStampBin, fEventTimeStampBin+fTimeStampBinWidth);
830  htitle = TString::Format("EMCTRQA_histEvents;;events");
831  TH1* hevents = fHistManager.CreateTH1(hname, htitle, 1, 0, 1);
832  hevents->GetXaxis()->SetBinLabel(1, TString::Format("%u <= time stamp < %u", fEventTimeStampBin, fEventTimeStampBin+fTimeStampBinWidth));
833 
834  hname = TString::Format("ByTimeStamp/EMCTRQA_histFastORL0_%u_%u", fEventTimeStampBin, fEventTimeStampBin+fTimeStampBinWidth);
835  htitle = TString::Format("EMCTRQA_histFastORL0;FastOR abs. ID;entries above 0");
836  fHistManager.CreateTH1(hname, htitle, fMaxFORabsId, 0, fMaxFORabsId);
837 
838  hname = TString::Format("ByTimeStamp/EMCTRQA_histLargeAmpFastORL0_%u_%u", fEventTimeStampBin, fEventTimeStampBin+fTimeStampBinWidth);
839  htitle = TString::Format("EMCTRQA_histLargeAmpFastORL0 (>%d);FastOR abs. ID;entries above %d", fFastorL0Th, fFastorL0Th);
840  fHistManager.CreateTH1(hname, htitle, fMaxFORabsId, 0, fMaxFORabsId);
841  }
842 
843  hname = TString::Format("ByTimeStamp/EMCTRQA_histEvents_%u_%u", fEventTimeStampBin, fEventTimeStampBin+fTimeStampBinWidth);
844  fHistManager.FillTH1(hname, 0.);
845  }
846 }
void ProcessCell(const AliEMCALCellInfo &cell)
void ReadFastORBadChannelFromFile(const char *fname)
Int_t fNL0EMCal
! EMCal number of L0 FastORs (will be reset each event)
ClassImp(AliAnalysisTaskTriggerRates) AliAnalysisTaskTriggerRates
AliEMCALTriggerOfflineQAPP()
Dummy constructor for ROOT I/O.
Int_t fSumL1DCal
! DCal sum of all online energy deposition (will be reset each event)
void ReadOfflineBadChannelFromStream(std::istream &stream)
Int_t fNL1DCal
! DCal number of L1 FastORs (will be reset each event)
Int_t fSumL0DCal
! DCal sum of all online energy deposition (will be reset each event)
Int_t fNL0DCal
! DCal number of L0 FastORs (will be reset each event)
std::set< Short_t > fBadChannels
Container of bad channels.
Class to generate EMCal trigger QA plots in pp collisions.
Double_t fMinCellAmp
Minimum offline amplitude of the cells.
virtual ~AliEMCALTriggerOfflineQAPP()
Destructor.
void ProcessFastor(const AliEMCALTriggerFastOR *fastor, AliVCaloCells *cells=0)
Bool_t fDCalPlots
Whether to add DCal QA plots.
Int_t fNL1EMCal
! EMCal number of L1 FastORs (will be reset each event)
Int_t fNTotTRU
! Total number of TRUs
Int_t fMinL1FastORAmp
Minimum L1 amplitude of the FastORs.
void Init()
Initialize the class, i.e. allocate histograms.
Int_t fMaxFORabsId
! Maximum FastOR abs id
const AliEMCALTriggerPatchInfo * fMaxPatchDCal[fgkNTriggerTypes][fgkNPatchTypes]
! DCal max patch (will be reset each event)
Int_t fSumL1EMCal
! EMCal sum of all online energy deposition (will be reset each event)
Int_t fDebugLevel
void ReadFastORBadChannelFromStream(std::istream &stream)
Bool_t Data(TH1F *h, Double_t *rangefit, Bool_t writefit, Double_t &sgn, Double_t &errsgn, Double_t &bkg, Double_t &errbkg, Double_t &sgnf, Double_t &errsgnf, Double_t &sigmafit, Int_t &status)
void ReadOfflineBadChannelFromFile(const char *fname)
std::set< Short_t > fOfflineBadChannels
Abs ID of offline bad channels.
void ProcessPatch(const AliEMCALTriggerPatchInfo *patch)
const AliEMCALTriggerPatchInfo * fMaxPatchEMCal[fgkNTriggerTypes][fgkNPatchTypes]
! EMCal max patch (will be reset each event)
TFile * file
Double_t fSumOfflineDCal
! DCal sum of all offline energy deposition (will be reset each event)
Int_t fNCellEMCal
! EMCal number of offline cells (will be reset each event)
Int_t fSumL0EMCal
! EMCal sum of all online energy deposition (will be reset each event)
Int_t fMinL0FastORAmp
Minimum L0 amplitude of the FastORs.
Double_t fSumOfflineEMCal
! EMCal sum of all offline energy deposition (will be reset each event)
Int_t fNCellDCal
! DCal number of offline cells (will be reset each event)
THistManager fHistManager
Histogram manager.