AliPhysics  8d00e07 (8d00e07)
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 private:
83 
86 
87  // Allows the registration of the class so that it is availble to be used by the correction task.
89 
91  ClassDef(AliEmcalCorrectionCellEmulateCrosstalk, 1); // EMCal cell crosstalk emulation correction component
93 };
94 
95 #if !(defined(__CINT__) || defined(__MAKECINT__))
96 
104 template <typename T>
106 {
107  std::string taskName = GetName();
108  std::map <std::string, std::vector<double>> values;
109 
110  for (auto& val : properties) {
111  AliDebugStream(1) << "Processing value " << val.first << "\n";
112  bool enabled = false;
113  fYAMLConfig.GetProperty({taskName, val.first, "enabled"}, enabled, true);
114  if (enabled) {
115  AliDebugStream(1) << val.first << " enabled.\n";
116  fYAMLConfig.GetProperty({taskName, val.first, "values"}, values, true);
117  // "all"" is prioritized over any individual SM values
118  auto property = values.find("all");
119  if (property != values.end()) {
120  // Set same value in all SMs
121  AliDebugStream(1) << "Retrieving all SM settings for property " << val.first << "\n";
122  for (unsigned int iSM = 0; iSM < fgkNsm; iSM++) {
123  SetProperty(val.second, property->second, iSM, val.first);
124  }
125  }
126  else {
127  // Handle per SM values
128  AliDebugStream(1) << "Retrieving per SM settings for property " << val.first << "\n";
129  for (auto && property : values) {
130  unsigned int iSM = std::stoul(property.first);
131  // iSM must be >= 0 because it is unsigned
132  if (iSM < fgkNsm) {
133  SetProperty(val.second, property.second, iSM, val.first);
134  }
135  else {
136  AliWarningStream() << "SM " << iSM << " requested for property " << val.first << " is out of range. Please check your configuration!\n";
137  }
138  }
139  }
140  }
141  }
142 }
143 #endif
144 
145 #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)
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