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>
33 using namespace EMCALTrigger;
44 fTriggerPatchesName(
"EmcalTriggers"),
51 fTimeStampBinWidth(0),
63 fTriggerPatchesName(
"EmcalTriggers"),
70 fTimeStampBinWidth(0),
77 if (beamType ==
kpp || beamType ==
kpA) {
78 AliInfo(
"Setting up the task for pp collisions.");
95 AliInfo(
"Setting up the task for PbPb collisions.");
134 if (!cls.InheritsFrom(
"AliEMCALTriggerPatchInfo")) {
135 AliError(Form(
"%s: Objects of type %s in %s are not inherited from AliEMCALTriggerPatchInfo!",
143 AliError(Form(
"%s: Unable to get trigger patch container with name %s. Aborting", GetName(),
fTriggerPatchesName.Data()));
160 triggerQA->SetDebugLevel(DebugLevel());
162 fOutput->Add(triggerQA->GetListOfHistograms());
189 if (!triggerQA)
return kFALSE;
194 triggerQA->EventTimeStamp(
fESDEvent->GetTimeStamp());
200 AliDebug(2, Form(
"nPatches = %d", nPatches));
202 for (
Int_t i = 0; i < nPatches; i++) {
203 AliDebug(2, Form(
"Processing bkg patch %d", i));
205 AliEMCALTriggerPatchInfo* patch =
static_cast<AliEMCALTriggerPatchInfo*
>(
fTriggerPatches->At(i));
206 if (!patch)
continue;
209 triggerQA->ProcessBkgPatch(patch);
212 triggerQA->ComputeBackground();
214 for (
Int_t i = 0; i < nPatches; i++) {
215 AliDebug(2, Form(
"Processing patch %d", i));
217 AliEMCALTriggerPatchInfo* patch =
static_cast<AliEMCALTriggerPatchInfo*
>(
fTriggerPatches->At(i));
218 if (!patch)
continue;
221 triggerQA->ProcessPatch(patch);
226 AliEMCALTriggerFastOR fastor;
228 Int_t globCol = -1, globRow = -1;
238 if (L1amp < 0) L1amp = 0;
241 if (L0amp < 0) L0amp = 0;
249 for(
int itime = 0; itime < nl0times; itime++){
250 time = l0times[itime];
255 fastor.Initialize(L0amp, L1amp, globRow, globCol, time,
fGeom);
257 triggerQA->ProcessFastor(&fastor,
fCaloCells);
263 AliEMCALTriggerQA::AliEMCALCellInfo cellInfo;
264 for (
Int_t pos = 0; pos < ncells; pos++) {
267 cellInfo.Set(absId, amp);
268 triggerQA->ProcessCell(cellInfo);
272 triggerQA->EventCompleted();
304 ::Error(
"AliEmcalTriggerQATask",
"No analysis manager to connect to.");
309 AliVEventHandler *evhand = mgr->GetInputEventHandler();
311 ::Error(
"AliEmcalTriggerQATask",
"This task requires an input event handler");
316 TString taskName(
"AliEmcalTriggerQATask");
317 if (!suffix.IsNull()) {
323 if(triggersName.IsNull()) {
324 if (evhand->InheritsFrom(
"AliESDInputHandler")) {
325 triggersName =
"EMCALTrigger";
326 ::Info(
"AddTaskEmcalTriggerQA",
"ESD analysis, triggersName = \"%s\"", triggersName.Data());
329 triggersName =
"emcalTrigger";
330 ::Info(
"AddTaskEmcalTriggerQA",
"AOD analysis, triggersName = \"%s\"", triggersName.Data());
333 if(cellsName.IsNull()) {
334 if (evhand->InheritsFrom(
"AliESDInputHandler")) {
335 cellsName =
"EMCALCells";
336 ::Info(
"AddTaskEmcalTriggerQA",
"ESD analysis, cellsName = \"%s\"", cellsName.Data());
339 cellsName =
"emcalCells";
340 ::Info(
"AddTaskEmcalTriggerQA",
"AOD analysis, cellsName = \"%s\"", cellsName.Data());
349 AliAnalysisDataContainer *cinput1 = mgr->GetCommonInputContainer();
350 mgr->ConnectInput (eTask, 0, cinput1 );
353 if (subdir.IsNull()) {
354 commonoutput = mgr->GetCommonFileName();
357 commonoutput = TString::Format(
"%s:%s", mgr->GetCommonFileName(), subdir.Data());
359 TString contOutName(Form(
"%s_histos", taskName.Data()));
360 mgr->ConnectOutput(eTask, 1, mgr->CreateContainer(contOutName, TList::Class(), AliAnalysisManager::kOutputContainer, commonoutput.Data()));
372 std::vector<std::string> triggerClasses = {
"CINT7",
"CEMC7",
"CDMC7",
"EG1",
"EG2",
"EJ1",
"EJ2",
"DG1",
"DG2",
"DJ1",
"DJ2" };
373 for (
auto triggerClass : triggerClasses) {
375 suffix.ReplaceAll(
"-",
"_");
379 if (runnumber > 197692) {
383 if (triggerClass.find(
"CINT7") != std::string::npos) {
385 triggerQA->EnablePatchType(AliEMCALTriggerQA::kRecalcPatch, EMCALTrigger::kTMEMCalLevel0, kTRUE);
386 triggerQA->EnablePatchType(AliEMCALTriggerQA::kRecalcPatch, EMCALTrigger::kTMEMCalGammaH, kTRUE);
387 triggerQA->EnablePatchType(AliEMCALTriggerQA::kRecalcPatch, EMCALTrigger::kTMEMCalJetH, kTRUE);
391 EMCALTrigger::EMCalTriggerType_t triggerType = EMCALTrigger::kTMEMCalLevel0;
392 if (triggerClass.find(
"CEMC7") != std::string::npos || triggerClass.find(
"CDMC7") != std::string::npos) {
393 triggerType = EMCALTrigger::kTMEMCalLevel0;
395 else if (triggerClass.find(
"EG") != std::string::npos || triggerClass.find(
"DG") != std::string::npos) {
396 triggerType = EMCALTrigger::kTMEMCalGammaH;
398 else if (triggerClass.find(
"EJ") != std::string::npos || triggerClass.find(
"DJ") != std::string::npos) {
399 triggerType = EMCALTrigger::kTMEMCalJetH;
402 triggerQA->EnablePatchType(AliEMCALTriggerQA::kRecalcPatch, triggerType, kTRUE);
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)
New centrality estimation (AliMultSelection, see https://twiki.cern.ch/twiki/bin/viewauth/ALICE/AliMu...
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()
static AliEmcalTriggerQATask * AddTaskEmcalTriggerQA(TString triggerPatchesName="EmcalTriggers", TString cellsName="", TString triggersName="", EBeamType_t beamType=kpp, ETriggerAnalysisType_t anaType=kTriggerOfflineExpertAnalysis, TString subdir="", TString suffix="")
void SetCentralityEstimation(ECentralityEstimation_t b)
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)
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)