CMS 3D CMS Logo

HGCalSiNoiseMap.h
Go to the documentation of this file.
1 #ifndef simcalorimetry_hgcalsimalgos_hgcalsinoisemap
2 #define simcalorimetry_hgcalsimalgos_hgcalsinoisemap
3 
9 #include <string>
10 #include <array>
11 #include <unordered_map>
12 
17 template <typename T>
19 public:
22 
25  float cce, noise;
26  unsigned short gain, thrADC;
27  };
28 
30  SiCellOpCharacteristics() : lnfluence(0.), fluence(0.), ileak(0.), enc_s(0.), enc_p(0.), mipfC(0), mipADC(0) {}
33  unsigned int mipADC;
34  };
35 
38 
42  void setIleakParam(const std::vector<double> &pars) { ileakParam_ = pars; }
43 
47  void setCceParam(const std::vector<double> &parsFine,
48  const std::vector<double> &parsThin,
49  const std::vector<double> &parsThick) {
50  cceParam_.push_back(parsFine); //120
51  cceParam_.push_back(parsThin); //200
52  cceParam_.push_back(parsThick); //300
53  }
54 
58  void setDoseMap(const std::string &, const unsigned int &);
59 
65  void setGeometry(const CaloSubdetectorGeometry *, GainRange_t gain = GainRange_t::AUTO, int aimMIPtoADC = 10);
66 
71  const SiCellOpCharacteristicsCore getSiCellOpCharacteristicsCore(const T &did, GainRange_t gain, int aimMIPtoADC);
72  const SiCellOpCharacteristicsCore getSiCellOpCharacteristicsCore(const T &did) {
74  }
75 
76  SiCellOpCharacteristics getSiCellOpCharacteristics(const T &did,
77  GainRange_t gain = GainRange_t::AUTO,
78  int aimMIPtoADC = 10);
79  SiCellOpCharacteristics getSiCellOpCharacteristics(double &cellCap,
80  double &cellVol,
81  double &mipEqfC,
82  std::vector<double> &cceParam,
83  int &subdet,
84  int &layer,
85  double &radius,
87  int &aimMIPtoADC);
88 
89  std::array<double, 3> &getMipEqfC() { return mipEqfC_; }
90  std::array<double, 3> &getCellCapacitance() { return cellCapacitance_; }
91  std::array<double, 3> &getCellVolume() { return cellVolume_; }
92  std::vector<std::vector<double> > &getCCEParam() { return cceParam_; }
93  std::vector<double> &getIleakParam() { return ileakParam_; }
94  std::vector<std::vector<double> > &getENCsParam() { return encsParam_; }
95  std::vector<double> &getLSBPerGain() { return lsbPerGain_; }
99  return defaultADCPulse_;
100  return adcPulses_[gain];
101  };
102  std::vector<double> &getMaxADCPerGain() { return chargeAtFullScaleADCPerGain_; }
103  double getENCpad(double ileak);
105  double getTDCOnsetAuto(uint32_t gainIdx);
106 
108 
109 private:
112 
113  //cache of SiCellOpCharacteristics
114  std::map<uint32_t, SiCellOpCharacteristicsCore> siopCache_;
115 
116  //vector of three params, per sensor type: 0:120 [mum], 1:200, 2:300
117  std::array<double, 3> mipEqfC_, cellCapacitance_, cellVolume_;
118  std::vector<std::vector<double> > cceParam_;
119 
120  //leakage current/volume vs fluence
121  std::vector<double> ileakParam_;
122 
123  //common noise subtraction noise (final scaling value)
125 
126  //electron charge in fC
127  const double qe2fc_;
128 
129  //electronics noise (series+parallel) polynomial coeffs and ADC pulses;
130  std::vector<std::vector<double> > encsParam_;
132  std::vector<hgc_digi::FEADCPulseShape> adcPulses_;
133 
134  //lsb
136 
137  //conversions
138  const double unitToMicro_ = 1.e6;
140 
141  //flags used to disable specific components of the Si operation parameters or usage of operation cache
143 };
144 
145 #include "HGCalSiNoiseMap.icc"
146 
147 template class HGCalSiNoiseMap<HGCSiliconDetId>;
148 template class HGCalSiNoiseMap<HFNoseDetId>;
149 
150 #endif
std::vector< double > chargeAtFullScaleADCPerGain_
std::vector< std::vector< double > > & getCCEParam()
void setDefaultADCPulseShape(const hgc_digi::FEADCPulseShape &adcPulse)
bool ignoreGainDependentPulse_
std::vector< std::vector< double > > encsParam_
void setCachedOp(bool flag)
std::vector< double > ileakParam_
hgc_digi::FEADCPulseShape defaultADCPulse_
std::vector< double > & getIleakParam()
std::array< double, 3 > cellCapacitance_
void setCceParam(const std::vector< double > &parsFine, const std::vector< double > &parsThin, const std::vector< double > &parsThick)
set the cce parameters to use
std::vector< std::vector< double > > cceParam_
const SiCellOpCharacteristicsCore getSiCellOpCharacteristicsCore(const T &did)
std::map< uint32_t, SiCellOpCharacteristicsCore > siopCache_
const double qe2fc_
std::vector< std::vector< double > > & getENCsParam()
const double unitToMicro_
SiCellOpCharacteristicsCore core
constexpr std::array< uint8_t, layerIndexSize > layer
derives from HGCalRadiation map to parse fluence parameters, provides Si-specific functions; see DN-1...
const hgc_digi::FEADCPulseShape & adcPulseForGain(GainRange_t gain)
std::array< double, 3 > & getCellVolume()
SiCellOpCharacteristics getSiCellOpCharacteristics(const T &did, GainRange_t gain=GainRange_t::AUTO, int aimMIPtoADC=10)
void setDoseMap(const std::string &, const unsigned int &)
overrides base class method with specifics for the configuration of the algo
double getTDCOnsetAuto(uint32_t gainIdx)
std::array< double, 3 > mipEqfC_
double getENCpad(double ileak)
std::vector< hgc_digi::FEADCPulseShape > adcPulses_
parses a txt file with dose/fluence parameters and provides functions for noise, etc.
std::array< double, 3 > & getCellCapacitance()
std::vector< double > lsbPerGain_
std::array< double, 3 > & getMipEqfC()
void setIleakParam(const std::vector< double > &pars)
set the ileak parameters to use
const double unitToMicroLog_
std::array< double, 3 > cellVolume_
std::vector< double > & getLSBPerGain()
const SiCellOpCharacteristicsCore getSiCellOpCharacteristicsCore(const T &did, GainRange_t gain, int aimMIPtoADC)
returns the charge collection efficiency and noise if gain range is set to auto, it will find the mos...
std::vector< double > & getMaxADCPerGain()
void setENCCommonNoiseSubScale(double val)
GainRange_t defaultGain_
void setGeometry(const CaloSubdetectorGeometry *, GainRange_t gain=GainRange_t::AUTO, int aimMIPtoADC=10)
specialization of the base class method which sets the geometry so that it can instantiate an operati...
long double T
std::array< float, 6 > FEADCPulseShape