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),
76 if (beamType ==
kpp) {
77 AliInfo(
"Setting up the task for pp collisions.");
87 AliInfo(
"Setting up the task for PbPb collisions.");
126 if (!cls.InheritsFrom(
"AliEMCALTriggerPatchInfo")) {
127 AliError(Form(
"%s: Objects of type %s in %s are not inherited from AliEMCALTriggerPatchInfo!",
135 AliError(Form(
"%s: Unable to get trigger patch container with name %s. Aborting", GetName(),
fTriggerPatchesName.Data()));
152 triggerQA->SetDebugLevel(DebugLevel());
154 fOutput->Add(triggerQA->GetListOfHistograms());
181 if (!triggerQA)
return kFALSE;
186 triggerQA->EventTimeStamp(
fESDEvent->GetTimeStamp());
192 AliDebug(2, Form(
"nPatches = %d", nPatches));
194 for (
Int_t i = 0; i < nPatches; i++) {
195 AliDebug(2, Form(
"Processing bkg patch %d", i));
197 AliEMCALTriggerPatchInfo* patch =
static_cast<AliEMCALTriggerPatchInfo*
>(
fTriggerPatches->At(i));
198 if (!patch)
continue;
201 triggerQA->ProcessBkgPatch(patch);
204 triggerQA->ComputeBackground();
206 for (
Int_t i = 0; i < nPatches; i++) {
207 AliDebug(2, Form(
"Processing patch %d", i));
209 AliEMCALTriggerPatchInfo* patch =
static_cast<AliEMCALTriggerPatchInfo*
>(
fTriggerPatches->At(i));
210 if (!patch)
continue;
213 triggerQA->ProcessPatch(patch);
218 AliEMCALTriggerFastOR fastor;
220 Int_t globCol = -1, globRow = -1;
230 if (L1amp < 0) L1amp = 0;
233 if (L0amp < 0) L0amp = 0;
241 for(
int itime = 0; itime < nl0times; itime++){
242 time = l0times[itime];
247 fastor.Initialize(L0amp, L1amp, globRow, globCol, time,
fGeom);
249 triggerQA->ProcessFastor(&fastor,
fCaloCells);
255 AliEMCALTriggerQA::AliEMCALCellInfo cellInfo;
256 for (
Int_t pos = 0; pos < ncells; pos++) {
259 cellInfo.Set(absId, amp);
260 triggerQA->ProcessCell(cellInfo);
264 triggerQA->EventCompleted();
296 ::Error(
"AliEmcalTriggerQATask",
"No analysis manager to connect to.");
301 AliVEventHandler *evhand = mgr->GetInputEventHandler();
303 ::Error(
"AliEmcalTriggerQATask",
"This task requires an input event handler");
308 TString taskName(
"AliEmcalTriggerQATask");
309 if (!suffix.IsNull()) {
315 if(triggersName.IsNull()) {
316 if (evhand->InheritsFrom(
"AliESDInputHandler")) {
317 triggersName =
"EMCALTrigger";
318 ::Info(
"AddTaskEmcalTriggerQA",
"ESD analysis, triggersName = \"%s\"", triggersName.Data());
321 triggersName =
"emcalTrigger";
322 ::Info(
"AddTaskEmcalTriggerQA",
"AOD analysis, triggersName = \"%s\"", triggersName.Data());
325 if(cellsName.IsNull()) {
326 if (evhand->InheritsFrom(
"AliESDInputHandler")) {
327 cellsName =
"EMCALCells";
328 ::Info(
"AddTaskEmcalTriggerQA",
"ESD analysis, cellsName = \"%s\"", cellsName.Data());
331 cellsName =
"emcalCells";
332 ::Info(
"AddTaskEmcalTriggerQA",
"AOD analysis, cellsName = \"%s\"", cellsName.Data());
341 AliAnalysisDataContainer *cinput1 = mgr->GetCommonInputContainer();
342 mgr->ConnectInput (eTask, 0, cinput1 );
345 if (subdir.IsNull()) {
346 commonoutput = mgr->GetCommonFileName();
349 commonoutput = TString::Format(
"%s:%s", mgr->GetCommonFileName(), subdir.Data());
351 TString contOutName(Form(
"%s_histos", taskName.Data()));
352 mgr->ConnectOutput(eTask, 1, mgr->CreateContainer(contOutName, TList::Class(), AliAnalysisManager::kOutputContainer, commonoutput.Data()));
364 std::vector<std::string> triggerClasses = {
"CINT7",
"CEMC7",
"CDMC7",
"EG1",
"EG2",
"EJ1",
"EJ2",
"DG1",
"DG2",
"DJ1",
"DJ2" };
365 for (
auto triggerClass : triggerClasses) {
367 suffix.ReplaceAll(
"-",
"_");
void UserCreateOutputObjects()
Int_t fADCperBin
ADC counts per bin.
void SetTriggerPatchesName(const char *name)
AliEMCALGeometry * fGeom
!emcal geometry
TList * fOutput
!output list
TClonesArray * fTriggerPatches
! trigger array in
UInt_t fTimeStampBinWidth
Time stamp bin width.
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()
std::vector< AliEMCALTriggerQA * > fEMCALTriggerQA
produces the QA histograms
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
Int_t GetNCentBins() const
static EBeamType_t BeamTypeFromRunNumber(Int_t runnumber)
static AliEmcalTriggerQATask * AddTaskEmcalTriggerQA(TString triggerPatchesName="EmcalTriggers", TString cellsName="", TString triggersName="", EBeamType_t beamType=kpp, Bool_t online=kFALSE, TString subdir="", TString suffix="")
ClassImp(AliAnalysisTaskCRC) AliAnalysisTaskCRC
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)