15 #include <TClonesArray.h>
16 #include <THashList.h>
17 #include <THnSparse.h>
19 #include <AliESDEvent.h>
20 #include <AliEMCALTriggerOnlineQAPbPb.h>
21 #include <AliEMCALTriggerQA.h>
22 #include <AliEMCALTriggerPatchInfo.h>
23 #include <AliEMCALTriggerFastOR.h>
24 #include <AliEMCALTriggerConstants.h>
25 #include <AliEMCALTriggerOnlineQAPP.h>
26 #include <AliVEventHandler.h>
27 #include <AliAnalysisManager.h>
32 using namespace EMCALTrigger;
43 fTriggerPatchesName(
"EmcalTriggers"),
50 fTimeStampBinWidth(0),
62 fTriggerPatchesName(
"EmcalTriggers"),
69 fTimeStampBinWidth(0),
79 AliInfo(
"Setting up the task for pp collisions.");
90 AliInfo(
"Setting up the task for PbPb collisions.");
131 if (!cls.InheritsFrom(
"AliEMCALTriggerPatchInfo")) {
132 AliError(Form(
"%s: Objects of type %s in %s are not inherited from AliEMCALTriggerPatchInfo!",
140 AliError(Form(
"%s: Unable to get trigger patch container with name %s. Aborting", GetName(),
fTriggerPatchesName.Data()));
164 if (triggerOffline) {
198 AliDebug(2, Form(
"nPatches = %d", nPatches));
200 for (
Int_t i = 0; i < nPatches; i++) {
201 AliDebug(2, Form(
"Processing bkg patch %d", i));
203 AliEMCALTriggerPatchInfo* patch =
static_cast<AliEMCALTriggerPatchInfo*
>(
fTriggerPatches->At(i));
204 if (!patch)
continue;
212 for (
Int_t i = 0; i < nPatches; i++) {
213 AliDebug(2, Form(
"Processing patch %d", i));
215 AliEMCALTriggerPatchInfo* patch =
static_cast<AliEMCALTriggerPatchInfo*
>(
fTriggerPatches->At(i));
216 if (!patch)
continue;
224 AliEMCALTriggerFastOR fastor;
226 Int_t globCol = -1, globRow = -1;
236 if (L1amp < 0) L1amp = 0;
239 if (L0amp < 0) L0amp = 0;
247 for(
int itime = 0; itime < nl0times; itime++){
248 time = l0times[itime];
253 fastor.Initialize(L0amp, L1amp, globRow, globCol, time,
fGeom);
261 AliEMCALTriggerQA::AliEMCALCellInfo cellInfo;
262 for (
Int_t pos = 0; pos < ncells; pos++) {
265 cellInfo.Set(absId, amp);
284 AliEMCALTriggerQA* qa = 0;
285 while ((qa = static_cast<AliEMCALTriggerQA*>(next()))) {
306 ::Error(
"AliEmcalTriggerQATask",
"No analysis manager to connect to.");
311 AliVEventHandler *evhand = mgr->GetInputEventHandler();
313 ::Error(
"AliEmcalTriggerQATask",
"This task requires an input event handler");
318 TString taskName(
"AliEmcalTriggerQATask");
319 if (!suffix.IsNull()) {
325 if(triggersName.IsNull()) {
326 if (evhand->InheritsFrom(
"AliESDInputHandler")) {
327 triggersName =
"EMCALTrigger";
328 ::Info(
"AddTaskEmcalTriggerQA",
"ESD analysis, triggersName = \"%s\"", triggersName.Data());
331 triggersName =
"emcalTrigger";
332 ::Info(
"AddTaskEmcalTriggerQA",
"AOD analysis, triggersName = \"%s\"", triggersName.Data());
335 if(cellsName.IsNull()) {
336 if (evhand->InheritsFrom(
"AliESDInputHandler")) {
337 cellsName =
"EMCALCells";
338 ::Info(
"AddTaskEmcalTriggerQA",
"ESD analysis, cellsName = \"%s\"", cellsName.Data());
341 cellsName =
"emcalCells";
342 ::Info(
"AddTaskEmcalTriggerQA",
"AOD analysis, cellsName = \"%s\"", cellsName.Data());
351 AliAnalysisDataContainer *cinput1 = mgr->GetCommonInputContainer();
352 mgr->ConnectInput (eTask, 0, cinput1 );
355 if (subdir.IsNull()) {
356 commonoutput = mgr->GetCommonFileName();
359 commonoutput = TString::Format(
"%s:%s", mgr->GetCommonFileName(), subdir.Data());
361 TString contOutName(Form(
"%s_histos", taskName.Data()));
362 mgr->ConnectOutput(eTask, 1, mgr->CreateContainer(contOutName, TList::Class(), AliAnalysisManager::kOutputContainer, commonoutput.Data()));
375 if (beam ==
kpA || beam ==
kAA) nCentBins = 4;
376 std::vector<std::string> triggerClasses = {
"CINT7",
"CEMC7",
"CDMC7",
"EG1",
"EG2",
"EJ1",
"EJ2",
"DG1",
"DG2",
"DJ1",
"DJ2" };
377 for (
auto triggerClass : triggerClasses) {
379 suffix.ReplaceAll(
"-",
"_");
void SetNCentBins(Int_t n)
void UserCreateOutputObjects()
Int_t fADCperBin
ADC counts per bin.
void SetTriggerPatchesName(const char *name)
Int_t fNcentBins
how many centrality bins
AliEMCALGeometry * fGeom
!emcal geometry
TList * fOutput
!output list
TClonesArray * fTriggerPatches
! trigger array in
UInt_t fTimeStampBinWidth
Time stamp bin width.
static AliEmcalTriggerQATask * AddTaskEmcalTriggerQA(TString triggerPatchesName="EmcalTriggers", TString cellsName="", TString triggersName="", Int_t nCentBins=0, Bool_t online=kFALSE, TString subdir="", TString suffix="")
Class to do some fast QA of the EMCal trigger. Useful also to tune trigger thresholds.
AliESDEvent * fESDEvent
! current ESD event
void SetForceBeamType(EBeamType_t f)
Bool_t fDCalPlots
Whether to add DCal QA plots.
TString fTriggerPatchesName
name of input trigger array
void SetADCperBin(Int_t n)
Class to generate EMCal trigger QA plots in pp collisions.
static void AddTaskEmcalTriggerQA_QAtrain(Int_t runnumber)
void UserCreateOutputObjects()
UInt_t fMinTimeStamp
Minimum event time stamp (only ESD)
Int_t fMinAmplitude
Minimum trigger patch amplitude.
AliVCaloCells * fCaloCells
!cells
void AddAcceptedTriggerClass(const char *trigClass)
Base task in the EMCAL framework (lighter version of AliAnalysisTaskEmcal)
virtual ~AliEmcalTriggerQATask()
Int_t fCentBin
!event centrality bin
void EnableDCal(Bool_t e=kTRUE)
void SetCaloCellsName(const char *n)
Bool_t fLocalInitialized
!whether or not the task has been already initialized
static EBeamType_t BeamTypeFromRunNumber(Int_t runnumber)
ClassImp(AliAnalysisTaskCRC) AliAnalysisTaskCRC
TObjArray fEMCALTriggerQA
produces the QA histograms
UInt_t fMaxTimeStamp
Maximum event time stamp (only ESD)
EBeamType_t
Switch for the beam type.
void SetCaloTriggersName(const char *n)
AliVCaloTrigger * fCaloTriggers
!calo triggers
void SetMakeGeneralHistograms(Bool_t g)
AliEMCALTriggerQA * GetTriggerQA(Int_t i=0)