#include "AliMCEvent.h"
#include "AliVParticle.h"
#include "AliAODMCHeader.h"
+#include "AliEventplane.h"
#include "TFormula.h"
#include "AliAnalysisManager.h"
ClassImp(AliAnalyseLeadingTrackUE)
-//-------------------------------------------------------------------
+//____________________________________________________________________
AliAnalyseLeadingTrackUE::AliAnalyseLeadingTrackUE() :
TObject(),
fDebug(0),
fCheckMotherPDG(kTRUE),
fTrackEtaCut(0.8),
fTrackEtaCutMin(-1.),
+ fTrackPhiCutEvPlMin(0),
+ fTrackPhiCutEvPlMax(0),
fTrackPtMin(0),
fEventSelection(AliVEvent::kMB|AliVEvent::kUserDefined),
fDCAXYCut(0),
// constructor
}
-
-//-------------------------------------------------------------------
+//____________________________________________________________________
AliAnalyseLeadingTrackUE & AliAnalyseLeadingTrackUE::operator = (const AliAnalyseLeadingTrackUE & /*source*/)
{
// assignment operator
return *this;
}
-
-//-------------------------------------------------------------------
+//____________________________________________________________________
AliAnalyseLeadingTrackUE::~AliAnalyseLeadingTrackUE()
{
}
-
//____________________________________________________________________
Bool_t AliAnalyseLeadingTrackUE::ApplyCuts(TObject* track)
{
return kTRUE;
}
-
//____________________________________________________________________
-void AliAnalyseLeadingTrackUE::DefineESDCuts(Int_t filterbit) {
+void AliAnalyseLeadingTrackUE::DefineESDCuts(Int_t filterbit)
+{
// Reproduces the cuts of the corresponding bit in the ESD->AOD filtering
// (see $ALICE_ROOT/ANALYSIS/macros/AddTaskESDFilter.C)
return tracks;
}
-
+//____________________________________________________________________
void AliAnalyseLeadingTrackUE::RemoveInjectedSignals(TObjArray* tracks, TObject* mcObj, Int_t maxLabel)
{
// remove injected signals (primaries above <maxLabel>)
AliInfo(Form("Reduced from %d to %d", before, tracks->GetEntriesFast()));
}
-//-------------------------------------------------------------------
+//____________________________________________________________________
void AliAnalyseLeadingTrackUE::RemoveWeakDecays(TObjArray* tracks, TObject* mcObj)
{
// remove particles from weak decays
AliInfo(Form("Reduced from %d to %d", before, tracks->GetEntriesFast()));
}
-//-------------------------------------------------------------------
-TObjArray* AliAnalyseLeadingTrackUE::GetAcceptedParticles(TObject* obj, TObject* arrayMC, Bool_t onlyprimaries, Int_t particleSpecies, Bool_t useEtaPtCuts, Bool_t speciesOnTracks)
+//____________________________________________________________________
+TObjArray* AliAnalyseLeadingTrackUE::GetAcceptedParticles(TObject* obj, TObject* arrayMC, Bool_t onlyprimaries, Int_t particleSpecies, Bool_t useEtaPtCuts, Bool_t speciesOnTracks, Double_t evtPlane)
{
// Returns an array of particles that pass the cuts, if arrayMC is given each reconstructed particle is replaced by its corresponding MC particles, depending on the parameter onlyprimaries only for primaries
// particleSpecies: -1 all particles are returned
// 0 (pions) 1 (kaons) 2 (protons) 3 (others) particles
// speciesOnTracks if kFALSE, particleSpecies is only applied on the matched MC particle (not on the track itself)
+ // Passing down the Double_t* evtPlane (range [-pi/2,pi/2]) will apply a phi cut with respect to the eventplane between fTrackPhiCutEvPlMin and fTrackPhiCutEvPlMax. For values outside [-pi/2,pi/2], this will be ignored.
Int_t nTracks = NParticles(obj);
TObjArray* tracks = new TObjArray;
AliVParticle* part = ParticleWithCuts( obj, ipart, onlyprimaries, (speciesOnTracks) ? particleSpecies : -1);
if (!part) continue;
+ if (TMath::Abs(evtPlane)<=TMath::Pi()/2) { //evtPlane range: (-pi/2,pi/2)
+ Double_t phiPart = part->Phi(); //range: [0,2*pi)
+ if(phiPart>TMath::Pi()) phiPart-=2*TMath::Pi();
+
+ Double_t dPhi = 0; //range: [0,pi/2], i.e. the difference over the shortest angle.
+ Double_t diff = TMath::Abs(phiPart-evtPlane);
+ if(diff<=TMath::Pi()/2) dPhi = diff;
+ else if(diff<=TMath::Pi()) dPhi = TMath::Pi()-diff;
+ else dPhi = diff-TMath::Pi();
+
+ if(dPhi<fTrackPhiCutEvPlMin || dPhi>fTrackPhiCutEvPlMax) {
+ if (hasOwnership)
+ delete part;
+ continue;
+ }
+ }
+
if (useEtaPtCuts)
if (TMath::Abs(part->Eta()) > fTrackEtaCut || TMath::Abs(part->Eta()) < fTrackEtaCutMin || part->Pt() < fTrackPtMin)
{
return tracks;
}
-//-------------------------------------------------------------------
+//____________________________________________________________________
TObjArray* AliAnalyseLeadingTrackUE::GetFakeParticles(TObject* obj, TObject* arrayMC, Bool_t onlyprimaries, Int_t particleSpecies, Bool_t useEtaPtCuts)
{
// particleSpecies: -1 all particles are returned
return pairs;
}
-//-------------------------------------------------------------------
+//____________________________________________________________________
TObjArray* AliAnalyseLeadingTrackUE::GetMinMaxRegion(TList *transv1, TList *transv2)
{
return regionParticles;
}
-//-------------------------------------------------------------------
+//____________________________________________________________________
Int_t AliAnalyseLeadingTrackUE::NParticles(TObject* obj)
{
return nTracks;
}
-//-------------------------------------------------------------------
+//____________________________________________________________________
AliVParticle* AliAnalyseLeadingTrackUE::ParticleWithCuts(TObject* obj, Int_t ipart, Bool_t onlyprimaries, Int_t particleSpecies)
{
// Returns track or MC particle at position "ipart" if passes selection criteria
return part;
}
-
-//-------------------------------------------------------------------
+//____________________________________________________________________
void AliAnalyseLeadingTrackUE::QSortTracks(TObjArray &a, Int_t first, Int_t last)
{
// Sort array of TObjArray of tracks by Pt using a quicksort algorithm.
}
-
//____________________________________________________________________
Bool_t AliAnalyseLeadingTrackUE::TriggerSelection(const TObject* obj)
{
}
//____________________________________________________________________
-
Bool_t AliAnalyseLeadingTrackUE::CheckTrack(AliVParticle * part)
{
// check if the track status flags are set
class TVector3;
class AliVTrack;
class AliHelperPID;
+class AliEventplane;
class TFormula;
class AliAnalyseLeadingTrackUE : public TObject {
AliVParticle* ParticleWithCuts(TObject* obj, Int_t ipart, Bool_t onlyprimaries = kTRUE, Int_t particleSpecies = -1); // Returns track or MC particle at position "ipart" if passes selection criteria
void QSortTracks(TObjArray &a, Int_t first, Int_t last); // Sort by pT an array of AliVParticles
TObjArray* SortRegions(const AliVParticle* leading, TObject* obj, TObject* arrayMC, Bool_t onlyprimaries = kTRUE); // Assign particles to towards, away or transverse regions
- TObjArray* GetAcceptedParticles(TObject* obj, TObject* arrayMC, Bool_t onlyprimaries = kTRUE, Int_t particleSpecies = -1, Bool_t useEtaPtCuts = kFALSE, Bool_t speciesOnTracks = kTRUE);
+ TObjArray* GetAcceptedParticles(TObject* obj, TObject* arrayMC, Bool_t onlyprimaries = kTRUE, Int_t particleSpecies = -1, Bool_t useEtaPtCuts = kFALSE, Bool_t speciesOnTracks = kTRUE, Double_t evtPlane = 1e10);
TObjArray* GetFakeParticles(TObject* obj, TObject* arrayMC, Bool_t onlyprimaries, Int_t particleSpecies, Bool_t useEtaPtCuts);
Bool_t TriggerSelection(const TObject* obj); // Select good triggers with AliPhysicsSelection class
Bool_t VertexSelection(const TObject* obj, Int_t ntracks, Double_t zed); // Vertex selection: see implementation
void SetSharedClusterCut(Double_t value) { fSharedClusterCut = value; }
void SetCrossedRowsCut(Int_t value) { fCrossedRowsCut = value; }
void SetFoundFractionCut(Double_t value) { fFoundFractionCut = value; }
+ void SetParticlePhiCutEventPlane(Double_t min, Double_t max) { fTrackPhiCutEvPlMin = min; fTrackPhiCutEvPlMax = max; }
protected:
Bool_t CheckTrack(AliVParticle * part);
Bool_t fCheckMotherPDG; // Check the PDG code of mother for secondaries
Double_t fTrackEtaCut; // pseudo-rapidity limit of transverse regions
Double_t fTrackEtaCutMin; // minimum of the pseudo-rapidity limit of transverse regions
+ Double_t fTrackPhiCutEvPlMin; // Minimum Phi cut on particles with respect to the Event Plane (values between 0 and Pi/2)
+ Double_t fTrackPhiCutEvPlMax; // Maximum Phi cut on particles with respect to the Event Plane (values between 0 and Pi/2)
+
Double_t fTrackPtMin; // pt limit for selecting particles
UInt_t fEventSelection; // bit for physics selection
TFormula* fDCAXYCut; // additional pt dependent cut on DCA XY (only for AOD)
// track cuts
fTrackEtaCut(0.8),
fTrackEtaCutMin(-1.),
+fTrackPhiCutEvPlMin(0),
+fTrackPhiCutEvPlMax(0),
fOnlyOneEtaSide(0),
fPtMin(0.5),
fDCAXYCut(0),
fAnalyseUE->DefineESDCuts(fFilterBit);
fAnalyseUE->SetEventSelection(fSelectBit);
fAnalyseUE->SetHelperPID(fHelperPID);
+ if(fTrackPhiCutEvPlMax!=0)
+ fAnalyseUE->SetParticlePhiCutEventPlane(fTrackPhiCutEvPlMin,fTrackPhiCutEvPlMax);
if ((fParticleSpeciesTrigger != -1 || fParticleSpeciesAssociated != -1) && !fHelperPID)
AliFatal("HelperPID object should be set in the steering macro");
return;
TObjArray* tracks = 0;
-
+
+ Double_t evtPlanePhi = 10e10; //A value outside [-pi/2,pi/2] will be ignored
+ if(fTrackPhiCutEvPlMax!=0) {
+ AliEventplane* evtPlane = inputEvent->GetEventplane();
+ Double_t qx = 0; Double_t qy = 0;
+ if(evtPlane) evtPlanePhi = evtPlane->CalculateVZEROEventPlane(inputEvent, 10, 2, qx, qy);
+ //Reject event if the plane is not available
+ else return;
+ }
+
if (fTriggersFromDetector == 0)
- tracks = fAnalyseUE->GetAcceptedParticles(inputEvent, 0, kTRUE, fParticleSpeciesTrigger, kTRUE);
+ tracks = fAnalyseUE->GetAcceptedParticles(inputEvent, 0, kTRUE, fParticleSpeciesTrigger, kTRUE, kTRUE, evtPlanePhi);
else if (fTriggersFromDetector <= 4)
tracks=GetParticlesFromDetector(inputEvent,fTriggersFromDetector);
else
// correlate particles with...
TObjArray* tracksCorrelate = 0;
if(fAssociatedFromDetector==0){
- if (fParticleSpeciesAssociated != fParticleSpeciesTrigger || fTriggersFromDetector > 0 )
+ if (fParticleSpeciesAssociated != fParticleSpeciesTrigger || fTriggersFromDetector > 0 || fTrackPhiCutEvPlMax != 0)
tracksCorrelate = fAnalyseUE->GetAcceptedParticles(inputEvent, 0, kTRUE, fParticleSpeciesAssociated, kTRUE);
}
else if (fAssociatedFromDetector <= 4){
}
}
+//____________________________________________________________________
TObjArray* AliAnalysisTaskPhiCorrelations::CloneAndReduceTrackList(TObjArray* tracks)
{
// clones a track list by using AliDPhiBasicParticle which uses much less memory (used for event mixing)
AliInfo(Form("Reduced from %d to %d", before, tracks->GetEntriesFast()));
}
+//____________________________________________________________________
void AliAnalysisTaskPhiCorrelations::CleanUp(TObjArray* tracks, TObject* mcObj, Int_t maxLabel)
{
// calls RemoveInjectedSignals, RemoveWeakDecays and RemoveDuplicates
}
//____________________________________________________________________
-Bool_t AliAnalysisTaskPhiCorrelations::IsMuEvent(){
+Bool_t AliAnalysisTaskPhiCorrelations::IsMuEvent()
+{
if(!fAOD)
AliFatal("Muon selection only implemented on AOD");//FIXME to be implemented also for ESDs as in AliAnalyseLeadingTrackUE::GetAcceptedPArticles
void SetCentralityWeights(TH1* hist) { fCentralityWeights = hist; }
// for event QA
- void SetTracksInVertex( Int_t val ){ fnTracksVertex = val; }
- void SetZVertex( Double_t val ) { fZVertex = val; }
- void SetAcceptOnlyMuEvents( Bool_t val ) { fAcceptOnlyMuEvents = val; }
+ void SetTracksInVertex(Int_t val ){ fnTracksVertex = val; }
+ void SetZVertex(Double_t val ) { fZVertex = val; }
+ void SetAcceptOnlyMuEvents(Bool_t val ) { fAcceptOnlyMuEvents = val; }
// track cuts
- void SetTrackEtaCut( Double_t val ) { fTrackEtaCut = val; }
- void SetTrackEtaCutMin( Double_t val ) { fTrackEtaCutMin = val; }
+ void SetTrackEtaCut(Double_t val ) { fTrackEtaCut = val; }
+ void SetTrackEtaCutMin(Double_t val ) { fTrackEtaCutMin = val; }
void SetOnlyOneEtaSide(Int_t flag) { fOnlyOneEtaSide = flag; }
+ void SetTrackPhiCutEvPlMin(Double_t val) { fTrackPhiCutEvPlMin = val; }
+ void SetTrackPhiCutEvPlMax(Double_t val) { fTrackPhiCutEvPlMax = val; }
void SetPtMin(Double_t val) { fPtMin = val; }
void SetFilterBit( UInt_t val ) { fFilterBit = val; }
void SetDCAXYCut(TFormula* value) { fDCAXYCut = value; }
Bool_t fInjectedSignals; // check header to skip injected signals in MC
Bool_t fRandomizeReactionPlane; // change the orientation of the RP by a random value by shifting all tracks
- AliHelperPID* fHelperPID; // points to class for PID
+ AliHelperPID* fHelperPID; // points to class for PID
AliAnalysisUtils* fAnalysisUtils; // points to class with common analysis utilities
- TMap* fMap; // points to TMap class containing scaling factors for VZERO A signal
+ TMap* fMap; // points to TMap class containing scaling factors for VZERO A signal
// Pointers to external UE classes
- AliAnalyseLeadingTrackUE* fAnalyseUE; //! points to class containing common analysis algorithms
- AliUEHistograms* fHistos; //! points to class to handle histograms/containers
- AliUEHistograms* fHistosMixed; //! points to class to handle mixed histograms/containers
+ AliAnalyseLeadingTrackUE* fAnalyseUE; //! points to class containing common analysis algorithms
+ AliUEHistograms* fHistos; //! points to class to handle histograms/containers
+ AliUEHistograms* fHistosMixed; //! points to class to handle mixed histograms/containers
- THnF* fEfficiencyCorrectionTriggers; // if non-0 this efficiency correction is applied on the fly to the filling for trigger particles. The factor is multiplicative, i.e. should contain 1/efficiency. Axes: eta, pT, centrality, z-vtx
- THnF* fEfficiencyCorrectionAssociated; // if non-0 this efficiency correction is applied on the fly to the filling for associated particles. The factor is multiplicative, i.e. should contain 1/efficiency. Axes: eta, pT, centrality, z-vtx
- TH1* fCentralityWeights; // for centrality flattening
+ THnF* fEfficiencyCorrectionTriggers; // if non-0 this efficiency correction is applied on the fly to the filling for trigger particles. The factor is multiplicative, i.e. should contain 1/efficiency. Axes: eta, pT, centrality, z-vtx
+ THnF* fEfficiencyCorrectionAssociated; // if non-0 this efficiency correction is applied on the fly to the filling for associated particles. The factor is multiplicative, i.e. should contain 1/efficiency. Axes: eta, pT, centrality, z-vtx
+ TH1* fCentralityWeights; // for centrality flattening
// Handlers and events
AliAODEvent* fAOD; //! AOD Event
AliEventPoolManager* fPoolMgr; //! event pool manager
// Histogram settings
- TList* fListOfHistos; // Output list of containers
+ TList* fListOfHistos; // Output list of containers
// Event QA cuts
- Int_t fnTracksVertex; // QA tracks pointing to principal vertex
- Double_t fZVertex; // Position of Vertex in Z direction
+ Int_t fnTracksVertex; // QA tracks pointing to principal vertex
+ Double_t fZVertex; // Position of Vertex in Z direction
Bool_t fAcceptOnlyMuEvents; // Only Events with at least one muon are accepted
- TString fCentralityMethod; // Method to determine centrality
+ TString fCentralityMethod; // Method to determine centrality
// Track cuts
Double_t fTrackEtaCut; // Maximum Eta cut on particles
- Double_t fTrackEtaCutMin; // Minimum Eta cut on particles
+ Double_t fTrackEtaCutMin; // Minimum Eta cut on particles
+ Double_t fTrackPhiCutEvPlMin; // Minimum Phi cut on particles with respect to the Event Plane (values between 0 and Pi/2)
+ Double_t fTrackPhiCutEvPlMax; // Maximum Phi cut on particles with respect to the Event Plane (values between 0 and Pi/2), if = 0, then no cut is performed
Int_t fOnlyOneEtaSide; // decides that only trigger particle from one eta side are considered (0 = all; -1 = negative, 1 = positive)
Double_t fPtMin; // Min pT to start correlations
TFormula* fDCAXYCut; // additional pt dependent cut on DCA XY (only for AOD)
- Double_t fSharedClusterCut; // cut on shared clusters (only for AOD)
- Int_t fCrossedRowsCut; // cut on crossed rows (only for AOD)
+ Double_t fSharedClusterCut; // cut on shared clusters (only for AOD)
+ Int_t fCrossedRowsCut; // cut on crossed rows (only for AOD)
Double_t fFoundFractionCut; // cut on crossed rows/findable clusters (only for AOD)
UInt_t fFilterBit; // Select tracks from an specific track cut
UInt_t fTrackStatus; // if non-0, the bits set in this variable are required for each track
Bool_t fUseChargeHadrons; // Only use charge hadrons
Int_t fParticleSpeciesTrigger; // Select which particle to use for the trigger [ -1 (all, default) 0 (pions) 1 (kaons) 2 (protons) 3 (others) particles ]
Int_t fParticleSpeciesAssociated; // Select which particle to use for the associated [ -1 (all, default) 0 (pions) 1 (kaons) 2 (protons) 3 (others) particles ]
- Bool_t fCheckMotherPDG; // Check the PDG code of mother for secondaries
+ Bool_t fCheckMotherPDG; // Check the PDG code of mother for secondaries
// Tracklets cuts
Double_t fTrackletDphiCut; //maximum Dphi cut on tracklets
Int_t fRejectResonanceDaughters; // reject all daughters of all resonance candidates (1: test method (cut at m_inv=0.9); 2: k0; 3: lambda)
Bool_t fFillOnlyStep0; // fill only step 0
Bool_t fSkipStep6; // skip step 6 when filling
- Bool_t fRejectCentralityOutliers; // enable rejection of outliers in centrality vs no track correlation
+ Bool_t fRejectCentralityOutliers; // enable rejection of outliers in centrality vs no track correlation. Interferes with the event plane dependence code
Bool_t fRejectZeroTrackEvents; // reject events which have no tracks (using the eta, pT cuts defined)
Bool_t fRemoveWeakDecays; // remove secondaries from weak decays from tracks and particles
Bool_t fRemoveDuplicates; // remove particles with the same label (double reconstruction)
{
AliAnalysisManager *mgr = AliAnalysisManager::GetAnalysisManager();
if (!mgr) {
- Error("AddTaskPWG4HighPtSpectra", "No analysis manager to connect to.");
+ Error("AddTaskHybridTrackEfficiency", "No analysis manager to connect to.");
return NULL;
}
TString dataType = mgr->GetInputEventHandler()->GetDataType(); // can be "ESD" or "AOD"
bIncludeNoITS = kTRUE;
}
else {
- ::Error("AddTaskPWG4HighPtSpectra","Period string not of predefined type. Add it to the list in this macro.");
+ ::Error("AddTaskHybridTrackEfficiency","Period string not of predefined type. Add it to the list in this macro.");
return NULL;
}
filterMask2 = 256;
}
else {
- ::Error("AddTaskPWG4HighPtSpectra","Period string not of predefined type. Add it to the list in this macro.");
+ ::Error("AddTaskHybridTrackEfficiency","Period string not of predefined type. Add it to the list in this macro.");
return NULL;
}
//==============================================================================
AliAnalysisManager *mgr = AliAnalysisManager::GetAnalysisManager();
if (!mgr) {
- Error("AddTaskPWG4HighPtSpectra", "No analysis manager to connect to.");
+ Error("AddTaskHybridTrackEfficiency", "No analysis manager to connect to.");
return NULL;
}
TString dataType = mgr->GetInputEventHandler()->GetDataType(); // can be "ESD" or "AOD"
// manager. The availability of MC handler can also be checked here.
//==============================================================================
if (!mgr->GetInputEventHandler()) {
- ::Error("AddTaskPWG4HighPtSpectra", "This task requires an input event handler");
+ ::Error("AddTaskHybridTrackEfficiency", "This task requires an input event handler");
return NULL;
}
}
else if(iAODanalysis==1) { //run on AODs
if(doEfficiency==1){
- gROOT->LoadMacro(gSystem->ExpandPathName("$ALICE_ROOT/PWGJE/macros/AddTaskPWG4HighPtSpectra.C"));
- AddTaskPWG4HighPtSpectraQA_AOD(prodType.Data(),isPbPb,AliVEvent::kMB,kTRUE,kFALSE);
+ gROOT->LoadMacro(gSystem->ExpandPathName("$ALICE_ROOT/PWGJE/macros/AddTaskHybridTrackEfficiency.C"));
+ AddTaskHybridTrackEfficiencyQA_AOD_train(prodType.Data(),isPbPb,AliVEvent::kMB,kTRUE,kFALSE);
}
AddTaskPWG4HighPtTrackQAAOD(prodType.Data(),isPbPb,iAODanalysis,filterBit);
}