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),
82 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/histJetArea_%d", groupname.Data(), cent);
282 histtitle = TString::Format(
"%s;#it{A}_{jet};counts", histname.Data());
285 histname = TString::Format(
"%s/histJetPhi_%d", groupname.Data(), cent);
286 histtitle = TString::Format(
"%s;#it{#phi}_{jet};counts", histname.Data());
289 histname = TString::Format(
"%s/histJetEta_%d", groupname.Data(), cent);
290 histtitle = TString::Format(
"%s;#it{#eta}_{jet};counts", histname.Data());
293 histname = TString::Format(
"%s/histNJets_%d", groupname.Data(), cent);
294 histtitle = TString::Format(
"%s;number of jets;events", histname.Data());
303 histname = TString::Format(
"%s/histJetCorrPt_%d", groupname.Data(), cent);
304 histtitle = TString::Format(
"%s;#it{p}_{T,jet}^{corr} (GeV/#it{c});counts", histname.Data());
341 TClonesArray *triggerpatches =
dynamic_cast<TClonesArray *
>(InputEvent()->FindListObject(
"EmcalTriggers"));
343 AliErrorStream() <<
"Trigger patch container EmcalTriggers not found in task " << GetName() << std::endl;
345 AliEMCALTriggerPatchInfo *currentpatch(
nullptr);
346 for(TIter patchiter = TIter(triggerpatches).Begin(); patchiter != TIter::End(); ++patchiter){
347 currentpatch =
static_cast<AliEMCALTriggerPatchInfo *
>(*patchiter);
348 if(currentpatch->GetPatchSize() != 2)
continue;
350 Double_t patchE = currentpatch->GetPatchE();
358 while ((jetCont = static_cast<AliJetContainer*>(next()))) {
359 groupname = jetCont->GetName();
361 for(
auto jet : jetCont->
accepted()) {
366 Double_t dEtaJetTrigger = 0.0, dPhiJetTrigger = 0.0, deltaRpatch = 0.0;
368 dEtaJetTrigger = jet->Eta() - currentpatch->GetEtaGeo();
369 dPhiJetTrigger = jet->Phi() - currentpatch->GetPhiGeo();
371 dphi2 = TMath::Abs(dPhiJetTrigger * dPhiJetTrigger );
372 deta2 = TMath::Abs(dEtaJetTrigger * dEtaJetTrigger );
373 deltaRpatch = TMath::Sqrt(dphi2 + deta2);
377 histname = TString::Format(
"%s/histJetPt_%d", groupname.Data(),
fCentBin);
380 histname = TString::Format(
"%s/histJetArea_%d", groupname.Data(),
fCentBin);
383 histname = TString::Format(
"%s/histJetPhi_%d", groupname.Data(),
fCentBin);
386 histname = TString::Format(
"%s/histJetEta_%d", groupname.Data(),
fCentBin);
390 histname = TString::Format(
"%s/histJetCorrPt_%d", groupname.Data(),
fCentBin);
394 histname = TString::Format(
"%s/histNJets_%d", groupname.Data(),
fCentBin);
411 while ((partCont = static_cast<AliParticleContainer*>(next()))) {
412 groupname = partCont->GetName();
414 for(
auto part : partCont->
accepted()) {
418 histname = TString::Format(
"%s/histTrackPt_%d", groupname.Data(),
fCentBin);
421 histname = TString::Format(
"%s/histTrackPhi_%d", groupname.Data(),
fCentBin);
424 histname = TString::Format(
"%s/histTrackEta_%d", groupname.Data(),
fCentBin);
427 if (partCont->GetLoadedClass()->InheritsFrom(
"AliVTrack")) {
428 const AliVTrack* track =
static_cast<const AliVTrack*
>(part);
430 histname = TString::Format(
"%s/fHistDeltaEtaPt_%d", groupname.Data(),
fCentBin);
433 histname = TString::Format(
"%s/fHistDeltaPhiPt_%d", groupname.Data(),
fCentBin);
436 histname = TString::Format(
"%s/fHistDeltaPtvsPt_%d", groupname.Data(),
fCentBin);
440 Int_t iCluster = track->GetEMCALcluster();
444 histname = TString::Format(
"%s/fHistEoverPvsP_%d", groupname.Data(),
fCentBin);
452 histname = TString::Format(
"%s/histNTracks_%d", groupname.Data(),
fCentBin);
467 while ((clusCont = static_cast<AliClusterContainer*>(next()))) {
468 groupname = clusCont->GetName();
470 for(
auto cluster : clusCont->
all()) {
471 if (!cluster)
continue;
473 if (cluster->GetIsExotic()) {
474 histname = TString::Format(
"%s/histClusterEnergyExotic_%d", groupname.Data(),
fCentBin);
480 for(
auto cluster : clusCont->
accepted()) {
481 if (!cluster)
continue;
485 cluster->GetMomentum(nPart,
fVertex);
487 histname = TString::Format(
"%s/histClusterEnergy_%d", groupname.Data(),
fCentBin);
490 histname = TString::Format(
"%s/histClusterNonLinCorrEnergy_%d", groupname.Data(),
fCentBin);
493 histname = TString::Format(
"%s/histClusterHadCorrEnergy_%d", groupname.Data(),
fCentBin);
496 histname = TString::Format(
"%s/histClusterPhi_%d", groupname.Data(),
fCentBin);
499 histname = TString::Format(
"%s/histClusterEta_%d", groupname.Data(),
fCentBin);
503 histname = TString::Format(
"%s/histNClusters_%d", groupname.Data(),
fCentBin);
524 for (
Short_t pos = 0; pos < ncells; pos++) {
589 if(!patch->IsRecalc())
return false;
590 return patch->IsGammaLowRecalc();
592 if(!patch->IsOfflineSimple())
return false;
593 return patch->IsGammaLowSimple();
599 if(!patch->IsRecalc())
return false;
600 return patch->IsJetLowRecalc();
602 if(!patch->IsOfflineSimple())
return false;
603 return patch->IsJetLowSimple();
616 for (
Int_t iPatch = 0; iPatch < nPatch; iPatch++) {
617 AliEMCALTriggerPatchInfo *patch = (AliEMCALTriggerPatchInfo*)
fTriggerPatchInfo->At( iPatch );
618 if (!patch)
continue;
627 cout<<
"****************************"<<endl;
628 cout<<
"**** User Task Finished ****"<<endl;
629 cout<<
"****************************"<<endl;
THashList * CreateHistoGroup(const char *groupname)
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="")
Declaration of class AliTLorentzVector.
void Terminate(Option_t *option)
Double_t fMinBinPt
min pt in histograms
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
TH2 * CreateTH2(const char *name, const char *title, int nbinsx, double xmin, double xmax, int nbinsy, double ymin, double ymax, Option_t *opt="")
Bool_t fUseRecalcPatches
Switch between offline (FEE) and recalc (L1) patches.
TH1F * fHistJetPt
Numb Jets Per Event.
THashList * GetListOfHistograms() const
Bool_t SelectSingleShowerPatch(const AliEMCALTriggerPatchInfo *patch) const
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="")
BeamType fForceBeamType
forced beam type
Int_t fNcentBins
how many centrality bins
AliClusterContainer * GetClusterContainer(Int_t i=0) const
AliVCluster * GetAcceptCluster(Int_t i) const
const AliClusterIterableContainer accepted() const
Bool_t SelectJetPatch(const AliEMCALTriggerPatchInfo *patch) const
TString fCaloCellsName
name of calo cell collection
void FillTH1(const char *hname, double x, double weight=1., Option_t *opt="")
TObjArray fJetCollArray
jet collection array
AliVCaloCells * fCaloCells
!cells
AliRhoParameter * GetRhoParameter()
AliEmcalList * fOutput
!output list
Double_t fMaxBinPt
max pt in histograms
void UserCreateOutputObjects()
ClassImp(AliAnalysisTaskCRC) AliAnalysisTaskCRC
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()
const AliJetIterableContainer accepted() const
Container structure for EMCAL clusters.
Container for jet within the EMCAL jet framework.
Int_t fNbins
no. of pt bins