AliPhysics  95775ff (95775ff)
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
AliAnalysisTaskEmcalLight.h
Go to the documentation of this file.
1 #ifndef ALIANALYSISTASKEMCALLIGHT_H
2 #define ALIANALYSISTASKEMCALLIGHT_H
3 /* Copyright(c) 1998-2016, ALICE Experiment at CERN, All rights reserved. *
4  * See cxx source for full Copyright notice */
5 
6 class TClonesArray;
7 class TString;
8 class TList;
9 class AliEmcalParticle;
10 class AliMCParticle;
11 class AliVCluster;
12 class AliVTrack;
13 class AliVParticle;
14 class AliVCaloCells;
15 class TH1;
16 class TProfile;
17 class AliEMCALGeometry;
18 class AliGenPythiaEventHeader;
19 class AliVCaloTrigger;
20 class AliAnalysisUtils;
21 class AliEMCALTriggerPatchInfo;
22 class AliAODTrack;
23 
24 #include "Rtypes.h"
25 
26 #include "AliParticleContainer.h"
27 #include "AliMCParticleContainer.h"
28 #include "AliTrackContainer.h"
29 #include "AliClusterContainer.h"
30 
31 #include "AliAnalysisTaskSE.h"
66  public:
67 
72  enum EDataType_t {
76  };
77 
82  enum EBeamType_t {
83  kNA = -1,
84  kpp = 0,
85  kAA = 1,
86  kpA = 2
87  };
88 
90  AliAnalysisTaskEmcalLight(const char *name, Bool_t histo=kFALSE);
92 
93  // Containers
95  AliTrackContainer *AddTrackContainer(const char *n);
103  AliParticleContainer *GetParticleContainer(const char* name) const;
105  AliClusterContainer *GetClusterContainer(const char* name) const;
107  AliMCParticleContainer *GetMCParticleContainer(const char* name) const { return dynamic_cast<AliMCParticleContainer*>(GetParticleContainer(name)); }
109  AliTrackContainer *GetTrackContainer(const char* name) const { return dynamic_cast<AliTrackContainer*>(GetParticleContainer(name)) ; }
110  void RemoveParticleContainer(Int_t i=0) { fParticleCollArray.RemoveAt(i) ; }
111  void RemoveClusterContainer(Int_t i=0) { fClusterCollArray.RemoveAt(i) ; }
112 
113  // Other input data
114  void SetCaloCellsName(const char *n) { fCaloCellsName = n ; }
116  void SetCaloTriggersName(const char *n) { fCaloTriggersName = n ; }
117  void SetCentralityEstimator(const char *c) { fCentEst = c ; }
118  void SetIsPythia(Bool_t i) { fIsPythia = i ; }
120 
121  // Task configuration
125  void SetNCentBins(Int_t n) { fNcentBins = n ; }
126 
127  // Event selection
129  void SetCentRange(Double_t min, Double_t max) { fMinCent = min ; fMaxCent = max ; }
130  void SetVzRange(Double_t min, Double_t max) { fMinVz = min ; fMaxVz = max ; }
132  void SetMinPtTrack(Double_t min) { fMinPtTrack = min ; }
133  void SetMinNTrack(Int_t min) { fMinNTrack = min ; }
135  void SetPtHardRange(Double_t min, Double_t max) { fMinPtHard = min ; fMaxPtHard = max ; }
136  void AddAcceptedTriggerClass(const char* trigClass) { fAcceptedTriggerClasses.Add(new TObjString(trigClass)); }
137  void AddRejectedTriggerClass(const char* trigClass) { fRejectedTriggerClasses.Add(new TObjString(trigClass)); }
140  void SetMCFilter() { fMCRejectFilter = kTRUE ; }
141  void ResetMCFilter() { fMCRejectFilter = kFALSE ; }
148 
149  protected:
150  void SetRejectionReasonLabels(TAxis* axis);
151  void AddObjectToEvent(TObject *obj, Bool_t attempt = kFALSE);
152  TClonesArray *GetArrayFromEvent(const char *name, const char *clname=0);
154  Bool_t PythiaInfoFromFile(const char* currFile, Float_t &fXsec, Float_t &fTrials, Int_t &pthard);
155  Bool_t IsTrackInEmcalAcceptance(AliVParticle* part, Double_t edges=0.9) const;
157 
158  // Overloaded AliAnalysisTaskSE methods
160  void UserExec(Option_t *option);
161  Bool_t UserNotify();
162 
163  // Virtual functions, to be overloaded in derived classes
164  virtual void ExecOnce();
165  virtual Bool_t FillGeneralHistograms();
166  virtual Bool_t IsEventSelected();
167  virtual Bool_t RetrieveEventObjects();
173  virtual Bool_t FillHistograms() { return kTRUE ; }
181  virtual Bool_t Run() { return kTRUE ; }
182 
183  // Static utilities
184  static void GetEtaPhiDiff(const AliVTrack *t, const AliVCluster *v, Double_t &phidiff, Double_t &etadiff);
185  static Byte_t GetTrackType(const AliVTrack *t);
186  static Byte_t GetTrackType(const AliAODTrack *aodTrack, UInt_t filterBit1, UInt_t filterBit2);
187  static Double_t DeltaPhi(Double_t phia, Double_t phib, Double_t rMin = -TMath::Pi()/2, Double_t rMax = 3*TMath::Pi()/2);
189  static void GenerateFixedBinArray(Int_t n, Double_t min, Double_t max, Double_t* array);
190  static Double_t GetParallelFraction(AliVParticle* part1, AliVParticle* part2);
191  static Double_t GetParallelFraction(const TVector3& vect1, AliVParticle* part2);
192  static EBeamType_t BeamTypeFromRunNumber(Int_t runnumber);
193 
195 
196  // Task configuration
203 
204  // Input data
210 
213 
214  // Event selection
232 
233  // Service fields
236  AliEMCALGeometry *fGeom;
237  AliVCaloCells *fCaloCells;
238  AliVCaloTrigger *fCaloTriggers;
239  TClonesArray *fTriggerPatchInfo;
252  AliGenPythiaEventHeader *fPythiaHeader;
256 
257  // Output
265  TProfile *fHistXsection;
271 
272  private:
273  AliAnalysisTaskEmcalLight(const AliAnalysisTaskEmcalLight&); // not implemented
275 
277  ClassDef(AliAnalysisTaskEmcalLight, 2);
279 };
280 
290 {
291  Double_t dphi = -999;
292  const Double_t tpi = TMath::TwoPi();
293 
294  if (phia < 0) phia += tpi;
295  else if (phia > tpi) phia -= tpi;
296  if (phib < 0) phib += tpi;
297  else if (phib > tpi) phib -= tpi;
298  dphi = phib - phia;
299  if (dphi < rangeMin) dphi += tpi;
300  else if (dphi > rangeMax) dphi -= tpi;
301 
302  return dphi;
303 }
304 
315 {
316  Double_t binWidth = (max-min)/n;
317  array[0] = min;
318  for (Int_t i = 1; i <= n; i++) {
319  array[i] = array[i-1]+binWidth;
320  }
321 }
322 
333 {
334  Double_t *array = new Double_t[n+1];
335  GenerateFixedBinArray(n, min, max, array);
336  return array;
337 }
338 
339 #endif
Float_t fPtHardAndJetPtFactor
Factor between ptHard and jet pT to reject/accept event.
Double_t fVertexSPD[3]
!event Svertex
TString fCaloTriggersName
name of calo triggers collection
TObjArray fAcceptedTriggerClasses
list of accepted trigger classes
Int_t fNcentBins
how many centrality bins
AliEMCALGeometry * fGeom
!emcal geometry
EBeamType_t fBeamType
!event beam type
double Double_t
Definition: External.C:58
TClonesArray * GetArrayFromEvent(const char *name, const char *clname=0)
EDataType_t
Switch for the data type.
TObjArray fClusterCollArray
cluster collection array
AliMCParticleContainer * GetMCParticleContainer(Int_t i=0) const
Float_t fXsection
!x-section from pythia header
Double_t fEPV0A
!event plane V0A
Double_t fEPV0
!event plane V0
TH1 * fHistEventCount
!incoming and selected events
TObjArray fRejectedTriggerClasses
list of accepted trigger classes
AliTrackContainer * GetTrackContainer(Int_t i=0) const
TObjArray fParticleCollArray
particle/track collection array
Container with name, TClonesArray and cuts for particles.
Double_t fZvertexDiff
upper limit for distance between primary and SPD vertex
AliTrackContainer * AddTrackContainer(const char *n)
Bool_t fMCRejectFilter
enable the filtering of events by tail rejection
Int_t fMinPtHard
select minimum pt hard (MC)
TString fCaloTriggerPatchInfoName
trigger patch info array name
Double_t fMinVz
min vertex for event selection
void AddRejectedTriggerClass(const char *trigClass)
TCanvas * c
Definition: TestFitELoss.C:172
TString fCentEst
name of the centrality estimator
UInt_t fTriggerSelectionBitMap
trigger selection bit map
TH1 * fHistCentrality
!event centrality distribution
AliTrackContainer * GetTrackContainer(const char *name) const
static Byte_t GetTrackType(const AliVTrack *t)
TH1 * fHistTriggerClasses
!number of events in each trigger class
TString fCaloCellsName
name of calo cell collection
TH1 * fHistEvents
!total number of events per pt hard bin
Bool_t IsTrackInEmcalAcceptance(AliVParticle *part, Double_t edges=0.9) const
Double_t fMinCent
min centrality for event selection
Double_t fMinPtTrack
cut on track pt in event selection
void SetCentRange(Double_t min, Double_t max)
Container for particles within the EMCAL framework.
void SetPtHardRange(Double_t min, Double_t max)
static void GetEtaPhiDiff(const AliVTrack *t, const AliVCluster *v, Double_t &phidiff, Double_t &etadiff)
void AddObjectToEvent(TObject *obj, Bool_t attempt=kFALSE)
static Double_t fgkEMCalDCalPhiDivide
phi value used to distinguish between DCal and EMCal
EBeamType_t fForceBeamType
forced beam type
AliClusterContainer * AddClusterContainer(const char *n)
Bool_t fCreateHisto
whether or not create histograms
TH1 * fHistTrialsVsPtHard
!total number of trials per pt hard bin after selection
TH1 * fHistEventRejection
!book keep reasons for rejecting event
int Int_t
Definition: External.C:63
TH1 * fHistTrials
!trials from pyxsec.root
void AddAcceptedTriggerClass(const char *trigClass)
unsigned int UInt_t
Definition: External.C:33
TString fFiredTriggerClasses
!trigger classes fired by the current event
float Float_t
Definition: External.C:68
Base task in the EMCAL framework (lighter version of AliAnalysisTaskEmcal)
TH1 * fHistEventsVsPtHard
!total number of events per pt hard bin after selection
Float_t fPtHardAndClusterPtFactor
Factor between ptHard and cluster pT to reject/accept event.
Double_t fVertex[3]
!event vertex
static Double_t * GenerateFixedBinArray(Int_t n, Double_t min, Double_t max)
AliClusterContainer * GetClusterContainer(Int_t i=0) const
void AdoptClusterContainer(AliClusterContainer *cont)
Bool_t fIsPythia
if it is a PYTHIA production
TProfile * fHistXsection
!x section from pyxsec.root
Int_t fCentBin
!event centrality bin
unsigned long ULong_t
Definition: External.C:38
Double_t fMaxCent
max centrality for event selection
ULong_t fFiredTriggerBitMap
!bit map of fired triggers
AliMCParticleContainer * GetMCParticleContainer(const char *name) const
Int_t fNVertSPDCont
!event SPD vertex number of contributors
static Double_t DeltaPhi(Double_t phia, Double_t phib, Double_t rMin=-TMath::Pi()/2, Double_t rMax=3 *TMath::Pi()/2)
void SetCentralityEstimator(const char *c)
Double_t fMinPtTrackInEmcal
min pt track in emcal
Bool_t PythiaInfoFromFile(const char *currFile, Float_t &fXsec, Float_t &fTrials, Int_t &pthard)
Bool_t fLocalInitialized
!whether or not the task has been already initialized
static EBeamType_t BeamTypeFromRunNumber(Int_t runnumber)
Int_t fMinNTrack
minimum nr of tracks in event with pT>fTrackPtCut
void SetCaloTriggerPatchInfoName(const char *n)
void AdoptTrackContainer(AliTrackContainer *cont)
AliParticleContainer * GetParticleContainer(Int_t i=0) const
void SetVzRange(Double_t min, Double_t max)
Int_t fNVertCont
!event vertex number of contributors
AliMCParticleContainer * AddMCParticleContainer(const char *n)
Bool_t fGeneralHistograms
whether or not it should fill some general histograms
AliGenPythiaEventHeader * fPythiaHeader
!event Pythia header
const char Option_t
Definition: External.C:48
Float_t fPtHardAndTrackPtFactor
Factor between ptHard and track pT to reject/accept event.
bool Bool_t
Definition: External.C:53
TH1 * fHistEventPlane
!event plane distribution
EBeamType_t
Switch for the beam type.
AliVCaloTrigger * fCaloTriggers
!calo triggers
TProfile * fHistXsectionVsPtHard
!x section from pythia header
Container structure for EMCAL clusters.
Container for MC-true particles within the EMCAL framework.
TH1 * fHistZVertex
!z vertex position
AliParticleContainer * AddParticleContainer(const char *n)
AliAnalysisTaskEmcalLight & operator=(const AliAnalysisTaskEmcalLight &)
void AdoptParticleContainer(AliParticleContainer *cont)
Double_t fMaxVz
max vertex for event selection
Double_t fCent
!event centrality
Double_t fEPV0C
!event plane V0C
Int_t fMaxPtHard
select maximum pt hard (MC)
Definition: External.C:196
Bool_t fUseNewCentralityEstimation
Use new centrality estimation (for 2015 data)
TClonesArray * fTriggerPatchInfo
!trigger patch info array
void AdoptMCParticleContainer(AliMCParticleContainer *cont)
Bool_t fNeedEmcalGeom
whether or not the task needs the emcal geometry
static Double_t GetParallelFraction(AliVParticle *part1, AliVParticle *part2)
EDataType_t fDataType
!data type (ESD or AOD)