AliPhysics  7f1bdba (7f1bdba)
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
44  void CalculateInducedEnergyInTCardCell(Int_t absId, Int_t absIdRef,
45  Int_t sm, Float_t ampRef,
46  Int_t cellCase) ;
47 
50 
51  virtual void ResetArrays();
52  Bool_t AcceptCell(Int_t absID);
53 
54  // Initialize array parameters.
55  #if !(defined(__CINT__) || defined(__MAKECINT__))
56  template <typename T>
57  void RetrieveAndSetProperties(const T & properties);
58  #endif
59  void SetProperty(Float_t val[][fgkNsm], std::vector<double> & property, unsigned int iSM, const std::string & name);
60  void SetProperty(Float_t val[fgkNsm], std::vector<double> & property, unsigned int iSM, const std::string & name);
61 
64 
65  // T-Card correlation emulation, do on MC
69 
77 
78  TRandom3 fRandom;
80 
85 
87 
88  AliAODCaloCells *fAODCellsTmp;
89 
90 
91 private:
92 
95 
96  // Allows the registration of the class so that it is availble to be used by the correction task.
98 
100  ClassDef(AliEmcalCorrectionCellEmulateCrosstalk, 3); // EMCal cell crosstalk emulation correction component
102 };
103 
104 #if !(defined(__CINT__) || defined(__MAKECINT__))
105 
113 template <typename T>
115 {
116  std::string taskName = GetName();
117  std::map <std::string, std::vector<double>> values;
118 
119  for (auto& val : properties) {
120  AliDebugStream(1) << "Processing value " << val.first << "\n";
121  bool enabled = false;
122  fYAMLConfig.GetProperty({taskName, val.first, "enabled"}, enabled, true);
123  if (enabled) {
124  AliDebugStream(1) << val.first << " enabled.\n";
125  fYAMLConfig.GetProperty({taskName, val.first, "values"}, values, true);
126  // "all"" is prioritized over any individual SM values
127  auto property = values.find("all");
128  if (property != values.end()) {
129  // Set same value in all SMs
130  AliDebugStream(1) << "Retrieving all SM settings for property " << val.first << "\n";
131  for (unsigned int iSM = 0; iSM < fgkNsm; iSM++) {
132  SetProperty(val.second, property->second, iSM, val.first);
133  }
134  }
135  else {
136  // Handle per SM values
137  AliDebugStream(1) << "Retrieving per SM settings for property " << val.first << "\n";
138  for (auto && property : values) {
139  unsigned int iSM = std::stoul(property.first);
140  // iSM must be >= 0 because it is unsigned
141  if (iSM < fgkNsm) {
142  SetProperty(val.second, property.second, iSM, val.first);
143  }
144  else {
145  AliWarningStream() << "SM " << iSM << " requested for property " << val.first << " is out of range. Please check your configuration!\n";
146  }
147  }
148  }
149  }
150  }
151 }
152 #endif
153 
154 #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.
Float_t fTCardCorrMinInduced
Minimum induced energy signal on adjacent cells, sum of induced plus original energy, use same as cell energy clusterization cut.
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 fTCardCorrMaxInducedELeak
Maximum value of induced energy signal that is always leaked, ~5-10 MeV.
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
void CalculateInducedEnergyInTCardCell(Int_t absId, Int_t absIdRef, Int_t sm, Float_t ampRef, Int_t cellCase)