15 #include <TClonesArray.h>
16 #include <THashList.h>
17 #include <THnSparse.h>
19 #include "AliEMCALTriggerPatchInfo.h"
20 #include "AliEMCALTriggerFastOR.h"
21 #include "AliEMCALTriggerConstants.h"
25 using namespace EMCALTrigger;
36 fTriggerPatchesName("EmcalTriggers"),
39 fBkgPatchType(kTMEMCalBkg),
41 fHistEMCalTriggers(0),
52 fTriggerPatchesName(
"EmcalTriggers"),
55 fBkgPatchType(kTMEMCalBkg),
57 fHistEMCalTriggers(0),
67 TString qaName(Form(
"%s_AliEMCALTriggerQA_Cent%d", name, i));
94 if (!cls.InheritsFrom(
"AliEMCALTriggerPatchInfo")) {
95 AliError(Form(
"%s: Objects of type %s in %s are not inherited from AliEMCALTriggerPatchInfo!",
103 AliError(Form(
"%s: Unable to get trigger patch container with name %s. Aborting", GetName(),
fTriggerPatchesName.Data()));
138 fHistEMCalTriggers =
new TH1F(
"fHistEMCalTriggers",
"fHistEMCalTriggers; triggers; counts",40,0,40);
139 #if ROOT_VERSION_CODE < ROOT_VERSION(6,4,2)
198 Int_t
nbins[20] = {0};
199 Double_t min[20] = {0};
200 Double_t max[20] = {0};
203 title[dim] =
"Centrality %";
210 title[dim] =
"DCal median (offline)";
213 max[dim] = AliEMCALTriggerQA::fgkMaxPatchAmp[
fBkgPatchType] / 10;
216 title[dim] =
"EMCal median (offline)";
219 max[dim] = AliEMCALTriggerQA::fgkMaxPatchAmp[
fBkgPatchType] / 10;
222 title[dim] =
"DCal median (recalc)";
225 max[dim] = AliEMCALTriggerQA::fgkMaxPatchAmp[
fBkgPatchType] / 10;
228 title[dim] =
"EMCal median (recalc)";
231 max[dim] = AliEMCALTriggerQA::fgkMaxPatchAmp[
fBkgPatchType] / 10;
234 fHistEventQA =
new THnSparseF(
"fHistEventQA",
"fHistEventQA",dim,nbins,min,max);
235 for (Int_t i = 0; i < dim; i++)
254 UInt_t firedTriggers = 0;
258 SETBIT(firedTriggers, bit);
262 return firedTriggers;
313 if ((firedTriggerBits & kMinBiasbit) == 0 &&
314 (firedTriggerBits & kEMCalAnybit) != 0)
fHistEMCalTriggers->Fill(
"EMCal Any and !MB", 1);
316 if ((firedTriggerBits & kMinBiasbit) == 0 &&
317 (firedTriggerBits & kDCalAnybit) != 0)
fHistEMCalTriggers->Fill(
"DCal Any and !MB", 1);
319 if ((firedTriggerBits & kMinBiasbit) == 0 &&
320 (firedTriggerBits & kEMCalDCalAnybit) != 0)
fHistEMCalTriggers->Fill(
"EMCal/DCal Any and !MB", 1);
325 AliDebug(2, Form(
"nPatches = %d", nPatches));
329 for (Int_t i = 0; i < nPatches; i++) {
330 AliDebug(2, Form(
"Processing patch %d", i));
332 AliEMCALTriggerPatchInfo* patch =
static_cast<AliEMCALTriggerPatchInfo*
>(
fTriggerPatches->At(i));
333 if (!patch)
continue;
342 for (Int_t i = 0; i < nPatches; i++) {
343 AliDebug(2, Form(
"Processing patch %d", i));
345 AliEMCALTriggerPatchInfo* patch =
static_cast<AliEMCALTriggerPatchInfo*
>(
fTriggerPatches->At(i));
346 if (!patch)
continue;
353 AliEMCALTriggerFastOR fastor;
355 Int_t globCol = -1, globRow = -1;
365 if (L1amp < 0) L1amp = 0;
367 if (L0amp < 0) L0amp = 0;
373 TArrayI l0times(nl0times);
375 for(
int itime = 0; itime < nl0times; itime++){
376 if(l0times[itime] >7 && l0times[itime] < 10){
377 time = l0times[itime];
383 fastor.Initialize(L0amp, L1amp, globRow, globCol, time,
fGeom);
398 Double_t contents[20] = {0};
400 Double_t DCalmedian[3] = {0};
401 Double_t EMCalmedian[3] = {0};
406 for (Int_t i = 0; i <
fHistEventQA->GetNdimensions(); i++) {
408 if (
title==
"Centrality %")
410 else if (
title==
"DCal median (offline)")
411 contents[i] = DCalmedian[2];
412 else if (
title==
"EMCal median (offline)")
413 contents[i] = EMCalmedian[2];
414 else if (
title==
"DCal median (recalc)")
415 contents[i] = DCalmedian[1];
416 else if (
title==
"EMCal median (recalc)")
417 contents[i] = EMCalmedian[1];
419 AliWarning(Form(
"Unable to fill dimension %s!",
title.Data()));
464 for (Int_t i = fNcentBins; i < n; i++) {
465 TString qaName(Form(
"%s_AliEMCALTriggerQA_Cent%d", GetName(), i));
467 AliEMCALTriggerQA* triggerQA =
new AliEMCALTriggerQA(*(static_cast<AliEMCALTriggerQA*>(
fEMCALTriggerQA->At(0))));
468 triggerQA->SetName(qaName);
469 triggerQA->SetTitle(qaName);
Int_t fADCperBin
ADC counts per bin.
ClassImp(AliAnalysisTaskTriggerRates) AliAnalysisTaskTriggerRates
TClonesArray * fTriggerPatches
! trigger array in
Base task in the EMCAL framework.
void Set2015CaloTriggerNames()
TString fTriggerPatchesName
name of input trigger array
TH1 * fHistEMCalTriggers
! EMCal triggers
Int_t fCentBin
!event centrality bin
TList * fOutput
!output list
void SetNCentBins(Int_t n)
void SetADCperBin(Int_t n)
THnSparse * fHistEventQA
! Event QA
void UserCreateOutputObjects()
Class to do some fast QA of the EMCal trigger. Useful also to tune trigger thresholds.
UInt_t SteerFiredTriggers(const TString &firedTriggersStr) const
void SetBkgPatchType(Int_t t)
AliEMCALGeometry * fGeom
!emcal geometry
virtual ~AliEmcalTriggerQATask()
BeamType fForceBeamType
forced beam type
Int_t fNcentBins
how many centrality bins
Double_t fCent
!event centrality
TObjArray * fEMCALTriggerQA
produces the QA histograms
Int_t fBkgPatchType
Background patch type.
void SetMakeGeneralHistograms(Bool_t g)
TString fCaloTriggerNames[kLastCaloTrigger]
names of the calo trigger classes
AliVCaloTrigger * fCaloTriggers
!calo triggers
void UserCreateOutputObjects()
Bool_t fInitialized
whether or not the task has been already initialized
AliEMCALTriggerQA * GetTriggerQA(Int_t i=0)