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),
67 fRunAnaAzimuthalCorrelation(kFALSE),
69 fHistEvtSelection(0x0),
145 while ((obj = next())) {
164 while ((clusCont = static_cast<AliClusterContainer*>(next()))) {
165 groupname = clusCont->GetName();
168 AliWarning(TString::Format(
"%s: Found groupname %s in hist manager. The cluster containers will be filled into the same histograms.", GetName(), groupname.Data()));
173 histname = TString::Format(
"%s/histClusterEnergy_%d", groupname.Data(), cent);
174 histtitle = TString::Format(
"%s;#it{E}_{cluster} (GeV);counts", histname.Data());
177 histname = TString::Format(
"%s/histClusterEnergyExotic_%d", groupname.Data(), cent);
178 histtitle = TString::Format(
"%s;#it{E}_{cluster}^{exotic} (GeV);counts", histname.Data());
181 histname = TString::Format(
"%s/histClusterNonLinCorrEnergy_%d", groupname.Data(), cent);
182 histtitle = TString::Format(
"%s;#it{E}_{cluster}^{non-lin.corr.} (GeV);counts", histname.Data());
185 histname = TString::Format(
"%s/histClusterHadCorrEnergy_%d", groupname.Data(), cent);
186 histtitle = TString::Format(
"%s;#it{E}_{cluster}^{had.corr.} (GeV);counts", histname.Data());
189 histname = TString::Format(
"%s/histClusterPhi_%d", groupname.Data(), cent);
190 histtitle = TString::Format(
"%s;#it{#phi}_{custer};counts", histname.Data());
193 histname = TString::Format(
"%s/histClusterEta_%d", groupname.Data(), cent);
194 histtitle = TString::Format(
"%s;#it{#eta}_{custer};counts", histname.Data());
197 histname = TString::Format(
"%s/histNClusters_%d", groupname.Data(), cent);
198 histtitle = TString::Format(
"%s;number of clusters;events", histname.Data());
208 histname =
"fHistSumNClusters";
209 histtitle = TString::Format(
"%s;Sum of n clusters;events", histname.Data());
231 histname = TString::Format(
"%s/histCellEnergy_%d", groupname.Data(), cent);
232 histtitle = TString::Format(
"%s;#it{E}_{cell} (GeV);counts", histname.Data());
235 histname = TString::Format(
"%s/histNCells_%d", groupname.Data(), cent);
236 histtitle = TString::Format(
"%s;number of cells;events", histname.Data());
259 while ((partCont = static_cast<AliParticleContainer*>(next()))) {
260 groupname = partCont->GetName();
263 AliWarning(TString::Format(
"%s: Found groupname %s in hist manager. The track containers will be filled into the same histograms.", GetName(), groupname.Data()));
268 histname = TString::Format(
"%s/histTrackPt_%d", groupname.Data(), cent);
269 histtitle = TString::Format(
"%s;#it{p}_{T,track} (GeV/#it{c});counts", histname.Data());
272 histname = TString::Format(
"%s/histTrackPhi_%d", groupname.Data(), cent);
273 histtitle = TString::Format(
"%s;#it{#phi}_{track};counts", histname.Data());
276 histname = TString::Format(
"%s/histTrackEta_%d", groupname.Data(), cent);
277 histtitle = TString::Format(
"%s;#it{#eta}_{track};counts", histname.Data());
280 if (TClass(partCont->GetClassName()).InheritsFrom(
"AliVTrack")) {
281 histname = TString::Format(
"%s/fHistDeltaEtaPt_%d", groupname.Data(), cent);
282 histtitle = TString::Format(
"%s;#it{p}_{T,track}^{vertex} (GeV/#it{c});#it{#eta}_{track}^{vertex} - #it{#eta}_{track}^{EMCal};counts", histname.Data());
285 histname = TString::Format(
"%s/fHistDeltaPhiPt_%d", groupname.Data(), cent);
286 histtitle = TString::Format(
"%s;#it{p}_{T,track}^{vertex} (GeV/#it{c});#it{#phi}_{track}^{vertex} - #it{#phi}_{track}^{EMCal};counts", histname.Data());
289 histname = TString::Format(
"%s/fHistDeltaPtvsPt_%d", groupname.Data(), cent);
290 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());
293 histname = TString::Format(
"%s/fHistEoverPvsP_%d", groupname.Data(), cent);
294 histtitle = TString::Format(
"%s;#it{P}_{track} (GeV/#it{c});#it{E}_{cluster} / #it{P}_{track} #it{c};counts", histname.Data());
298 histname = TString::Format(
"%s/histNTracks_%d", groupname.Data(), cent);
299 histtitle = TString::Format(
"%s;number of tracks;events", histname.Data());
309 histname =
"fHistSumNTracks";
310 histtitle = TString::Format(
"%s;Sum of n tracks;events", histname.Data());
331 while ((jetCont = static_cast<AliJetContainer*>(next()))) {
332 groupname = jetCont->GetName();
335 AliWarning(TString::Format(
"%s: Found groupname %s in hist manager. The jet containers will be filled into the same histograms.", GetName(), groupname.Data()));
340 histname = TString::Format(
"%s/histJetPt_%d", groupname.Data(), cent);
341 histtitle = TString::Format(
"%s;#it{p}_{T,jet} (GeV/#it{c});counts", histname.Data());
344 histname = TString::Format(
"%s/histJetArea_%d", groupname.Data(), cent);
345 histtitle = TString::Format(
"%s;#it{A}_{jet};counts", histname.Data());
348 histname = TString::Format(
"%s/histJetPhi_%d", groupname.Data(), cent);
349 histtitle = TString::Format(
"%s;#it{#phi}_{jet};counts", histname.Data());
352 histname = TString::Format(
"%s/histJetEta_%d", groupname.Data(), cent);
353 histtitle = TString::Format(
"%s;#it{#eta}_{jet};counts", histname.Data());
356 histname = TString::Format(
"%s/histNJets_%d", groupname.Data(), cent);
357 histtitle = TString::Format(
"%s;number of jets;events", histname.Data());
366 histname = TString::Format(
"%s/histJetCorrPt_%d", groupname.Data(), cent);
367 histtitle = TString::Format(
"%s;#it{p}_{T,jet}^{corr} (GeV/#it{c});counts", histname.Data());
377 Bool_t oldStatus = TH1::AddDirectoryStatus();
378 TH1::AddDirectory(kFALSE);
409 const Int_t dimSpec = 5;
410 const Int_t nBinsSpec[dimSpec] = {100,100, 140, 50,
fNRPBins};
411 const Double_t lowBinSpec[dimSpec] = {0,0,-80, 0, 0};
413 fHJetSpec =
new THnSparseF(
"fHJetSpec",
"Recoil jet spectrum",dimSpec,nBinsSpec,lowBinSpec,hiBinSpec);
435 const Int_t dimCor = 5;
436 const Int_t nBinsCor[dimCor] = {50, 200, 100, 100, 100};
437 const Double_t lowBinCor[dimCor] = {0, -50, -0.5*TMath::Pi(), 0, 0};
438 const Double_t hiBinCor[dimCor] = {50, 150, 1.5*TMath::Pi(), 1, 100};
439 fHJetPhiCorr =
new THnSparseF(
"fHJetPhiCorr",
"TT p_{T} vs jet p_{T} vs dPhi vs area vs centrality",dimCor,nBinsCor,lowBinCor,hiBinCor);
441 fhDphiPtSig =
new TH2F(
"hDphiPtS",
"recoil #Delta #phi vs jet pT signal",100,-2,5,250,-50,200);
443 fhDphiPtSig->GetYaxis()->SetTitle(
"p^{reco,ch}_{T,jet} (GeV/c)");
444 fhDphiPtRef =
new TH2F(
"hDphiPtR",
"recoil #Delta #phi vs jet pT reference",100,-2,5,250,-50,200);
446 fhDphiPtRef->GetYaxis()->SetTitle(
"p^{reco,ch}_{T,jet} (GeV/c)");
460 THnSparse *hn =
dynamic_cast<THnSparse*
>(
fOutput->At(i));
469 TH1::AddDirectory(oldStatus);
484 AliVEvent *ev = InputEvent();
505 AliError(Form(
"jet container not found - check name %s",
fJetContName.Data()));
507 while ((jetCont = static_cast<AliJetContainer*>(next())))
508 AliError(Form(
"%s",jetCont->GetName()));
514 if(fDebug) Printf(
"centrality: %f\n",
fCent);
524 if(fDebug) Printf(
"rho = %f, rho check = %f",rho,
GetRhoVal(0));
544 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);
552 for(
Int_t tt=0;tt<ParticleList.GetEntries();tt++){
556 AliVParticle *partback = (AliVParticle*)ParticleList.At(tt);
557 if(!partback)
continue;
558 if(fDebug) Printf(
"trigger particle pt = %f \teta = %f \t phi = %f",partback->Pt(),partback->Eta(),partback->Phi());
566 if(
fCent<20.)
fh2RPTC20->Fill(TMath::Abs(phiBinT),partback->Pt());
567 if(
fCent<10.)
fh2RPTC10->Fill(TMath::Abs(phiBinT),partback->Pt());
577 groupname = jetCont->GetName();
579 for(
auto jetbig : jetCont->
accepted()) {
580 if (!jetbig)
continue;
582 ptbig = jetbig->Pt();
583 etabig = jetbig->Eta();
584 phibig = jetbig->Phi();
585 if(ptbig==0)
continue;
587 areabig = jetbig->Area();
591 if(areabig>=0.07) injet=injet+1;
592 if(areabig>=0.4) injet4=injet4+1;
594 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);
600 Double_t dPhiShift=phibig-partback->Phi();
601 if(dPhiShift>2*TMath::Pi()) dPhiShift -= 2*TMath::Pi();
602 if(dPhiShift<-2*TMath::Pi()) dPhiShift += 2*TMath::Pi();
603 if(dPhiShift<-0.5*TMath::Pi()) dPhiShift += 2*TMath::Pi();
604 if(dPhiShift>1.5*TMath::Pi()) dPhiShift -= 2*TMath::Pi();
607 Double_t fill[] = {partback->Pt(),ptcorr,dPhiShift,areabig,
fCent};
617 if(phitt<0)phitt+=TMath::Pi()*2.;
661 while ((jetCont = static_cast<AliJetContainer*>(next()))) {
662 groupname = jetCont->GetName();
664 for(
auto jet : jetCont->
accepted()) {
668 histname = TString::Format(
"%s/histJetPt_%d", groupname.Data(),
fCentBin);
671 histname = TString::Format(
"%s/histJetArea_%d", groupname.Data(),
fCentBin);
674 histname = TString::Format(
"%s/histJetPhi_%d", groupname.Data(),
fCentBin);
677 histname = TString::Format(
"%s/histJetEta_%d", groupname.Data(),
fCentBin);
681 histname = TString::Format(
"%s/histJetCorrPt_%d", groupname.Data(),
fCentBin);
685 histname = TString::Format(
"%s/histNJets_%d", groupname.Data(),
fCentBin);
700 UInt_t sumAcceptedTracks = 0;
703 while ((partCont = static_cast<AliParticleContainer*>(next()))) {
704 groupname = partCont->GetName();
710 histname = TString::Format(
"%s/histTrackPt_%d", groupname.Data(),
fCentBin);
713 histname = TString::Format(
"%s/histTrackPhi_%d", groupname.Data(),
fCentBin);
716 histname = TString::Format(
"%s/histTrackEta_%d", groupname.Data(),
fCentBin);
719 if (partCont->GetLoadedClass()->InheritsFrom(
"AliVTrack")) {
720 const AliVTrack* track =
static_cast<const AliVTrack*
>(
part);
722 histname = TString::Format(
"%s/fHistDeltaEtaPt_%d", groupname.Data(),
fCentBin);
725 histname = TString::Format(
"%s/fHistDeltaPhiPt_%d", groupname.Data(),
fCentBin);
728 histname = TString::Format(
"%s/fHistDeltaPtvsPt_%d", groupname.Data(),
fCentBin);
732 Int_t iCluster = track->GetEMCALcluster();
736 histname = TString::Format(
"%s/fHistEoverPvsP_%d", groupname.Data(),
fCentBin);
743 sumAcceptedTracks += count;
745 histname = TString::Format(
"%s/histNTracks_%d", groupname.Data(),
fCentBin);
749 histname =
"fHistSumNTracks";
761 UInt_t sumAcceptedClusters = 0;
764 while ((clusCont = static_cast<AliClusterContainer*>(next()))) {
765 groupname = clusCont->GetName();
767 for(
auto cluster : clusCont->
all()) {
768 if (!cluster)
continue;
770 if (cluster->GetIsExotic()) {
771 histname = TString::Format(
"%s/histClusterEnergyExotic_%d", groupname.Data(),
fCentBin);
777 for(
auto cluster : clusCont->
accepted()) {
778 if (!cluster)
continue;
782 cluster->GetMomentum(nPart,
fVertex);
784 histname = TString::Format(
"%s/histClusterEnergy_%d", groupname.Data(),
fCentBin);
787 histname = TString::Format(
"%s/histClusterNonLinCorrEnergy_%d", groupname.Data(),
fCentBin);
790 histname = TString::Format(
"%s/histClusterHadCorrEnergy_%d", groupname.Data(),
fCentBin);
793 histname = TString::Format(
"%s/histClusterPhi_%d", groupname.Data(),
fCentBin);
796 histname = TString::Format(
"%s/histClusterEta_%d", groupname.Data(),
fCentBin);
799 sumAcceptedClusters += count;
801 histname = TString::Format(
"%s/histNClusters_%d", groupname.Data(),
fCentBin);
805 histname =
"fHistSumNClusters";
825 for (
Short_t pos = 0; pos < ncells; pos++) {
872 const Int_t dim = count;
879 while(c<dim && i<32){
884 hnTitle += Form(
";%s",label.Data());
892 return new THnSparseF(name, hnTitle.Data(), dim,
nbins, xmin, xmax);
903 label =
"V0 centrality (%)";
909 label =
"corrected jet pt";
939 label =
"leading track";
945 label =
"trigger track";
958 for(
Int_t cr=0;cr<100;cr++) triggers[cr]=-1;
964 groupname = partCont->GetName();
970 if(
part->Pt()>=minT &&
part->Pt()<maxT){
971 triggers[im]=iCount-1;
977 if(im>0) rd=
fRandom->Integer(im);
986 if (vphi < -1*TMath::Pi()) vphi += (2*TMath::Pi());
987 else if (vphi > TMath::Pi()) vphi -= (2*TMath::Pi());
988 if (mphi < -1*TMath::Pi()) mphi += (2*TMath::Pi());
989 else if (mphi > TMath::Pi()) mphi -= (2*TMath::Pi());
990 double dphi = mphi-vphi;
991 if (dphi < -1*TMath::Pi()) dphi += (2*TMath::Pi());
992 else if (dphi > TMath::Pi()) dphi -= (2*TMath::Pi());
999 if(!(TMath::Abs(phi)<=2*TMath::Pi())){AliError(
"phi w.r.t. RP out of defined range");
return -1;}
1000 Double_t phiwrtrp=TMath::ACos(TMath::Abs(TMath::Cos(phi)));
1002 if(phibin<0||phibin>=
fNRPBins){AliError(
"Phi Bin not defined");}
Float_t fJetHadronDeltaPhi
Bool_t fRunAnaAzimuthalCorrelation
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
TH1I * fHistEvtSelection
!
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()
AliEventCuts fEventCuts
Event cuts.
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
THnSparse * fHJetPhiCorr
!
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)