1 #include <AliVParticle.h> 5 #include "AliAnalysisManager.h" 6 #include "AliVEventHandler.h" 21 fSubjetFinder(
nullptr),
83 while ((p = next()))
fOutput->Add(p);
101 while ((pc = static_cast<AliJetContainer*>(next())))
LoopJets(pc);
116 const TString s(pc->GetName());
121 for (
auto pj : pc->
accepted())
if (!(pj->IsGhost())) {
124 const auto da(pj->Area());
125 const auto dj(d>0. ? pj->Pt() - d*da : pj->Pt());
148 if (!(pj && pc))
return;
152 const TString s(Form(
"%s_sj",pc->GetName()));
154 const auto dj((d>0.) ? (pj->
Pt() - d*(pj->
Area())) : pj->
Pt());
158 auto d1(-9999.), d2(-9999.);
164 const auto da(p->Area());
165 const auto dd(d>0. ? (p->Pt() - d*da) : p->Pt());
166 if (dd>d1) { d2 = d1; d1 = dd; }
else if (dd>d2) { d2 = dd; }
190 if (!(pj && pc))
return;
193 const TString s(Form(
"%s_consti",pc->GetName()));
195 const auto dj((d>0.) ? (pj->
Pt() - d*(pj->
Area())) : pj->
Pt());
199 auto d1(-9999.), d2(-9999.);
201 const auto p(pj->
Track(i));
if (!p)
continue;
204 const auto dd(p->Pt());
205 if (dd>d1) { d2 = d1; d1 = dd; }
else if (dd>d2) { d2 = dd; }
238 while ((p = static_cast<AliJetContainer*>(next()))) {
242 AliWarning(Form(
"Found group name %s in hist manager", s.Data()));
257 fHistMgr->
CreateTH2(Form(
"%s/hArea_%d", s.Data(),i),
"",
fNbins, dMin, dMax, nbs, 0., 3.,
"s");
274 while ((p = static_cast<AliJetContainer*>(next()))) {
275 const TString s(Form(
"%s_sj",p->GetName()));
278 AliWarning(Form(
"Found group name %s in hist manager", s.Data()));
291 fHistMgr->
CreateTH1(Form(
"%s/hNsubjets_%d", s.Data(),i),
"", 500, -0.5, 499.5,
"s");
292 fHistMgr->
CreateTH2(Form(
"%s/hSubjetPt_%d", s.Data(),i),
"", nbs, dMin, dMax,
fNbins, dMin, dMax,
"s");
293 fHistMgr->
CreateTH2(Form(
"%s/hL1stSjPt_%d", s.Data(),i),
"", nbs, dMin, dMax,
fNbins, dMin, dMax,
"s");
294 fHistMgr->
CreateTH2(Form(
"%s/hL2ndSjPt_%d", s.Data(),i),
"", nbs, dMin, dMax,
fNbins, dMin, dMax,
"s");
295 fHistMgr->
CreateTH2(Form(
"%s/hDelta_Sj_%d", s.Data(),i),
"", nbs, dMin, dMax,
fNbins, dMin, dMax,
"s");
296 fHistMgr->
CreateTH2(Form(
"%s/hSubjetArea_%d",s.Data(),i),
"", nbs, dMin, dMax, nbs, 0., 3.,
"s");
313 while ((p = static_cast<AliJetContainer*>(next()))) {
314 const TString s(Form(
"%s_consti",p->GetName()));
317 AliWarning(Form(
"Found group name %s in hist manager", s.Data()));
330 fHistMgr->
CreateTH1(Form(
"%s/hNtracks_%d",s.Data(),i),
"", 500, -0.5, 499.5,
"s");
331 fHistMgr->
CreateTH2(Form(
"%s/hL1stTrk_%d",s.Data(),i),
"", nbs, dMin, dMax,
fNbins, dMin, dMax,
"s");
332 fHistMgr->
CreateTH2(Form(
"%s/hL2ndTrk_%d",s.Data(),i),
"", nbs, dMin, dMax,
fNbins, dMin, dMax,
"s");
333 fHistMgr->
CreateTH2(Form(
"%s/hDeltaTk_%d",s.Data(),i),
"", nbs, dMin, dMax,
fNbins, dMin, dMax,
"s");
350 auto mgr(AliAnalysisManager::GetAnalysisManager());
353 ::Error(Form(
"AliAnalysisTaskEmcalSubjet::%s",__func__),
"No analysis manager to connect to");
358 AliVEventHandler *pH(mgr->GetInputEventHandler());
361 ::Error(Form(
"AliAnalysisTaskEmcalSubjet::%s",__func__),
"This task requires an input event handler");
369 if (pH->InheritsFrom(
"AliESDInputHandler")) wType =
kESD;
370 if (pH->InheritsFrom(
"AliAODInputHandler")) wType = kAOD;
372 if (wType==kUnknown) {
373 ::Error(Form(
"AliAnalysisTaskEmcalSubjet::%s",__func__),
"Unkown data input");
382 if (sTrks==
"usedefault") {
383 if (wType==
kESD) sTrkName =
"Tracks";
384 if (wType==kAOD) sTrkName =
"tracks";
387 if (sTrkName==
"mcparticles") {
388 task->AddMCParticleContainer(sTrkName);
389 }
else if ((sTrkName==
"tracks") || (sTrkName==
"Tracks")) {
390 task->AddTrackContainer(sTrkName);
391 }
else if (!sTrkName.IsNull()) {
392 task->AddParticleContainer(sTrkName);
397 if (sClus==
"usedefault") {
398 if (wType==
kESD) sClsName =
"CaloClusters";
399 if (wType==kAOD) sClsName =
"caloClusters";
402 task->AddClusterContainer(sClsName);
406 if (sCells==
"usedefault") {
407 if (wType==
kESD) sCellName =
"EMCALCells";
408 if (wType==kAOD) sCellName =
"emcalCells";
411 task->SetCaloCellsName(sCellName);
415 mgr->ConnectInput( task, 0, mgr->GetCommonInputContainer());
416 mgr->ConnectOutput(task, 1, mgr->CreateContainer(
"listSubjet",
417 AliEmcalList::Class(),
418 AliAnalysisManager::kOutputContainer,
419 AliAnalysisManager::GetCommonFileName()));
void SetRadius(Double_t val)
virtual Bool_t Run()
Run function. This is the core function of the analysis and contains the user code. Therefore users have to implement this function.
THashList * CreateHistoGroup(const char *groupname)
Create a new group of histograms within a parent group.
Double_t GetRhoVal() const
const TString & GetRhoName() const
void CreateHistoSubjets()
void LoopJetConstis(AliEmcalJet const *pj, AliJetContainer const *pc)
Bool_t Filter(AliEmcalJet *pJet, AliJetContainer *pContJets, Double_t dVtx[3])
virtual ~AliAnalysisTaskEmcalSubjet()
void FillTH2(const char *hname, double x, double y, double weight=1., Option_t *opt="")
Fill a 2D histogram within the container.
Double_t fMinBinPt
min pt in histograms
void CreateHistoJetConstis()
Bool_t fGeneralHistograms
whether or not it should fill some general histograms
AliVParticle * Track(Int_t idx) const
Int_t fCentBin
!event centrality bin
UShort_t GetNumberOfTracks() const
virtual void UserCreateOutputObjects()
void LoopSubjets(AliEmcalJet const *pj, AliJetContainer const *pc)
AliAnalysisTaskEmcalSubjet()
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.
void SetJetAlgorithm(Int_t val)
TObject * FindObject(const char *name) const
Find an object inside the container.
THashList * GetListOfHistograms() const
Get the list of histograms.
void LoopJets(AliJetContainer const *pc)
TH1 * CreateTH1(const char *name, const char *title, int nbins, double xmin, double xmax, Option_t *opt="")
Create a new TH1 within the container.
Int_t fNcentBins
how many centrality bins
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
AliEmcalJet * GetJet(Int_t index)
AliEmcalJetFinder * fSubjetFinder
AliEmcalList * fOutput
!output list
Double_t fMaxBinPt
max pt in histograms
Double_t fVertex[3]
!event vertex
static AliAnalysisTaskEmcalSubjet * AddTask(const TString sTrks="usedefault", const TString sClus="usedefault", const TString sCells="usedefault")
Bool_t fCreateHisto
whether or not create histograms
virtual Bool_t Run()
Run function. This is the core function of the analysis and contains the user code. Therefore users have to implement this function.
Base task in the EMCAL jet framework.
Represent a jet reconstructed using the EMCal jet framework.
Container class for histograms.
void UserCreateOutputObjects()
Main initialization function on the worker.
const AliJetIterableContainer accepted() const
EDataType_t
Switch for the data type.
Container for jet within the EMCAL jet framework.
Int_t fNbins
no. of pt bins