16 #include <TClonesArray.h> 24 #include <TClonesArray.h> 27 #include <THashList.h> 29 #include <TObjArray.h> 30 #include <TParameter.h> 32 #include <AliVCluster.h> 33 #include <AliVParticle.h> 44 #include "AliAnalysisUtils.h" 45 #include "AliESDEvent.h" 46 #include "AliEMCALTriggerPatchInfo.h" 48 #include "AliInputEventHandler.h" 50 #include "AliMultSelection.h" 51 #include "AliMultEstimator.h" 52 #include "AliOADBContainer.h" 68 fUseRecalcPatches(false),
113 while ((obj = next())) {
134 while ((clusCont = static_cast<AliClusterContainer*>(next()))) {
135 groupname = clusCont->GetName();
138 histname = TString::Format(
"%s/histClusterEnergy_%d", groupname.Data(), cent);
139 histtitle = TString::Format(
"%s;#it{E}_{cluster} (GeV);counts", histname.Data());
142 histname = TString::Format(
"%s/histClusterEnergyExotic_%d", groupname.Data(), cent);
143 histtitle = TString::Format(
"%s;#it{E}_{cluster}^{exotic} (GeV);counts", histname.Data());
146 histname = TString::Format(
"%s/histClusterNonLinCorrEnergy_%d", groupname.Data(), cent);
147 histtitle = TString::Format(
"%s;#it{E}_{cluster}^{non-lin.corr.} (GeV);counts", histname.Data());
150 histname = TString::Format(
"%s/histClusterHadCorrEnergy_%d", groupname.Data(), cent);
151 histtitle = TString::Format(
"%s;#it{E}_{cluster}^{had.corr.} (GeV);counts", histname.Data());
154 histname = TString::Format(
"%s/histClusterPhi_%d", groupname.Data(), cent);
155 histtitle = TString::Format(
"%s;#it{#phi}_{custer};counts", histname.Data());
158 histname = TString::Format(
"%s/histClusterEta_%d", groupname.Data(), cent);
159 histtitle = TString::Format(
"%s;#it{#eta}_{custer};counts", histname.Data());
162 histname = TString::Format(
"%s/histNClusters_%d", groupname.Data(), cent);
163 histtitle = TString::Format(
"%s;number of clusters;events", histname.Data());
187 histname = TString::Format(
"%s/histCellEnergy_%d", groupname.Data(), cent);
188 histtitle = TString::Format(
"%s;#it{E}_{cell} (GeV);counts", histname.Data());
191 histname = TString::Format(
"%s/histNCells_%d", groupname.Data(), cent);
192 histtitle = TString::Format(
"%s;number of cells;events", histname.Data());
215 while ((partCont = static_cast<AliParticleContainer*>(next()))) {
216 groupname = partCont->GetName();
219 histname = TString::Format(
"%s/histTrackPt_%d", groupname.Data(), cent);
220 histtitle = TString::Format(
"%s;#it{p}_{T,track} (GeV/#it{c});counts", histname.Data());
223 histname = TString::Format(
"%s/histTrackPhi_%d", groupname.Data(), cent);
224 histtitle = TString::Format(
"%s;#it{#phi}_{track};counts", histname.Data());
227 histname = TString::Format(
"%s/histTrackEta_%d", groupname.Data(), cent);
228 histtitle = TString::Format(
"%s;#it{#eta}_{track};counts", histname.Data());
231 if (TClass(partCont->GetClassName()).InheritsFrom(
"AliVTrack")) {
232 histname = TString::Format(
"%s/fHistDeltaEtaPt_%d", groupname.Data(), cent);
233 histtitle = TString::Format(
"%s;#it{p}_{T,track}^{vertex} (GeV/#it{c});#it{#eta}_{track}^{vertex} - #it{#eta}_{track}^{EMCal};counts", histname.Data());
236 histname = TString::Format(
"%s/fHistDeltaPhiPt_%d", groupname.Data(), cent);
237 histtitle = TString::Format(
"%s;#it{p}_{T,track}^{vertex} (GeV/#it{c});#it{#phi}_{track}^{vertex} - #it{#phi}_{track}^{EMCal};counts", histname.Data());
240 histname = TString::Format(
"%s/fHistDeltaPtvsPt_%d", groupname.Data(), cent);
241 histtitle = TString::Format(
"%s;#it{p}_{T,track}^{vertex} (GeV/#it{c});#it{p}_{T,track}^{vertex} - #it{p}_{T,track}^{EMCal} (GeV/#it{c});counts", histname.Data());
244 histname = TString::Format(
"%s/fHistEoverPvsP_%d", groupname.Data(), cent);
245 histtitle = TString::Format(
"%s;#it{P}_{track} (GeV/#it{c});#it{E}_{cluster} / #it{P}_{track} #it{c};counts", histname.Data());
249 histname = TString::Format(
"%s/histNTracks_%d", groupname.Data(), cent);
250 histtitle = TString::Format(
"%s;number of tracks;events", histname.Data());
273 while ((jetCont = static_cast<AliJetContainer*>(next()))) {
274 groupname = jetCont->GetName();
277 histname = TString::Format(
"%s/histJetPt_%d", groupname.Data(), cent);
278 histtitle = TString::Format(
"%s;#it{p}_{T,jet} (GeV/#it{c});counts", histname.Data());
281 histname = TString::Format(
"%s/histJetClusterEnergy_%d", groupname.Data(), cent);
282 histtitle = TString::Format(
"%s;#it{E}_{cluster} (GeV);counts", histname.Data());
285 histname = TString::Format(
"%s/histJetTrkPt_%d", groupname.Data(), cent);
286 histtitle = TString::Format(
"%s;#it{p}_{T,JetTrk} (GeV/#it{c});counts", histname.Data());
289 histname = TString::Format(
"%s/fHistDeltaEtaDeltaPhiJE_%d", groupname.Data(), cent);
290 histtitle = TString::Format(
"%s;#it{#phi}_{jet} - #it{#phi}_{JE,patch};#it{#eta}_{Jet} - #it{#eta}_{JE,patch};counts", histname.Data());
293 histname = TString::Format(
"%s/fHistDeltaEtaDeltaPhiGA_%d", groupname.Data(), cent);
294 histtitle = TString::Format(
"%s;#it{#phi}_{jet} - #it{#phi}_{GA,patch};#it{#eta}_{Jet} - #it{#eta}_{GA,patch};counts", histname.Data());
297 histname = TString::Format(
"%s/fHistJetEPatchEJE_%d", groupname.Data(), cent);
298 histtitle = TString::Format(
"%s;#it{E_{JE,patch}};#it{E_{Jet}^{UnCorr}};counts", histname.Data());
301 histname = TString::Format(
"%s/fHistJetEPatchEGA_%d", groupname.Data(), cent);
302 histtitle = TString::Format(
"%s;#it{E_{GA,patch}};#it{E_{Jet,UnCorr}};counts", histname.Data());
305 histname = TString::Format(
"%s/histJetArea_%d", groupname.Data(), cent);
306 histtitle = TString::Format(
"%s;#it{A}_{jet};counts", histname.Data());
309 histname = TString::Format(
"%s/histJetPhi_%d", groupname.Data(), cent);
310 histtitle = TString::Format(
"%s;#it{#phi}_{jet};counts", histname.Data());
313 histname = TString::Format(
"%s/histJetEta_%d", groupname.Data(), cent);
314 histtitle = TString::Format(
"%s;#it{#eta}_{jet};counts", histname.Data());
317 histname = TString::Format(
"%s/histJetClusterPhi_%d", groupname.Data(), cent);
318 histtitle = TString::Format(
"%s;#it{#phi}_{jet}^{cluster};counts", histname.Data());
321 histname = TString::Format(
"%s/histJetClusterEta_%d", groupname.Data(), cent);
322 histtitle = TString::Format(
"%s;#it{#eta}_{jet}^{cluster};counts", histname.Data());
325 histname = TString::Format(
"%s/histNJets_%d", groupname.Data(), cent);
326 histtitle = TString::Format(
"%s;number of jets;events", histname.Data());
335 histname = TString::Format(
"%s/histJetCorrPt_%d", groupname.Data(), cent);
336 histtitle = TString::Format(
"%s;#it{p}_{T,jet}^{corr} (GeV/#it{c});counts", histname.Data());
370 TClonesArray *triggerpatches =
dynamic_cast<TClonesArray *
>(InputEvent()->FindListObject(
"EmcalTriggers"));
372 AliErrorStream() <<
"Trigger patch container EmcalTriggers not found in task " << GetName() << std::endl;
374 while ((jetCont = static_cast<AliJetContainer*>(next()))) {
375 groupname = jetCont->GetName();
377 for(
auto jet : jetCont->
accepted()) {
381 histname = TString::Format(
"%s/histJetPt_%d", groupname.Data(),
fCentBin);
384 histname = TString::Format(
"%s/histJetClusterEnergy_%d", groupname.Data(),
fCentBin);
387 histname = TString::Format(
"%s/histJetArea_%d", groupname.Data(),
fCentBin);
390 histname = TString::Format(
"%s/histJetPhi_%d", groupname.Data(),
fCentBin);
393 histname = TString::Format(
"%s/histJetEta_%d", groupname.Data(),
fCentBin);
397 AliEMCALTriggerPatchInfo *currentpatch(
nullptr);
398 for(TIter patchiter = TIter(triggerpatches).Begin(); patchiter != TIter::End(); ++patchiter){
399 currentpatch =
static_cast<AliEMCALTriggerPatchInfo *
>(*patchiter);
400 if(currentpatch->GetPatchSize() != 2)
continue;
403 if(currentpatch->IsGammaLowRecalc() || currentpatch->IsGammaLowSimple()){
404 histname = TString::Format(
"%s/fHistDeltaEtaDeltaPhiGA_%d", groupname.Data(),
fCentBin);
405 fHistManager.
FillTH2(histname, jet->Phi() - currentpatch->GetPhiGeo(), jet->Eta() - currentpatch->GetEtaGeo());
406 histname = TString::Format(
"%s/fHistJetEPatchEGA_%d", groupname.Data(),
fCentBin);
411 if(currentpatch->IsJetLowRecalc() || currentpatch->IsJetLowSimple()){
412 histname = TString::Format(
"%s/fHistDeltaEtaDeltaPhiJE_%d", groupname.Data(),
fCentBin);
413 fHistManager.
FillTH2(histname, jet->Phi() - currentpatch->GetPhiGeo(), jet->Eta() - currentpatch->GetEtaGeo());
414 histname = TString::Format(
"%s/fHistJetEPatchEJE_%d", groupname.Data(),
fCentBin);
423 for (
Int_t it = 0; it < jet->GetNumberOfTracks(); it++) {
424 AliVParticle *JetTrk = jet->TrackAt(it, tracks->GetArray());
427 histname = TString::Format(
"%s/histJetTrkPt_%d", groupname.Data(),
fCentBin);
436 for(
auto cluster : JetCluster->
accepted()) {
438 cluster->GetMomentum(nPart,
fVertex);
439 histname = TString::Format(
"%s/histJetClusterEnergy_%d", groupname.Data(),
fCentBin);
441 histname = TString::Format(
"%s/histJetClusterPhi_%d", groupname.Data(),
fCentBin);
443 histname = TString::Format(
"%s/histJetClusterEta_%d", groupname.Data(),
fCentBin);
450 histname = TString::Format(
"%s/histJetCorrPt_%d", groupname.Data(),
fCentBin);
454 histname = TString::Format(
"%s/histNJets_%d", groupname.Data(),
fCentBin);
471 while ((partCont = static_cast<AliParticleContainer*>(next()))) {
472 groupname = partCont->GetName();
474 for(
auto part : partCont->
accepted()) {
478 histname = TString::Format(
"%s/histTrackPt_%d", groupname.Data(),
fCentBin);
481 histname = TString::Format(
"%s/histTrackPhi_%d", groupname.Data(),
fCentBin);
484 histname = TString::Format(
"%s/histTrackEta_%d", groupname.Data(),
fCentBin);
487 if (partCont->GetLoadedClass()->InheritsFrom(
"AliVTrack")) {
488 const AliVTrack* track =
static_cast<const AliVTrack*
>(part);
490 histname = TString::Format(
"%s/fHistDeltaEtaPt_%d", groupname.Data(),
fCentBin);
493 histname = TString::Format(
"%s/fHistDeltaPhiPt_%d", groupname.Data(),
fCentBin);
496 histname = TString::Format(
"%s/fHistDeltaPtvsPt_%d", groupname.Data(),
fCentBin);
500 Int_t iCluster = track->GetEMCALcluster();
504 histname = TString::Format(
"%s/fHistEoverPvsP_%d", groupname.Data(),
fCentBin);
512 histname = TString::Format(
"%s/histNTracks_%d", groupname.Data(),
fCentBin);
527 while ((clusCont = static_cast<AliClusterContainer*>(next()))) {
528 groupname = clusCont->GetName();
530 for(
auto cluster : clusCont->
all()) {
531 if (!cluster)
continue;
533 if (cluster->GetIsExotic()) {
534 histname = TString::Format(
"%s/histClusterEnergyExotic_%d", groupname.Data(),
fCentBin);
540 for(
auto cluster : clusCont->
accepted()) {
541 if (!cluster)
continue;
545 cluster->GetMomentum(nPart,
fVertex);
547 histname = TString::Format(
"%s/histClusterEnergy_%d", groupname.Data(),
fCentBin);
550 histname = TString::Format(
"%s/histClusterNonLinCorrEnergy_%d", groupname.Data(),
fCentBin);
553 histname = TString::Format(
"%s/histClusterHadCorrEnergy_%d", groupname.Data(),
fCentBin);
556 histname = TString::Format(
"%s/histClusterPhi_%d", groupname.Data(),
fCentBin);
559 histname = TString::Format(
"%s/histClusterEta_%d", groupname.Data(),
fCentBin);
563 histname = TString::Format(
"%s/histNClusters_%d", groupname.Data(),
fCentBin);
584 for (
Short_t pos = 0; pos < ncells; pos++) {
612 TString firedtriggers(InputEvent()->GetFiredTriggerClasses());
613 if(!firedtriggers.Contains(
"EG1")){
645 for (
Int_t iPatch = 0; iPatch < nPatch; iPatch++) {
646 AliEMCALTriggerPatchInfo *patch = (AliEMCALTriggerPatchInfo*)
fTriggerPatchInfo->At( iPatch );
647 if (!patch)
continue;
656 cout<<
"*****************************"<<endl;
657 cout<<
"******* Task Finished *******"<<endl;
658 cout<<
"*****************************"<<endl;
THashList * CreateHistoGroup(const char *groupname)
Create a new group of histograms within a parent group.
TObjArray fClusterCollArray
cluster collection array
void AllocateCellHistograms()
Double_t GetRhoVal() const
const TString & GetRhoName() const
virtual ~AliAnalysisTaskEmcalJetSpectra8TeVTriggerQA()
void FillTH2(const char *hname, double x, double y, double weight=1., Option_t *opt="")
Fill a 2D histogram within the container.
Declaration of class AliTLorentzVector.
void Terminate(Option_t *option)
Double_t fMinBinPt
min pt in histograms
AliClusterContainer * GetClusterContainer() const
THistManager fHistManager
Histogram manager.
Int_t fCentBin
!event centrality bin
Declaration of class AliAnalysisTaskEmcalJetSpectra8TeVTriggerQA.
void AllocateClusterHistograms()
void AllocateJetHistograms()
Container for particles within the EMCAL framework.
void SetCaloTriggerPatchInfoName(const char *n)
AliAnalysisTaskEmcalJetSpectra8TeVTriggerQA()
TObjArray fParticleCollArray
particle/track collection array
const AliClusterIterableContainer all() const
AliParticleContainer * GetParticleContainer() const
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_t fUseRecalcPatches
Switch between offline (FEE) and recalc (L1) patches.
TH1F * fHistJetPt
Numb Jets Per Event.
THashList * GetListOfHistograms() const
Get the list of histograms.
void AllocateTrackHistograms()
Double_t Phi_0_2pi() const
Implementation of a EMCal spectra task and QA for EMCal triggers.
TH1 * CreateTH1(const char *name, const char *title, int nbins, double xmin, double xmax, Option_t *opt="")
Create a new TH1 within the container.
BeamType fForceBeamType
forced beam type
Int_t fNcentBins
how many centrality bins
AliClusterContainer * GetClusterContainer(Int_t i=0) const
Get cluster container attached to this task.
AliVCluster * GetAcceptCluster(Int_t i) const
const AliClusterIterableContainer accepted() const
TString fCaloCellsName
name of calo cell collection
void FillTH1(const char *hname, double x, double weight=1., Option_t *opt="")
Fill a 1D histogram within the container.
TObjArray fJetCollArray
jet collection array
AliVCaloCells * fCaloCells
!cells
AliRhoParameter * GetRhoParameter()
AliEmcalList * fOutput
!output list
Double_t fMaxBinPt
max pt in histograms
void UserCreateOutputObjects()
Double_t fVertex[3]
!event vertex
void SetMakeGeneralHistograms(Bool_t g)
TClonesArray * fTriggerPatchInfo
!trigger patch info array
Base task in the EMCAL jet framework.
const AliParticleIterableContainer accepted() const
void UserCreateOutputObjects()
Main initialization function on the worker.
const AliJetIterableContainer accepted() const
Container structure for EMCAL clusters.
Container for jet within the EMCAL jet framework.
Int_t fNbins
no. of pt bins