CMS 3D CMS Logo

HGCalSiNoiseMap.cc
Go to the documentation of this file.
2 
3 //
5  : encpScale_(840.),
6  encCommonNoiseSub_(sqrt(1.25)),
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 }
46 
47 //
48 void HGCalSiNoiseMap::setDoseMap(const std::string &fullpath, const unsigned int &algo) {
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 }
57 
58 //
61  int aimMIPtoADC) {
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 }
HGCalSiNoiseMap::CCE
Definition: HGCalSiNoiseMap.h:17
HGCalSiNoiseMap::cceParam_
std::vector< std::vector< double > > cceParam_
Definition: HGCalSiNoiseMap.h:70
HGCalSiNoiseMap::SiCellOpCharacteristics
Definition: HGCalSiNoiseMap.h:19
radiiVec
std::array< double, 8 > radiiVec
Definition: HGCalRadiationMap.h:10
mps_fire.i
i
Definition: mps_fire.py:355
HGCalSiNoiseMap::q160fC
Definition: HGCalSiNoiseMap.h:16
HGCalSiNoiseMap::SiCellOpCharacteristics::mipfC
double mipfC
Definition: HGCalSiNoiseMap.h:22
HGCalSiNoiseMap::encsParam_
std::vector< std::vector< double > > encsParam_
Definition: HGCalSiNoiseMap.h:85
HGCalSiNoiseMap::SiCellOpCharacteristics::fluence
double fluence
Definition: HGCalSiNoiseMap.h:22
funct::false
false
Definition: Factorize.h:34
HGCalRadiationMap::getFluenceValue
double getFluenceValue(const int, const int, const radiiVec &, bool logVal=false)
Definition: HGCalRadiationMap.cc:27
reco_skim_cfg_mod.fullpath
fullpath
Definition: reco_skim_cfg_mod.py:202
HGCalRadiationMap::algo
const unsigned int & algo()
Definition: HGCalRadiationMap.h:34
HGCalSiNoiseMap.h
HGCalSiNoiseMap::NOISE
Definition: HGCalSiNoiseMap.h:17
HGCalSiNoiseMap::q320fC
Definition: HGCalSiNoiseMap.h:16
HGCalSiNoiseMap::mipEqfC_
std::array< double, 3 > mipEqfC_
Definition: HGCalSiNoiseMap.h:69
HGCalSiNoiseMap::SiCellOpCharacteristics::ileak
double ileak
Definition: HGCalSiNoiseMap.h:22
HGCalSiNoiseMap::ileakParam_
std::vector< double > ileakParam_
Definition: HGCalSiNoiseMap.h:73
HGCSiliconDetId
Definition: HGCSiliconDetId.h:22
cmsdt::algo
algo
Definition: constants.h:164
testProducerWithPsetDescEmpty_cfi.x1
x1
Definition: testProducerWithPsetDescEmpty_cfi.py:33
HGCalSiNoiseMap::SiCellOpCharacteristics::lnfluence
double lnfluence
Definition: HGCalSiNoiseMap.h:22
HGCalSiNoiseMap::q80fC
Definition: HGCalSiNoiseMap.h:16
HGCalSiNoiseMap::chargeAtFullScaleADCPerGain_
std::vector< double > chargeAtFullScaleADCPerGain_
Definition: HGCalSiNoiseMap.h:88
HGCalSiNoiseMap::SiCellOpCharacteristics::cce
double cce
Definition: HGCalSiNoiseMap.h:22
mathSSE::sqrt
T sqrt(T t)
Definition: SSEVec.h:19
HGCalSiNoiseMap::qe2fc_
const double qe2fc_
Definition: HGCalSiNoiseMap.h:82
HGCalSiNoiseMap::GainRange_t
GainRange_t
Definition: HGCalSiNoiseMap.h:16
HGCalSiNoiseMap::encpScale_
const double encpScale_
Definition: HGCalSiNoiseMap.h:76
geometryCSVtoXML.xy
xy
Definition: geometryCSVtoXML.py:19
HGCalSiNoiseMap::lsbPerGain_
std::vector< double > lsbPerGain_
Definition: HGCalSiNoiseMap.h:88
AlCaHLTBitMon_QueryRunRegistry.string
string
Definition: AlCaHLTBitMon_QueryRunRegistry.py:256
S
double S(const TLorentzVector &, const TLorentzVector &)
Definition: Particle.cc:97
SiStripPI::max
Definition: SiStripPayloadInspectorHelper.h:169
HGCalSiNoiseMap::ignoreNoise_
bool ignoreNoise_
Definition: HGCalSiNoiseMap.h:94
HGCalRadiationMap::setDoseMap
void setDoseMap(const std::string &, const unsigned int)
Definition: HGCalRadiationMap.cc:6
HGCalSiNoiseMap::setDoseMap
void setDoseMap(const std::string &, const unsigned int &)
overrides base class method with specifics for the configuration of the algo
Definition: HGCalSiNoiseMap.cc:48
HGCalSiNoiseMap::HGCalSiNoiseMap
HGCalSiNoiseMap()
Definition: HGCalSiNoiseMap.cc:4
HGCalSiNoiseMap::encCommonNoiseSub_
const double encCommonNoiseSub_
Definition: HGCalSiNoiseMap.h:79
PedestalClient_cfi.gain
gain
Definition: PedestalClient_cfi.py:37
HGCalSiNoiseMap::FLUENCE
Definition: HGCalSiNoiseMap.h:17
HGCSiliconDetId::cellV
int cellV() const
Definition: HGCSiliconDetId.h:61
HGCSiliconDetId::cellU
int cellU() const
get the cell #'s in u,v or in x,y
Definition: HGCSiliconDetId.h:60
HGCalSiNoiseMap::ignoreFluence_
bool ignoreFluence_
Definition: HGCalSiNoiseMap.h:94
HGCalSiNoiseMap::cellCapacitance_
std::array< double, 3 > cellCapacitance_
Definition: HGCalSiNoiseMap.h:69
relativeConstraints.empty
bool empty
Definition: relativeConstraints.py:46
HGCalSiNoiseMap::cellVolume_
std::array< double, 3 > cellVolume_
Definition: HGCalSiNoiseMap.h:69
Exception
Definition: hltDiff.cc:246
HGCalRadiationMap::getDoseMap
const doseParametersMap & getDoseMap()
Definition: HGCalRadiationMap.h:39
CosmicsPD_Skims.radius
radius
Definition: CosmicsPD_Skims.py:135
HGCSiliconDetId::type
int type() const
get the type
Definition: HGCSiliconDetId.h:51
HGCSiliconDetId::waferU
int waferU() const
Definition: HGCSiliconDetId.h:76
HGCalRadiationMap::ddd
const HGCalDDDConstants * ddd()
Definition: HGCalRadiationMap.h:37
dqm-mbProfile.log
log
Definition: dqm-mbProfile.py:17
S
Definition: CSCDBL1TPParametersExtended.h:16
HGCalSiNoiseMap::ignoreCCE_
bool ignoreCCE_
Definition: HGCalSiNoiseMap.h:94
HGCSiliconDetId::subdet
DetId::Detector subdet() const
get the subdetector
Definition: HGCSiliconDetId.h:48
funct::pow
Power< A, B >::type pow(const A &a, const B &b)
Definition: Power.h:30
HGCalSiNoiseMap::getSiCellOpCharacteristics
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 mos...
Definition: HGCalSiNoiseMap.cc:59
HGCalSiNoiseMap::SiCellOpCharacteristics::thrADC
unsigned int thrADC
Definition: HGCalSiNoiseMap.h:23
JetChargeProducer_cfi.exp
exp
Definition: JetChargeProducer_cfi.py:6
HGCalSiNoiseMap::SiCellOpCharacteristics::noise
double noise
Definition: HGCalSiNoiseMap.h:22
HGCalSiNoiseMap::unitToMicro_
const double unitToMicro_
Definition: HGCalSiNoiseMap.h:91
HGCSiliconDetId::waferV
int waferV() const
Definition: HGCSiliconDetId.h:77
HGCalSiNoiseMap::SiCellOpCharacteristics::gain
unsigned int gain
Definition: HGCalSiNoiseMap.h:23
HGCSiliconDetId::layer
int layer() const
get the layer #
Definition: HGCSiliconDetId.h:57
HGCalSiNoiseMap::SiCellOpCharacteristics::mipADC
unsigned int mipADC
Definition: HGCalSiNoiseMap.h:23