AliPhysics  1811c8f (1811c8f)
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 <map>
25 #include <set>
26 #include <string>
27 #include <vector>
28 #include <iostream>
29 
30 #include "Rtypes.h"
31 
32 #include "AliParticleContainer.h"
33 #include "AliMCParticleContainer.h"
34 #include "AliTrackContainer.h"
35 #include "AliClusterContainer.h"
36 
37 #include "AliAnalysisTaskSE.h"
72  public:
73 
78  enum EDataType_t {
82  };
83 
88  enum EBeamType_t {
89  kNA = -1,
90  kpp = 0,
91  kAA = 1,
92  kpA = 2
93  };
94 
103  };
104 
106  AliAnalysisTaskEmcalLight(const char *name, Bool_t histo=kFALSE);
107  virtual ~AliAnalysisTaskEmcalLight();
108 
109  // Containers
110  AliParticleContainer *AddParticleContainer(std::string branchName, std::string contName="");
111  AliClusterContainer *AddClusterContainer(std::string branchName, std::string contName="");
112  void AdoptParticleContainer(AliParticleContainer* cont) { fParticleCollArray[cont->GetName()] = cont; }
113  void AdoptClusterContainer(AliClusterContainer* cont) { fClusterCollArray[cont->GetName()] = cont; }
114  AliParticleContainer *GetParticleContainer(std::string name) const;
115  AliClusterContainer *GetClusterContainer(std::string name) const;
116  AliMCParticleContainer *GetMCParticleContainer(std::string name) const { return dynamic_cast<AliMCParticleContainer*>(GetParticleContainer(name)); }
117  AliTrackContainer *GetTrackContainer(std::string name) const { return dynamic_cast<AliTrackContainer*>(GetParticleContainer(name)) ; }
118  void RemoveParticleContainer(std::string name) { fParticleCollArray.erase(name) ; }
119  void RemoveClusterContainer(std::string name) { fClusterCollArray.erase(name) ; }
120 
121  // Other input data
122  void SetCaloCellsName(const char *n) { fCaloCellsName = n ; }
124  void SetCaloTriggersName(const char *n) { fCaloTriggersName = n ; }
125  void SetCentralityEstimator(const char *c) { fCentEst = c ; }
126  void SetIsPythia(Bool_t i) { fIsPythia = i ; }
128 
129  // Task configuration
133  void SetCentBins(const std::vector<double>& bins) { fCentBins = std::vector<double>(bins) ; }
134  Int_t GetNCentBins() const { return fCentBins.size() > 1 ? fCentBins.size() - 1 : 1; }
136 
137  // Event selection
139  void SetCentRange(Double_t min, Double_t max) { fMinCent = min ; fMaxCent = max ; }
140  void SetVzRange(Double_t min, Double_t max) { fMinVz = min ; fMaxVz = max ; }
142  void SetMinNVertCont(Int_t cut) { fMinNVertCont = cut ; }
143  void SetPtHardRange(Double_t min, Double_t max) { fMinPtHard = min ; fMaxPtHard = max ; }
145  void AddAcceptedTriggerClass(const char* trigClass) { fAcceptedTriggerClasses.insert(trigClass) ; }
146  void AddRejectedTriggerClass(const char* trigClass) { fRejectedTriggerClasses.insert(trigClass) ; }
149  void SetMCFilter() { fMCRejectFilter = kTRUE ; }
150  void ResetMCFilter() { fMCRejectFilter = kFALSE ; }
159  void SetInhibit(Bool_t s) { fInhibit = s ; }
161 
162  Bool_t IsInhibit() const { return fInhibit; }
163 
164  protected:
165  void SetRejectionReasonLabels(TAxis* axis);
166  void AddObjectToEvent(TObject *obj, Bool_t attempt = kFALSE);
167  TClonesArray *GetArrayFromEvent(const char *name, const char *clname=0);
169  Bool_t PythiaInfoFromFile(const char* currFile, Float_t &fXsec, Float_t &fTrials, Int_t &pthard);
170  Bool_t IsTrackInEmcalAcceptance(AliVParticle* part, Double_t edges=0.9) const;
172 
173  // Overloaded AliAnalysisTaskSE methods
175  void UserExec(Option_t *option);
176  Bool_t UserNotify();
177 
178  // Virtual functions, to be overloaded in derived classes
179  virtual void ExecOnce();
180  virtual Bool_t FillGeneralHistograms(Bool_t eventSelected);
181  virtual Bool_t IsEventSelected();
182  virtual Bool_t RetrieveEventObjects();
188  virtual Bool_t FillHistograms() { return kTRUE ; }
196  virtual Bool_t Run() { return kTRUE ; }
197 
198  // Static utilities
199  static void GetEtaPhiDiff(const AliVTrack *t, const AliVCluster *v, Double_t &phidiff, Double_t &etadiff);
200  static Byte_t GetTrackType(const AliVTrack *t);
201  static Byte_t GetTrackType(const AliAODTrack *aodTrack, UInt_t filterBit1, UInt_t filterBit2);
202  static Double_t DeltaPhi(Double_t phia, Double_t phib, Double_t rMin = -TMath::Pi()/2, Double_t rMax = 3*TMath::Pi()/2);
203  static std::vector<double> GenerateFixedBinArray(int n, double min, double max, bool last = true);
204  static void GenerateFixedBinArray(int n, double min, double max, std::vector<double>& array, bool last = true);
205  static std::vector<double> GenerateLogFixedBinArray(int n, double min, double max, bool last = true);
206  static void GenerateLogFixedBinArray(int n, double min, double max, std::vector<double>& array, bool last = true);
207  static Double_t GetParallelFraction(AliVParticle* part1, AliVParticle* part2);
208  static Double_t GetParallelFraction(const TVector3& vect1, AliVParticle* part2);
209  static EBeamType_t BeamTypeFromRunNumber(Int_t runnumber);
210 
212 
213  // Task configuration
218  std::vector<double> fCentBins;
220 
221  // Input data
227 
228  std::map<std::string,
230  std::map<std::string,
232 
233  // Event selection
244  std::set<std::string> fAcceptedTriggerClasses;
245  std::set<std::string> fRejectedTriggerClasses;
255 
256  // Service fields
260  AliEMCALGeometry *fGeom;
261  AliVCaloCells *fCaloCells;
262  AliVCaloTrigger *fCaloTriggers;
263  TClonesArray *fTriggerPatchInfo;
274  std::vector<std::string> fFiredTriggerClasses;
276  AliGenPythiaEventHeader *fPythiaHeader;
283 
284  // Output
286 
287  private:
288  std::map<std::string, TH1*> fHistograms;
289  TH1* GetGeneralTH1(const char* name, bool warn=false);
290  TH2* GetGeneralTH2(const char* name, bool warn=false);
291  TProfile* GetGeneralTProfile(const char* name, bool warn=false);
292 
293  AliAnalysisTaskEmcalLight(const AliAnalysisTaskEmcalLight&); // not implemented
295 
297  ClassDef(AliAnalysisTaskEmcalLight, 4);
299 };
300 
301 #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
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
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)
TString part
use mixed event to constrain combinatorial background
Definition: InvMassFit.C:52
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
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
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
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 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
void SetCentBins(const std::vector< double > &bins)
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)
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 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)