16 #include <TClonesArray.h> 21 #include <AliAnalysisManager.h> 22 #include <AliVEventHandler.h> 23 #include <AliVCluster.h> 24 #include <AliVParticle.h> 83 while ((obj = next())) {
102 while ((clusCont = static_cast<AliClusterContainer*>(next()))) {
103 groupname = clusCont->GetName();
106 AliWarning(TString::Format(
"%s: Found groupname %s in hist manager. The cluster containers will be filled into the same histograms.", GetName(), groupname.Data()));
111 histname = TString::Format(
"%s/histClusterEnergy_%d", groupname.Data(), cent);
112 histtitle = TString::Format(
"%s;#it{E}_{cluster} (GeV);counts", histname.Data());
115 histname = TString::Format(
"%s/histClusterEnergyExotic_%d", groupname.Data(), cent);
116 histtitle = TString::Format(
"%s;#it{E}_{cluster}^{exotic} (GeV);counts", histname.Data());
119 histname = TString::Format(
"%s/histClusterNonLinCorrEnergy_%d", groupname.Data(), cent);
120 histtitle = TString::Format(
"%s;#it{E}_{cluster}^{non-lin.corr.} (GeV);counts", histname.Data());
123 histname = TString::Format(
"%s/histClusterHadCorrEnergy_%d", groupname.Data(), cent);
124 histtitle = TString::Format(
"%s;#it{E}_{cluster}^{had.corr.} (GeV);counts", histname.Data());
127 histname = TString::Format(
"%s/histClusterPhi_%d", groupname.Data(), cent);
128 histtitle = TString::Format(
"%s;#it{#phi}_{custer};counts", histname.Data());
131 histname = TString::Format(
"%s/histClusterEta_%d", groupname.Data(), cent);
132 histtitle = TString::Format(
"%s;#it{#eta}_{custer};counts", histname.Data());
135 histname = TString::Format(
"%s/histNClusters_%d", groupname.Data(), cent);
136 histtitle = TString::Format(
"%s;number of clusters;events", histname.Data());
146 histname =
"fHistSumNClusters";
147 histtitle = TString::Format(
"%s;Sum of n clusters;events", histname.Data());
169 histname = TString::Format(
"%s/histCellEnergy_%d", groupname.Data(), cent);
170 histtitle = TString::Format(
"%s;#it{E}_{cell} (GeV);counts", histname.Data());
173 histname = TString::Format(
"%s/histNCells_%d", groupname.Data(), cent);
174 histtitle = TString::Format(
"%s;number of cells;events", histname.Data());
197 while ((partCont = static_cast<AliParticleContainer*>(next()))) {
198 groupname = partCont->GetName();
201 AliWarning(TString::Format(
"%s: Found groupname %s in hist manager. The track containers will be filled into the same histograms.", GetName(), groupname.Data()));
206 histname = TString::Format(
"%s/histTrackPt_%d", groupname.Data(), cent);
207 histtitle = TString::Format(
"%s;#it{p}_{T,track} (GeV/#it{c});counts", histname.Data());
210 histname = TString::Format(
"%s/histTrackPhi_%d", groupname.Data(), cent);
211 histtitle = TString::Format(
"%s;#it{#phi}_{track};counts", histname.Data());
214 histname = TString::Format(
"%s/histTrackEta_%d", groupname.Data(), cent);
215 histtitle = TString::Format(
"%s;#it{#eta}_{track};counts", histname.Data());
218 if (TClass(partCont->GetClassName()).InheritsFrom(
"AliVTrack")) {
219 histname = TString::Format(
"%s/fHistDeltaEtaPt_%d", groupname.Data(), cent);
220 histtitle = TString::Format(
"%s;#it{p}_{T,track}^{vertex} (GeV/#it{c});#it{#eta}_{track}^{vertex} - #it{#eta}_{track}^{EMCal};counts", histname.Data());
223 histname = TString::Format(
"%s/fHistDeltaPhiPt_%d", groupname.Data(), cent);
224 histtitle = TString::Format(
"%s;#it{p}_{T,track}^{vertex} (GeV/#it{c});#it{#phi}_{track}^{vertex} - #it{#phi}_{track}^{EMCal};counts", histname.Data());
227 histname = TString::Format(
"%s/fHistDeltaPtvsPt_%d", groupname.Data(), cent);
228 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());
231 histname = TString::Format(
"%s/fHistEoverPvsP_%d", groupname.Data(), cent);
232 histtitle = TString::Format(
"%s;#it{P}_{track} (GeV/#it{c});#it{E}_{cluster} / #it{P}_{track} #it{c};counts", histname.Data());
236 histname = TString::Format(
"%s/histNTracks_%d", groupname.Data(), cent);
237 histtitle = TString::Format(
"%s;number of tracks;events", histname.Data());
247 histname =
"fHistSumNTracks";
248 histtitle = TString::Format(
"%s;Sum of n tracks;events", histname.Data());
269 while ((jetCont = static_cast<AliJetContainer*>(next()))) {
270 groupname = jetCont->GetName();
273 AliWarning(TString::Format(
"%s: Found groupname %s in hist manager. The jet containers will be filled into the same histograms.", GetName(), groupname.Data()));
278 histname = TString::Format(
"%s/histJetPt_%d", groupname.Data(), cent);
279 histtitle = TString::Format(
"%s;#it{p}_{T,jet} (GeV/#it{c});counts", histname.Data());
282 histname = TString::Format(
"%s/histJetArea_%d", groupname.Data(), cent);
283 histtitle = TString::Format(
"%s;#it{A}_{jet};counts", histname.Data());
286 histname = TString::Format(
"%s/histJetPhi_%d", groupname.Data(), cent);
287 histtitle = TString::Format(
"%s;#it{#phi}_{jet};counts", histname.Data());
290 histname = TString::Format(
"%s/histJetEta_%d", groupname.Data(), cent);
291 histtitle = TString::Format(
"%s;#it{#eta}_{jet};counts", histname.Data());
294 histname = TString::Format(
"%s/histNJets_%d", groupname.Data(), cent);
295 histtitle = TString::Format(
"%s;number of jets;events", histname.Data());
304 histname = TString::Format(
"%s/histJetCorrPt_%d", groupname.Data(), cent);
305 histtitle = TString::Format(
"%s;#it{p}_{T,jet}^{corr} (GeV/#it{c});counts", histname.Data());
338 while ((jetCont = static_cast<AliJetContainer*>(next()))) {
339 groupname = jetCont->GetName();
341 for(
auto jet : jetCont->
accepted()) {
345 histname = TString::Format(
"%s/histJetPt_%d", groupname.Data(),
fCentBin);
348 histname = TString::Format(
"%s/histJetArea_%d", groupname.Data(),
fCentBin);
351 histname = TString::Format(
"%s/histJetPhi_%d", groupname.Data(),
fCentBin);
354 histname = TString::Format(
"%s/histJetEta_%d", groupname.Data(),
fCentBin);
358 histname = TString::Format(
"%s/histJetCorrPt_%d", groupname.Data(),
fCentBin);
362 histname = TString::Format(
"%s/histNJets_%d", groupname.Data(),
fCentBin);
377 UInt_t sumAcceptedTracks = 0;
380 while ((partCont = static_cast<AliParticleContainer*>(next()))) {
381 groupname = partCont->GetName();
383 for(
auto part : partCont->
accepted()) {
387 histname = TString::Format(
"%s/histTrackPt_%d", groupname.Data(),
fCentBin);
390 histname = TString::Format(
"%s/histTrackPhi_%d", groupname.Data(),
fCentBin);
393 histname = TString::Format(
"%s/histTrackEta_%d", groupname.Data(),
fCentBin);
396 if (partCont->GetLoadedClass()->InheritsFrom(
"AliVTrack")) {
397 const AliVTrack* track =
static_cast<const AliVTrack*
>(part);
399 histname = TString::Format(
"%s/fHistDeltaEtaPt_%d", groupname.Data(),
fCentBin);
402 histname = TString::Format(
"%s/fHistDeltaPhiPt_%d", groupname.Data(),
fCentBin);
405 histname = TString::Format(
"%s/fHistDeltaPtvsPt_%d", groupname.Data(),
fCentBin);
409 Int_t iCluster = track->GetEMCALcluster();
413 histname = TString::Format(
"%s/fHistEoverPvsP_%d", groupname.Data(),
fCentBin);
420 sumAcceptedTracks += count;
422 histname = TString::Format(
"%s/histNTracks_%d", groupname.Data(),
fCentBin);
426 histname =
"fHistSumNTracks";
438 UInt_t sumAcceptedClusters = 0;
441 while ((clusCont = static_cast<AliClusterContainer*>(next()))) {
442 groupname = clusCont->GetName();
444 for(
auto cluster : clusCont->
all()) {
445 if (!cluster)
continue;
447 if (cluster->GetIsExotic()) {
448 histname = TString::Format(
"%s/histClusterEnergyExotic_%d", groupname.Data(),
fCentBin);
454 for(
auto cluster : clusCont->
accepted()) {
455 if (!cluster)
continue;
459 cluster->GetMomentum(nPart,
fVertex);
461 histname = TString::Format(
"%s/histClusterEnergy_%d", groupname.Data(),
fCentBin);
464 histname = TString::Format(
"%s/histClusterNonLinCorrEnergy_%d", groupname.Data(),
fCentBin);
467 histname = TString::Format(
"%s/histClusterHadCorrEnergy_%d", groupname.Data(),
fCentBin);
470 histname = TString::Format(
"%s/histClusterPhi_%d", groupname.Data(),
fCentBin);
473 histname = TString::Format(
"%s/histClusterEta_%d", groupname.Data(),
fCentBin);
476 sumAcceptedClusters += count;
478 histname = TString::Format(
"%s/histNClusters_%d", groupname.Data(),
fCentBin);
482 histname =
"fHistSumNClusters";
502 for (
Short_t pos = 0; pos < ncells; pos++) {
544 const char *nclusters,
553 ::Error(
"AddTaskEmcalJetSample",
"No analysis manager to connect to.");
559 AliVEventHandler* handler = mgr->GetInputEventHandler();
562 ::Error(
"AddTaskEmcalJetSample",
"This task requires an input event handler");
574 if (handler->InheritsFrom(
"AliESDInputHandler")) {
577 else if (handler->InheritsFrom(
"AliAODInputHandler")) {
589 if (trackName ==
"usedefault") {
590 if (dataType ==
kESD) {
591 trackName =
"Tracks";
593 else if (dataType == kAOD) {
594 trackName =
"tracks";
601 if (clusName ==
"usedefault") {
602 if (dataType ==
kESD) {
603 clusName =
"CaloClusters";
605 else if (dataType == kAOD) {
606 clusName =
"caloClusters";
613 if (cellName ==
"usedefault") {
614 if (dataType ==
kESD) {
615 cellName =
"EMCALCells";
617 else if (dataType == kAOD) {
618 cellName =
"emcalCells";
625 TString name(
"AliAnalysisTaskEmcalJetSample");
626 if (!trackName.IsNull()) {
630 if (!clusName.IsNull()) {
634 if (!cellName.IsNull()) {
638 if (strcmp(suffix,
"") != 0) {
647 if (trackName ==
"mcparticles") {
650 else if (trackName ==
"tracks" || trackName ==
"Tracks") {
653 else if (!trackName.IsNull()) {
662 mgr->AddTask(sampleTask);
665 AliAnalysisDataContainer *cinput1 = mgr->GetCommonInputContainer() ;
667 contname +=
"_histos";
668 AliAnalysisDataContainer *coutput1 = mgr->CreateContainer(contname.Data(),
669 TList::Class(),AliAnalysisManager::kOutputContainer,
670 Form(
"%s", AliAnalysisManager::GetCommonFileName()));
671 mgr->ConnectInput (sampleTask, 0, cinput1 );
672 mgr->ConnectOutput (sampleTask, 1, coutput1 );
THashList * CreateHistoGroup(const char *groupname)
Create a new group of histograms within a parent group.
TObjArray fClusterCollArray
cluster collection array
Double_t GetRhoVal() const
const TString & GetRhoName() const
Declaration of class AliAnalysisTaskEmcalJetSample.
AliAnalysisTaskEmcalJetSample()
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.
Double_t fMinBinPt
min pt in histograms
void AllocateCellHistograms()
Int_t fCentBin
!event centrality bin
void SetVzRange(Double_t min, Double_t max)
Implementation of a sample jet analysis task.
AliClusterContainer * AddClusterContainer(const char *n)
Create new cluster container and attach it to the task.
Container for particles within the EMCAL framework.
TObjArray fParticleCollArray
particle/track collection array
void AllocateClusterHistograms()
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="")
Create a new TH2 within the container.
TObject * FindObject(const char *name) const
Find an object inside the container.
void AllocateTrackHistograms()
THashList * GetListOfHistograms() const
Get the list of histograms.
static AliAnalysisTaskEmcalJetSample * AddTaskEmcalJetSample(const char *ntracks="usedefault", const char *nclusters="usedefault", const char *ncells="usedefault", const char *suffix="")
Double_t Phi_0_2pi() const
void Terminate(Option_t *option)
AliParticleContainer * AddParticleContainer(const char *n)
Create new particle container and attach it to the task.
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
AliMCParticleContainer * AddMCParticleContainer(const char *n)
Create new container for MC particles and attach it to the task.
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()
void AllocateJetHistograms()
AliEmcalList * fOutput
!output list
Double_t fMaxBinPt
max pt in histograms
THistManager fHistManager
Histogram manager.
Double_t fVertex[3]
!event vertex
AliTrackContainer * AddTrackContainer(const char *n)
Create new track container and attach it to the task.
void SetMakeGeneralHistograms(Bool_t g)
Base task in the EMCAL jet framework.
const AliParticleIterableContainer accepted() const
void UserCreateOutputObjects()
Main initialization function on the worker.
const AliJetIterableContainer accepted() const
EDataType_t
Switch for the data type.
void SetCaloCellsName(const char *n)
Container structure for EMCAL clusters.
void UserCreateOutputObjects()
Container for jet within the EMCAL jet framework.
Int_t fNbins
no. of pt bins
virtual ~AliAnalysisTaskEmcalJetSample()