8 #include <TClonesArray.h> 11 #include "TLorentzVector.h" 14 #include "AliVCluster.h" 15 #include "AliVTrack.h" 48 const Int_t NMAX = 9999;
52 Int_t maxPartIds[] = {0, 0};
64 AliVParticle *track = 0;
65 tracks->ResetCurrentID();
68 if (track->Pt() > maxPartPts[0]) {
69 maxPartPts[1] = maxPartPts[0];
70 maxPartIds[1] = maxPartIds[0];
71 maxPartPts[0] = track->Pt();
72 maxPartIds[0] = tracks->GetCurrentID()+1;
74 else if (track->Pt() > maxPartPts[1]) {
75 maxPartPts[1] = track->Pt();
76 maxPartIds[1] = tracks->GetCurrentID()+1;
83 AliVCluster *cluster = 0;
84 clusters->ResetCurrentID();
87 clusters->
GetMomentum(nPart, clusters->GetCurrentID());
89 if (nPart.Pt() > maxPartPts[0]) {
90 maxPartPts[1] = maxPartPts[0];
91 maxPartIds[1] = maxPartIds[0];
92 maxPartPts[0] = nPart.Pt();
93 maxPartIds[0] = -clusters->GetCurrentID()-1;
95 else if (nPart.Pt() > maxPartPts[1]) {
96 maxPartPts[1] = nPart.Pt();
97 maxPartIds[1] = -clusters->GetCurrentID()-1;
109 AliVParticle *track = 0;
110 tracks->ResetCurrentID();
114 if (tracks->GetCurrentID() == maxPartIds[0]-1 || tracks->GetCurrentID() == maxPartIds[1]-1)
117 rhovec[NpartAcc] = track->Pt();
124 AliVCluster *cluster = 0;
125 clusters->ResetCurrentID();
128 if (clusters->GetCurrentID() == -maxPartIds[0]-1 || clusters->GetCurrentID() == -maxPartIds[1]-1)
131 TLorentzVector nPart;
132 clusters->
GetMomentum(nPart, clusters->GetCurrentID());
134 rhovec[NpartAcc] = nPart.Pt();
139 if (NpartAcc == NMAX) {
140 AliError(Form(
"%s: NpartAcc >= %d", GetName(), NMAX));
147 rho = TMath::Median(NpartAcc, rhovec);
149 rho = TMath::Mean(NpartAcc, rhovec);
171 AliError(Form(
"%s: No particle container found! Assuming area = 1...",GetName()));
181 if (maxPhi > TMath::Pi() * 2) maxPhi = TMath::Pi() * 2;
182 if (minPhi < 0) minPhi = 0;
184 fTotalArea = (maxEta - minEta) * (maxPhi - minPhi);
187 AliError(Form(
"%s: Area = %f < 1e-6, assuming area = 1", GetName(),
fTotalArea));
virtual AliVParticle * GetNextAcceptParticle()
void ExecOnce()
Perform steps needed to initialize the analysis.
Double_t GetParticleEtaMin() const
Container for particles within the EMCAL framework.
AliParticleContainer * GetParticleContainer(Int_t i=0) const
Get particle container attached to this task.
AliRhoParameter * fOutRhoScaled
output rho object
AliClusterContainer * GetClusterContainer(Int_t i=0) const
Get cluster container attached to this task.
Double_t fCent
!event centrality
virtual Double_t GetScaleFactor(Double_t cent)
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.
Double_t GetParticlePhiMax() const
Double_t GetParticleEtaMax() const
Double_t GetParticlePhiMin() const
Bool_t GetMomentum(TLorentzVector &mom, const AliVCluster *vc, Double_t mass) const
void ExecOnce()
Perform steps needed to initialize the analysis.
AliRhoParameter * fOutRho
AliAnalysisTaskRhoAverage()
Container structure for EMCAL clusters.
AliVCluster * GetNextAcceptCluster()