AliPhysics  608b256 (608b256)
AliEMCALTriggerOfflineLightQAPP.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 <TLinearBinning.h>
21 #include <TH1D.h>
22 #include <TH2D.h>
23 #include <TH3D.h>
24 #include <TProfile.h>
25 #include <TObjString.h>
26 #include <TObjArray.h>
27 
28 #include <AliEMCALTriggerPatchInfo.h>
29 #include <AliEMCALTriggerFastOR.h>
30 #include <AliLog.h>
31 #include <AliEMCALGeometry.h>
32 #include <AliVCaloCells.h>
33 #include <AliEMCALTriggerConstants.h>
34 
36 
40 
43  AliEMCALTriggerQA(),
44  fBadChannels(),
45  fL0MinTime(7),
46  fL0MaxTime(10),
47  fMinL0FastORAmp(0),
48  fMinL1FastORAmp(0),
49  fEnableEnergyCorrelationSM(kFALSE),
50  fHistManager(),
51  fNTotTRU(0),
52  fMaxFORabsId(0)
53 {
54  for (Int_t i = 0; i < 3; i++) {
55  for (Int_t itype = 0; itype < 6; itype++) {
56  fMaxPatchEMCal[itype][i] = 0;
57  fMaxPatchDCal[itype][i] = 0;
58  }
59  }
60 }
61 
66  AliEMCALTriggerQA(name),
67  fBadChannels(),
68  fL0MinTime(7),
69  fL0MaxTime(10),
70  fMinL0FastORAmp(0),
71  fMinL1FastORAmp(0),
73  fHistManager(name),
74  fNTotTRU(0),
75  fMaxFORabsId(0)
76 {
77  for (Int_t i = 0; i < 3; i++) {
78  for (Int_t itype = 0; itype < 6; itype++) {
79  fMaxPatchEMCal[itype][i] = 0;
80  fMaxPatchDCal[itype][i] = 0;
81  }
82  }
83 }
84 
89  AliEMCALTriggerQA(triggerQA),
90  fBadChannels(),
91  fL0MinTime(triggerQA.fL0MinTime),
92  fL0MaxTime(triggerQA.fL0MaxTime),
96  fHistManager(triggerQA.GetName()),
97  fNTotTRU(0),
98  fMaxFORabsId(0)
99 {
100  for (Int_t i = 0; i < 3; i++) {
101  for (Int_t itype = 0; itype < 6; itype++) {
102  fMaxPatchEMCal[itype][i] = 0;
103  fMaxPatchDCal[itype][i] = 0;
104  }
105  }
106 }
107 
110 {
111 }
112 
117 {
118  Short_t absId = -1;
119 
120  while (stream.good()) {
121  stream >> absId;
122  AddFastORBadChannel(absId);
123  }
124 }
125 
130 {
131  std::ifstream file(fname);
133 }
134 
137 {
138  TString hname;
139  TString htitle;
140 
141  // Geometry object not available at this stage, so need to hardcode some numbers
142  fNTotTRU = 32 + 20; // there are 32 TRU in the EMCal (10 full SM * 3 TRU + 2 small SM * 1 TRU)
143  Int_t ndet = 2;
144  fMaxFORabsId = fNTotTRU * 96; // there are 96 channels in each TRU
145 
146  if (fTimeStampBinWidth > 0) fHistManager.CreateHistoGroup("ByTimeStamp");
148 
149  hname = "EMCTRQA_histFastORL0Hits";
150  htitle = "EMCTRQA_histFastORL0Hits;col;row;entries";
151  fHistManager.CreateTH2(hname, htitle, 48, 0, 48, 105, 0, 105);
152 
153  hname = "EMCTRQA_histFastORL0AccumulatedAmplitude";
154  htitle = "EMCTRQA_histFastORL0AccumulatedAmplitude;col;row;accumulated amplitude";
155  fHistManager.CreateTH2(hname, htitle, 48, 0, 48, 105, 0, 105);
156 
157  hname = "EMCTRQA_histFastORL0HitsTriggered";
158  htitle = "EMCTRQA_histFastORL0HitsTriggered;col;row;entries";
159  fHistManager.CreateTH2(hname, htitle, 48, 0, 48, 105, 0, 105);
160 
161  hname = "EMCTRQA_histFastORL0AccumulatedAmplitudeTriggered";
162  htitle = "EMCTRQA_histFastORL0AccumulatedAmplitudeTriggered;col;row;accumulated amplitude";
163  fHistManager.CreateTH2(hname, htitle, 48, 0, 48, 105, 0, 105);
164 
165  hname = "EMCTRQA_histFastORL0Time";
166  htitle = "EMCTRQA_histFastORL0Time;FastOR abs. ID;time";
167  fHistManager.CreateTH2(hname, htitle, fMaxFORabsId, 0, fMaxFORabsId, 21, -1, 20);
168 
169  hname = "EMCTRQA_histFastORL0AmpVsTime";
170  htitle = "EMCTRQA_histFastORL0AmpVsTime;time;amplitude";
171  fHistManager.CreateTH2(hname, htitle, 21, -1, 20, 1024/fADCperBin, 0, 1024);
172 
173  hname = "EMCTRQA_histFastORL1Hits";
174  htitle = "EMCTRQA_histFastORL1Hits;col;row;entries";
175  fHistManager.CreateTH2(hname, htitle, 48, 0, 48, 105, 0, 105);
176 
177  hname = "EMCTRQA_histFastORL1AccumulatedAmplitude";
178  htitle = "EMCTRQA_histFastORL1AccumulatedAmplitude;col;row;accumulated amplitude";
179  fHistManager.CreateTH2(hname, htitle, 48, 0, 48, 105, 0, 105);
180 
181  hname = "EMCTRQA_histFastORL1AmpVsL0Amp";
182  htitle = "EMCTRQA_histFastORL1AmpVsL0Amp;L0 amplitude;L1 time sum;entries";
183  fHistManager.CreateTH2(hname, htitle, 1024/fADCperBin, 0, 1024, 1024/fADCperBin, 0, 1024);
184 
185  hname = "EMCTRQA_histFastORL1AmpVsL0AmpTriggered";
186  htitle = "EMCTRQA_histFastORL1AmpVsL0AmpTriggered;L0 amplitude;L1 time sum;entries";
187  fHistManager.CreateTH2(hname, htitle, 1024/fADCperBin, 0, 1024, 1024/fADCperBin, 0, 1024);
188 
189  hname = "EMCTRQA_histCellAmpVsFastORL0Amp";
190  htitle = "EMCTRQA_histCellAmpVsFastORL0Amp;FastOR L0 amplitude;2x2 cell sum energy (GeV)";
191  fHistManager.CreateTH2(hname, htitle, 1024/fADCperBin, 0, 1024, 1024/fADCperBin, 0, 80);
192 
193  hname = "EMCTRQA_histCellAmpVsFastORL0AmpTriggered";
194  htitle = "EMCTRQA_histCellAmpVsFastORL0AmpTriggered;FastOR L0 amplitude;2x2 cell sum energy (GeV)";
195  fHistManager.CreateTH2(hname, htitle, 1024/fADCperBin, 0, 1024, 1024/fADCperBin, 0, 80);
196 
197  hname = "EMCTRQA_histCellAmpVsFastORL1Amp";
198  htitle = "EMCTRQA_histCellAmpVsFastORL1Amp;FastOR L1 amplitude;2x2 cell sum energy (GeV)";
199  fHistManager.CreateTH2(hname, htitle, 1024/fADCperBin, 0, 1024, 1024/fADCperBin, 0, 80);
200 
202  hname = "EMCTRQA_histCellAmpVsFastORL1AmpSM";
203  htitle = "EMCTRQA_histCellAmpVsFastORL1AmpSM;SM; FastOR L1 amplitude;2x2 cell sum energy (GeV)";
204  TLinearBinning smbinning(21, -1.5, 19.5), energybinning(200, 0., 20.);
205  const TBinning *histsmbinning[3] = {&smbinning, &energybinning, &energybinning};
206  fHistManager.CreateTHnSparse(hname, htitle, 3, histsmbinning);
207  }
208 
209  for (Int_t nTRU = 0; nTRU < fNTotTRU; nTRU++) {
210  if (nTRU == 34 || nTRU == 35 ||
211  nTRU == 40 || nTRU == 41 ||
212  nTRU == 46 || nTRU == 47) continue;
213  hname = TString::Format("ByTRU/EMCTRQA_histCellAmpVsFastORL0AmpTRU%d", nTRU);
214  htitle = TString::Format("ByTRU/EMCTRQA_histCellAmpVsFastORL0Amp%d;FastOR L0 amplitude;2x2 cell sum energy (GeV)", nTRU);
215  fHistManager.CreateTH2(hname, htitle, 1024/fADCperBin, 0, 1024, 1024/fADCperBin, 0, 80);
216 
217  hname = TString::Format("ByTRU/EMCTRQA_histFastORAmpSTUVsTRU%d", nTRU);
218  htitle = TString::Format("ByTRU/EMCTRQA_histFastORAmpSTUVsTRU%d;TRU amplitude;STU amplitude", nTRU);
219  fHistManager.CreateTH2(hname, htitle, 1024/fADCperBin, 0, 1024, 1024/fADCperBin, 0, 1024);
220 
221  hname = TString::Format("ByTRU/EMCTRQA_histCellAmpVsFastORL1AmpSTU%d", nTRU);
222  htitle = TString::Format("ByTRU/EMCTRQA_histCellAmpVsFastORL0Amp%d;FastOR L1 amplitude;2x2 cell sum energy (GeV)", nTRU);
223  fHistManager.CreateTH2(hname, htitle, 1024/fADCperBin, 0, 1024, 1024/fADCperBin, 0, 80);
224  }
225 
226  const char* det[2] = { "EMCal", "DCal" };
227 
228  for (Int_t itrig = 0; itrig < fgkNTriggerTypes; itrig++) {
229 
230  for (Int_t itype = 0; itype < fgkNPatchTypes; itype++) {
231  if (!IsPatchTypeEnabled(itype, itrig)) continue;
232  for (Int_t idet = 0; idet < ndet; idet++) {
233  hname = TString::Format("EMCTRQA_hist%sPatchAmp%s%s", det[idet], EMCALTrigger::kEMCalTriggerNames[itrig].Data(), fgkPatchTypes[itype].Data());
234  htitle = TString::Format("EMCTRQA_hist%sPatchAmp%s%s;amplitude;entries", det[idet], EMCALTrigger::kEMCalTriggerNames[itrig].Data(), fgkPatchTypes[itype].Data());
235  fHistManager.CreateTH1(hname, htitle, fgkMaxPatchAmp[itrig]/fADCperBin, 0, fgkMaxPatchAmp[itrig]);
236 
237  hname = TString::Format("EMCTRQA_hist%sMaxPatchAmp%s%s", det[idet], EMCALTrigger::kEMCalTriggerNames[itrig].Data(), fgkPatchTypes[itype].Data());
238  htitle = TString::Format("EMCTRQA_hist%sMaxPatchAmp%s%s;amplitude;entries", det[idet], EMCALTrigger::kEMCalTriggerNames[itrig].Data(), fgkPatchTypes[itype].Data());
239  fHistManager.CreateTH1(hname, htitle, fgkMaxPatchAmp[itrig]/fADCperBin, 0, fgkMaxPatchAmp[itrig]);
240  }
241 
242  hname = TString::Format("EMCTRQA_histMaxEdgePos%s%s", EMCALTrigger::kEMCalTriggerNames[itrig].Data(), fgkPatchTypes[itype].Data());
243  htitle = TString::Format("EMCTRQA_histMaxEdgePos%s%s;col;row;entries", EMCALTrigger::kEMCalTriggerNames[itrig].Data(), fgkPatchTypes[itype].Data());
244  fHistManager.CreateTH2(hname, htitle, 48, 0, 48, 105, 0, 105);
245 
246  hname = TString::Format("EMCTRQA_histAccAmpEdgePos%s%s", EMCALTrigger::kEMCalTriggerNames[itrig].Data(), fgkPatchTypes[itype].Data());
247  htitle = TString::Format("EMCTRQA_histAccAmpEdgePos%s%s;col;row;accumulated amplitude", EMCALTrigger::kEMCalTriggerNames[itrig].Data(), fgkPatchTypes[itype].Data());
248  fHistManager.CreateTH2(hname, htitle, 48, 0, 48, 105, 0, 105);
249  }
250  }
251 }
252 
257 void AliEMCALTriggerOfflineLightQAPP::ProcessPatch(const AliEMCALTriggerPatchInfo* patch)
258 {
259  TString hname;
260 
261  Bool_t (AliEMCALTriggerPatchInfo::* triggerCheck[fgkNPatchTypes][fgkNTriggerTypes])(void) const = {
262  { &AliEMCALTriggerPatchInfo::IsLevel0,
263  &AliEMCALTriggerPatchInfo::IsGammaLow,
264  &AliEMCALTriggerPatchInfo::IsGammaHigh,
265  &AliEMCALTriggerPatchInfo::IsJetLow,
266  &AliEMCALTriggerPatchInfo::IsJetHigh,
267  &AliEMCALTriggerPatchInfo::IsBkg
268  },
269  { &AliEMCALTriggerPatchInfo::IsLevel0Recalc,
270  &AliEMCALTriggerPatchInfo::IsGammaLowRecalc,
271  &AliEMCALTriggerPatchInfo::IsGammaHighRecalc,
272  &AliEMCALTriggerPatchInfo::IsJetLowRecalc,
273  &AliEMCALTriggerPatchInfo::IsJetHighRecalc,
274  &AliEMCALTriggerPatchInfo::IsBkgRecalc
275  },
276  { &AliEMCALTriggerPatchInfo::IsLevel0Simple,
277  &AliEMCALTriggerPatchInfo::IsGammaLowSimple,
278  &AliEMCALTriggerPatchInfo::IsGammaHighSimple,
279  &AliEMCALTriggerPatchInfo::IsJetLowSimple,
280  &AliEMCALTriggerPatchInfo::IsJetHighSimple,
281  &AliEMCALTriggerPatchInfo::IsBkgSimple
282  }
283  };
284 
285  TString det;
286 
287  if (patch->IsEMCal()) {
288  det = "EMCal";
289  }
290  else if (patch->IsDCalPHOS()) {
291  det = "DCal";
292  }
293  else {
294  AliWarning(Form("Patch is not EMCal nor DCal/PHOS (pos: %d, %d)", patch->GetRowStart(), patch->GetColStart()));
295  }
296 
297  for (Int_t itrig = 0; itrig < fgkNTriggerTypes; itrig++) {
298  for (Int_t itype = 0; itype < fgkNPatchTypes; itype++) {
299  if (!IsPatchTypeEnabled(itype, itrig)) continue;
300 
301  if (!(patch->*(triggerCheck[itype][itrig]))()) continue;
302 
303  //if (itrig == EMCALTrigger::kTMEMCalLevel0 && itype == kRecalcPatch) Printf("Recalc amp is %d", GetAmplitude(patch, kRecalcPatch));
304 
305  if (patch->IsEMCal()) {
306  if (GetAmplitude(fMaxPatchEMCal[itrig][itype], itype) < GetAmplitude(patch, itype)) fMaxPatchEMCal[itrig][itype] = patch;
307  }
308  else if (patch->IsDCalPHOS()) {
309  if (GetAmplitude(fMaxPatchDCal[itrig][itype], itype) < GetAmplitude(patch, itype)) fMaxPatchDCal[itrig][itype] = patch;
310  }
311 
312  hname = TString::Format("EMCTRQA_histAccAmpEdgePos%s%s", EMCALTrigger::kEMCalTriggerNames[itrig].Data(), fgkPatchTypes[itype].Data());
313  fHistManager.FillTH2(hname, patch->GetColStart(), patch->GetRowStart(), GetAmplitude(patch, itype));
314 
315  hname = Form("EMCTRQA_hist%sPatchAmp%s%s", det.Data(), EMCALTrigger::kEMCalTriggerNames[itrig].Data(), fgkPatchTypes[itype].Data());
316  fHistManager.FillTH1(hname, GetAmplitude(patch, itype));
317  }
318  if (fDebugLevel >= 2) {
319  Printf("Type = %s; global pos = (%d, %d); Amp (online) = %d; Amp (offline) = %d; Patch energy = %.3f\n"
320  "Position (CM): Eta=%.3f, Phi=%.3f\n"
321  "Position (Geo): Eta=%.3f, Phi=%.3f\n",
322  EMCALTrigger::kEMCalTriggerNames[itrig].Data(), patch->GetRowStart(), patch->GetColStart(), patch->GetADCAmp(), patch->GetADCOfflineAmp(), patch->GetPatchE(),
323  patch->GetEtaCM(), patch->GetPhiCM(),
324  patch->GetEtaGeo(), patch->GetPhiGeo());
325  }
326  }
327 }
328 
329 
334 void AliEMCALTriggerOfflineLightQAPP::ProcessFastor(const AliEMCALTriggerFastOR* fastor, AliVCaloCells* cells)
335 {
336  TString hname;
337 
338  if (fBadChannels.find(fastor->GetAbsId()) != fBadChannels.end()) return;
339 
340  Double_t offlineAmp = 0;
341  Int_t nTRU = -1;
342  Int_t nADC = -1;
343  Int_t iSM = -1;
344  Int_t iEta = -1;
345  Int_t iPhi = -1;
346 
347  if (fGeom) {
348  fGeom->GetPositionInSMFromAbsFastORIndex(fastor->GetAbsId(), iSM, iEta, iPhi);
349 
350  Int_t idx[4] = {-1};
351  fGeom->GetCellIndexFromFastORIndex(fastor->GetAbsId(), idx);
352  fGeom->GetTRUFromAbsFastORIndex(fastor->GetAbsId(), nTRU, nADC);
353 
354  if (nTRU >= fNTotTRU || nTRU < 0 ||
355  nTRU == 34 || nTRU == 35 ||
356  nTRU == 40 || nTRU == 41 ||
357  nTRU == 46 || nTRU == 47) {
358  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));
359  return;
360  }
361 
362  if (idx[0] >= 0) {
363  if (fastor->GetL0Amp() > fMinL0FastORAmp) {
364  if (cells) {
365  for (Int_t i = 0; i < 4; i++) {
366  offlineAmp += cells->GetCellAmplitude(idx[i]);
367  }
368  }
369  }
370  }
371  }
372 
373  if (fastor->GetL0Amp() > fMinL0FastORAmp) {
374  if (fTimeStampBinWidth > 0) {
375  hname = TString::Format("ByTimeStamp/EMCTRQA_histFastORL0_%u_%u", fEventTimeStampBin, fEventTimeStampBin+fTimeStampBinWidth);
376  fHistManager.FillTH1(hname, fastor->GetAbsId());
377  }
378 
379  hname = "EMCTRQA_histFastORL0Hits";
380  fHistManager.FillTH2(hname, fastor->GetGlobalCol(), fastor->GetGlobalRow());
381 
382  hname = "EMCTRQA_histFastORL0AccumulatedAmplitude";
383  fHistManager.FillTH2(hname, fastor->GetGlobalCol(), fastor->GetGlobalRow(), fastor->GetL0Amp());
384 
385  hname = "EMCTRQA_histFastORL0Time";
386  fHistManager.FillTH2(hname, fastor->GetAbsId(), fastor->GetL0Time());
387 
388  hname = "EMCTRQA_histFastORL0AmpVsTime";
389  fHistManager.FillTH2(hname, fastor->GetL0Time(), fastor->GetL0Amp());
390 
391  hname = "EMCTRQA_histCellAmpVsFastORL0Amp";
392  fHistManager.FillTH2(hname, fastor->GetL0Amp(), offlineAmp);
393 
394  if (fastor->GetL0Time() > fL0MinTime && fastor->GetL0Time() < fL0MaxTime) {
395  hname = "EMCTRQA_histFastORL0HitsTriggered";
396  fHistManager.FillTH2(hname, fastor->GetGlobalCol(), fastor->GetGlobalRow());
397 
398  hname = "EMCTRQA_histFastORL0AccumulatedAmplitudeTriggered";
399  fHistManager.FillTH2(hname, fastor->GetGlobalCol(), fastor->GetGlobalRow(), fastor->GetL0Amp());
400 
401  hname = "EMCTRQA_histCellAmpVsFastORL0AmpTriggered";
402  fHistManager.FillTH2(hname, fastor->GetL0Amp(), offlineAmp);
403  }
404 
405  hname = TString::Format("ByTRU/EMCTRQA_histCellAmpVsFastORL0AmpTRU%d",nTRU);
406  fHistManager.FillTH2(hname, fastor->GetL0Amp(), offlineAmp);
407  }
408 
409  if (fastor->GetL1Amp() > fMinL1FastORAmp) {
410  hname = "EMCTRQA_histFastORL1Hits";
411  fHistManager.FillTH2(hname, fastor->GetGlobalCol(), fastor->GetGlobalRow());
412 
413  hname = "EMCTRQA_histFastORL1AccumulatedAmplitude";
414  fHistManager.FillTH2(hname, fastor->GetGlobalCol(), fastor->GetGlobalRow(), fastor->GetL1Amp());
415 
416  hname = "EMCTRQA_histCellAmpVsFastORL1Amp";
417  fHistManager.FillTH2(hname, fastor->GetL1Amp(), offlineAmp);
418 
420  double point[3] = {static_cast<double>(iSM), fastor->GetL1Amp() * EMCALTrigger::kEMCL1ADCtoGeV , offlineAmp};
421  hname = "EMCTRQA_histCellAmpVsFastORL1AmpSM";
422  fHistManager.FillTHnSparse(hname, point);
423  }
424 
425  hname = TString::Format("ByTRU/EMCTRQA_histCellAmpVsFastORL1AmpSTU%d",nTRU);
426  fHistManager.FillTH2(hname, fastor->GetL1Amp(), offlineAmp);
427  }
428 
429  UInt_t L1ampChopped = (fastor->GetL1Amp() >> 2) * 4;
430  if (fastor->GetL0Amp() > fMinL0FastORAmp || L1ampChopped > fMinL1FastORAmp) {
431  hname = TString::Format("ByTRU/EMCTRQA_histFastORAmpSTUVsTRU%d",nTRU);
432  fHistManager.FillTH2(hname, fastor->GetL0Amp(), L1ampChopped);
433 
434  hname = "EMCTRQA_histFastORL1AmpVsL0Amp";
435  fHistManager.FillTH2(hname, fastor->GetL0Amp(), L1ampChopped);
436 
437  if (fastor->GetL0Time() > fL0MinTime && fastor->GetL0Time() < fL0MaxTime) {
438  hname = "EMCTRQA_histFastORL1AmpVsL0AmpTriggered";
439  fHistManager.FillTH2(hname, fastor->GetL0Amp(), L1ampChopped);
440  }
441  }
442 }
443 
444 
449 {
450  AliDebug(2, Form("Entering AliEmcalTriggerQAAP::EventCompleted"));
451 
452  TString hname;
453 
454  for (Int_t itrig = 0; itrig < fgkNTriggerTypes; itrig++) {
455  AliDebug(2, Form("Trigger type: %s", EMCALTrigger::kEMCalTriggerNames[itrig].Data()));
456 
457  for (Int_t itype = 0; itype < fgkNPatchTypes; itype++) {
458  if (!IsPatchTypeEnabled(itype, itrig)) continue;
459 
460  AliDebug(2, Form("Patch type %s", fgkPatchTypes[itype].Data()));
461 
462  if (fMaxPatchEMCal[itrig][itype]) {
463  hname = TString::Format("EMCTRQA_histMaxEdgePos%s%s", EMCALTrigger::kEMCalTriggerNames[itrig].Data(), fgkPatchTypes[itype].Data());
464  fHistManager.FillTH2(hname, fMaxPatchEMCal[itrig][itype]->GetColStart(), fMaxPatchEMCal[itrig][itype]->GetRowStart());
465  }
466 
467  hname = TString::Format("EMCTRQA_histEMCalMaxPatchAmp%s%s", EMCALTrigger::kEMCalTriggerNames[itrig].Data(), fgkPatchTypes[itype].Data());
468  fHistManager.FillTH1(hname, GetAmplitude(fMaxPatchEMCal[itrig][itype], itype));
469 
470  if (fMaxPatchDCal[itrig][itype]) {
471  hname = TString::Format("EMCTRQA_histMaxEdgePos%s%s", EMCALTrigger::kEMCalTriggerNames[itrig].Data(), fgkPatchTypes[itype].Data());
472  fHistManager.FillTH2(hname, fMaxPatchDCal[itrig][itype]->GetColStart(), fMaxPatchDCal[itrig][itype]->GetRowStart());
473  }
474 
475  hname = TString::Format("EMCTRQA_histDCalMaxPatchAmp%s%s", EMCALTrigger::kEMCalTriggerNames[itrig].Data(), fgkPatchTypes[itype].Data());
476  fHistManager.FillTH1(hname, GetAmplitude(fMaxPatchDCal[itrig][itype], itype));
477  }
478  }
479 
480  for (Int_t itype = 0; itype < fgkNPatchTypes; itype++) {
481  for (Int_t itrig = 0; itrig < fgkNTriggerTypes; itrig++) {
482  fMaxPatchEMCal[itrig][itype] = 0;
483  fMaxPatchDCal[itrig][itype] = 0;
484  }
485  }
486 }
487 
495 {
496  AliEMCALTriggerQA::EventTimeStamp(timeStamp);
497 
498  if (fTimeStampBinWidth > 0) {
499  TString hname = TString::Format("ByTimeStamp/EMCTRQA_histEvents_%u_%u", fEventTimeStampBin, fEventTimeStampBin+fTimeStampBinWidth);
500  if (!fHistManager.FindObject(hname)) {
501  TString htitle;
502 
503  hname = TString::Format("ByTimeStamp/EMCTRQA_histEvents_%u_%u", fEventTimeStampBin, fEventTimeStampBin+fTimeStampBinWidth);
504  htitle = TString::Format("EMCTRQA_histEvents;;events");
505  TH1* hevents = fHistManager.CreateTH1(hname, htitle, 1, 0, 1);
506  hevents->GetXaxis()->SetBinLabel(1, TString::Format("%u <= time stamp < %u", fEventTimeStampBin, fEventTimeStampBin+fTimeStampBinWidth));
507 
508  hname = TString::Format("ByTimeStamp/EMCTRQA_histFastORL0_%u_%u", fEventTimeStampBin, fEventTimeStampBin+fTimeStampBinWidth);
509  htitle = TString::Format("EMCTRQA_histFastORL0;FastOR abs. ID;entries above 0");
510  fHistManager.CreateTH1(hname, htitle, fMaxFORabsId, 0, fMaxFORabsId);
511  }
512 
513  hname = TString::Format("ByTimeStamp/EMCTRQA_histEvents_%u_%u", fEventTimeStampBin, fEventTimeStampBin+fTimeStampBinWidth);
514  fHistManager.FillTH1(hname, 0.);
515  }
516 }
THashList * CreateHistoGroup(const char *groupname)
Create a new group of histograms within a parent group.
double Double_t
Definition: External.C:58
AliEMCALTriggerOfflineLightQAPP()
Dummy constructor for ROOT I/O.
Class creating a linear binning, used in the histogram manager.
UInt_t fMinL0FastORAmp
Minimum L0 amplitude of the FastORs.
void ReadFastORBadChannelFromStream(std::istream &stream)
void FillTH2(const char *hname, double x, double y, double weight=1., Option_t *opt="")
Fill a 2D histogram within the container.
Int_t fMaxFORabsId
! Maximum FastOR abs id
Bool_t fEnableEnergyCorrelationSM
Enable energy correlation per supermodule.
void ProcessFastor(const AliEMCALTriggerFastOR *fastor, AliVCaloCells *cells=0)
Interface for binnings used by the histogram handler.
Definition: TBinning.h:23
const AliEMCALTriggerPatchInfo * fMaxPatchDCal[fgkNTriggerTypes][fgkNPatchTypes]
! DCal max patch (will be reset each event)
void Init()
Initialize the class, i.e. allocate histograms.
UInt_t fMinL1FastORAmp
Minimum L1 amplitude of the FastORs.
void FillTHnSparse(const char *name, const double *x, double weight=1., Option_t *opt="")
TH2 * CreateTH2(const char *name, const char *title, int nbinsx, double xmin, double xmax, int nbinsy, double ymin, double ymax, Option_t *opt="")
Create a new TH2 within the container.
TObject * FindObject(const char *name) const
Find an object inside the container.
int Int_t
Definition: External.C:63
unsigned int UInt_t
Definition: External.C:33
TH1 * CreateTH1(const char *name, const char *title, int nbins, double xmin, double xmax, Option_t *opt="")
Create a new TH1 within the container.
void ProcessPatch(const AliEMCALTriggerPatchInfo *patch)
THistManager fHistManager
Histogram manager.
const AliEMCALTriggerPatchInfo * fMaxPatchEMCal[fgkNTriggerTypes][fgkNPatchTypes]
! EMCal max patch (will be reset each event)
Int_t fDebugLevel
void FillTH1(const char *hname, double x, double weight=1., Option_t *opt="")
Fill a 1D histogram within the container.
std::set< Short_t > fBadChannels
Container of bad channels.
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)
short Short_t
Definition: External.C:23
TFile * file
TList with histograms for a given trigger.
bool Bool_t
Definition: External.C:53
THnSparse * CreateTHnSparse(const char *name, const char *title, int ndim, const int *nbins, const double *min, const double *max, Option_t *opt="")
Create a new THnSparse within the container.
Definition: External.C:196