20 #include <TClonesArray.h>
23 #include <THashList.h>
25 #include <TObjArray.h>
26 #include <TParameter.h>
28 #include "AliAnalysisUtils.h"
29 #include "AliESDEvent.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.),
50 fUseRecalcPatches(false),
51 fRequestCentrality(false),
59 fCentralityRange(-999., 999.),
61 fUseRecalcPatches(false),
62 fRequestCentrality(false),
69 AliInfoStream() <<
"Creating histograms for task " << GetName() << std::endl;
73 const std::array<const TString, 10> patchtypes = {
"EG1",
"EG2",
"EJ1",
"EJ2",
"EMC7",
"DG1",
"DG2",
"DJ1",
"DJ2",
"DMC7"};
74 const std::array<double, 5> encuts = {1., 2., 5., 10., 20.};
77 fHistos->
CreateTH1(
"EventCount" + trg,
"Event count for trigger class " + trg, 1, 0.5, 1.5, optionstring);
78 fHistos->
CreateTH1(
"EventCentrality" + trg,
"Event centrality for trigger class " + trg, 103, -2., 101., optionstring);
79 fHistos->
CreateTH1(
"VertexZ" + trg,
"z-position of the primary vertex for trigger class " + trg, 200, -40., 40., optionstring);
80 for(
const auto &patch : patchtypes){
81 fHistos->
CreateTH1(patch +
"PatchEnergy" + trg, patch +
"-patch energy for trigger class " + trg, energybinning, optionstring);
82 fHistos->
CreateTH1(patch +
"PatchET" + trg, patch +
"-patch transverse energy for trigger class "+ trg, energybinning, optionstring);
83 fHistos->
CreateTH2(patch +
"PatchEnergyEsmear" + trg, patch +
"-patch energy vs. smeared energy for trigger class " + trg, energybinning, energybinning);
84 fHistos->
CreateTH2(patch +
"PatchEnergyEta" + trg, patch +
"%s-patch energy for trigger class " + trg, energybinning, etabinning, optionstring);
85 fHistos->
CreateTH2(patch +
"PatchETEta" +trg, patch +
"-patch transverse energy for trigger class " + trg, energybinning, etabinning, optionstring);
87 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);
88 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);
92 AliDebugStream(1) <<
"Histograms done" << std::endl;
98 AliMultSelection *mult =
dynamic_cast<AliMultSelection *
>(InputEvent()->FindListObject(
"MultSelection"));
100 AliErrorStream() << GetName() <<
": Centrality selection enabled but no centrality estimator found" << std::endl;
103 if(mult->IsEventSelected())
return false;
105 AliDebugStream(1) << GetName() <<
": Centrality " <<
fEventCentrality << std::endl;
107 AliDebugStream(1) << GetName() <<
": reject centrality: " <<
fEventCentrality << std::endl;
110 AliDebugStream(1) << GetName() <<
": select centrality " <<
fEventCentrality << std::endl;
113 AliDebugStream(1) << GetName() <<
": No centrality selection applied" << std::endl;
119 AliDebugStream(1) << GetName() <<
": Start function" << std::endl;
121 AliDebugStream(1) << GetName() <<
": Number of trigger patches " <<
fTriggerPatchInfo->GetEntries() << std::endl;
127 if(!patch->IsOfflineSimple())
continue;
129 bool isDCAL = patch->IsDCalPHOS(),
133 std::vector<TString> patchnames;
136 patchnames.push_back(
"DJ1");
137 patchnames.push_back(
"DJ2");
139 patchnames.push_back(
"EJ1");
140 patchnames.push_back(
"EJ2");
145 patchnames.push_back(
"DMC7");
146 patchnames.push_back(
"DG1");
147 patchnames.push_back(
"DG2");
149 patchnames.push_back(
"EMC7");
150 patchnames.push_back(
"EG1");
151 patchnames.push_back(
"EG2");
154 if(!patchnames.size()){
159 TLorentzVector posvec;
162 eta = patch->GetEtaGeo();
163 phi = patch->GetPhiGeo();
164 col = patch->GetColStart();
165 row = patch->GetRowStart();
166 et = patch->GetLorentzVectorCenterGeo().Et();
169 for(
const auto &nameit : patchnames){
180 AliDebugStream(1) << GetName() <<
": Using weight " << weight <<
" for trigger " << triggerclass <<
" in patch histograms." << std::endl;
181 fHistos->
FillTH1(patchname +
"PatchEnergy" + triggerclass, energy, weight);
182 fHistos->
FillTH1(patchname +
"PatchET" + triggerclass, transverseenergy, weight);
183 fHistos->
FillTH2(patchname +
"PatchEnergyEta" + triggerclass, energy, eta, weight);
184 fHistos->
FillTH2(patchname +
"PatchETEta" + triggerclass, transverseenergy, eta, weight);
185 fHistos->
FillTH2(patchname +
"PatchEnergyEsmear" + triggerclass, energy, smearedenergy, weight);
186 const std::array<double, 5> encuts = {1., 2., 5., 10., 20.};
187 for(
auto etest : encuts){
189 fHistos->
FillTH2(Form(
"%sEtaPhi%dG%s", patchname.Data(),
static_cast<int>(etest), triggerclass.Data()), eta, phi, weight);
190 fHistos->
FillTH2(Form(
"%sColRow%dG%s", patchname.Data(),
static_cast<int>(etest), triggerclass.Data()), col, row, weight);
199 AliDebugStream(1) << GetName() <<
": Using weight " << weight <<
" for trigger " << trg <<
" in event histograms." << std::endl;
208 boundaries[0] = patch->GetEtaMin();
209 boundaries[1] = patch->GetEtaMax();
210 boundaries[2] = patch->GetPhiMin();
211 boundaries[3] = patch->GetPhiMax();
216 if(!patch->IsRecalc())
return false;
217 return patch->IsGammaLowRecalc();
219 if(!patch->IsOfflineSimple())
return false;
220 return patch->IsGammaLowSimple();
226 if(!patch->IsRecalc())
return false;
227 return patch->IsJetLowRecalc();
229 if(!patch->IsOfflineSimple())
return false;
230 return patch->IsJetLowSimple();
std::vector< TString > fSelectedTriggers
! Triggers selected for given event
virtual bool IsUserEventSelected()
Apply additional event selection requested by the user.
std::vector< TString > GetSupportedTriggers()
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="")
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
1! 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="")
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="")
Helper class creating user defined custom binning.
Temporary class handling.
void FillTH1(const char *hname, double x, double weight=1., Option_t *opt="")
bool SelectJetPatch(const AliEMCALTriggerPatchInfo *patch) const
Selecting offline/recalc simple jet patches.
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()
Creating output histograms.
TClonesArray * fTriggerPatchInfo
!trigger patch info array
Double_t GetSmearedEnergyV1() 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)