AliPhysics  f05a842 (f05a842)
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
AliEmcalCorrectionTask.h
Go to the documentation of this file.
1 #ifndef ALIEMCALCORRECTIONTASK_H
2 #define ALIEMCALCORRECTIONTASK_H
3 
4 
5 
6 #if !(defined(__CINT__) || defined(__MAKECINT__))
7 #include <yaml-cpp/yaml.h>
8 #endif
9 
10 #include "AliAnalysisTaskSE.h"
11 #include <Rtypes.h>
12 
13 // Base component
15 // Geometry
16 class AliEMCALGeometry;
17 
18 #include "AliParticleContainer.h"
19 #include "AliMCParticleContainer.h"
20 #include "AliTrackContainer.h"
21 #include "AliClusterContainer.h"
22 
47  public:
52  enum BeamType {
53  kNA = -1,
54  kpp = 0,
55  kAA = 1,
56  kpA = 2
57  };
58 
60  AliEmcalCorrectionTask(const char * name);
61  virtual ~AliEmcalCorrectionTask();
62 
63  // Methods from AliAnalysisTaskSE
65  void UserExec(Option_t * option);
67 
68  // Functions that can be overloaded by users
72  virtual void ExecOnce();
76  virtual Bool_t Run();
77 
78  // Options
79  void SetUserConfigurationFilename(std::string name) { fUserConfigurationFilename = name; }
81 
83 
84  // Containers and cells
86  AliTrackContainer *AddTrackContainer(const char *n);
94  AliParticleContainer *GetParticleContainer(const char* name) const;
96  AliClusterContainer *GetClusterContainer(const char* name) const;
98  AliMCParticleContainer *GetMCParticleContainer(const char* name) const { return dynamic_cast<AliMCParticleContainer*>(GetParticleContainer(name)); }
100  AliTrackContainer *GetTrackContainer(const char* name) const { return dynamic_cast<AliTrackContainer*>(GetParticleContainer(name)) ; }
101  void RemoveParticleContainer(Int_t i=0) { fParticleCollArray.RemoveAt(i) ; }
102  void RemoveClusterContainer(Int_t i=0) { fClusterCollArray.RemoveAt(i) ; }
103  void SetCaloCellsName(const char* name) { fCaloCellsName = name; }
104 
106  void SetRunPeriod(const char* runPeriod) { fRunPeriod = runPeriod; fRunPeriod.ToLower(); }
107  const TString & GetRunPeriod() const { return fRunPeriod; }
108 
111 
112  const std::vector<AliEmcalCorrectionComponent *> & CorrectionComponents() { return fCorrectionComponents; }
113 
114  bool WriteConfigurationFile(std::string filename, bool userConfig = false);
115 
116  private:
117  AliEmcalCorrectionTask(const AliEmcalCorrectionTask &); // Not implemented
118  AliEmcalCorrectionTask &operator=(const AliEmcalCorrectionTask &); // Not implemented
119 
120  static inline bool doesFileExist(const std::string & filename);
121  void SetupConfigurationFilePath(std::string & filename, bool userFile = false);
122 
123  void RetrieveExecutionOrder(std::vector <std::string> & componentsToAdd);
124  void InitializeComponents();
125 
128  void CopyClusters(TClonesArray *orig, TClonesArray *dest);
129  void CleanupCreatedBranches();
130 
132  void ExecOnceComponents();
133 
135 
136 #if !(defined(__CINT__) || defined(__MAKECINT__))
137  YAML::Node fUserConfiguration;
139 #endif
140 
143 
146 
147  std::vector <AliEmcalCorrectionComponent *> fCorrectionComponents;
149 
150  bool fIsEsd;
169  AliEMCALGeometry *fGeom;
170 
173  AliVCaloCells *fCaloCells;
174  AliVCaloCells *fCaloCellsFromInputEvent;
175 
177 
179  ClassDef(AliEmcalCorrectionTask, 1); // EMCal correction task
181 };
182 
183 #endif /* ALIEMCALCORRECTIONTASK_H */
Int_t fNcentBins
how many centrality bins
Steering task for the EMCal correction frameworkThis class is the steering class for the cell and clu...
AliEMCALGeometry * fGeom
!emcal geometry
const char * filename
Definition: TestFCM.C:1
double Double_t
Definition: External.C:58
AliTrackContainer * AddTrackContainer(const char *n)
AliTrackContainer * GetTrackContainer(const char *name) const
AliClusterContainer * GetClusterContainer(Int_t i=0) const
std::vector< AliEmcalCorrectionComponent * > fCorrectionComponents
! Contains the correction components
Container with name, TClonesArray and cuts for particles.
void RetrieveExecutionOrder(std::vector< std::string > &componentsToAdd)
AliVCaloCells * fCaloCellsFromInputEvent
! pointer to calo cells from the input event
void AdoptClusterContainer(AliClusterContainer *cont)
void SetupConfigurationFilePath(std::string &filename, bool userFile=false)
void UserExec(Option_t *option)
void SetDefaultConfigurationFilename(std::string name)
Double_t fMaxCent
max centrality for event selection
Double_t fVertex[3]
!event vertex
AliEmcalCorrectionTask & operator=(const AliEmcalCorrectionTask &)
TList * fOutput
! Output for histograms
bool fConfigurationInitialized
True if the YAML files are initialized.
void RemoveClusterContainer(Int_t i=0)
static bool doesFileExist(const std::string &filename)
Container for particles within the EMCAL framework.
void SetUserConfigurationFilename(std::string name)
bool fCreateNewObjectBranches
Create new branches for cells and clusters.
AliTrackContainer * GetTrackContainer(Int_t i=0) const
AliMCParticleContainer * GetMCParticleContainer(const char *name) const
bool fEventInitialized
If the event is initialized properly.
TString fCentEst
name of V0 centrality estimator
int Int_t
Definition: External.C:63
std::string fUserConfigurationFilename
! User YAML configruation filename
const std::vector< AliEmcalCorrectionComponent * > & CorrectionComponents()
std::string fDefaultConfigurationString
Store the default YAML configuration as a string so that it can be streamed.
TString fRunPeriod
Run period (passed by user)
Double_t fCent
! Event centrality
void SetUseNewCentralityEstimation(Bool_t b)
BeamType
Switch for the beam type.
AliMCParticleContainer * AddMCParticleContainer(const char *n)
AliVCaloCells * fCaloCells
! pointer to calo cells
std::string fCreatedTrackBranchName
Name of created track branch.
bool WriteConfigurationFile(std::string filename, bool userConfig=false)
Bool_t fNeedEmcalGeom
whether or not the task needs the emcal geometry
std::string fCreatedClusterBranchName
Name of created cluster branch.
Bool_t fUseNewCentralityEstimation
Use new centrality estimation (for 2015 data)
void CopyClusters(TClonesArray *orig, TClonesArray *dest)
std::string fDefaultConfigurationFilename
! Default YAML configuration filename
TObjArray fParticleCollArray
particle/track collection array
TObjArray fClusterCollArray
cluster collection array
AliMCParticleContainer * GetMCParticleContainer(Int_t i=0) const
const TString & GetRunPeriod() const
void AdoptTrackContainer(AliTrackContainer *cont)
AliParticleContainer * GetParticleContainer(Int_t i=0) const
void SetCaloCellsName(const char *name)
void AdoptParticleContainer(AliParticleContainer *cont)
BeamType fBeamType
!event beam type
TString fCaloCellsName
name of calo cell collection
const char Option_t
Definition: External.C:48
YAML::Node fDefaultConfiguration
User YAML Configuration.
Int_t fNVertCont
!event vertex number of contributors
void RemoveParticleContainer(Int_t i=0)
bool Bool_t
Definition: External.C:53
Int_t fCentBin
! Event centrality bin
void AdoptMCParticleContainer(AliMCParticleContainer *cont)
Double_t fMinCent
min centrality for event selection
void SetRunPeriod(const char *runPeriod)
AliClusterContainer * AddClusterContainer(const char *n)
AliParticleContainer * AddParticleContainer(const char *n)
Container structure for EMCAL clusters.
Container for MC-true particles within the EMCAL framework.
std::string fUserConfigurationString
Default YAML Configuration.
void SetCreateNewObjectBranches(bool flag)
BeamType fForceBeamType
forced beam type