AliPhysics  6cf2591 (6cf2591)
 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 SetPtHardBin(Int_t pt) { fSelectPtHardBin = pt ; }
136  void AddAcceptedTriggerClass(const char* trigClass) { fAcceptedTriggerClasses.Add(new TObjString(trigClass)); }
137  void AddRejectedTriggerClass(const char* trigClass) { fRejectedTriggerClasses.Add(new TObjString(trigClass)); }
140 
141  protected:
142  void SetRejectionReasonLabels(TAxis* axis);
143  void AddObjectToEvent(TObject *obj, Bool_t attempt = kFALSE);
144  TClonesArray *GetArrayFromEvent(const char *name, const char *clname=0);
146  Bool_t PythiaInfoFromFile(const char* currFile, Float_t &fXsec, Float_t &fTrials, Int_t &pthard);
147  Bool_t IsTrackInEmcalAcceptance(AliVParticle* part, Double_t edges=0.9) const;
148 
149  // Overloaded AliAnalysisTaskSE methods
151  void UserExec(Option_t *option);
152  Bool_t UserNotify();
153 
154  // Virtual functions, to be overloaded in derived classes
155  virtual void ExecOnce();
156  virtual Bool_t FillGeneralHistograms();
157  virtual Bool_t IsEventSelected();
158  virtual Bool_t RetrieveEventObjects();
164  virtual Bool_t FillHistograms() { return kTRUE ; }
172  virtual Bool_t Run() { return kTRUE ; }
173 
174  // Static utilities
175  static void GetEtaPhiDiff(const AliVTrack *t, const AliVCluster *v, Double_t &phidiff, Double_t &etadiff);
176  static Byte_t GetTrackType(const AliVTrack *t);
177  static Byte_t GetTrackType(const AliAODTrack *aodTrack, UInt_t filterBit1, UInt_t filterBit2);
178  static Double_t DeltaPhi(Double_t phia, Double_t phib, Double_t rMin = -TMath::Pi()/2, Double_t rMax = 3*TMath::Pi()/2);
180  static void GenerateFixedBinArray(Int_t n, Double_t min, Double_t max, Double_t* array);
181  static Double_t GetParallelFraction(AliVParticle* part1, AliVParticle* part2);
182  static Double_t GetParallelFraction(const TVector3& vect1, AliVParticle* part2);
183  static EBeamType_t BeamTypeFromRunNumber(Int_t runnumber);
184 
186 
187  // Task configuration
194 
195  // Input data
201 
204 
205  // Event selection
218 
219  // Service fields
222  AliEMCALGeometry *fGeom;
223  AliVCaloCells *fCaloCells;
224  AliVCaloTrigger *fCaloTriggers;
225  TClonesArray *fTriggerPatchInfo;
238  AliGenPythiaEventHeader *fPythiaHeader;
243 
244  // Output
252  TProfile *fHistXsection;
259 
260  private:
261  AliAnalysisTaskEmcalLight(const AliAnalysisTaskEmcalLight&); // not implemented
263 
265  ClassDef(AliAnalysisTaskEmcalLight, 1);
267 };
268 
278 {
279  Double_t dphi = -999;
280  const Double_t tpi = TMath::TwoPi();
281 
282  if (phia < 0) phia += tpi;
283  else if (phia > tpi) phia -= tpi;
284  if (phib < 0) phib += tpi;
285  else if (phib > tpi) phib -= tpi;
286  dphi = phib - phia;
287  if (dphi < rangeMin) dphi += tpi;
288  else if (dphi > rangeMax) dphi -= tpi;
289 
290  return dphi;
291 }
292 
303 {
304  Double_t binWidth = (max-min)/n;
305  array[0] = min;
306  for (Int_t i = 1; i <= n; i++) {
307  array[i] = array[i-1]+binWidth;
308  }
309 }
310 
321 {
322  Double_t *array = new Double_t[n+1];
323  GenerateFixedBinArray(n, min, max, array);
324  return array;
325 }
326 
327 #endif
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)
TString fCaloTriggerPatchInfoName
trigger patch info array name
Double_t fMinVz
min vertex for event selection
TProfile * fHistXsectionAfterSel
!x section from pythia header
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.
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 * 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)
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
Int_t fPtHardBin
!event pt hard bin
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
Int_t fSelectPtHardBin
select one pt hard bin for analysis
TH1 * fHistEventsAfterSel
!total number of events per pt hard bin after selection
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
TH1 * fHistPtHard
!pt hard distribution
bool Bool_t
Definition: External.C:53
TH1 * fHistTrialsAfterSel
!total number of trials per pt hard bin after selection
TH1 * fHistEventPlane
!event plane distribution
EBeamType_t
Switch for the beam type.
AliVCaloTrigger * fCaloTriggers
!calo triggers
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
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)