20 #include <TClonesArray.h>
23 #include <THashList.h>
25 #include <TObjArray.h>
26 #include <TParameter.h>
28 #include "AliAnalysisUtils.h"
29 #include "AliESDEvent.h"
30 #include "AliEMCALTriggerPatchInfo.h"
32 #include "AliInputEventHandler.h"
34 #include "AliMultSelection.h"
35 #include "AliMultEstimator.h"
36 #include "AliOADBContainer.h"
44 namespace EMCalTriggerPtAnalysis {
46 AliAnalysisTaskEmcalPatchesRef::AliAnalysisTaskEmcalPatchesRef() :
48 fCentralityRange(-999., 999.),
49 fRequestCentrality(false),
57 fCentralityRange(-999., 999.),
58 fRequestCentrality(false),
65 AliInfoStream() <<
"Creating histograms for task " << GetName() << std::endl;
69 std::array<TString, 10> patchtypes = {
"EG1",
"EG2",
"EJ1",
"EJ2",
"EMC7",
"DG1",
"DG2",
"DJ1",
"DJ2",
"DMC7"};
70 Double_t encuts[5] = {1., 2., 5., 10., 20.};
72 fHistos->
CreateTH1(Form(
"hEventCount%s", trg.Data()), Form(
"Event count for trigger class %s", trg.Data()), 1, 0.5, 1.5);
73 fHistos->
CreateTH1(Form(
"hEventCentrality%s", trg.Data()), Form(
"Event centrality for trigger class %s", trg.Data()), 103, -2., 101.);
74 fHistos->
CreateTH1(Form(
"hVertexZ%s", trg.Data()), Form(
"z-position of the primary vertex for trigger class %s", trg.Data()), 200, -40., 40.);
75 for(
auto patch : patchtypes){
76 fHistos->
CreateTH1(Form(
"h%sPatchEnergy%s", patch.Data(), trg.Data()), Form(
"%s-patch energy for trigger class %s", patch.Data(), trg.Data()), energybinning);
77 fHistos->
CreateTH1(Form(
"h%sPatchET%s", patch.Data(), trg.Data()), Form(
"%s-patch transverse energy for trigger class %s", patch.Data(), trg.Data()), energybinning);
78 fHistos->
CreateTH2(Form(
"h%sPatchEnergyEta%s", patch.Data(), trg.Data()), Form(
"%s-patch energy for trigger class %s", patch.Data(), trg.Data()), energybinning, etabinning);
79 fHistos->
CreateTH2(Form(
"h%sPatchETEta%s", patch.Data(), trg.Data()), Form(
"%s-patch transverse energy for trigger class %s", patch.Data(), trg.Data()), energybinning, etabinning);
80 for(
int ien = 0; ien < 5; ien++){
81 fHistos->
CreateTH2(Form(
"h%sEtaPhi%dG%s", patch.Data(),
static_cast<int>(encuts[ien]), trg.Data()), Form(
"%s-patch #eta-#phi map for patches with energy larger than %f GeV/c for trigger class %s", patch.Data(), encuts[ien], trg.Data()), 100, -0.7, 0.7, 200, 0, TMath::TwoPi());
82 fHistos->
CreateTH2(Form(
"h%sColRow%dG%s", patch.Data(),
static_cast<int>(encuts[ien]), trg.Data()), Form(
"%s-patch col-row map for patches with energy larger than %f GeV/c for trigger class %s", patch.Data(), encuts[ien], trg.Data()), 48, -0.5, 47.5, 104, -0.5, 103.5);
86 AliDebugStream(1) <<
"Histograms done" << std::endl;
92 AliMultSelection *mult =
dynamic_cast<AliMultSelection *
>(InputEvent()->FindListObject(
"MultSelection"));
94 AliErrorStream() << GetName() <<
": Centrality selection enabled but no centrality estimator found" << std::endl;
97 if(mult->IsEventSelected())
return false;
99 AliDebugStream(1) << GetName() <<
": Centrality " <<
fEventCentrality << std::endl;
101 AliDebugStream(1) << GetName() <<
": reject centrality: " <<
fEventCentrality << std::endl;
104 AliDebugStream(1) << GetName() <<
": select centrality " <<
fEventCentrality << std::endl;
107 AliDebugStream(1) << GetName() <<
": No centrality selection applied" << std::endl;
113 AliDebugStream(1) << GetName() <<
": Start function" << std::endl;
115 AliDebugStream(1) << GetName() <<
": Number of trigger patches " <<
fTriggerPatchInfo->GetEntries() << std::endl;
120 AliEMCALTriggerPatchInfo *patch =
static_cast<AliEMCALTriggerPatchInfo *
>(patchIter);
121 if(!patch->IsOfflineSimple())
continue;
123 bool isDCAL = patch->IsDCalPHOS(),
127 std::vector<TString> patchnames;
130 patchnames.push_back(
"DJ1");
131 patchnames.push_back(
"DJ2");
133 patchnames.push_back(
"EJ1");
134 patchnames.push_back(
"EJ2");
139 patchnames.push_back(
"DMC7");
140 patchnames.push_back(
"DG1");
141 patchnames.push_back(
"DG2");
143 patchnames.push_back(
"EMC7");
144 patchnames.push_back(
"EG1");
145 patchnames.push_back(
"EG2");
148 if(!patchnames.size()){
153 TLorentzVector posvec;
154 energy = patch->GetPatchE();
155 eta = patch->GetEtaGeo();
156 phi = patch->GetPhiGeo();
157 col = patch->GetColStart();
158 row = patch->GetRowStart();
159 et = patch->GetLorentzVectorCenterGeo().Et();
162 for(
const auto &nameit : patchnames){
172 AliDebugStream(1) << GetName() <<
": Using weight " << weight <<
" for trigger " << triggerclass <<
" in patch histograms." << std::endl;
173 fHistos->
FillTH1(Form(
"h%sPatchEnergy%s", patchname.Data(), triggerclass.Data()), energy, weight);
174 fHistos->
FillTH1(Form(
"h%sPatchET%s", patchname.Data(), triggerclass.Data()), transverseenergy, weight);
175 fHistos->
FillTH2(Form(
"h%sPatchEnergyEta%s", patchname.Data(), triggerclass.Data()), energy, eta, weight);
176 fHistos->
FillTH2(Form(
"h%sPatchETEta%s", patchname.Data(), triggerclass.Data()), transverseenergy, eta, weight);
177 Double_t encuts[5] = {1., 2., 5., 10., 20.};
178 for(
int ien = 0; ien < 5; ien++){
179 if(energy > encuts[ien]){
180 fHistos->
FillTH2(Form(
"h%sEtaPhi%dG%s", patchname.Data(),
static_cast<int>(encuts[ien]), triggerclass.Data()), eta, phi, weight);
181 fHistos->
FillTH2(Form(
"h%sColRow%dG%s", patchname.Data(),
static_cast<int>(encuts[ien]), triggerclass.Data()), col, row, weight);
190 AliDebugStream(1) << GetName() <<
": Using weight " << weight <<
" for trigger " << trg <<
" in event histograms." << std::endl;
199 boundaries[0] = patch->GetEtaMin();
200 boundaries[1] = patch->GetEtaMax();
201 boundaries[2] = patch->GetPhiMin();
202 boundaries[3] = patch->GetPhiMax();
206 if(!patch->IsOfflineSimple())
return false;
207 return patch->IsGammaLowSimple();
211 if(!patch->IsOfflineSimple())
return false;
212 return patch->IsJetLowSimple();
std::vector< TString > fSelectedTriggers
! Triggers selected for given event
virtual bool IsUserEventSelected()
void FillPatchHistograms(TString triggerclass, TString patchname, double energy, double transverseenergy, double eta, double phi, int col, int row)
std::vector< TString > GetSupportedTriggers()
Class creating a linear binning, used in the histogram manager.
THistManager * fHistos
Task Histogram container.
Double_t GetTriggerWeight(const TString &triggerclass) const
void FillTH2(const char *hname, double x, double y, double weight=1., Option_t *opt="")
AliAnalysisTaskEmcalPatchesRef()
void AddStep(Double_t max, Double_t binwidth)
virtual void UserFillHistosAfterEventSelection()
Double_t fEventCentrality
1! Event centrality
void SetCaloTriggerPatchInfoName(const char *n)
Bool_t fRequestCentrality
Switch for request of centrality selection.
Base class for analyses using EMCAL triggers.
TH2 * CreateTH2(const char *name, const char *title, int nbinsx, double xmin, double xmax, int nbinsy, double ymin, double ymax, Option_t *opt="")
bool SelectSingleShowerPatch(const AliEMCALTriggerPatchInfo *patch) const
TH1 * CreateTH1(const char *name, const char *title, int nbins, double xmin, double xmax, Option_t *opt="")
Helper class creating user defined custom binning.
void FillTH1(const char *hname, double x, double weight=1., Option_t *opt="")
bool SelectJetPatch(const AliEMCALTriggerPatchInfo *patch) const
Analysis of trigger patches in min. bias and triggered events.
ClassImp(AliAnalysisTaskCRC) AliAnalysisTaskCRC
Double_t fVertex[3]
!event vertex
AliCutValueRange< double > fCentralityRange
Range of accepted event centralities.
virtual void CreateUserHistos()
TClonesArray * fTriggerPatchInfo
!trigger patch info array
void GetPatchBoundaries(const AliEMCALTriggerPatchInfo *patch, Double_t *boundaries) const
bool IsInRange(t value) const
void SetMinimum(Double_t min)