AliPhysics  9b6b435 (9b6b435)
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 AliGenEventHeader;
19 class AliGenPythiaEventHeader;
20 class AliVCaloTrigger;
21 class AliAnalysisUtils;
22 class AliEMCALTriggerPatchInfo;
23 class AliAODTrack;
24 
25 #include <map>
26 #include <set>
27 #include <string>
28 #include <vector>
29 #include <iostream>
30 
31 #include "Rtypes.h"
32 
33 #include "AliParticleContainer.h"
34 #include "AliMCParticleContainer.h"
35 #include "AliTrackContainer.h"
36 #include "AliClusterContainer.h"
37 
38 #include "AliAnalysisTaskSE.h"
73  public:
74 
79  enum EDataType_t {
83  };
84 
89  enum EBeamType_t {
90  kNA = -1,
91  kpp = 0,
92  kAA = 1,
93  kpA = 2
94  };
95 
104  };
105 
107  AliAnalysisTaskEmcalLight(const char *name, Bool_t histo=kFALSE);
108  virtual ~AliAnalysisTaskEmcalLight();
109 
110  // Containers
111  AliParticleContainer *AddParticleContainer(std::string branchName, std::string contName="");
112  AliClusterContainer *AddClusterContainer(std::string branchName, std::string contName="");
115  AliParticleContainer *GetParticleContainer(std::string name) const;
116  AliClusterContainer *GetClusterContainer(std::string name) const;
117  AliMCParticleContainer *GetMCParticleContainer(std::string name) const { return dynamic_cast<AliMCParticleContainer*>(GetParticleContainer(name)); }
118  AliTrackContainer *GetTrackContainer(std::string name) const { return dynamic_cast<AliTrackContainer*>(GetParticleContainer(name)) ; }
119  void RemoveParticleContainer(std::string name) { fParticleCollArray.erase(name) ; }
120  void RemoveClusterContainer(std::string name) { fClusterCollArray.erase(name) ; }
121 
122  // Other input data
123  void SetCaloCellsName(const char *n) { fCaloCellsName = n ; }
125  void SetCaloTriggersName(const char *n) { fCaloTriggersName = n ; }
126  void SetCentralityEstimator(const char *c) { fCentEst = c ; }
128  void SetIsPythia(Bool_t i);
129  void SetMCEventHeaderName(const char* name);
131 
132  // Task configuration
136  void SetCentBins(const std::vector<double>& bins) { fCentBins = std::vector<double>(bins) ; }
137  Int_t GetNCentBins() const { return fCentBins.size() > 1 ? fCentBins.size() - 1 : 1; }
139 
140  // Event selection
142  void SetCentRange(Double_t min, Double_t max) { fMinCent = min ; fMaxCent = max ; }
143  void SetVzRange(Double_t min, Double_t max) { fMinVz = min ; fMaxVz = max ; }
145  void SetMinNVertCont(Int_t cut) { fMinNVertCont = cut ; }
146  void SetPtHardRange(Double_t min, Double_t max) { fMinPtHard = min ; fMaxPtHard = max ; }
148  void AddAcceptedTriggerClass(const char* trigClass) { fAcceptedTriggerClasses.insert(trigClass) ; }
149  void AddRejectedTriggerClass(const char* trigClass) { fRejectedTriggerClasses.insert(trigClass) ; }
152  void SetMCFilter() { fMCRejectFilter = kTRUE ; }
153  void ResetMCFilter() { fMCRejectFilter = kFALSE ; }
162  void SetInhibit(Bool_t s) { fInhibit = s ; }
164  void SetUseAliEmcalList(Bool_t doUse) { fUseAliEmcalList = doUse ; }
166 
167  Bool_t IsInhibit() const { return fInhibit; }
168 
169  protected:
170  void SetRejectionReasonLabels(TAxis* axis);
171  void AddObjectToEvent(TObject *obj, Bool_t attempt = kFALSE);
172  TClonesArray *GetArrayFromEvent(const char *name, const char *clname=0);
174  Bool_t PythiaInfoFromFile(const char* currFile, Float_t &fXsec, Float_t &fTrials, Int_t &pthard, Bool_t &useXsecFromHeader);
175  Bool_t IsTrackInEmcalAcceptance(AliVParticle* part, Double_t edges=0.9) const;
177 
178  // Overloaded AliAnalysisTaskSE methods
180  void UserExec(Option_t *option);
181  Bool_t UserNotify();
182 
183  // Virtual functions, to be overloaded in derived classes
184  virtual void ExecOnce();
185  virtual Bool_t FillGeneralHistograms(Bool_t eventSelected);
186  virtual Bool_t IsEventSelected();
187  virtual Bool_t RetrieveEventObjects();
193  virtual Bool_t FillHistograms() { return kTRUE ; }
201  virtual Bool_t Run() { return kTRUE ; }
202 
203  // Static utilities
204  static void GetEtaPhiDiff(const AliVTrack *t, const AliVCluster *v, Double_t &phidiff, Double_t &etadiff);
205  static Byte_t GetTrackType(const AliVTrack *t);
206  static Byte_t GetTrackType(const AliAODTrack *aodTrack, UInt_t filterBit1, UInt_t filterBit2);
207  static Double_t DeltaPhi(Double_t phia, Double_t phib, Double_t rMin = -TMath::Pi()/2, Double_t rMax = 3*TMath::Pi()/2);
208  static std::vector<double> GenerateFixedBinArray(int n, double min, double max, bool last = true);
209  static void GenerateFixedBinArray(int n, double min, double max, std::vector<double>& array, bool last = true);
210  static std::vector<double> GenerateLogFixedBinArray(int n, double min, double max, bool last = true);
211  static void GenerateLogFixedBinArray(int n, double min, double max, std::vector<double>& array, bool last = true);
212  static Double_t GetParallelFraction(AliVParticle* part1, AliVParticle* part2);
213  static Double_t GetParallelFraction(const TVector3& vect1, AliVParticle* part2);
214  static EBeamType_t BeamTypeFromRunNumber(Int_t runnumber);
215 
217 
218  // Task configuration
223  std::vector<double> fCentBins;
225 
226  // Input data
234 
235  std::map<std::string,
237  std::map<std::string,
239 
240  // Event selection
251  std::set<std::string> fAcceptedTriggerClasses;
252  std::set<std::string> fRejectedTriggerClasses;
264 
265  // Service fields
269  AliEMCALGeometry *fGeom;
270  AliVCaloCells *fCaloCells;
271  AliVCaloTrigger *fCaloTriggers;
272  TClonesArray *fTriggerPatchInfo;
283  std::vector<std::string> fFiredTriggerClasses;
285  AliGenEventHeader *fMCHeader;
286  AliGenPythiaEventHeader *fPythiaHeader;
294 
295  // Output
297 
298  private:
299  std::map<std::string, TH1*> fHistograms;
300  TH1* GetGeneralTH1(const char* name, bool warn=false);
301  TH2* GetGeneralTH2(const char* name, bool warn=false);
302  TProfile* GetGeneralTProfile(const char* name, bool warn=false);
303 
304  AliAnalysisTaskEmcalLight(const AliAnalysisTaskEmcalLight&); // not implemented
306 
308  ClassDef(AliAnalysisTaskEmcalLight, 5);
310 };
311 
312 #endif
Bool_t fSwitchOffLHC15oFaultyBranches
Switch off faulty tree branches in LHC15o AOD trees.
AliClusterContainer * AddClusterContainer(std::string branchName, std::string contName="")
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
AliEMCALGeometry * fGeom
!emcal geometry
EBeamType_t fBeamType
!event beam type
Bool_t fInhibit
!inhibit execution of the task
double Double_t
Definition: External.C:58
TClonesArray * GetArrayFromEvent(const char *name, const char *clname=0)
EDataType_t
Switch for the data type.
Float_t fXsection
!x-section from pythia header
Double_t fEPV0A
!event plane V0A
TString fSelectGeneratorName
Selects only events produced by a generator that has a name containing a string.
Double_t fEPV0
!event plane V0
Bool_t fIsMonteCarlo
if it is a MC production
Container with name, TClonesArray and cuts for particles.
Bool_t fMCRejectFilter
enable the filtering of events by tail rejection
TString fCaloTriggerPatchInfoName
trigger patch info array name
Double_t fMinVz
min vertex for event selection
New centrality estimation (AliMultSelection, see https://twiki.cern.ch/twiki/bin/viewauth/ALICE/AliMu...
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
std::vector< double > fCentBins
how many centrality bins
Bool_t fEventSelectionAfterRun
If kTRUE, the event selection is performed after Run() but before FillHistograms() ...
static Byte_t GetTrackType(const AliVTrack *t)
static std::vector< double > GenerateFixedBinArray(int n, double min, double max, bool last=true)
TString fCaloCellsName
name of calo cell collection
Bool_t IsTrackInEmcalAcceptance(AliVParticle *part, Double_t edges=0.9) const
void SetMCEventHeaderName(const char *name)
Double_t fMinCent
min centrality for event selection
std::set< std::string > fRejectedTriggerClasses
list of accepted trigger classes
TH1 * GetGeneralTH1(const char *name, bool warn=false)
void SetCentRange(Double_t min, Double_t max)
Double_t fMaxMinimumBiasPtHard
maximum pt hard for the minimum bias pt hard bin (MC)
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)
std::map< std::string, TH1 * > fHistograms
!general QA histograms
static Double_t fgkEMCalDCalPhiDivide
phi value used to distinguish between DCal and EMCal
EBeamType_t fForceBeamType
forced beam type
std::vector< std::string > fFiredTriggerClasses
!trigger classes fired by the current event
Bool_t fCreateHisto
whether or not create histograms
Bool_t PythiaInfoFromFile(const char *currFile, Float_t &fXsec, Float_t &fTrials, Int_t &pthard, Bool_t &useXsecFromHeader)
int Int_t
Definition: External.C:63
void AddAcceptedTriggerClass(const char *trigClass)
TH2 * GetGeneralTH2(const char *name, bool warn=false)
Double_t fMinPtHard
select minimum pt hard (MC)
unsigned int UInt_t
Definition: External.C:33
TString fMCEventHeaderName
Looks for MC event properties in a particular MC event type (useful for a MC cocktail production) ...
float Float_t
Definition: External.C:68
void RemoveParticleContainer(std::string name)
Base task in the EMCAL framework (lighter version of AliAnalysisTaskEmcal)
Float_t fPtHardAndClusterPtFactor
Factor between ptHard and cluster pT to reject/accept event.
Double_t fMaxVzDiff
upper limit for distance between primary and SPD vertex
Bool_t fUsePtHardBinScaling
Apply pt-hard bin scaling (in case AliEmcalList is used to handle the output)
Double_t fVertex[3]
!event vertex
Double_t fMaximumEventWeight
Minimum event weight for the related bookkeping histogram.
ECentralityEstimation_t fCentralityEstimation
Centrality estimation.
Int_t fPtHardBin
!event pt hard bin
AliClusterContainer * GetClusterContainer(std::string name) const
void AdoptClusterContainer(AliClusterContainer *cont)
void SetCentralityEstimation(ECentralityEstimation_t b)
Bool_t fIsPythia
if it is a PYTHIA production
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
Double_t fMinNVertCont
minumum number of vertex contributors
Int_t fNVertSPDCont
!event SPD vertex number of contributors
std::set< std::string > fAcceptedTriggerClasses
list of accepted trigger classes
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)
ECentralityEstimation_t
Switch for the centrality estimation.
Double_t fMinimumEventWeight
Minimum event weight for the related bookkeping histogram.
Bool_t fLocalInitialized
!whether or not the task has been already initialized
AliGenEventHeader * fMCHeader
!event MC header
void SetCentBins(const std::vector< double > &bins)
const char * GetName() const
static EBeamType_t BeamTypeFromRunNumber(Int_t runnumber)
void SetCaloTriggerPatchInfoName(const char *n)
AliParticleContainer * AddParticleContainer(std::string branchName, std::string contName="")
void RemoveClusterContainer(std::string name)
Definition: External.C:220
TProfile * GetGeneralTProfile(const char *name, bool warn=false)
Bool_t fUseAliEmcalList
Use AliEmcalList as output object.
std::map< std::string, AliParticleContainer * > fParticleCollArray
particle/track collection array
void SetVzRange(Double_t min, Double_t max)
Int_t fNVertCont
!event vertex number of contributors
static std::vector< double > GenerateLogFixedBinArray(int n, double min, double max, bool last=true)
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.
AliParticleContainer * GetParticleContainer(std::string name) const
Bool_t fUseXsecFromHeader
!Switch for using cross section from header (if not found in pythia file)
bool Bool_t
Definition: External.C:53
AliMCParticleContainer * GetMCParticleContainer(std::string name) const
std::map< std::string, AliClusterContainer * > fClusterCollArray
cluster collection array
EBeamType_t
Switch for the beam type.
AliVCaloTrigger * fCaloTriggers
!calo triggers
void SetEventWeightRange(Double_t min, Double_t max)
AliTrackContainer * GetTrackContainer(std::string name) const
Container structure for EMCAL clusters.
Container for MC-true particles within the EMCAL framework.
TString fGeneratorName
!name of the MC generator used to produce the current event (only AOD)
AliAnalysisTaskEmcalLight & operator=(const AliAnalysisTaskEmcalLight &)
void AdoptParticleContainer(AliParticleContainer *cont)
virtual Bool_t FillGeneralHistograms(Bool_t eventSelected)
Double_t fMaxVz
max vertex for event selection
Double_t fCent
!event centrality
Double_t fEPV0C
!event plane V0C
Definition: External.C:196
TClonesArray * fTriggerPatchInfo
!trigger patch info array
Double_t fMaxPtHard
select maximum pt hard (MC)
Old centrality estimation (AliCentrality, works only on Run-1 PbPb and pPb)
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)