CMS 3D CMS Logo

List of all members | Classes | Public Types | Public Member Functions | Private Attributes
HGCalSiNoiseMap Class Reference

derives from HGCalRadiation map to parse fluence parameters, provides Si-specific functions; see DN-19-045 More...

#include <HGCalSiNoiseMap.h>

Inheritance diagram for HGCalSiNoiseMap:
HGCalRadiationMap

Classes

struct  SiCellOpCharacteristics
 

Public Types

enum  GainRange_t { q80fC, q160fC, q320fC, AUTO }
 
enum  NoiseMapAlgoBits_t { FLUENCE, CCE, NOISE }
 
- Public Types inherited from HGCalRadiationMap
typedef std::map< std::pair< int, int >, DoseParametersdoseParametersMap
 

Public Member Functions

std::vector< std::vector< double > > & getCCEParam ()
 
std::array< double, 3 > & getCellCapacitance ()
 
std::array< double, 3 > & getCellVolume ()
 
std::vector< std::vector< double > > & getENCsParam ()
 
std::vector< double > & getIleakParam ()
 
std::vector< double > & getLSBPerGain ()
 
std::vector< double > & getMaxADCPerGain ()
 
std::array< double, 3 > & getMipEqfC ()
 
SiCellOpCharacteristics getSiCellOpCharacteristics (const HGCSiliconDetId &did, GainRange_t gain=GainRange_t::AUTO, int aimMIPtoADC=10)
 returns the charge collection efficiency and noise if gain range is set to auto, it will find the most appropriate gain to put the mip peak close to 10 ADC counts More...
 
 HGCalSiNoiseMap ()
 
void setCceParam (const std::vector< double > &parsFine, const std::vector< double > &parsThin, const std::vector< double > &parsThick)
 set the cce parameters to use More...
 
void setDoseMap (const std::string &, const unsigned int &)
 overrides base class method with specifics for the configuration of the algo More...
 
void setIleakParam (const std::vector< double > &pars)
 set the ileak parameters to use More...
 
 ~HGCalSiNoiseMap ()
 
- Public Member Functions inherited from HGCalRadiationMap
const unsigned int & algo ()
 
const HGCalDDDConstantsddd ()
 
const HGCalGeometrygeom ()
 
const doseParametersMapgetDoseMap ()
 
double getDoseValue (const int, const int, const radiiVec &, bool logVal=false)
 
double getFluenceValue (const int, const int, const radiiVec &, bool logVal=false)
 
 HGCalRadiationMap ()
 
void setDoseMap (const std::string &, const unsigned int)
 
void setGeometry (const CaloSubdetectorGeometry *)
 
const HGCalTopologytopo ()
 
 ~HGCalRadiationMap ()
 

Private Attributes

std::vector< std::vector< double > > cceParam_
 
std::array< double, 3 > cellCapacitance_
 
std::array< double, 3 > cellVolume_
 
std::vector< double > chargeAtFullScaleADCPerGain_
 
const double encCommonNoiseSub_
 
const double encpScale_
 
std::vector< std::vector< double > > encsParam_
 
bool ignoreCCE_
 
bool ignoreFluence_
 
bool ignoreNoise_
 
std::vector< double > ileakParam_
 
std::vector< double > lsbPerGain_
 
std::array< double, 3 > mipEqfC_
 
const double qe2fc_
 
const double unitToMicro_ = 1.e6
 

Detailed Description

derives from HGCalRadiation map to parse fluence parameters, provides Si-specific functions; see DN-19-045

Definition at line 14 of file HGCalSiNoiseMap.h.

Member Enumeration Documentation

Enumerator
q80fC 
q160fC 
q320fC 
AUTO 

Definition at line 16 of file HGCalSiNoiseMap.h.

Enumerator
FLUENCE 
CCE 
NOISE 

Definition at line 17 of file HGCalSiNoiseMap.h.

Constructor & Destructor Documentation

HGCalSiNoiseMap::HGCalSiNoiseMap ( )

Definition at line 4 of file HGCalSiNoiseMap.cc.

References cellCapacitance_, cellVolume_, chargeAtFullScaleADCPerGain_, encsParam_, mps_fire::i, lsbPerGain_, mipEqfC_, and qe2fc_.

