21 #include <TClonesArray.h> 22 #include <AliAODTrack.h> 37 AliAnalysisTaskEmcal("
AliAnalysisTaskParticleRandomizer", kFALSE), fRandomizeInPhi(1), fRandomizeInEta(0), fRandomizeInTheta(0), fRandomizeInPt(0), fTrackEfficiency(1.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));
130 if (fTrackEfficiency < fRandom->Rndm())
133 new ((*fOutputArray)[accTracks]) AliAODTrack(*((AliAODTrack*)
fInputArray->At(iPart)));
136 AliAODTrack* particle =
static_cast<AliAODTrack*
>(
fOutputArray->At(accTracks));
155 if (fTrackEfficiency < fRandom->Rndm())
158 new ((*fOutputArray)[accTracks]) AliAODTrack(*(
GetAODTrack(inputParticle)));
161 AliAODTrack* particle =
static_cast<AliAODTrack*
>(
fOutputArray->At(accTracks));
180 particle->SetTheta(minTheta +
fRandom->Rndm()*(maxTheta-minTheta));
185 Double_t randomTheta = 2.*atan(exp(-randomEta));
186 particle->SetTheta(randomTheta);
193 particle->SetPhi(
AddFlow(particle->Phi(), particle->Pt()));
199 AliAODTrack* newTrack =
new AliAODTrack();
200 newTrack->SetPt(track->
Pt());
201 newTrack->SetTheta(2.*atan(exp(-track->
Eta())));
202 newTrack->SetPhi(track->
Phi());
203 newTrack->SetCharge(track->
Charge());
204 newTrack->SetLabel(track->
GetLabel());
207 UInt_t filterMap = BIT(8) | BIT(9);
208 newTrack->SetIsHybridGlobalConstrainedGlobal();
209 newTrack->SetFilterMap(filterMap);
261 AliError(Form(
"%s: Could not retrieve rho with name %s!", GetName(),
fJetRemovalRhoObj.Data()));
268 return (rho->GetVal());
277 Int_t maxNumberOfIterations = 200;
330 for (
Int_t i=0; i<maxNumberOfIterations; i++)
334 + v2*TMath::Sin(2.*(phi-(
fEPV0+(TMath::Pi()/2.))))
340 +v2*TMath::Cos(2.*(phi-(
fEPV0+(TMath::Pi()/2.))))
346 if (TMath::AreEqualAbs(phiprev,phi,precisionPhi))
break;
369 jetSubLeading = jetLeading;
371 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
Artificial tracking efficiency factor.
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 part
use mixed event to constrain combinatorial background
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 fTrackEfficiency
randomize the particle's position in Pt
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.