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),
42 fHistEMCalTriggers(0),
53 fTriggerPatchesName(
"EmcalTriggers"),
56 fBkgPatchType(kTMEMCalBkg),
59 fHistEMCalTriggers(0),
69 TString qaName(Form(
"%s_AliEMCALTriggerQA_Cent%d", name, i));
96 if (!cls.InheritsFrom(
"AliEMCALTriggerPatchInfo")) {
97 AliError(Form(
"%s: Objects of type %s in %s are not inherited from AliEMCALTriggerPatchInfo!",
105 AliError(Form(
"%s: Unable to get trigger patch container with name %s. Aborting", GetName(),
fTriggerPatchesName.Data()));
140 fHistEMCalTriggers =
new TH1F(
"fHistEMCalTriggers",
"fHistEMCalTriggers; triggers; counts",40,0,40);
141 #if ROOT_VERSION_CODE < ROOT_VERSION(6,4,2)
200 Int_t
nbins[20] = {0};
201 Double_t min[20] = {0};
202 Double_t max[20] = {0};
205 title[dim] =
"Centrality %";
212 title[dim] =
"DCal median (offline)";
215 max[dim] = AliEMCALTriggerQA::fgkMaxPatchAmp[
fBkgPatchType] / 10;
218 title[dim] =
"EMCal median (offline)";
221 max[dim] = AliEMCALTriggerQA::fgkMaxPatchAmp[
fBkgPatchType] / 10;
224 title[dim] =
"DCal median (recalc)";
227 max[dim] = AliEMCALTriggerQA::fgkMaxPatchAmp[
fBkgPatchType] / 10;
230 title[dim] =
"EMCal median (recalc)";
233 max[dim] = AliEMCALTriggerQA::fgkMaxPatchAmp[
fBkgPatchType] / 10;
236 fHistEventQA =
new THnSparseF(
"fHistEventQA",
"fHistEventQA",dim,nbins,min,max);
237 for (Int_t i = 0; i < dim; i++)
256 UInt_t firedTriggers = 0;
260 SETBIT(firedTriggers, bit);
264 return firedTriggers;
315 if ((firedTriggerBits & kMinBiasbit) == 0 &&
316 (firedTriggerBits & kEMCalAnybit) != 0)
fHistEMCalTriggers->Fill(
"EMCal Any and !MB", 1);
318 if ((firedTriggerBits & kMinBiasbit) == 0 &&
319 (firedTriggerBits & kDCalAnybit) != 0)
fHistEMCalTriggers->Fill(
"DCal Any and !MB", 1);
321 if ((firedTriggerBits & kMinBiasbit) == 0 &&
322 (firedTriggerBits & kEMCalDCalAnybit) != 0)
fHistEMCalTriggers->Fill(
"EMCal/DCal Any and !MB", 1);
327 AliDebug(2, Form(
"nPatches = %d", nPatches));
331 for (Int_t i = 0; i < nPatches; i++) {
332 AliDebug(2, Form(
"Processing patch %d", i));
334 AliEMCALTriggerPatchInfo* patch =
static_cast<AliEMCALTriggerPatchInfo*
>(
fTriggerPatches->At(i));
335 if (!patch)
continue;
344 for (Int_t i = 0; i < nPatches; i++) {
345 AliDebug(2, Form(
"Processing patch %d", i));
347 AliEMCALTriggerPatchInfo* patch =
static_cast<AliEMCALTriggerPatchInfo*
>(
fTriggerPatches->At(i));
348 if (!patch)
continue;
355 AliEMCALTriggerFastOR fastor;
357 Int_t globCol = -1, globRow = -1;
365 if (
fBadChannels.HasChannel(globCol, globRow))
continue;
369 if (L1amp < 0) L1amp = 0;
371 if (L0amp < 0) L0amp = 0;
377 TArrayI l0times(nl0times);
379 for(
int itime = 0; itime < nl0times; itime++){
380 if(l0times[itime] >7 && l0times[itime] < 10){
381 time = l0times[itime];
387 fastor.Initialize(L0amp, L1amp, globRow, globCol, time,
fGeom);
402 Double_t contents[20] = {0};
404 Double_t DCalmedian[3] = {0};
405 Double_t EMCalmedian[3] = {0};
410 for (Int_t i = 0; i <
fHistEventQA->GetNdimensions(); i++) {
412 if (
title==
"Centrality %")
414 else if (
title==
"DCal median (offline)")
415 contents[i] = DCalmedian[2];
416 else if (
title==
"EMCal median (offline)")
417 contents[i] = EMCalmedian[2];
418 else if (
title==
"DCal median (recalc)")
419 contents[i] = DCalmedian[1];
420 else if (
title==
"EMCal median (recalc)")
421 contents[i] = EMCalmedian[1];
423 AliWarning(Form(
"Unable to fill dimension %s!",
title.Data()));
468 for (Int_t i = fNcentBins; i < n; i++) {
469 TString qaName(Form(
"%s_AliEMCALTriggerQA_Cent%d", GetName(), i));
471 AliEMCALTriggerQA* triggerQA =
new AliEMCALTriggerQA(*(static_cast<AliEMCALTriggerQA*>(
fEMCALTriggerQA->At(0))));
472 triggerQA->SetName(qaName);
473 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
name of pythia info object
Int_t fNcentBins
if MC label > fMCLabelShift, MC label -= fMCLabelShift
Double_t fCent
!event centrality
TObjArray * fEMCALTriggerQA
produces the QA histograms
Int_t fBkgPatchType
Background patch type.
AliEMCALTriggerChannelContainer fBadChannels
Container of bad channels.
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 it should fill some general histograms
AliEMCALTriggerQA * GetTriggerQA(Int_t i=0)