18 #include "TParticle.h"
24 #include "AliAODPWG4ParticleCorrelation.h"
35 fhDeltaEtaNearParton(0), fhDeltaPhiNearParton(0),
36 fhDeltaPtNearParton(0), fhPtRatNearParton(0),
37 fhDeltaEtaAwayParton(0), fhDeltaPhiAwayParton(0),
38 fhDeltaPtAwayParton(0), fhPtRatAwayParton(0)
49 outputContainer->SetName(
"ParticlePartonHistos") ;
52 (
"DeltaPhiNearParton",
"#phi_{particle} - #phi_{parton} vs p_{T particle}",
59 (
"DeltaEtaNearParton",
"#eta_{particle} - #eta_{parton} vs p_{T particle}",
66 (
"DeltaPtNearParton",
"#p_{T particle} - #p_{T parton} vs p_{T particle}",
67 200,0,120,100,-10,10);
73 (
"PtRatNearParton",
"#p_{T parton} / #p_{T particle} vs p_{T particle}",
80 (
"DeltaPhiAwayParton",
"#phi_{particle} - #phi_{parton} vs p_{T particle}",
87 (
"DeltaEtaAwayParton",
"#eta_{particle} - #eta_{parton} vs p_{T particle}",
94 (
"DeltaPtAwayParton",
"#p_{T particle} - #p_{T parton} vs p_{T particle}",
95 200,0,120,100,-10,10);
101 (
"PtRatAwayParton",
"#p_{T parton} / #p_{T particle} vs p_{T particle}",
107 return outputContainer;
128 printf(
"**** Print %s %s ****\n", GetName(), GetTitle() ) ;
141 AliFatal(Form(
"No input particles in AOD with name branch < %s > ",
GetInputAODName().
Data()));
143 if(strcmp(
GetInputAODBranch()->GetClass()->GetName(),
"AliAODPWG4ParticleCorrelation"))
144 AliFatal(Form(
"Wrong type of AOD object, change AOD class name in input AOD: It should be <AliAODPWG4ParticleCorrelation> and not <%s>",
147 AliDebug(1,
"Begin fill AODs");
148 AliDebug(1,Form(
"In particle branch aod entries %d",
GetInputAODBranch()->GetEntriesFast()));
152 for(
Int_t iaod = 0; iaod < naod ; iaod++)
154 AliAODPWG4ParticleCorrelation* particle = (AliAODPWG4ParticleCorrelation*) (
GetInputAODBranch()->At(iaod));
159 AliFatal(
"No Stack available, STOP");
163 if(stack->GetNtrack() < 8)
165 AliWarning(Form(
"*** small number of particles, not a PYTHIA simulation? ***: n tracks %d", stack->GetNprimary()));
175 TParticle * parton = NULL ;
176 for(
Int_t ipr = 0;ipr < 8; ipr ++ ){
177 parton = stack->Particle(ipr) ;
182 objarray->SetOwner(kFALSE);
184 objarray->Add(parton);
187 if(objarray->GetEntriesFast() > 0) particle->AddObjArray(objarray);
191 AliDebug(1,
"End fill AODs");
201 AliFatal(Form(
"No input particles in AOD with name branch < %s >",
GetInputAODName().
Data()));
205 AliDebug(1,
"Begin parton correlation analysis, fill histograms");
206 AliDebug(1,Form(
"In particle branch aod entries %d",
GetInputAODBranch()->GetEntriesFast()));
211 AliFatal(
"No Stack available, STOP");
217 TParticle * mom = NULL ;
219 for(
Int_t iaod = 0; iaod < naod ; iaod++){
220 AliAODPWG4ParticleCorrelation* particle = (AliAODPWG4ParticleCorrelation*) (
GetInputAODBranch()->At(iaod));
222 Float_t ptTrigg = particle->Pt();
223 Float_t phiTrigg = particle->Phi();
224 Float_t etaTrigg = particle->Eta();
225 Int_t imom = particle->GetLabel();
226 Int_t iparent = 2000;
227 Int_t iawayparent = -1;
230 if(!(objarray) || (objarray->GetEntriesFast() < 7) )
232 AliFatal(
"Reference list with partons not filled, STOP analysis");
237 if(imom < 8 ) iparent = imom ;
238 else if (imom < stack->GetNtrack()) {
239 mom = stack->Particle(imom);
241 iparent=mom->GetFirstMother();
244 mom = stack->Particle(iparent);
247 iparent = mom->GetFirstMother();
255 AliDebug(1,Form(
"N reference partons %d; labels: mother %d, parent %d", objarray->GetEntriesFast(), imom, iparent));
257 if(iparent < 0 || iparent > 8)
259 AliWarning(Form(
"Failed to find appropriate parton, index %d", iparent));
264 TParticle * nearParton = (TParticle*) objarray->At(iparent);
265 Float_t ptNearParton = nearParton->Pt();
266 Float_t phiNearParton = nearParton->Phi() ;
267 Float_t etaNearParton = nearParton->Eta() ;
274 if (iparent == 7) iawayparent = 6;
275 else if(iparent == 6) iawayparent = 7;
278 AliWarning(
"Parent parton is not final state, skip");
283 TParticle * awayParton = (TParticle*) objarray->At(iawayparent);
284 Float_t ptAwayParton = awayParton->Pt();
285 Float_t phiAwayParton = awayParton->Phi() ;
286 Float_t etaAwayParton = awayParton->Eta() ;
294 AliDebug(1,
"End fill histograms");
void Print(const Option_t *opt) const
Print some relevant parameters set for the analysis.
TH2F * fhDeltaEtaNearParton
! Difference of parton eta and prompt trigger particle eta
Particle-parton correlation.
virtual void AddToHistogramsName(TString add)
TH2F * fhDeltaPtNearParton
! Difference of parton pT and prompt trigger particle pT
virtual AliStack * GetMCStack() const
virtual TString GetInputAODName() const
virtual void SetInputAODName(TString name)
TH2F * fhPtRatNearParton
! Ratio of parton pT and prompt trigger particle pT
TList * GetCreateOutputObjects()
Create histograms to be saved in output file.
void InitParameters()
Initialize the parameters of the analysis.
TH2F * fhDeltaPtAwayParton
! Difference of parton pT and prompt trigger particle pT
virtual TString GetAODObjArrayName() const
Base class for CaloTrackCorr analysis algorithms.
virtual TClonesArray * GetInputAODBranch() const
TH2F * fhDeltaPhiAwayParton
! Difference of parton phi and prompt trigger particle phi
void MakeAnalysisFillHistograms()
void MakeAnalysisFillAOD()
virtual Double_t GetEventWeight() const
Bool_t Data(TH1F *h, Double_t *rangefit, Bool_t writefit, Double_t &sgn, Double_t &errsgn, Double_t &bkg, Double_t &errbkg, Double_t &sgnf, Double_t &errsgnf, Double_t &sigmafit, Int_t &status)
TH2F * fhDeltaPhiNearParton
! Difference of parton phi and prompt trigger particle phi
ClassImp(AliAnalysisTaskCRC) AliAnalysisTaskCRC
virtual void SetAODObjArrayName(TString name)
virtual void Print(const Option_t *) const
Print some relevant parameters set for the analysis.
AliAnaParticlePartonCorrelation()
Default Constructor. Initialize parameters.
TH2F * fhDeltaEtaAwayParton
! Difference of parton eta and prompt trigger particle eta
TH2F * fhPtRatAwayParton
! Ratio of parton pT and prompt trigger particle pT