33 #include <TClonesArray.h> 36 #include <THashList.h> 38 #include <TObjArray.h> 39 #include <TParameter.h> 41 #include "AliAnalysisUtils.h" 42 #include "AliESDEvent.h" 43 #include "AliEMCALTriggerPatchInfo.h" 45 #include "AliInputEventHandler.h" 47 #include "AliMultSelection.h" 48 #include "AliMultEstimator.h" 49 #include "AliOADBContainer.h" 59 AliAnalysisTaskEmcalPatchesRef::AliAnalysisTaskEmcalPatchesRef() :
61 fCentralityRange(-999., 999.),
63 fUseRecalcPatches(false),
64 fRequestCentrality(false),
82 AliInfoStream() <<
"Creating histograms for task " << GetName() << std::endl;
86 const std::array<const TString, 10> patchtypes = {
"EG1",
"EG2",
"EJ1",
"EJ2",
"EMC7",
"DG1",
"DG2",
"DJ1",
"DJ2",
"DMC7"};
87 const std::array<double, 5> encuts = {1., 2., 5., 10., 20.};
90 fHistos->
CreateTH1(
"EventCount" + trg,
"Event count for trigger class " + trg, 1, 0.5, 1.5, optionstring);
91 fHistos->
CreateTH1(
"EventCentrality" + trg,
"Event centrality for trigger class " + trg, 103, -2., 101., optionstring);
92 fHistos->
CreateTH1(
"VertexZ" + trg,
"z-position of the primary vertex for trigger class " + trg, 200, -40., 40., optionstring);
93 for(
const auto &patch : patchtypes){
94 fHistos->
CreateTH1(patch +
"PatchEnergy" + trg, patch +
"-patch energy for trigger class " + trg, energybinning, optionstring);
95 fHistos->
CreateTH1(patch +
"PatchET" + trg, patch +
"-patch transverse energy for trigger class "+ trg, energybinning, optionstring);
96 fHistos->
CreateTH2(patch +
"PatchEnergyEsmear" + trg, patch +
"-patch energy vs. smeared energy for trigger class " + trg, energybinning, energybinning);
97 fHistos->
CreateTH2(patch +
"PatchEnergyEta" + trg, patch +
"%s-patch energy for trigger class " + trg, energybinning, etabinning, optionstring);
98 fHistos->
CreateTH2(patch +
"PatchETEta" +trg, patch +
"-patch transverse energy for trigger class " + trg, energybinning, etabinning, optionstring);
100 fHistos->
CreateTH2(Form(
"%sEtaPhi%dG%s", patch.Data(),
static_cast<int>(
energy), trg.Data()), Form(
"%s-patch #eta-#phi map for patches with energy larger than %f GeV/c for trigger class %s", patch.Data(),
energy, trg.Data()), 100, -0.7, 0.7, 200, 0, TMath::TwoPi(), optionstring);
101 fHistos->
CreateTH2(Form(
"%sColRow%dG%s", patch.Data(),
static_cast<int>(
energy), trg.Data()), Form(
"%s-patch col-row map for patches with energy larger than %f GeV/c for trigger class %s", patch.Data(),
energy, trg.Data()), 48, -0.5, 47.5, 104, -0.5, 103.5, optionstring);
105 AliDebugStream(1) <<
"Histograms done" << std::endl;
111 AliMultSelection *mult =
dynamic_cast<AliMultSelection *
>(InputEvent()->FindListObject(
"MultSelection"));
113 AliErrorStream() << GetName() <<
": Centrality selection enabled but no centrality estimator found" << std::endl;
116 if(mult->IsEventSelected())
return false;
118 AliDebugStream(1) << GetName() <<
": Centrality " <<
fEventCentrality << std::endl;
120 AliDebugStream(1) << GetName() <<
": reject centrality: " <<
fEventCentrality << std::endl;
123 AliDebugStream(1) << GetName() <<
": select centrality " <<
fEventCentrality << std::endl;
126 AliDebugStream(1) << GetName() <<
": No centrality selection applied" << std::endl;
132 AliDebugStream(1) << GetName() <<
": Start function" << std::endl;
134 AliDebugStream(1) << GetName() <<
": Number of trigger patches " <<
fTriggerPatchInfo->GetEntries() << std::endl;
139 AliEMCALTriggerPatchInfo *patch =
static_cast<AliEMCALTriggerPatchInfo *
>(patchIter);
140 if(!patch->IsOfflineSimple())
continue;
142 bool isDCAL = patch->IsDCalPHOS(),
146 std::vector<TString> patchnames;
149 patchnames.push_back(
"DJ1");
150 patchnames.push_back(
"DJ2");
152 patchnames.push_back(
"EJ1");
153 patchnames.push_back(
"EJ2");
158 patchnames.push_back(
"DMC7");
159 patchnames.push_back(
"DG1");
160 patchnames.push_back(
"DG2");
162 patchnames.push_back(
"EMC7");
163 patchnames.push_back(
"EG1");
164 patchnames.push_back(
"EG2");
167 if(!patchnames.size()){
172 TLorentzVector posvec;
174 smearedenergy = patch->GetSmearedEnergy();
175 eta = patch->GetEtaGeo();
176 phi = patch->GetPhiGeo();
177 col = patch->GetColStart();
178 row = patch->GetRowStart();
179 et = patch->GetLorentzVectorCenterGeo().Et();
182 for(
const auto &nameit : patchnames){
193 AliDebugStream(1) << GetName() <<
": Using weight " << weight <<
" for trigger " << triggerclass <<
" in patch histograms." << std::endl;
194 fHistos->
FillTH1(patchname +
"PatchEnergy" + triggerclass, energy, weight);
195 fHistos->
FillTH1(patchname +
"PatchET" + triggerclass, transverseenergy, weight);
196 fHistos->
FillTH2(patchname +
"PatchEnergyEta" + triggerclass, energy, eta, weight);
197 fHistos->
FillTH2(patchname +
"PatchETEta" + triggerclass, transverseenergy, eta, weight);
198 fHistos->
FillTH2(patchname +
"PatchEnergyEsmear" + triggerclass, energy, smearedenergy, weight);
199 const std::array<double, 5> encuts = {1., 2., 5., 10., 20.};
200 for(
auto etest : encuts){
202 fHistos->
FillTH2(Form(
"%sEtaPhi%dG%s", patchname.Data(),
static_cast<int>(etest), triggerclass.Data()), eta, phi, weight);
203 fHistos->
FillTH2(Form(
"%sColRow%dG%s", patchname.Data(),
static_cast<int>(etest), triggerclass.Data()), col, row, weight);
212 AliDebugStream(1) << GetName() <<
": Using weight " << weight <<
" for trigger " << trg <<
" in event histograms." << std::endl;
221 boundaries[0] = patch->GetEtaMin();
222 boundaries[1] = patch->GetEtaMax();
223 boundaries[2] = patch->GetPhiMin();
224 boundaries[3] = patch->GetPhiMax();
229 if(!patch->IsRecalc())
return false;
230 return patch->IsGammaLowRecalc();
232 if(!patch->IsOfflineSimple())
return false;
233 return patch->IsGammaLowSimple();
239 if(!patch->IsRecalc())
return false;
240 return patch->IsJetLowRecalc();
242 if(!patch->IsOfflineSimple())
return false;
243 return patch->IsJetLowSimple();
std::vector< TString > fSelectedTriggers
! Triggers selected for given event
virtual bool IsUserEventSelected()
Apply additional event selection requested by the user.
Class creating a linear binning, used in the histogram manager.
THistManager * fHistos
Task Histogram container.
void FillPatchHistograms(TString triggerclass, TString patchname, double energy, double transverseenergy, double smearedenergy, double eta, double phi, int col, int row)
Filling patch related histogram.
Double_t GetTriggerWeight(const TString &triggerclass) const
Bool_t fEnableSumw2
Enable sumw2 during histogram creation.
void FillTH2(const char *hname, double x, double y, double weight=1., Option_t *opt="")
Fill a 2D histogram within the container.
AliAnalysisTaskEmcalPatchesRef()
Dummy (I/O) onstructor.
EnergyBinning()
Constructor.
void AddStep(Double_t max, Double_t binwidth)
virtual void UserFillHistosAfterEventSelection()
Fill event-based histograms.
virtual bool Run()
Main event loop.
Double_t fEventCentrality
! Event centrality
Common energy binning used in the patch QA task.
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="")
Create a new TH2 within the container.
bool SelectSingleShowerPatch(const AliEMCALTriggerPatchInfo *patch) const
Selecting offline/recalc simple single shower (gamma or L0) patches.
TH1 * CreateTH1(const char *name, const char *title, int nbins, double xmin, double xmax, Option_t *opt="")
Create a new TH1 within the container.
Helper class creating user defined custom binning.
void FillTH1(const char *hname, double x, double weight=1., Option_t *opt="")
Fill a 1D histogram within the container.
bool SelectJetPatch(const AliEMCALTriggerPatchInfo *patch) const
Selecting offline/recalc simple jet patches.
Analysis of trigger patches in min. bias and triggered events.
Analysis of high- tracks in triggered events.
Double_t fVertex[3]
!event vertex
AliCutValueRange< double > fCentralityRange
Range of accepted event centralities.
virtual void CreateUserHistos()
Creating output histograms.
TClonesArray * fTriggerPatchInfo
!trigger patch info array
std::vector< TString > GetSupportedTriggers(Bool_t useExclusiveTriggers=true) const
Bool_t fUseRecalcPatches
Switch between offline (FEE) and recalc (L1) patches.
void GetPatchBoundaries(const AliEMCALTriggerPatchInfo *patch, Double_t *boundaries) const
bool IsInRange(t value) const
void SetMinimum(Double_t min)