5  : encpScale_(840.),
7  qe2fc_(1.60217646E-4),
8  ignoreFluence_(false),
9  ignoreCCE_(false),
10  ignoreNoise_(false) {
11  encsParam_.push_back({636., 15.6, 0.0328}); // q80fC: II order polynomial coefficients
12  chargeAtFullScaleADCPerGain_.push_back(80.); // the num of fC (charge) which corresponds to the max ADC value
13  encsParam_.push_back({1045., 8.74, 0.0685}); // q160fC
14  chargeAtFullScaleADCPerGain_.push_back(160.);
15  encsParam_.push_back({1915., 2.79, 0.0878}); // q320fC
16  chargeAtFullScaleADCPerGain_.push_back(320.);
17 
18  // adc has 10 bits -> 1024 counts at max ( >0 baseline to be handled)
19  for (auto i : chargeAtFullScaleADCPerGain_)
20  lsbPerGain_.push_back(i / 1024.);
21 
22  //fine sensors: 120 mum - 67: MPV of charge[number of e-]/mum for a mip in silicon; srouce PDG
23  const double mipEqfC_120 = 120. * 67. * qe2fc_;
24  mipEqfC_[0] = mipEqfC_120;
25  const double cellCapacitance_120 = 50;
26  cellCapacitance_[0] = cellCapacitance_120;
27  const double cellVolume_120 = 0.52 * (120.e-4);
28  cellVolume_[0] = cellVolume_120;
29 
30  //thin sensors: 200 mum
31  const double mipEqfC_200 = 200. * 70. * qe2fc_;
32  mipEqfC_[1] = mipEqfC_200;
33  const double cellCapacitance_200 = 65;
34  cellCapacitance_[1] = cellCapacitance_200;
35  const double cellVolume_200 = 1.18 * (200.e-4);
36  cellVolume_[1] = cellVolume_200;
37 
38  //thick sensors: 300 mum
39  const double mipEqfC_300 = 300. * 73. * qe2fc_;
40  mipEqfC_[2] = mipEqfC_300;
41  const double cellCapacitance_300 = 45;
42  cellCapacitance_[2] = cellCapacitance_300;
43  const double cellVolume_300 = 1.18 * (300.e-4);
44  cellVolume_[2] = cellVolume_300;
45 }
std::vector< double > chargeAtFullScaleADCPerGain_
T sqrt(T t)
Definition: SSEVec.h:19
std::array< double, 3 > cellCapacitance_
std::array< double, 3 > mipEqfC_
std::vector< std::vector< double > > encsParam_
const double encCommonNoiseSub_
const double encpScale_
std::array< double, 3 > cellVolume_
const double qe2fc_
std::vector< double > lsbPerGain_
HGCalSiNoiseMap::~HGCalSiNoiseMap ( )
inline

Definition at line 27 of file HGCalSiNoiseMap.h.

27 {};

Member Function Documentation

std::vector<std::vector<double> >& HGCalSiNoiseMap::getCCEParam ( )
inline

Definition at line 61 of file HGCalSiNoiseMap.h.

References cceParam_.

61 { return cceParam_; }
std::vector< std::vector< double > > cceParam_
std::array<double, 3>& HGCalSiNoiseMap::getCellCapacitance ( )
inline

Definition at line 59 of file HGCalSiNoiseMap.h.

References cellCapacitance_.

59 { return cellCapacitance_; }
std::array< double, 3 > cellCapacitance_
std::array<double, 3>& HGCalSiNoiseMap::getCellVolume ( )
inline

Definition at line 60 of file HGCalSiNoiseMap.h.

References cellVolume_.

60 { return cellVolume_; }
std::array< double, 3 > cellVolume_
std::vector<std::vector<double> >& HGCalSiNoiseMap::getENCsParam ( )
inline

Definition at line 63 of file HGCalSiNoiseMap.h.

References encsParam_.

63 { return encsParam_; }
std::vector< std::vector< double > > encsParam_
std::vector<double>& HGCalSiNoiseMap::getIleakParam ( )
inline

Definition at line 62 of file HGCalSiNoiseMap.h.

References ileakParam_.

62 { return ileakParam_; }
std::vector< double > ileakParam_
std::vector<double>& HGCalSiNoiseMap::getLSBPerGain ( )
inline

Definition at line 64 of file HGCalSiNoiseMap.h.

References lsbPerGain_.

Referenced by HGCDigitizerBase< DFr >::runSimple().

