8 #include "AliEMCALTriggerPatchInfo.h" 9 #include "AliAnalysisManager.h" 11 #include "AliVCaloTrigger.h" 21 SetCaloTriggerPatchInfoName(
"EmcalTriggers");
22 SetCaloTriggersName(
"EMCALTrigger");
25 AliAnalysisTaskEmcalTriggerBackground::AliAnalysisTaskEmcalTriggerBackground(
const char *name) :
42 fHistos->
CreateTH2(
"hRhoEMCAL",
"Rho values in EMCAL", 1000, 0., 1000, 1000, 0., 1000.);
43 fHistos->
CreateTH2(
"hRhoEMCALMedianDCAL",
"Rho value in EMCAL vs Median DCAL", 1000, 0., 1000, 1000, 0., 1000.);
44 fHistos->
CreateTH2(
"hRhoDCAL",
"Rho values in DCAL", 1000, 0., 1000, 1000, 0., 1000.);
45 fHistos->
CreateTH2(
"hRhoDCALMedianEMCAL",
"Rho value in DCAL vs Median EMCAL", 1000, 0., 1000, 1000, 0., 1000.);
51 std::vector<double> bkgpatchesEMCAL, bkgpatchesDCAL;
54 AliEMCALTriggerPatchInfo *patch =
static_cast<AliEMCALTriggerPatchInfo *
>(p);
55 if(!patch->IsBkgRecalc())
continue;
56 if(patch->IsEMCal()) bkgpatchesEMCAL.push_back(patch->GetADCAmp());
57 else bkgpatchesDCAL.push_back(patch->GetADCAmp());
60 std::sort(bkgpatchesEMCAL.begin(), bkgpatchesEMCAL.end(), std::greater<double>());
61 std::sort(bkgpatchesDCAL.begin(), bkgpatchesDCAL.end(), std::greater<double>());
63 auto medEMCAL = TMath::Median<double>(bkgpatchesEMCAL.size(), bkgpatchesEMCAL.data()),
64 medDCAL = TMath::Median<double>(bkgpatchesDCAL.size(), bkgpatchesDCAL.data());
74 auto mgr = AliAnalysisManager::GetAnalysisManager();
76 std::cerr <<
"No Analysis manager available." << std::endl;
83 TString outfilename(mgr->GetCommonFileName());
84 outfilename += Form(
":EmcalTriggerBackground%s", name);
85 mgr->ConnectInput(task, 0, mgr->GetCommonInputContainer());
86 mgr->ConnectOutput(task, 1, mgr->CreateContainer(Form(
"EmcalTriggerBackground%s", name), TList::Class(), AliAnalysisManager::kOutputContainer, outfilename.Data()));
87 std::cout <<
"Done" << std::endl;
THistManager * fHistos
! histograms
Base task in the EMCAL framework.
void FillTH2(const char *hname, double x, double y, double weight=1., Option_t *opt="")
Fill a 2D histogram within the container.
static AliAnalysisTaskEmcalTriggerBackground * AddTaskEmcalTriggerBackground(const char *nametag)
void SetCaloTriggerPatchInfoName(const char *n)
TH2 * CreateTH2(const char *name, const char *title, int nbinsx, double xmin, double xmax, int nbinsy, double ymin, double ymax, Option_t *opt="")
Create a new TH2 within the container.
THashList * GetListOfHistograms() const
Get the list of histograms.
AliEmcalList * fOutput
!output list
virtual void UserCreateOutputObjects()
void SetMakeGeneralHistograms(Bool_t g)
TClonesArray * fTriggerPatchInfo
!trigger patch info array
Container class for histograms.
void SetCaloTriggersName(const char *n)
AliVCaloTrigger * fCaloTriggers
!calo triggers
void UserCreateOutputObjects()
Main initialization function on the worker.
virtual ~AliAnalysisTaskEmcalTriggerBackground()
AliAnalysisTaskEmcalTriggerBackground()
virtual bool Run()
Run function. This is the core function of the analysis and contains the user code. Therefore users have to implement this function.