AliPhysics  5eaf189 (5eaf189)
AliEmcalCorrectionCellEmulateCrosstalk.h
Go to the documentation of this file.
1 #ifndef ALIEMCALCORRECTIONCELLEMULATECROSSTALK_H
2 #define ALIEMCALCORRECTIONCELLEMULATECROSSTALK_H
3 
4 #include <TRandom3.h>
5 
7 
24  public:
27 
28  // Sets up and runs the task
31  Bool_t Run();
32 
33  // Print correction paramters
34  void PrintTCardParam();
35 
36  protected:
37 
38  // Useful constants
39  static const Int_t fgkNEMCalCells = 17664;
40  static const Int_t fgkNsm = 22;
41 
42  // T-Card correlation emulation, do on MC
46 
47  virtual void ResetArrays();
48  Bool_t AcceptCell(Int_t absID);
49 
50  // Initialize array parameters.
51  #if !(defined(__CINT__) || defined(__MAKECINT__))
52  template <typename T>
53  void RetrieveAndSetProperties(const T & properties);
54  #endif
55  void SetProperty(Float_t val[][fgkNsm], std::vector<double> & property, unsigned int iSM, const std::string & name);
56  void SetProperty(Float_t val[fgkNsm], std::vector<double> & property, unsigned int iSM, const std::string & name);
57 
60 
61  // T-Card correlation emulation, do on MC
65 
73 
74  TRandom3 fRandom;
76 
79 
81 
82  AliAODCaloCells *fAODCellsTmp;
83 
84 
85 private:
86 
89 
90  // Allows the registration of the class so that it is availble to be used by the correction task.
92 
94  ClassDef(AliEmcalCorrectionCellEmulateCrosstalk, 2); // EMCal cell crosstalk emulation correction component
96 };
97 
98 #if !(defined(__CINT__) || defined(__MAKECINT__))
99 
107 template <typename T>
109 {
110  std::string taskName = GetName();
111  std::map <std::string, std::vector<double>> values;
112 
113  for (auto& val : properties) {
114  AliDebugStream(1) << "Processing value " << val.first << "\n";
115  bool enabled = false;
116  fYAMLConfig.GetProperty({taskName, val.first, "enabled"}, enabled, true);
117  if (enabled) {
118  AliDebugStream(1) << val.first << " enabled.\n";
119  fYAMLConfig.GetProperty({taskName, val.first, "values"}, values, true);
120  // "all"" is prioritized over any individual SM values
121  auto property = values.find("all");
122  if (property != values.end()) {
123  // Set same value in all SMs
124  AliDebugStream(1) << "Retrieving all SM settings for property " << val.first << "\n";
125  for (unsigned int iSM = 0; iSM < fgkNsm; iSM++) {
126  SetProperty(val.second, property->second, iSM, val.first);
127  }
128  }
129  else {
130  // Handle per SM values
131  AliDebugStream(1) << "Retrieving per SM settings for property " << val.first << "\n";
132  for (auto && property : values) {
133  unsigned int iSM = std::stoul(property.first);
134  // iSM must be >= 0 because it is unsigned
135  if (iSM < fgkNsm) {
136  SetProperty(val.second, property.second, iSM, val.first);
137  }
138  else {
139  AliWarningStream() << "SM " << iSM << " requested for property " << val.first << " is out of range. Please check your configuration!\n";
140  }
141  }
142  }
143  }
144  }
145 }
146 #endif
147 
148 #endif /* ALIEMCALCORRECTIONCellEmulateCrosstalk_H */
Float_t fTCardCorrInduceEnerFracP1[4][fgkNsm]
Induced energy loss gauss fraction param1 on 0-same row, diff col, 1-up/down cells left/right col 2-l...
Bool_t fTCardCorrCellsNew[fgkNEMCalCells]
Array with induced cell energy in T-Card neighbour cells, that before had no signal.
Float_t fTCardCorrMaxInduced
Maximum induced energy signal on adjacent cells.
static const Int_t fgkNsm
Total number of super-modules.
static const Int_t fgkNEMCalCells
Total number of cells in the calorimeter, 10*48*24 (EMCal) + 4*48*8 (EMCal/DCal 1/3) + 6*32*24 (DCal)...
Correction component to emulate cell-level crosstalk in the EMCal correction framework.
Bool_t fTCardCorrClusEnerConserv
When making correlation, subtract from the reference cell the induced energy on the neighbour cells...
bool GetProperty(std::vector< std::string > propertyPath, const std::string &propertyName, T &property, const bool requiredProperty) const
Float_t fTCardCorrInduceEnerProb[fgkNsm]
Probability to induce energy loss per SM.
void SetProperty(Float_t val[][fgkNsm], std::vector< double > &property, unsigned int iSM, const std::string &name)
AliAODCaloCells * fAODCellsTmp
! Temporal array of cells copy
UShort_t T(UShort_t m, UShort_t t)
Definition: RingBits.C:60
Float_t fTCardCorrInduceEnerFrac[4][fgkNsm]
Induced energy loss gauss fraction param0 on 0-same row, diff col, 1-up/down cells left/right col 2-l...
int Int_t
Definition: External.C:63
Float_t fTCardCorrMinAmp
Minimum cell energy to induce signal on adjacent cells.
Float_t fTCardCorrInduceEnerFracWidth[4][fgkNsm]
Induced energy loss gauss witdth on 0-same row, diff col, 1-up/down cells left/right col 2-left/righ ...
float Float_t
Definition: External.C:68
Base class for correction components in the EMCal correction framework.
Float_t fTCardCorrCellsEner[fgkNEMCalCells]
Array with induced cell energy in T-Card neighbour cells.
Float_t fTCardCorrInduceEnerFracMin[fgkNsm]
In case fTCardCorrInduceEnerFracP1 is non null, restrict the minimum fraction of induced energy per S...
TH1F * fCellEnergyDistBefore
! cell energy distribution, before energy smearing
TH1F * fCellEnergyDistAfter
! cell energy distribution, after energy smearing
AliEmcalCorrectionCellEmulateCrosstalk & operator=(const AliEmcalCorrectionCellEmulateCrosstalk &)
Float_t fTCardCorrInduceEner[4][fgkNsm]
Induced energy loss gauss constant on 0-same row, diff col, 1-up/down cells left/right col 2-left/rig...
static RegisterCorrectionComponent< AliEmcalCorrectionCellEmulateCrosstalk > reg
PWG::Tools::AliYAMLConfiguration fYAMLConfig
Contains the YAML configuration used to configure the component.
Float_t fTCardCorrInduceEnerFracMax[fgkNsm]
In case fTCardCorrInduceEnerFracP1 is non null, restrict the maximum fraction of induced energy per S...
bool Bool_t
Definition: External.C:53