64 { return lsbPerGain_; }
std::vector< double > lsbPerGain_
std::vector<double>& HGCalSiNoiseMap::getMaxADCPerGain ( )
inline

Definition at line 65 of file HGCalSiNoiseMap.h.

References chargeAtFullScaleADCPerGain_.

Referenced by HGCDigitizerBase< DFr >::runSimple().

std::vector< double > chargeAtFullScaleADCPerGain_
std::array<double, 3>& HGCalSiNoiseMap::getMipEqfC ( )
inline

Definition at line 58 of file HGCalSiNoiseMap.h.

References mipEqfC_.

58 { return mipEqfC_; }
std::array< double, 3 > mipEqfC_
HGCalSiNoiseMap::SiCellOpCharacteristics HGCalSiNoiseMap::getSiCellOpCharacteristics ( const HGCSiliconDetId did,
GainRange_t  gain = GainRange_t::AUTO,
int  aimMIPtoADC = 10 
)

returns the charge collection efficiency and noise if gain range is set to auto, it will find the most appropriate gain to put the mip peak close to 10 ADC counts

Definition at line 59 of file HGCalSiNoiseMap.cc.

References HGCalSiNoiseMap::SiCellOpCharacteristics::cce, cceParam_, cellCapacitance_, HGCSiliconDetId::cellU(), HGCSiliconDetId::cellV(), cellVolume_, HGCalRadiationMap::ddd(), relativeConstraints::empty, encCommonNoiseSub_, encpScale_, encsParam_, Exception, JetChargeProducer_cfi::exp, HGCalSiNoiseMap::SiCellOpCharacteristics::fluence, HGCalSiNoiseMap::SiCellOpCharacteristics::gain, PedestalClient_cfi::gain, HGCalRadiationMap::getDoseMap(), HGCalRadiationMap::getFluenceValue(), ignoreCCE_, ignoreFluence_, ignoreNoise_, HGCalSiNoiseMap::SiCellOpCharacteristics::ileak, ileakParam_, HGCSiliconDetId::layer(), HGCalSiNoiseMap::SiCellOpCharacteristics::lnfluence, dqm-mbProfile::log, lsbPerGain_, SiStripPI::max, HGCalSiNoiseMap::SiCellOpCharacteristics::mipADC, mipEqfC_, HGCalSiNoiseMap::SiCellOpCharacteristics::mipfC, HGCalSiNoiseMap::SiCellOpCharacteristics::noise, funct::pow(), q160fC, q320fC, q80fC, qe2fc_, BeamHaloGenFilter_cfi::radii, CosmicsPD_Skims::radius, S(), mathSSE::sqrt(), HGCSiliconDetId::subdet(), HGCalSiNoiseMap::SiCellOpCharacteristics::thrADC, HGCSiliconDetId::type(), unitToMicro_, HGCSiliconDetId::waferU(), HGCSiliconDetId::waferV(), and geometryCSVtoXML::xy.

Referenced by HGCDigitizerBase< DFr >::runSimple(), and setCceParam().

