16 #include <TClonesArray.h> 24 #include "THnSparse.h" 29 #include <AliAnalysisManager.h> 30 #include <AliVEventHandler.h> 31 #include <AliVEvent.h> 32 #include <AliVCluster.h> 33 #include <AliVParticle.h> 65 fJetHadronDeltaPhi(0.6),
68 fHistEvtSelection(0x0),
138 while ((obj = next())) {
157 while ((clusCont = static_cast<AliClusterContainer*>(next()))) {
158 groupname = clusCont->GetName();
161 AliWarning(TString::Format(
"%s: Found groupname %s in hist manager. The cluster containers will be filled into the same histograms.", GetName(), groupname.Data()));
166 histname = TString::Format(
"%s/histClusterEnergy_%d", groupname.Data(), cent);
167 histtitle = TString::Format(
"%s;#it{E}_{cluster} (GeV);counts", histname.Data());
170 histname = TString::Format(
"%s/histClusterEnergyExotic_%d", groupname.Data(), cent);
171 histtitle = TString::Format(
"%s;#it{E}_{cluster}^{exotic} (GeV);counts", histname.Data());
174 histname = TString::Format(
"%s/histClusterNonLinCorrEnergy_%d", groupname.Data(), cent);
175 histtitle = TString::Format(
"%s;#it{E}_{cluster}^{non-lin.corr.} (GeV);counts", histname.Data());
178 histname = TString::Format(
"%s/histClusterHadCorrEnergy_%d", groupname.Data(), cent);
179 histtitle = TString::Format(
"%s;#it{E}_{cluster}^{had.corr.} (GeV);counts", histname.Data());
182 histname = TString::Format(
"%s/histClusterPhi_%d", groupname.Data(), cent);
183 histtitle = TString::Format(
"%s;#it{#phi}_{custer};counts", histname.Data());
186 histname = TString::Format(
"%s/histClusterEta_%d", groupname.Data(), cent);
187 histtitle = TString::Format(
"%s;#it{#eta}_{custer};counts", histname.Data());
190 histname = TString::Format(
"%s/histNClusters_%d", groupname.Data(), cent);
191 histtitle = TString::Format(
"%s;number of clusters;events", histname.Data());
201 histname =
"fHistSumNClusters";
202 histtitle = TString::Format(
"%s;Sum of n clusters;events", histname.Data());
224 histname = TString::Format(
"%s/histCellEnergy_%d", groupname.Data(), cent);
225 histtitle = TString::Format(
"%s;#it{E}_{cell} (GeV);counts", histname.Data());
228 histname = TString::Format(
"%s/histNCells_%d", groupname.Data(), cent);
229 histtitle = TString::Format(
"%s;number of cells;events", histname.Data());
252 while ((partCont = static_cast<AliParticleContainer*>(next()))) {
253 groupname = partCont->GetName();
256 AliWarning(TString::Format(
"%s: Found groupname %s in hist manager. The track containers will be filled into the same histograms.", GetName(), groupname.Data()));
261 histname = TString::Format(
"%s/histTrackPt_%d", groupname.Data(), cent);
262 histtitle = TString::Format(
"%s;#it{p}_{T,track} (GeV/#it{c});counts", histname.Data());
265 histname = TString::Format(
"%s/histTrackPhi_%d", groupname.Data(), cent);
266 histtitle = TString::Format(
"%s;#it{#phi}_{track};counts", histname.Data());
269 histname = TString::Format(
"%s/histTrackEta_%d", groupname.Data(), cent);
270 histtitle = TString::Format(
"%s;#it{#eta}_{track};counts", histname.Data());
273 if (TClass(partCont->GetClassName()).InheritsFrom(
"AliVTrack")) {
274 histname = TString::Format(
"%s/fHistDeltaEtaPt_%d", groupname.Data(), cent);
275 histtitle = TString::Format(
"%s;#it{p}_{T,track}^{vertex} (GeV/#it{c});#it{#eta}_{track}^{vertex} - #it{#eta}_{track}^{EMCal};counts", histname.Data());
278 histname = TString::Format(
"%s/fHistDeltaPhiPt_%d", groupname.Data(), cent);
279 histtitle = TString::Format(
"%s;#it{p}_{T,track}^{vertex} (GeV/#it{c});#it{#phi}_{track}^{vertex} - #it{#phi}_{track}^{EMCal};counts", histname.Data());
282 histname = TString::Format(
"%s/fHistDeltaPtvsPt_%d", groupname.Data(), cent);
283 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());
286 histname = TString::Format(
"%s/fHistEoverPvsP_%d", groupname.Data(), cent);
287 histtitle = TString::Format(
"%s;#it{P}_{track} (GeV/#it{c});#it{E}_{cluster} / #it{P}_{track} #it{c};counts", histname.Data());
291 histname = TString::Format(
"%s/histNTracks_%d", groupname.Data(), cent);
292 histtitle = TString::Format(
"%s;number of tracks;events", histname.Data());
302 histname =
"fHistSumNTracks";
303 histtitle = TString::Format(
"%s;Sum of n tracks;events", histname.Data());
324 while ((jetCont = static_cast<AliJetContainer*>(next()))) {
325 groupname = jetCont->GetName();
328 AliWarning(TString::Format(
"%s: Found groupname %s in hist manager. The jet containers will be filled into the same histograms.", GetName(), groupname.Data()));
333 histname = TString::Format(
"%s/histJetPt_%d", groupname.Data(), cent);
334 histtitle = TString::Format(
"%s;#it{p}_{T,jet} (GeV/#it{c});counts", histname.Data());
337 histname = TString::Format(
"%s/histJetArea_%d", groupname.Data(), cent);
338 histtitle = TString::Format(
"%s;#it{A}_{jet};counts", histname.Data());
341 histname = TString::Format(
"%s/histJetPhi_%d", groupname.Data(), cent);
342 histtitle = TString::Format(
"%s;#it{#phi}_{jet};counts", histname.Data());
345 histname = TString::Format(
"%s/histJetEta_%d", groupname.Data(), cent);
346 histtitle = TString::Format(
"%s;#it{#eta}_{jet};counts", histname.Data());
349 histname = TString::Format(
"%s/histNJets_%d", groupname.Data(), cent);
350 histtitle = TString::Format(
"%s;number of jets;events", histname.Data());
359 histname = TString::Format(
"%s/histJetCorrPt_%d", groupname.Data(), cent);
360 histtitle = TString::Format(
"%s;#it{p}_{T,jet}^{corr} (GeV/#it{c});counts", histname.Data());
370 Bool_t oldStatus = TH1::AddDirectoryStatus();
371 TH1::AddDirectory(kFALSE);
402 const Int_t dimSpec = 5;
403 const Int_t nBinsSpec[dimSpec] = {100,100, 140, 50,
fNRPBins};
404 const Double_t lowBinSpec[dimSpec] = {0,0,-80, 0, 0};
406 fHJetSpec =
new THnSparseF(
"fHJetSpec",
"Recoil jet spectrum",dimSpec,nBinsSpec,lowBinSpec,hiBinSpec);
432 THnSparse *hn =
dynamic_cast<THnSparse*
>(
fOutput->At(i));
441 TH1::AddDirectory(oldStatus);
456 AliVEvent *ev = InputEvent();
477 AliError(Form(
"jet container not found - check name %s",
fJetContName.Data()));
479 while ((jetCont = static_cast<AliJetContainer*>(next())))
480 AliError(Form(
"%s",jetCont->GetName()));
486 if(fDebug) Printf(
"centrality: %f\n",
fCent);
496 if(fDebug) Printf(
"rho = %f, rho check = %f",rho,
GetRhoVal(0));
514 if(fDebug) Printf(
"%s class ---> n triggers between %f and %f = %i, index of trigger chosen = %i",dice>
fFrac?
"ref.":
"sig.",minT,maxT,number,nT);
522 for(
Int_t tt=0;tt<ParticleList.GetEntries();tt++){
526 AliVParticle *partback = (AliVParticle*)ParticleList.At(tt);
527 if(!partback)
continue;
528 if(fDebug) Printf(
"trigger particle pt = %f \teta = %f \t phi = %f",partback->Pt(),partback->Eta(),partback->Phi());
536 if(
fCent<20.)
fh2RPTC20->Fill(TMath::Abs(phiBinT),partback->Pt());
537 if(
fCent<10.)
fh2RPTC10->Fill(TMath::Abs(phiBinT),partback->Pt());
547 groupname = jetCont->GetName();
549 for(
auto jetbig : jetCont->
accepted()) {
550 if (!jetbig)
continue;
552 ptbig = jetbig->Pt();
553 etabig = jetbig->Eta();
554 phibig = jetbig->Phi();
555 if(ptbig==0)
continue;
557 areabig = jetbig->Area();
561 if(areabig>=0.07) injet=injet+1;
562 if(areabig>=0.4) injet4=injet4+1;
564 if(fDebug) Printf(
"jet properties...\n\teta = %f \t phi = %f \t pt = %f \t relativephi = %f\t area = %f\t rho = %f",etabig,phibig,ptbig,dphi,areabig,rho);
572 if(phitt<0)phitt+=TMath::Pi()*2.;
591 while ((jetCont = static_cast<AliJetContainer*>(next()))) {
592 groupname = jetCont->GetName();
594 for(
auto jet : jetCont->
accepted()) {
598 histname = TString::Format(
"%s/histJetPt_%d", groupname.Data(),
fCentBin);
601 histname = TString::Format(
"%s/histJetArea_%d", groupname.Data(),
fCentBin);
604 histname = TString::Format(
"%s/histJetPhi_%d", groupname.Data(),
fCentBin);
607 histname = TString::Format(
"%s/histJetEta_%d", groupname.Data(),
fCentBin);
611 histname = TString::Format(
"%s/histJetCorrPt_%d", groupname.Data(),
fCentBin);
615 histname = TString::Format(
"%s/histNJets_%d", groupname.Data(),
fCentBin);
630 UInt_t sumAcceptedTracks = 0;
633 while ((partCont = static_cast<AliParticleContainer*>(next()))) {
634 groupname = partCont->GetName();
640 histname = TString::Format(
"%s/histTrackPt_%d", groupname.Data(),
fCentBin);
643 histname = TString::Format(
"%s/histTrackPhi_%d", groupname.Data(),
fCentBin);
646 histname = TString::Format(
"%s/histTrackEta_%d", groupname.Data(),
fCentBin);
649 if (partCont->GetLoadedClass()->InheritsFrom(
"AliVTrack")) {
650 const AliVTrack* track =
static_cast<const AliVTrack*
>(
part);
652 histname = TString::Format(
"%s/fHistDeltaEtaPt_%d", groupname.Data(),
fCentBin);
655 histname = TString::Format(
"%s/fHistDeltaPhiPt_%d", groupname.Data(),
fCentBin);
658 histname = TString::Format(
"%s/fHistDeltaPtvsPt_%d", groupname.Data(),
fCentBin);
662 Int_t iCluster = track->GetEMCALcluster();
666 histname = TString::Format(
"%s/fHistEoverPvsP_%d", groupname.Data(),
fCentBin);
673 sumAcceptedTracks += count;
675 histname = TString::Format(
"%s/histNTracks_%d", groupname.Data(),
fCentBin);
679 histname =
"fHistSumNTracks";
691 UInt_t sumAcceptedClusters = 0;
694 while ((clusCont = static_cast<AliClusterContainer*>(next()))) {
695 groupname = clusCont->GetName();
697 for(
auto cluster : clusCont->
all()) {
698 if (!cluster)
continue;
700 if (cluster->GetIsExotic()) {
701 histname = TString::Format(
"%s/histClusterEnergyExotic_%d", groupname.Data(),
fCentBin);
707 for(
auto cluster : clusCont->
accepted()) {
708 if (!cluster)
continue;
712 cluster->GetMomentum(nPart,
fVertex);
714 histname = TString::Format(
"%s/histClusterEnergy_%d", groupname.Data(),
fCentBin);
717 histname = TString::Format(
"%s/histClusterNonLinCorrEnergy_%d", groupname.Data(),
fCentBin);
720 histname = TString::Format(
"%s/histClusterHadCorrEnergy_%d", groupname.Data(),
fCentBin);
723 histname = TString::Format(
"%s/histClusterPhi_%d", groupname.Data(),
fCentBin);
726 histname = TString::Format(
"%s/histClusterEta_%d", groupname.Data(),
fCentBin);
729 sumAcceptedClusters += count;
731 histname = TString::Format(
"%s/histNClusters_%d", groupname.Data(),
fCentBin);
735 histname =
"fHistSumNClusters";
755 for (
Short_t pos = 0; pos < ncells; pos++) {
802 const Int_t dim = count;
809 while(c<dim && i<32){
814 hnTitle += Form(
";%s",label.Data());
822 return new THnSparseF(name, hnTitle.Data(), dim,
nbins, xmin, xmax);
833 label =
"V0 centrality (%)";
839 label =
"corrected jet pt";
869 label =
"leading track";
875 label =
"trigger track";
888 for(
Int_t cr=0;cr<100;cr++) triggers[cr]=-1;
894 groupname = partCont->GetName();
900 if(
part->Pt()>=minT &&
part->Pt()<maxT){
901 triggers[im]=iCount-1;
907 if(im>0) rd=
fRandom->Integer(im);
916 if (vphi < -1*TMath::Pi()) vphi += (2*TMath::Pi());
917 else if (vphi > TMath::Pi()) vphi -= (2*TMath::Pi());
918 if (mphi < -1*TMath::Pi()) mphi += (2*TMath::Pi());
919 else if (mphi > TMath::Pi()) mphi -= (2*TMath::Pi());
920 double dphi = mphi-vphi;
921 if (dphi < -1*TMath::Pi()) dphi += (2*TMath::Pi());
922 else if (dphi > TMath::Pi()) dphi -= (2*TMath::Pi());
929 if(!(TMath::Abs(phi)<=2*TMath::Pi())){AliError(
"phi w.r.t. RP out of defined range");
return -1;}
930 Double_t phiwrtrp=TMath::ACos(TMath::Abs(TMath::Cos(phi)));
932 if(phibin<0||phibin>=
fNRPBins){AliError(
"Phi Bin not defined");}
Float_t fJetHadronDeltaPhi
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
Int_t SelectTrigger(TList *list, Double_t minT, Double_t maxT, Int_t &number)
AliJetContainer * GetJetContainer(Int_t i=0) const
void AllocateJetCoreHistograms()
void AllocateClusterHistograms()
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
Double_t fEPV0
!event plane V0
Int_t fCentBin
!event centrality bin
TString part
use mixed event to constrain combinatorial background
Container for particles within the EMCAL framework.
TObjArray fParticleCollArray
particle/track collection array
AliParticleContainer * GetParticleContainer(Int_t i=0) const
Get particle container attached to this task.
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.
THashList * GetListOfHistograms() const
Get the list of histograms.
Double_t Phi_0_2pi() const
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
void UserCreateOutputObjects()
const AliClusterIterableContainer accepted() const
THnSparse * NewTHnSparseF(const char *name, UInt_t entries)
Double_t fCent
!event centrality
virtual ~AliAnalysisTaskJetCoreEmcal()
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
Double_t RelativePhi(Double_t mphi, Double_t vphi)
AliVCaloCells * fCaloCells
!cells
AliRhoParameter * GetRhoParameter()
Double_t GetRhoVal(Int_t i=0) const
AliAnalysisTaskJetCoreEmcal()
AliEmcalList * fOutput
!output list
Double_t fMaxBinPt
max pt in histograms
THistManager fHistManager
Histogram manager.
Double_t fVertex[3]
!event vertex
void SetMakeGeneralHistograms(Bool_t g)
void Terminate(Option_t *option)
Base task in the EMCAL jet framework.
const AliParticleIterableContainer accepted() const
void UserCreateOutputObjects()
Main initialization function on the worker.
const AliJetIterableContainer accepted() const
void AllocateTrackHistograms()
void AllocateCellHistograms()
void GetDimParams(Int_t iEntry, TString &label, Int_t &nbins, Double_t &xmin, Double_t &xmax)
Container structure for EMCAL clusters.
Container for jet within the EMCAL jet framework.
Int_t fNbins
no. of pt bins
void AllocateJetHistograms()
Int_t GetPhiBin(Double_t phi)