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> 44 fTriggerPatchesName(
"EmcalTriggers"),
51 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());
196 triggerQA->EventTimeStamp(
fESDEvent->GetTimeStamp());
202 AliDebug(2, Form(
"nPatches = %d", nPatches));
204 for (
Int_t i = 0; i < nPatches; i++) {
205 AliDebug(2, Form(
"Processing bkg patch %d", i));
207 AliEMCALTriggerPatchInfo* patch =
static_cast<AliEMCALTriggerPatchInfo*
>(
fTriggerPatches->At(i));
208 if (!patch)
continue;
211 triggerQA->ProcessBkgPatch(patch);
214 triggerQA->ComputeBackground();
216 for (
Int_t i = 0; i < nPatches; i++) {
217 AliDebug(2, Form(
"Processing patch %d", i));
219 AliEMCALTriggerPatchInfo* patch =
static_cast<AliEMCALTriggerPatchInfo*
>(
fTriggerPatches->At(i));
220 if (!patch)
continue;
223 triggerQA->ProcessPatch(patch);
228 AliEMCALTriggerFastOR fastor;
230 Int_t globCol = -1, globRow = -1;
240 if (L1amp < 0) L1amp = 0;
243 if (L0amp < 0) L0amp = 0;
251 for(
int itime = 0; itime < nl0times; itime++){
252 time = l0times[itime];
257 fastor.Initialize(L0amp, L1amp, globRow, globCol, time,
fGeom);
259 triggerQA->ProcessFastor(&fastor,
fCaloCells);
265 AliEMCALTriggerQA::AliEMCALCellInfo cellInfo;
266 for (
Int_t pos = 0; pos < ncells; pos++) {
269 cellInfo.Set(absId, amp);
270 triggerQA->ProcessCell(cellInfo);
274 triggerQA->EventCompleted();
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()));
374 std::vector<std::string> triggerClasses = {
"CINT7",
"CEMC7",
"CDMC7",
"EG1",
"EG2",
"EJ1",
"EJ2",
"DG1",
"DG2",
"DJ1",
"DJ2" };
376 for (
auto triggerClass : triggerClasses) {
378 suffix.ReplaceAll(
"-",
"_");
382 if (runnumber > 197692) {
386 if (triggerClass.find(
"CINT7") != std::string::npos) {
388 triggerQA->EnablePatchType(AliEMCALTriggerQA::kRecalcPatch, EMCALTrigger::kTMEMCalLevel0, kTRUE);
389 triggerQA->EnablePatchType(AliEMCALTriggerQA::kRecalcPatch, EMCALTrigger::kTMEMCalGammaH, kTRUE);
390 triggerQA->EnablePatchType(AliEMCALTriggerQA::kRecalcPatch, EMCALTrigger::kTMEMCalJetH, kTRUE);
394 EMCALTrigger::EMCalTriggerType_t triggerType = EMCALTrigger::kTMEMCalLevel0;
395 if (triggerClass.find(
"CEMC7") != std::string::npos || triggerClass.find(
"CDMC7") != std::string::npos) {
396 triggerType = EMCALTrigger::kTMEMCalLevel0;
398 else if (triggerClass.find(
"EG") != std::string::npos || triggerClass.find(
"DG") != std::string::npos) {
399 triggerType = EMCALTrigger::kTMEMCalGammaH;
401 else if (triggerClass.find(
"EJ") != std::string::npos || triggerClass.find(
"DJ") != std::string::npos) {
402 triggerType = EMCALTrigger::kTMEMCalJetH;
405 triggerQA->EnablePatchType(AliEMCALTriggerQA::kRecalcPatch, triggerType, kTRUE);
void UserCreateOutputObjects()
Int_t fADCperBin
ADC counts per bin.
void SetTriggerPatchesName(const char *name)
AliEMCALGeometry * fGeom
!emcal geometry
EBeamType_t fBeamType
!event beam type
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.
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)
static AliEmcalTriggerQATask * AddTaskEmcalTriggerQA_QAtrain(Int_t runnumber)
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)