61  {
62  SiCellOpCharacteristics siop;
63 
64  //decode cell properties
65  int layer(cellId.layer());
66  unsigned int cellThick = cellId.type();
67  double cellCap(cellCapacitance_[cellThick]);
68  double cellVol(cellVolume_[cellThick]);
69 
70  //leakage current and CCE [muA]
71  if (ignoreFluence_) {
72  siop.fluence = 0;
73  siop.lnfluence = -1;
74  siop.ileak = exp(ileakParam_[1]) * cellVol * unitToMicro_;
75  siop.cce = 1;
76  } else {
77  if (getDoseMap().empty()) {
78  throw cms::Exception("BadConfiguration")
79  << " Fluence is required but no DoseMap has been passed to HGCalSiNoiseMap";
80  return siop;
81  }
82 
83  //compute the radius here
84  auto xy(ddd()->locateCell(
85  cellId.layer(), cellId.waferU(), cellId.waferV(), cellId.cellU(), cellId.cellV(), true, true));
86  double radius2 = std::pow(xy.first, 2) + std::pow(xy.second, 2); //in cm
87 
88  double radius = sqrt(radius2);
89  double radius3 = radius * radius2;
90  double radius4 = pow(radius2, 2);
91  radiiVec radii{{radius, radius2, radius3, radius4, 0., 0., 0., 0.}};
92  siop.fluence = getFluenceValue(cellId.subdet(), layer, radii);
93  siop.lnfluence = log(siop.fluence);
94  siop.ileak = exp(ileakParam_[0] * siop.lnfluence + ileakParam_[1]) * cellVol * unitToMicro_;
95 
96  if (ignoreCCE_) {
97  siop.cce = 1.0;
98  } else {
99  //lin+log parametrization
100  //cceParam_ are parameters as defined in equation (2) of DN-19-045
101  siop.cce = siop.fluence <= cceParam_[cellThick][0] ? 1. + cceParam_[cellThick][1] * siop.fluence
102  : (1. - cceParam_[cellThick][2] * siop.lnfluence) +
103  (cceParam_[cellThick][1] * cceParam_[cellThick][0] +
104  cceParam_[cellThick][2] * log(cceParam_[cellThick][0]));
105  siop.cce = std::max(0., siop.cce);
106  }
107  }
108 
109  //determine the gain to apply accounting for cce
110  //move computation to ROC level (one day)
111  double S(siop.cce * mipEqfC_[cellThick]);
112  if (gain == GainRange_t::AUTO) {
113  double desiredLSB(S / aimMIPtoADC);
114  std::vector<double> diffToPhysLSB = {fabs(desiredLSB - lsbPerGain_[GainRange_t::q80fC]),
115  fabs(desiredLSB - lsbPerGain_[GainRange_t::q160fC]),
116  fabs(desiredLSB - lsbPerGain_[GainRange_t::q320fC])};
117  size_t gainIdx = std::min_element(diffToPhysLSB.begin(), diffToPhysLSB.end()) - diffToPhysLSB.begin();
119  if (gainIdx == 1)
121  if (gainIdx == 2)
123  }
124 
125  //fill in the parameters of the struct
126  siop.gain = gain;
127  siop.mipfC = S;
128  siop.mipADC = std::floor(S / lsbPerGain_[gain]);
129  siop.thrADC = std::floor(S / 2. / lsbPerGain_[gain]);
130 
131  //build noise estimate
132  if (ignoreNoise_) {
133  siop.noise = 0.0;
134  } else {
135  double enc_s(encsParam_[gain][0] + encsParam_[gain][1] * cellCap + encsParam_[gain][2] * pow(cellCap, 2));
136  double enc_p(encpScale_ * sqrt(siop.ileak));
137  siop.noise = hypot(enc_p, enc_s * encCommonNoiseSub_) * qe2fc_;
138  }
139 
140  return siop;
141 }
double getFluenceValue(const int, const int, const radiiVec &, bool logVal=false)
std::array< double, 8 > radiiVec
std::vector< std::vector< double > > cceParam_
T sqrt(T t)
Definition: SSEVec.h:19
std::array< double, 3 > cellCapacitance_
std::array< double, 3 > mipEqfC_
std::vector< std::vector< double > > encsParam_
const double encCommonNoiseSub_
double S(const TLorentzVector &, const TLorentzVector &)
Definition: Particle.cc:97
const double encpScale_
const HGCalDDDConstants * ddd()
const doseParametersMap & getDoseMap()
std::array< double, 3 > cellVolume_
const double unitToMicro_
const double qe2fc_
Power< A, B >::type pow(const A &a, const B &b)
Definition: Power.h:30
std::vector< double > ileakParam_
std::vector< double > lsbPerGain_
void HGCalSiNoiseMap::setCceParam ( const std::vector< double > &  parsFine,
const std::vector< double > &  parsThin,
const std::vector< double > &  parsThick 
)
inline

set the cce parameters to use

Definition at line 37 of file HGCalSiNoiseMap.h.

References cceParam_, HGCalSiNoiseMap::SiCellOpCharacteristics::gain, getSiCellOpCharacteristics(), setDoseMap(), and AlCaHLTBitMon_QueryRunRegistry::string.

Referenced by HGCDigitizerBase< DFr >::HGCDigitizerBase().

39  {
40  cceParam_.push_back(parsFine); //120
41  cceParam_.push_back(parsThin); //200
42  cceParam_.push_back(parsThick); //300
43  }
std::vector< std::vector< double > > cceParam_
void HGCalSiNoiseMap::setDoseMap ( const std::string &  fullpath,
const unsigned int &  algo 
)

overrides base class method with specifics for the configuration of the algo

Definition at line 48 of file HGCalSiNoiseMap.cc.

