21 #include <TClonesArray.h>
22 #include <AliAODTrack.h>
37 AliAnalysisTaskEmcal("
AliAnalysisTaskParticleRandomizer", kFALSE), fRandomizeInPhi(1), fRandomizeInEta(0), fRandomizeInTheta(0), fRandomizeInPt(0), fMinPhi(0), fMaxPhi(TMath::TwoPi()), fMinEta(-0.9), fMaxEta(+0.9), fMinPt(0), fMaxPt(120), fDistributionV2(0), fDistributionV3(0), fDistributionV4(0), fDistributionV5(0), fInputArrayName(), fOutputArrayName(), fInputArray(0), fOutputArray(0), fJetRemovalRhoObj(), fJetRemovalArrayName(), fJetRemovalArray(0), fJetRemovalPtThreshold(999.), fJetRemovalNLeadingJets(0), fJetEmbeddingArrayName(), fJetEmbeddingArray(0), fRandomPsi3(0), fLeadingJet(0), fSubleadingJet(0), fRandom()
54 AliWarning(Form(
"Name of input array not given!"));
56 AliFatal(Form(
"Name of output array not given!"));
86 AliFatal(Form(
"Output array '%s' already exists in the event! Rename it.",
fInputArrayName.Data()));
89 if(strcmp(
fInputArray->GetClass()->GetName(),
"AliAODTrack"))
90 AliError(Form(
"Track type %s not yet supported. Use AliAODTrack",
fInputArray->GetClass()->GetName()));
122 AliAODTrack* inputParticle =
static_cast<AliAODTrack*
>(
fInputArray->At(iPart));
128 new ((*fOutputArray)[accTracks]) AliAODTrack(*((AliAODTrack*)
fInputArray->At(iPart)));
131 AliAODTrack* particle =
static_cast<AliAODTrack*
>(
fOutputArray->At(accTracks));
148 new ((*fOutputArray)[accTracks]) AliAODTrack(*(
GetAODTrack(inputParticle)));
151 AliAODTrack* particle =
static_cast<AliAODTrack*
>(
fOutputArray->At(accTracks));
170 particle->SetTheta(minTheta +
fRandom->Rndm()*(maxTheta-minTheta));
175 Double_t randomTheta = 2.*atan(exp(-randomEta));
176 particle->SetTheta(randomTheta);
183 particle->SetPhi(
AddFlow(particle->Phi(), particle->Pt()));
189 AliAODTrack* newTrack =
new AliAODTrack();
190 newTrack->SetPt(track->
Pt());
191 newTrack->SetTheta(2.*atan(exp(-track->
Eta())));
192 newTrack->SetPhi(track->
Phi());
193 newTrack->SetCharge(track->
Charge());
194 newTrack->SetLabel(track->
GetLabel());
197 UInt_t filterMap = BIT(8) | BIT(9);
198 newTrack->SetIsHybridGlobalConstrainedGlobal();
199 newTrack->SetFilterMap(filterMap);
251 AliError(Form(
"%s: Could not retrieve rho with name %s!", GetName(),
fJetRemovalRhoObj.Data()));
258 return (rho->GetVal());
267 Int_t maxNumberOfIterations = 200;
320 for (
Int_t i=0; i<maxNumberOfIterations; i++)
324 + v2*TMath::Sin(2.*(phi-(
fEPV0+(TMath::Pi()/2.))))
330 +v2*TMath::Cos(2.*(phi-(
fEPV0+(TMath::Pi()/2.))))
336 if (TMath::AreEqualAbs(phiprev,phi,precisionPhi))
break;
359 jetSubLeading = jetLeading;
361 tmpSubleadingPt = tmpLeadingPt;
Double_t fMaxPt
range for Pt for randomization
TH2D * fDistributionV4
Distribution for v3 in bins of pt and centrality.
Double_t fMinEta
range for phi for randomization
Bool_t fRandomizeInTheta
randomize the particle's position in pseudorap
Double_t fRandomPsi4
eventwise calculated psi 3
TRandom3 * fRandom
! random number generator
Int_t fJetRemovalNLeadingJets
threshold at which jets given in fInputJetArray will be removed
TClonesArray * fInputArray
Name of the destination TClonesArray.
TH2D * fDistributionV5
Distribution for v4 in bins of pt and centrality.
Base task in the EMCAL framework.
Bool_t fRandomizeInPt
randomize the particle's position in theta
Double_t fMinPhi
randomize the particle's position in Pt
void GetLeadingJets(AliEmcalJet *&jetLeading, AliEmcalJet *&jetSubLeading)
Double_t fEPV0
!event plane V0
TClonesArray * fJetRemovalArray
Name of the TClonesArray containing jets for removal that will be loaded.
TString fOutputArrayName
Name of the TClonesArray that will be loaded.
TClonesArray * fOutputArray
! Destination TClonesArray
TString fJetRemovalArrayName
Name of array to rho object.
TString fJetEmbeddingArrayName
if this set via ActivateLeadingJetRemoval, the first n leading jets will be removed ...
Int_t ContainsTrack(AliVParticle *track, TClonesArray *tracks) const
Double_t fCent
!event centrality
Double_t fRandomPsi5
eventwise calculated psi 4
Double_t fMinPt
range for eta for randomization
AliEmcalJet * fSubleadingJet
! subleading jet (calculated event-by-event)
TClonesArray * fJetEmbeddingArray
Name of the TClonesArray containing tracks for embedding.
void RandomizeTrack(AliAODTrack *particle)
Double_t fJetRemovalPtThreshold
TString fInputArrayName
Distribution for v5 in bins of pt and centrality.
virtual void UserCreateOutputObjects()
Double_t fMaxPhi
range for phi for randomization
Particle randomization task.
TH2D * fDistributionV2
range for Pt for randomization
virtual ~AliAnalysisTaskParticleRandomizer()
Double_t GetExternalRho()
Represent a jet reconstructed using the EMCal jet framework.
virtual void ExecOnce()
Perform steps needed to initialize the analysis.
void ExecOnce()
Perform steps needed to initialize the analysis.
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.
AliAODTrack * GetAODTrack(AliPicoTrack *track)
Double_t fMaxEta
range for eta for randomization
AliEmcalJet * fLeadingJet
eventwise calculated psi 5
Double_t AddFlow(Double_t phi, Double_t pt)
TString fJetRemovalRhoObj
Bool_t IsParticleInJet(Int_t part)
Bool_t fRandomizeInEta
randomize the particle's position in azimuth
TH2D * fDistributionV3
Distribution for v2 in bins of pt and centrality.