References CCE, FLUENCE, ignoreCCE_, ignoreFluence_, ignoreNoise_, NOISE, HGCalRadiationMap::setDoseMap(), and testProducerWithPsetDescEmpty_cfi::x1.

Referenced by HGCDigitizerBase< DFr >::HGCDigitizerBase(), and setCceParam().

48  {
49  //decode bits in the algo word
50  ignoreFluence_ = ((algo >> FLUENCE) & 0x1);
51  ignoreCCE_ = ((algo >> CCE) & 0x1);
52  ignoreNoise_ = ((algo >> NOISE) & 0x1);
53 
54  //call base class method
56 }
const unsigned int & algo()
void setDoseMap(const std::string &, const unsigned int)
void HGCalSiNoiseMap::setIleakParam ( const std::vector< double > &  pars)
inline

set the ileak parameters to use

Definition at line 32 of file HGCalSiNoiseMap.h.

References ileakParam_.

Referenced by HGCDigitizerBase< DFr >::HGCDigitizerBase().

32 { ileakParam_ = pars; }
std::vector< double > ileakParam_

Member Data Documentation

std::vector<std::vector<double> > HGCalSiNoiseMap::cceParam_
private

Definition at line 70 of file HGCalSiNoiseMap.h.

Referenced by getCCEParam(), getSiCellOpCharacteristics(), and setCceParam().

std::array<double, 3> HGCalSiNoiseMap::cellCapacitance_
private
std::array<double, 3> HGCalSiNoiseMap::cellVolume_
private

Definition at line 69 of file HGCalSiNoiseMap.h.

Referenced by getCellVolume(), getSiCellOpCharacteristics(), and HGCalSiNoiseMap().

std::vector<double> HGCalSiNoiseMap::chargeAtFullScaleADCPerGain_
private

Definition at line 88 of file HGCalSiNoiseMap.h.

Referenced by getMaxADCPerGain(), and HGCalSiNoiseMap().

const double HGCalSiNoiseMap::encCommonNoiseSub_
private

Definition at line 79 of file HGCalSiNoiseMap.h.

Referenced by getSiCellOpCharacteristics().

const double HGCalSiNoiseMap::encpScale_
private

Definition at line 76 of file HGCalSiNoiseMap.h.

Referenced by getSiCellOpCharacteristics().

std::vector<std::vector<double> > HGCalSiNoiseMap::encsParam_
private

Definition at line 85 of file HGCalSiNoiseMap.h.

Referenced by getENCsParam(), getSiCellOpCharacteristics(), and HGCalSiNoiseMap().

bool HGCalSiNoiseMap::ignoreCCE_
private

Definition at line 94 of file HGCalSiNoiseMap.h.

Referenced by getSiCellOpCharacteristics(), and setDoseMap().

bool HGCalSiNoiseMap::ignoreFluence_
private

Definition at line 94 of file HGCalSiNoiseMap.h.

Referenced by getSiCellOpCharacteristics(), and setDoseMap().

bool HGCalSiNoiseMap::ignoreNoise_
private

Definition at line 94 of file HGCalSiNoiseMap.h.

Referenced by getSiCellOpCharacteristics(), and setDoseMap().

std::vector<double> HGCalSiNoiseMap::ileakParam_
private

Definition at line 73 of file HGCalSiNoiseMap.h.

Referenced by getIleakParam(), getSiCellOpCharacteristics(), and setIleakParam().

std::vector<double> HGCalSiNoiseMap::lsbPerGain_
private

Definition at line 88 of file HGCalSiNoiseMap.h.

Referenced by getLSBPerGain(), getSiCellOpCharacteristics(), and HGCalSiNoiseMap().

std::array<double, 3> HGCalSiNoiseMap::mipEqfC_
private

Definition at line 69 of file HGCalSiNoiseMap.h.

Referenced by getMipEqfC(), getSiCellOpCharacteristics(), and HGCalSiNoiseMap().

const double HGCalSiNoiseMap::qe2fc_
private

Definition at line 82 of file HGCalSiNoiseMap.h.

Referenced by getSiCellOpCharacteristics(), and HGCalSiNoiseMap().

const double HGCalSiNoiseMap::unitToMicro_ = 1.e6
private

Definition at line 91 of file HGCalSiNoiseMap.h.

Referenced by getSiCellOpCharacteristics().