CMS 3D CMS Logo

List of all members | Public Member Functions | Private Attributes
HcalDbHardcode Class Reference

Hardcode implementation of some conditions data. More...

#include <HcalDbHardcode.h>

Public Member Functions

const int getGainIndex (HcalGenericDetId fId) const
 
int getLayersInDepth (int ieta, int depth, const HcalTopology *topo)
 
const HcalHardcodeParametersgetParameters (HcalGenericDetId fId) const
 
 HcalDbHardcode ()
 
bool isHEPlan1 (HcalGenericDetId fId) const
 
const bool killHE () const
 
HcalCalibrationQIECoder makeCalibrationQIECoder (HcalGenericDetId fId) const
 
HcalGain makeGain (HcalGenericDetId fId, bool fSmear=false) const
 
HcalGainWidth makeGainWidth (HcalGenericDetId fId) const
 
std::unique_ptr< HcalDcsMapmakeHardcodeDcsMap () const
 
void makeHardcodeFrontEndMap (HcalFrontEndMap &emap, const std::vector< HcalGenericDetId > &cells) const
 
std::unique_ptr< HcalFrontEndMapmakeHardcodeFrontEndMap (const std::vector< HcalGenericDetId > &cells) const
 
std::unique_ptr< HcalElectronicsMapmakeHardcodeMap (const std::vector< HcalGenericDetId > &cells) const
 
std::unique_ptr< HcalSiPMCharacteristicsmakeHardcodeSiPMCharacteristics () const
 
HcalSiPMParameter makeHardcodeSiPMParameter (HcalGenericDetId fId, const HcalTopology *topo, double intlumi)
 
HcalTPChannelParameter makeHardcodeTPChannelParameter (HcalGenericDetId fId) const
 
void makeHardcodeTPParameters (HcalTPParameters &tppar) const
 
HcalMCParam makeMCParam (HcalGenericDetId fId) const
 
HcalPedestal makePedestal (HcalGenericDetId fId, bool fSmear, bool eff, const HcalTopology *topo, double intlumi)
 
HcalPedestalWidth makePedestalWidth (HcalGenericDetId fId, bool eff, const HcalTopology *topo, double intlumi)
 
HcalPFCut makePFCut (HcalGenericDetId fId, double intlumi, bool noHE) const
 
HcalQIECoder makeQIECoder (HcalGenericDetId fId) const
 
HcalQIEShape makeQIEShape () const
 
HcalQIEType makeQIEType (HcalGenericDetId fId) const
 
HcalRecoParam makeRecoParam (HcalGenericDetId fId) const
 
HcalTimingParam makeTimingParam (HcalGenericDetId fId) const
 
HcalZSThreshold makeZSThreshold (HcalGenericDetId fId) const
 
void setHB (HcalHardcodeParameters p)
 
void setHBUpgrade (HcalHardcodeParameters p)
 
void setHE (HcalHardcodeParameters p)
 
void setHEUpgrade (HcalHardcodeParameters p)
 
void setHF (HcalHardcodeParameters p)
 
void setHFUpgrade (HcalHardcodeParameters p)
 
void setHO (HcalHardcodeParameters p)
 
void setKillHE (bool b)
 
void setSiPMCharacteristics (std::vector< edm::ParameterSet > vps)
 
void testHEPlan1 (bool b)
 
void testHFQIE10 (bool b)
 
void useHBUpgrade (bool b)
 
const bool useHBUpgrade () const
 
void useHEUpgrade (bool b)
 
const bool useHEUpgrade () const
 
void useHFUpgrade (bool b)
 
const bool useHFUpgrade () const
 
void useHOUpgrade (bool b)
 
const bool useHOUpgrade () const
 
virtual ~HcalDbHardcode ()
 

Private Attributes

bool killHE_
 
bool setHB_
 
bool setHBUpgrade_
 
bool setHE_
 
bool setHEUpgrade_
 
bool setHF_
 
bool setHFUpgrade_
 
bool setHO_
 
bool testHEPlan1_
 
bool testHFQIE10_
 
HcalHardcodeParameters theDefaultParameters_
 
HcalHardcodeParameters theHBParameters_
 
HcalHardcodeParameters theHBUpgradeParameters_
 
HcalHardcodeParameters theHEParameters_
 
HcalHardcodeParameters theHEUpgradeParameters_
 
HcalHardcodeParameters theHFParameters_
 
HcalHardcodeParameters theHFUpgradeParameters_
 
HcalHardcodeParameters theHOParameters_
 
std::map< std::pair< int, int >, int > theLayersInDepths_
 
std::vector< edm::ParameterSettheSiPMCharacteristics_
 
bool useHBUpgrade_
 
bool useHEUpgrade_
 
bool useHFUpgrade_
 
bool useHOUpgrade_
 

Detailed Description

Hardcode implementation of some conditions data.

Author
Fedor Ratnikov

Definition at line 46 of file HcalDbHardcode.h.

Constructor & Destructor Documentation

◆ HcalDbHardcode()

HcalDbHardcode::HcalDbHardcode ( )

Definition at line 18 of file HcalDbHardcode.cc.

19  : //"generic" set of conditions
20  theDefaultParameters_(3.0, //pedestal
21  0.5, //pedestal width
22  {0.2, 0.2}, //gains
23  {0.0, 0.0}, //gain widths
24  0, //ZS threshold
25  0, //QIE type
26  {0.0, 0.0, 0.0, 0.0}, //QIE offsets
27  {0.9, 0.9, 0.9, 0.9}, //QIE slopes
28  125, //MC shape
29  105, //Reco shape
30  0.0, //photoelectronsToAnalog
31  {0.0}, //dark current
32  {0.0}, //noise correlation
33  0.0, //PF noise threshold
34  0.1 //PF seed threshold
35  ),
36  setHB_(false),
37  setHE_(false),
38  setHF_(false),
39  setHO_(false),
40  setHBUpgrade_(false),
41  setHEUpgrade_(false),
42  setHFUpgrade_(false),
43  useHBUpgrade_(false),
44  useHEUpgrade_(false),
45  useHOUpgrade_(true),
46  useHFUpgrade_(false),
47  testHFQIE10_(false),
48  testHEPlan1_(false) {}
HcalHardcodeParameters theDefaultParameters_

◆ ~HcalDbHardcode()

virtual HcalDbHardcode::~HcalDbHardcode ( )
inlinevirtual

Definition at line 52 of file HcalDbHardcode.h.

52 {}

Member Function Documentation

◆ getGainIndex()

const int HcalDbHardcode::getGainIndex ( HcalGenericDetId  fId) const

Definition at line 92 of file HcalDbHardcode.cc.

References HcalDetId::depth(), HcalGenericDetId::genericSubdet(), HcalGenericDetId::HcalGenForward, HcalGenericDetId::HcalGenOuter, and HcalDetId::ieta().

Referenced by makeGain(), and makeGainWidth().

92  {
93  int index = 0;
95  HcalDetId hid(fId);
96  if ((hid.ieta() > -5) && (hid.ieta() < 5))
97  index = 0;
98  else
99  index = 1;
100  } else if (fId.genericSubdet() == HcalGenericDetId::HcalGenForward) {
101  HcalDetId hid(fId);
102  if (hid.depth() % 2 == 1)
103  index = 0; //depths 1,3
104  else if (hid.depth() % 2 == 0)
105  index = 1; //depths 2,4
106  }
107  return index;
108 }
HcalGenericSubdetector genericSubdet() const

◆ getLayersInDepth()

int HcalDbHardcode::getLayersInDepth ( int  ieta,
int  depth,
const HcalTopology topo 
)

Definition at line 655 of file HcalDbHardcode.cc.

References hcalRecHitTable_cff::depth, HLT_2024v12_cff::distance, HcalTopology::getDepthSegmentation(), hcalRecHitTable_cff::ieta, pfDeepBoostedJetPreprocessParams_cfi::lower_bound, MuonTCMETValueMapProducer_cff::nLayers, theLayersInDepths_, and pfDeepBoostedJetPreprocessParams_cfi::upper_bound.

Referenced by makeHardcodeSiPMParameter(), and HcalHardcodeCalibrations::produceRespCorrs().

655  {
656  //check for cached value
657  auto eta_depth_pair = std::make_pair(ieta, depth);
658  auto nLayers = theLayersInDepths_.find(eta_depth_pair);
659  if (nLayers != theLayersInDepths_.end()) {
660  return nLayers->second;
661  } else {
662  std::vector<int> segmentation;
663  topo->getDepthSegmentation(ieta, segmentation);
664  //assume depth segmentation vector is sorted
665  int nLayersInDepth = std::distance(std::lower_bound(segmentation.begin(), segmentation.end(), depth),
666  std::upper_bound(segmentation.begin(), segmentation.end(), depth));
667  theLayersInDepths_.insert(std::make_pair(eta_depth_pair, nLayersInDepth));
668  return nLayersInDepth;
669  }
670 }
std::map< std::pair< int, int >, int > theLayersInDepths_
void getDepthSegmentation(const unsigned ring, std::vector< int > &readoutDepths, const bool flag=false) const

◆ getParameters()

const HcalHardcodeParameters & HcalDbHardcode::getParameters ( HcalGenericDetId  fId) const

Definition at line 50 of file HcalDbHardcode.cc.

References HcalDetId::depth(), HcalGenericDetId::genericSubdet(), HcalGenericDetId::HcalGenBarrel, HcalGenericDetId::HcalGenEndcap, HcalGenericDetId::HcalGenForward, HcalGenericDetId::HcalGenOuter, HcalDetId::ieta(), HcalDetId::iphi(), HcalGenericDetId::isHcalDetId(), isHEPlan1(), setHB_, setHBUpgrade_, setHE_, setHEUpgrade_, setHF_, setHFUpgrade_, setHO_, testHEPlan1_, testHFQIE10_, theDefaultParameters_, theHBParameters_, theHBUpgradeParameters_, theHEParameters_, theHEUpgradeParameters_, theHFParameters_, theHFUpgradeParameters_, theHOParameters_, useHBUpgrade_, useHEUpgrade_, useHFUpgrade_, and HcalDetId::zside().

Referenced by makeGain(), makeGainWidth(), makeHardcodeSiPMParameter(), makeMCParam(), makePedestal(), makePedestalWidth(), makePFCut(), makeQIECoder(), makeQIEType(), makeRecoParam(), and makeZSThreshold().

50  {
54  else if (!useHBUpgrade_ && setHB_)
55  return theHBParameters_;
56  else
57  return theDefaultParameters_;
58  } else if (fId.genericSubdet() == HcalGenericDetId::HcalGenEndcap) {
59  bool b_isHEPlan1 = testHEPlan1_ ? isHEPlan1(fId) : false;
60  if ((useHEUpgrade_ || b_isHEPlan1) && setHEUpgrade_)
62  else if (!useHEUpgrade_ && !b_isHEPlan1 && setHE_)
63  return theHEParameters_;
64  else
65  return theDefaultParameters_;
66  } else if (fId.genericSubdet() == HcalGenericDetId::HcalGenForward) {
69  else if (testHFQIE10_ && fId.isHcalDetId()) {
70  HcalDetId hid(fId);
71  //special mixed case for HF 2016
72  if (hid.iphi() == 39 && hid.zside() == 1 &&
73  (hid.depth() >= 3 || (hid.depth() == 2 && (hid.ieta() == 30 || hid.ieta() == 34))) && setHFUpgrade_)
75  else if (setHF_)
76  return theHFParameters_;
77  else
78  return theDefaultParameters_;
79  } else if (!useHFUpgrade_ && setHF_)
80  return theHFParameters_;
81  else
82  return theDefaultParameters_;
83  } else if (fId.genericSubdet() == HcalGenericDetId::HcalGenOuter) {
84  if (setHO_)
85  return theHOParameters_;
86  else
87  return theDefaultParameters_;
88  } else
89  return theDefaultParameters_;
90 }
HcalHardcodeParameters theHOParameters_
HcalHardcodeParameters theDefaultParameters_
HcalHardcodeParameters theHEUpgradeParameters_
bool isHcalDetId() const
HcalHardcodeParameters theHBUpgradeParameters_
bool isHEPlan1(HcalGenericDetId fId) const
HcalHardcodeParameters theHBParameters_
HcalGenericSubdetector genericSubdet() const
HcalHardcodeParameters theHFParameters_
HcalHardcodeParameters theHEParameters_
HcalHardcodeParameters theHFUpgradeParameters_

◆ isHEPlan1()

bool HcalDbHardcode::isHEPlan1 ( HcalGenericDetId  fId) const

Definition at line 672 of file HcalDbHardcode.cc.

References HcalDetId::iphi(), HcalGenericDetId::isHcalDetId(), and HcalDetId::zside().

Referenced by getParameters(), and makeHardcodeSiPMParameter().

672  {
673  if (fId.isHcalDetId()) {
674  HcalDetId hid(fId);
675  //special mixed case for HE 2017
676  if (hid.zside() == 1 && (hid.iphi() == 63 || hid.iphi() == 64 || hid.iphi() == 65 || hid.iphi() == 66))
677  return true;
678  }
679  return false;
680 }
bool isHcalDetId() const

◆ killHE()

const bool HcalDbHardcode::killHE ( ) const
inline

◆ makeCalibrationQIECoder()

HcalCalibrationQIECoder HcalDbHardcode::makeCalibrationQIECoder ( HcalGenericDetId  fId) const

Definition at line 244 of file HcalDbHardcode.cc.

References mps_fire::i, DetId::rawId(), and mps_fire::result.

244  {
246  float lowEdges[64];
247  for (int i = 0; i < 64; i++) {
248  lowEdges[i] = -1.5 + i;
249  }
250  result.setMinCharges(lowEdges);
251  return result;
252 }
constexpr uint32_t rawId() const
get the raw id
Definition: DetId.h:57

◆ makeGain()

HcalGain HcalDbHardcode::makeGain ( HcalGenericDetId  fId,
bool  fSmear = false 
) const

Definition at line 160 of file HcalDbHardcode.cc.

References f, nano_mu_digi_cff::float, HcalHardcodeParameters::gain(), getGainIndex(), getParameters(), mps_fire::i, makeGainWidth(), DetId::rawId(), mps_fire::result, and ApeEstimator_cff::width.

Referenced by HcalHardcodeCalibrations::produceGains().

160  { // GeV/fC
162  float value0 = getParameters(fId).gain(getGainIndex(fId));
163  float value[4] = {value0, value0, value0, value0};
164  if (fSmear) {
165  for (int i = 0; i < 4; i++) {
166  value[i] = 0.0f;
167  while (value[i] <= 0.0f)
168  value[i] = value0 + (float)CLHEP::RandGauss::shoot(0.0, width.getValue(i));
169  }
170  }
171  HcalGain result(fId.rawId(), value[0], value[1], value[2], value[3]);
172  return result;
173 }
const HcalHardcodeParameters & getParameters(HcalGenericDetId fId) const
const int getGainIndex(HcalGenericDetId fId) const
HcalGainWidth makeGainWidth(HcalGenericDetId fId) const
double f[11][100]
Definition: value.py:1
double gain(unsigned index) const
constexpr uint32_t rawId() const
get the raw id
Definition: DetId.h:57

◆ makeGainWidth()

HcalGainWidth HcalDbHardcode::makeGainWidth ( HcalGenericDetId  fId) const

Definition at line 175 of file HcalDbHardcode.cc.

References HcalHardcodeParameters::gainWidth(), getGainIndex(), getParameters(), DetId::rawId(), mps_fire::result, and relativeConstraints::value.

Referenced by makeGain(), and HcalHardcodeCalibrations::produceGainWidths().

175  { // GeV/fC
176  float value = getParameters(fId).gainWidth(getGainIndex(fId));
178  return result;
179 }
const HcalHardcodeParameters & getParameters(HcalGenericDetId fId) const
const int getGainIndex(HcalGenericDetId fId) const
Definition: value.py:1
constexpr uint32_t rawId() const
get the raw id
Definition: DetId.h:57
double gainWidth(unsigned index) const

◆ makeHardcodeDcsMap()

std::unique_ptr< HcalDcsMap > HcalDbHardcode::makeHardcodeDcsMap ( ) const

Definition at line 531 of file HcalDbHardcode.cc.

References HcalDcsDetId::DYN8, HcalBarrel, HcalDcsBarrel, HcalDcsForward, HcalDcsOuter, HcalForward, HcalOuter, HcalDcsDetId::HV, and HcalDcsMapAddons::Helper::mapGeomId2DcsId().

Referenced by HcalHardcodeCalibrations::produceDcsMap().

531  {
532  HcalDcsMapAddons::Helper dcs_map_helper;
533  dcs_map_helper.mapGeomId2DcsId(HcalDetId(HcalBarrel, -16, 1, 1),
535  dcs_map_helper.mapGeomId2DcsId(HcalDetId(HcalForward, -41, 3, 1),
537  dcs_map_helper.mapGeomId2DcsId(HcalDetId(HcalForward, -26, 25, 2),
539  dcs_map_helper.mapGeomId2DcsId(HcalDetId(HcalBarrel, -15, 68, 1),
541  dcs_map_helper.mapGeomId2DcsId(HcalDetId(HcalOuter, -14, 1, 4),
543  dcs_map_helper.mapGeomId2DcsId(HcalDetId(HcalForward, 41, 71, 2),
545  return std::make_unique<HcalDcsMap>(dcs_map_helper);
546 }
bool mapGeomId2DcsId(HcalDetId fId, HcalDcsDetId fDcsId)
Definition: HcalDcsMap.cc:143

◆ makeHardcodeFrontEndMap() [1/2]

void HcalDbHardcode::makeHardcodeFrontEndMap ( HcalFrontEndMap emap,
const std::vector< HcalGenericDetId > &  cells 
) const

◆ makeHardcodeFrontEndMap() [2/2]

std::unique_ptr< HcalFrontEndMap > HcalDbHardcode::makeHardcodeFrontEndMap ( const std::vector< HcalGenericDetId > &  cells) const

Definition at line 578 of file HcalDbHardcode.cc.

References hgcalTBTopologyTester_cfi::cells, hgcalTestNeighbor_cfi::detector, HcalBarrel, HcalEndcap, HcalForward, HcalOuter, mps_fire::i, hcalRecHitTable_cff::ieta, hcalRecHitTable_cff::iphi, HcalFrontEndMapAddons::Helper::loadObject(), relativeConstraints::ring, nano_mu_digi_cff::sector, AlCaHLTBitMon_QueryRunRegistry::string, and HcalDetId::subdet().

579  {
581  std::stringstream mystream;
582  std::string detector[5] = {"XX", "HB", "HE", "HO", "HF"};
583  for (const auto& fId : cells) {
584  if (fId.isHcalDetId()) {
585  HcalDetId id = HcalDetId(fId.rawId());
586  HcalSubdetector subdet = id.subdet();
587  int ieta = id.ietaAbs();
588  int iside = id.zside();
589  int iphi = id.iphi();
590  std::string det, rbx;
591  int irm(0);
592  char tempbuff[30];
593  char sidesign = (iside == -1) ? 'M' : 'P';
594  if (subdet == HcalBarrel || subdet == HcalEndcap) {
595  det = detector[subdet];
596  irm = (iphi + 1) % 4 + 1;
597  int iwedge(0);
598  if (ieta >= 21 && (irm == 1 || irm == 3))
599  iwedge = (iphi + 1 + irm + 1) / 4;
600  else
601  iwedge = (iphi + irm + 1) / 4;
602  if (iwedge > 18)
603  iwedge -= 18;
604  sprintf(tempbuff, "%s%c%2.2i%c", det.c_str(), sidesign, iwedge, '\0');
605  mystream << tempbuff;
606  rbx = mystream.str();
607  mystream.str("");
608  emapHelper.loadObject(id, irm, rbx);
609  } else if (subdet == HcalForward) {
610  det = detector[subdet];
611  int hfphi(0);
612  if ((iside == 1 && ieta == 40) || (iside == -1 && ieta == 41)) {
613  irm = ((iphi + 1) / 2) % 36 + 1;
614  hfphi = ((iphi + 1) / 6) % 12 + 1;
615  } else {
616  irm = (iphi + 1) / 2;
617  hfphi = (iphi - 1) / 6 + 1;
618  }
619  irm = (irm - 1) % 3 + 1;
620  sprintf(tempbuff, "%s%c%2.2i%c", det.c_str(), sidesign, hfphi, '\0');
621  mystream << tempbuff;
622  rbx = mystream.str();
623  mystream.str("");
624  emapHelper.loadObject(id, irm, rbx);
625  } else if (subdet == HcalOuter) {
626  det = detector[subdet];
627  int ring(0), sector(0);
628  if (ieta <= 4)
629  ring = 0;
630  else if (ieta >= 5 && ieta <= 10)
631  ring = 1;
632  else
633  ring = 2;
634  for (int i = -2; i < iphi; i += 6)
635  sector++;
636  if (sector > 12)
637  sector = 1;
638  irm = ((iphi + 1) / 2) % 6 + 1;
639  if (ring != 0 && sector % 2 != 0)
640  sector++;
641  if (ring == 0)
642  sprintf(tempbuff, "%s%i%2.2d", det.c_str(), ring, sector);
643  else
644  sprintf(tempbuff, "%s%i%c%2.2d", det.c_str(), ring, sidesign, sector);
645  mystream << tempbuff;
646  rbx = mystream.str();
647  mystream.str("");
648  emapHelper.loadObject(id, irm, rbx);
649  }
650  }
651  }
652  return std::make_unique<HcalFrontEndMap>(emapHelper);
653 }
bool loadObject(DetId fId, int rm, std::string rbx)
load a new entry
constexpr HcalSubdetector subdet() const
get the subdetector
Definition: HcalDetId.h:138
HcalSubdetector
Definition: HcalAssistant.h:31

◆ makeHardcodeMap()

std::unique_ptr< HcalElectronicsMap > HcalDbHardcode::makeHardcodeMap ( const std::vector< HcalGenericDetId > &  cells) const

Definition at line 548 of file HcalDbHardcode.cc.

References cms::cuda::assert(), hgcalTBTopologyTester_cfi::cells, counter, HcalGenericDetId::HcalGenBarrel, HcalGenericDetId::HcalGenEndcap, HcalGenericDetId::HcalGenForward, HcalGenericDetId::HcalGenOuter, HcalGenericDetId::HcalGenTriggerTower, HcalGenericDetId::HcalGenZDC, HcalElectronicsMapAddons::Helper::mapEId2chId(), and HcalElectronicsMapAddons::Helper::mapEId2tId().

Referenced by HcalHardcodeCalibrations::produceElectronicsMap().

548  {
549  static const int kUTCAMask = 0x4000000; //set bit 26 for uTCA version
550  static const int kLinearIndexMax = 0x7FFFF; //19 bits
551  static const int kTriggerBitMask = 0x02000000; //2^25
552  uint32_t counter = 0;
553  uint32_t counterTrig = 0;
555  for (const auto& fId : cells) {
556  if (fId.genericSubdet() == HcalGenericDetId::HcalGenBarrel ||
557  fId.genericSubdet() == HcalGenericDetId::HcalGenEndcap ||
558  fId.genericSubdet() == HcalGenericDetId::HcalGenForward ||
559  fId.genericSubdet() == HcalGenericDetId::HcalGenOuter || fId.genericSubdet() == HcalGenericDetId::HcalGenZDC) {
560  ++counter;
561  assert(counter < kLinearIndexMax);
562  uint32_t raw = counter;
563  raw |= kUTCAMask;
564  HcalElectronicsId elId(raw);
565  emapHelper.mapEId2chId(elId, fId);
566  } else if (fId.genericSubdet() == HcalGenericDetId::HcalGenTriggerTower) {
567  ++counterTrig;
568  assert(counterTrig < kLinearIndexMax);
569  uint32_t raw = counterTrig;
570  raw |= kUTCAMask | kTriggerBitMask;
571  HcalElectronicsId elId(raw);
572  emapHelper.mapEId2tId(elId, fId);
573  }
574  }
575  return std::make_unique<HcalElectronicsMap>(emapHelper);
576 }
bool mapEId2chId(HcalElectronicsId fElectronicsId, DetId fId)
assert(be >=bs)
bool mapEId2tId(HcalElectronicsId fElectronicsId, HcalTrigTowerDetId fTriggerId)
static std::atomic< unsigned int > counter
Readout chain identification for Hcal.

◆ makeHardcodeSiPMCharacteristics()

std::unique_ptr< HcalSiPMCharacteristics > HcalDbHardcode::makeHardcodeSiPMCharacteristics ( ) const

Definition at line 734 of file HcalDbHardcode.cc.

References HcalSiPMCharacteristicsAddons::Helper::loadObject(), and theSiPMCharacteristics_.

Referenced by makePedestal(), makePedestalWidth(), and HcalHardcodeCalibrations::produceSiPMCharacteristics().

734  {
735  // SiPMCharacteristics are constants for each type of SiPM:
736  // Type, # of pixels, 3 parameters for non-linearity, cross talk parameter, ..
737  // Obtained from data sheet and measurements
738  // types (in order): HcalHOZecotek=1, HcalHOHamamatsu, HcalHEHamamatsu1, HcalHEHamamatsu2, HcalHBHamamatsu1, HcalHBHamamatsu2, HcalHPD
740  for (unsigned ip = 0; ip < theSiPMCharacteristics_.size(); ++ip) {
741  auto& ps = theSiPMCharacteristics_[ip];
742  sipmHelper.loadObject(ip + 1,
743  ps.getParameter<int>("pixels"),
744  ps.getParameter<double>("nonlin1"),
745  ps.getParameter<double>("nonlin2"),
746  ps.getParameter<double>("nonlin3"),
747  ps.getParameter<double>("crosstalk"),
748  0,
749  0);
750  }
751  return std::make_unique<HcalSiPMCharacteristics>(sipmHelper);
752 }
std::vector< edm::ParameterSet > theSiPMCharacteristics_
bool loadObject(int type, int pixels, float parLin1, float parLin2, float parLin3, float crossTalk, int auxi1=0, float auxi2=0)

◆ makeHardcodeSiPMParameter()

HcalSiPMParameter HcalDbHardcode::makeHardcodeSiPMParameter ( HcalGenericDetId  fId,
const HcalTopology topo,
double  intlumi 
)

Definition at line 682 of file HcalDbHardcode.cc.

References HcalHardcodeParameters::darkCurrent(), HcalDetId::depth(), nano_mu_digi_cff::float, HcalGenericDetId::genericSubdet(), getLayersInDepth(), getParameters(), HcalGenericDetId::HcalGenBarrel, HcalGenericDetId::HcalGenEndcap, HcalGenericDetId::HcalGenOuter, HcalHBHamamatsu1, HcalHBHamamatsu2, HcalHEHamamatsu1, HcalHEHamamatsu2, HcalHOHamamatsu, HcalHPD, HcalNoSiPM, HcalDetId::ietaAbs(), submitPVValidationJobs::intlumi, isHEPlan1(), HcalHardcodeParameters::noiseCorrelation(), HcalHardcodeParameters::photoelectronsToAnalog(), DetId::rawId(), testHEPlan1_, useHBUpgrade_, useHEUpgrade_, and useHOUpgrade_.

Referenced by makePedestal(), makePedestalWidth(), and HcalHardcodeCalibrations::produceSiPMParameters().

684  {
685  // SiPMParameter defined for each DetId the following quantities:
686  // SiPM type, PhotoElectronToAnalog, Dark Current, two auxiliary words
687  // (the second of those containing float noise correlation coefficient
688  // These numbers come from some measurements done with SiPMs
689  // rule for type: cells with >4 layers use larger device (3.3mm diameter), otherwise 2.8mm
690  HcalSiPMType theType = HcalNoSiPM;
691  double thePe2fC = getParameters(fId).photoelectronsToAnalog();
692  double theDC = getParameters(fId).darkCurrent(0, intlumi);
693  double theNoiseCN = getParameters(fId).noiseCorrelation(0);
695  if (useHBUpgrade_) {
696  HcalDetId hid(fId);
697  int nLayersInDepth = getLayersInDepth(hid.ietaAbs(), hid.depth(), topo);
698  if (nLayersInDepth > 4) {
699  theType = HcalHBHamamatsu2;
700  theDC = getParameters(fId).darkCurrent(1, intlumi);
701  theNoiseCN = getParameters(fId).noiseCorrelation(1);
702  } else {
703  theType = HcalHBHamamatsu1;
704  theDC = getParameters(fId).darkCurrent(0, intlumi);
705  theNoiseCN = getParameters(fId).noiseCorrelation(0);
706  }
707  } else
708  theType = HcalHPD;
709  } else if (fId.genericSubdet() == HcalGenericDetId::HcalGenEndcap) {
710  if (useHEUpgrade_ || (testHEPlan1_ && isHEPlan1(fId))) {
711  HcalDetId hid(fId);
712  int nLayersInDepth = getLayersInDepth(hid.ietaAbs(), hid.depth(), topo);
713  if (nLayersInDepth > 4) {
714  theType = HcalHEHamamatsu2;
715  theDC = getParameters(fId).darkCurrent(1, intlumi);
716  theNoiseCN = getParameters(fId).noiseCorrelation(1);
717  } else {
718  theType = HcalHEHamamatsu1;
719  theDC = getParameters(fId).darkCurrent(0, intlumi);
720  theNoiseCN = getParameters(fId).noiseCorrelation(0);
721  }
722  } else
723  theType = HcalHPD;
724  } else if (fId.genericSubdet() == HcalGenericDetId::HcalGenOuter) {
725  if (useHOUpgrade_)
726  theType = HcalHOHamamatsu;
727  else
728  theType = HcalHPD;
729  }
730 
731  return HcalSiPMParameter(fId.rawId(), theType, thePe2fC, theDC, 0, (float)theNoiseCN);
732 }
double photoelectronsToAnalog() const
const HcalHardcodeParameters & getParameters(HcalGenericDetId fId) const
double darkCurrent(unsigned index, double intlumi) const
double noiseCorrelation(unsigned index) const
HcalSiPMType
Definition: HcalSiPMType.h:4
bool isHEPlan1(HcalGenericDetId fId) const
HcalGenericSubdetector genericSubdet() const
constexpr uint32_t rawId() const
get the raw id
Definition: DetId.h:57
int getLayersInDepth(int ieta, int depth, const HcalTopology *topo)

◆ makeHardcodeTPChannelParameter()

HcalTPChannelParameter HcalDbHardcode::makeHardcodeTPChannelParameter ( HcalGenericDetId  fId) const

Definition at line 754 of file HcalDbHardcode.cc.

References DetId::rawId().

Referenced by HcalHardcodeCalibrations::produceTPChannelParameters().

754  {
755  // For each detId parameters for trigger primitive
756  // mask for channel validity and self trigger information, fine grain
757  // bit information and auxiliary words
758  uint32_t bitInfo = ((44 << 16) | 30);
759  return HcalTPChannelParameter(fId.rawId(), 0, bitInfo, 0, 0);
760 }
constexpr uint32_t rawId() const
get the raw id
Definition: DetId.h:57

◆ makeHardcodeTPParameters()

void HcalDbHardcode::makeHardcodeTPParameters ( HcalTPParameters tppar) const

Definition at line 762 of file HcalDbHardcode.cc.

References HcalTPParameters::loadObject().

Referenced by HcalHardcodeCalibrations::produceTPParameters().

762  {
763  // Parameters for a given TP algorithm:
764  // FineGrain Algorithm Version for HBHE, ADC threshold fof TDC mask of HF,
765  // TDC mask for HF, Self Trigger bits, auxiliary words
766  tppar.loadObject(0, 0, 0xFFFFFFFFFFFFFFFF, 0, 0, 0);
767 }
void loadObject(int version, int adcCut, uint64_t tdcMask, uint32_t tbits, int auxi1, int auxi2)

◆ makeMCParam()

HcalMCParam HcalDbHardcode::makeMCParam ( HcalGenericDetId  fId) const

Definition at line 256 of file HcalDbHardcode.cc.

References ecalEBTriggerPrimitiveDigis_cfi::binOfMaximum, f, HcalGenericDetId::genericSubdet(), getParameters(), HcalGenericDetId::HcalGenBarrel, HcalGenericDetId::HcalGenEndcap, HcalGenericDetId::HcalGenForward, HcalGenericDetId::HcalGenOuter, HcalGenericDetId::HcalGenZDC, HcalDetId::ieta(), HcalDetId::iphi(), dqmdumpme::k, HcalHardcodeParameters::mcShape(), DetId::rawId(), mps_fire::result, ecalSimParameterMap_cff::syncPhase, and hcalSimParameters_cfi::timeSmearing.

Referenced by HcalHardcodeCalibrations::produceMCParams().

256  {
257  int r1bit[5];
258  r1bit[0] = 9; // [0,9]
259  int syncPhase = 0;
260  r1bit[1] = 1;
261  int binOfMaximum = 0;
262  r1bit[2] = 4;
263  float phase = -25.0f; // [-25.0,25.0]
264  float Xphase = (phase + 32.0f) * 4.0f; // never change this line
265  // (offset 50nsec, 0.25ns step)
266  int Iphase = Xphase;
267  r1bit[3] = 8; // [0,256] offset 50ns, .25ns step
268  int timeSmearing = 0;
269  r1bit[4] = 1; // bool
270 
271  const HcalHardcodeParameters& hparam(getParameters(fId));
272  int pulseShapeID = hparam.mcShape(); // a0
273 
275  syncPhase = 1; // a1 bool
276  binOfMaximum = 5; // a2
277  phase = 5.0f; // a3 [-25.0,25.0]
278  Xphase = (phase + 32.0f) * 4.0f; // never change this line
279  // (offset 50nsec, 0.25ns step)
280  Iphase = Xphase;
281  timeSmearing = 1; // a4
282 
283  }
284 
286  syncPhase = 1; // a1 bool
287  binOfMaximum = 5; // a2
288  phase = 5.0f; // a3 [-25.0,25.0]
289  Xphase = (phase + 32.0f) * 4.0f; // never change this line
290  // (offset 50nsec, 0.25ns step)
291  Iphase = Xphase;
292  timeSmearing = 1; // a4
293 
294  }
295 
296  else if (fId.genericSubdet() == HcalGenericDetId::HcalGenOuter) {
297  syncPhase = 1; // a1 bool
298  binOfMaximum = 5; // a2
299  phase = 5.0f; // a3 [-25.0,25.0]
300  Xphase = (phase + 32.0f) * 4.0f; // never change this line
301  // (offset 50nsec, 0.25ns step)
302  Iphase = Xphase;
303  timeSmearing = 0; // a4
304 
305  HcalDetId cell = HcalDetId(fId);
306  if (cell.ieta() == 1 && cell.iphi() == 1)
307  pulseShapeID = 125;
308 
309  }
310 
312  syncPhase = 1; // a1 bool
313  binOfMaximum = 3; // a2
314  phase = 14.0f; // a3 [-25.0,25.0]
315  Xphase = (phase + 32.0f) * 4.0f; // never change this line
316  // (offset 50nsec, 0.25ns step)
317  Iphase = Xphase;
318  timeSmearing = 0; // a4
319 
320  }
321 
322  else if (fId.genericSubdet() == HcalGenericDetId::HcalGenZDC) {
323  pulseShapeID = 401; // a0
324  syncPhase = 1; // a1 bool
325  binOfMaximum = 5; // a2
326  phase = -4.0f; // a3 [-25.0,25.0]
327  Xphase = (phase + 32.0f) * 4.0f; // never change this line
328  // (offset 50nsec, 0.25ns step)
329  Iphase = Xphase;
330  timeSmearing = 0; // a4
331  }
332 
333  int rshift[7];
334  rshift[0] = 0;
335  for (int k = 0; k < 5; k++) {
336  rshift[k + 1] = rshift[k] + r1bit[k];
337  }
338 
339  int packingScheme = 1; // a5
340  unsigned int param = pulseShapeID | syncPhase << rshift[1] | (binOfMaximum << rshift[2]) | (Iphase << rshift[3]) |
341  (timeSmearing << rshift[4] | packingScheme << 27);
342 
343  HcalMCParam result(fId.rawId(), param);
344  return result;
345 }
const HcalHardcodeParameters & getParameters(HcalGenericDetId fId) const
constexpr int ieta() const
get the cell ieta
Definition: HcalDetId.h:155
double f[11][100]
HcalGenericSubdetector genericSubdet() const
constexpr uint32_t rawId() const
get the raw id
Definition: DetId.h:57
constexpr int iphi() const
get the cell iphi
Definition: HcalDetId.h:157

◆ makePedestal()

HcalPedestal HcalDbHardcode::makePedestal ( HcalGenericDetId  fId,
bool  fSmear,
bool  eff,
const HcalTopology topo,
double  intlumi 
)

Definition at line 110 of file HcalDbHardcode.cc.

References f, nano_mu_digi_cff::float, getParameters(), mps_fire::i, submitPVValidationJobs::intlumi, makeHardcodeSiPMCharacteristics(), makeHardcodeSiPMParameter(), makePedestalWidth(), HcalHardcodeParameters::pedestal(), DetId::rawId(), mps_fire::result, and ApeEstimator_cff::width.

Referenced by HcalHardcodeCalibrations::producePedestals_().

111  {
113  float value0 = getParameters(fId).pedestal();
114  if (eff) {
115  //account for dark current + crosstalk
116  auto sipmpar = makeHardcodeSiPMParameter(fId, topo, intlumi);
117  auto sipmchar = makeHardcodeSiPMCharacteristics();
118  value0 += sipmpar.getDarkCurrent() * 25. / (1. - sipmchar->getCrossTalk(sipmpar.getType()));
119  }
120  float value[4] = {value0, value0, value0, value0};
121  if (fSmear) {
122  for (int i = 0; i < 4; i++) {
123  value[i] = 0.0f;
124  while (value[i] <= 0.0f)
125  // ignore correlations, assume 10K pedestal run
126  value[i] = value0 + (float)CLHEP::RandGauss::shoot(0.0, width.getWidth(i) / 100.);
127  }
128  }
129  HcalPedestal result(fId.rawId(), value[0], value[1], value[2], value[3]);
130  return result;
131 }
const HcalHardcodeParameters & getParameters(HcalGenericDetId fId) const
std::unique_ptr< HcalSiPMCharacteristics > makeHardcodeSiPMCharacteristics() const
double f[11][100]
Definition: value.py:1
constexpr uint32_t rawId() const
get the raw id
Definition: DetId.h:57
HcalSiPMParameter makeHardcodeSiPMParameter(HcalGenericDetId fId, const HcalTopology *topo, double intlumi)
HcalPedestalWidth makePedestalWidth(HcalGenericDetId fId, bool eff, const HcalTopology *topo, double intlumi)

◆ makePedestalWidth()

HcalPedestalWidth HcalDbHardcode::makePedestalWidth ( HcalGenericDetId  fId,
bool  eff,
const HcalTopology topo,
double  intlumi 
)

Definition at line 133 of file HcalDbHardcode.cc.

References getParameters(), mps_fire::i, submitPVValidationJobs::intlumi, dqmiolumiharvest::j, makeHardcodeSiPMCharacteristics(), makeHardcodeSiPMParameter(), HcalHardcodeParameters::pedestalWidth(), funct::pow(), DetId::rawId(), mps_fire::result, and relativeConstraints::value.

Referenced by makePedestal(), and HcalHardcodeCalibrations::producePedestalWidths_().

136  {
137  float value = getParameters(fId).pedestalWidth();
138  float width2 = value * value;
139  // everything in fC
140 
141  if (eff) {
142  //account for dark current + crosstalk
143  auto sipmpar = makeHardcodeSiPMParameter(fId, topo, intlumi);
144  auto sipmchar = makeHardcodeSiPMCharacteristics();
145  //add in quadrature
146  width2 += sipmpar.getDarkCurrent() * 25. / std::pow(1 - sipmchar->getCrossTalk(sipmpar.getType()), 3) *
147  sipmpar.getFCByPE();
148  }
149 
151  for (int i = 0; i < 4; i++) {
152  for (int j = 0; j < 4; j++) {
153  result.setSigma(i, j, 0.0);
154  }
155  result.setSigma(i, i, width2);
156  }
157  return result;
158 }
const HcalHardcodeParameters & getParameters(HcalGenericDetId fId) const
std::unique_ptr< HcalSiPMCharacteristics > makeHardcodeSiPMCharacteristics() const
Definition: value.py:1
constexpr uint32_t rawId() const
get the raw id
Definition: DetId.h:57
HcalSiPMParameter makeHardcodeSiPMParameter(HcalGenericDetId fId, const HcalTopology *topo, double intlumi)
Power< A, B >::type pow(const A &a, const B &b)
Definition: Power.h:29

◆ makePFCut()

HcalPFCut HcalDbHardcode::makePFCut ( HcalGenericDetId  fId,
double  intlumi,
bool  noHE 
) const

Definition at line 181 of file HcalDbHardcode.cc.

References funct::abs(), HcalDetId::depth(), HLT_2024v12_cff::eps, HcalGenericDetId::genericSubdet(), getParameters(), HcalGenericDetId::HcalGenBarrel, mps_fire::i, mkLumiAveragedPlots::intLumi, edmLumisInFiles::lumis, HcalHardcodeParameters::noiseThreshold(), DetId::rawId(), mps_fire::result, HLT_2024v12_cff::seeds, HcalHardcodeParameters::seedThreshold(), and HLT_2024v12_cff::value1.

Referenced by HcalHardcodeCalibrations::producePFCuts().

181  { // GeV
182 
183  // assign default dummy parameters
184  float value0 = getParameters(fId).noiseThreshold();
185  float value1 = getParameters(fId).seedThreshold();
186 
187  if (noHE && fId.genericSubdet() == HcalGenericDetId::HcalGenBarrel) { // HB Phase2
188 
189  // aging-independent (lumi=0) intialization for Phase2 using "HBphase1" numbers
190  const float cuts_Phase1[] = {0.1, 0.2, 0.3, 0.3};
191  const float seeds_Phase1[] = {0.125, 0.25, 0.35, 0.35};
192 
193  HcalDetId hid(fId);
194  int depth_m1 = hid.depth() - 1;
195  value0 = cuts_Phase1[depth_m1];
196  value1 = seeds_Phase1[depth_m1];
197 
198  // lumi-dependent stuff for Phase2 from SLHCUpgradeSimulations/Configuration/python/aging.py
199  const double lumis[] = {300, 1000, 3000, 4500}; // integrated lumi points
200  // row by row initialization
201  const float cuts[4][4] = {{0.4, 0.5, 0.6, 0.6}, {0.8, 1.2, 1.2, 1.2}, {1.0, 2.0, 2.0, 2.0}, {1.25, 2.5, 2.5, 2.5}};
202  const float seeds[4][4] = {
203  {0.5, 0.625, 0.75, 0.75}, {1.0, 1.5, 1.5, 1.5}, {1.25, 2.5, 2.5, 2.5}, {1.5, 3.0, 3.0, 3.0}};
204  const double eps = 1.e-6;
205 
206  for (int i = 0; i < 4; i++) {
207  if (std::abs(intLumi - lumis[i]) < eps) {
208  value0 = cuts[i][depth_m1];
209  value1 = seeds[i][depth_m1];
210  }
211  }
212  }
213 
214  HcalPFCut result(fId.rawId(), value0, value1);
215  return result;
216 }
const HcalHardcodeParameters & getParameters(HcalGenericDetId fId) const
Abs< T >::type abs(const T &t)
Definition: Abs.h:22
HcalGenericSubdetector genericSubdet() const
constexpr uint32_t rawId() const
get the raw id
Definition: DetId.h:57

◆ makeQIECoder()

HcalQIECoder HcalDbHardcode::makeQIECoder ( HcalGenericDetId  fId) const

Definition at line 224 of file HcalDbHardcode.cc.

References getParameters(), FastTimerService_cff::range, DetId::rawId(), and mps_fire::result.

Referenced by HcalHardcodeCalibrations::produceQIEData().

224  {
225  HcalQIECoder result(fId.rawId());
226  // slope in ADC/fC
227  const HcalHardcodeParameters& param(getParameters(fId));
228  for (unsigned range = 0; range < 4; range++) {
229  for (unsigned capid = 0; capid < 4; capid++) {
230  result.setOffset(capid, range, param.qieOffset(range));
231  result.setSlope(capid, range, param.qieSlope(range));
232  }
233  }
234 
235  return result;
236 }
const HcalHardcodeParameters & getParameters(HcalGenericDetId fId) const
constexpr uint32_t rawId() const
get the raw id
Definition: DetId.h:57

◆ makeQIEShape()

HcalQIEShape HcalDbHardcode::makeQIEShape ( ) const

Definition at line 254 of file HcalDbHardcode.cc.

254 { return HcalQIEShape(); }

◆ makeQIEType()

HcalQIEType HcalDbHardcode::makeQIEType ( HcalGenericDetId  fId) const

Definition at line 238 of file HcalDbHardcode.cc.

References getParameters(), HcalHardcodeParameters::qieType(), DetId::rawId(), and mps_fire::result.

Referenced by HcalHardcodeCalibrations::produceQIETypes().

238  {
239  HcalQIENum qieType = (HcalQIENum)(getParameters(fId).qieType());
240  HcalQIEType result(fId.rawId(), qieType);
241  return result;
242 }
const HcalHardcodeParameters & getParameters(HcalGenericDetId fId) const
HcalQIENum
Definition: HcalQIENum.h:4
constexpr uint32_t rawId() const
get the raw id
Definition: DetId.h:57

◆ makeRecoParam()

HcalRecoParam HcalDbHardcode::makeRecoParam ( HcalGenericDetId  fId) const

Definition at line 347 of file HcalDbHardcode.cc.

References castor_dqm_sourceclient-live_cfg::correctForTimeslew, HLT_2024v12_cff::correctTiming, HLT_2024v12_cff::firstAuxTS, castor_dqm_sourceclient-live_cfg::firstSample, HcalGenericDetId::genericSubdet(), getParameters(), HcalGenericDetId::HcalGenBarrel, HcalGenericDetId::HcalGenEndcap, HcalGenericDetId::HcalGenForward, HcalGenericDetId::HcalGenOuter, dqmiolumiharvest::j, dqmdumpme::k, DetId::rawId(), HcalHardcodeParameters::recoShape(), mps_fire::result, castor_dqm_sourceclient-live_cfg::samplesToAdd, and HLT_2024v12_cff::useLeakCorrection.

Referenced by HcalHardcodeCalibrations::produceRecoParams().

347  {
348  // Mostly comes from S.Kunori's macro
349  int p1bit[6];
350 
351  // param1
352  int containmentCorrectionFlag = 0;
353  p1bit[0] = 1; // bool
354  int containmentCorrectionPreSample = 0;
355  p1bit[1] = 1; // bool
356  float phase = 13.0; // [-25.0,25.0]
357  float Xphase = (phase + 32.0) * 4.0; //never change this line
358  // (offset 50nsec, 0.25ns step)
359  int Iphase = Xphase;
360  p1bit[2] = 8; // [0,256]
361  // (offset 50ns, 0.25ns step
362  int firstSample = 4;
363  p1bit[3] = 4; // [0,9]
364  int samplesToAdd = 2;
365  p1bit[4] = 4; // [0,9]
366  p1bit[5] = 9; // [0,9]
367 
368  const HcalHardcodeParameters& hparam(getParameters(fId));
369  int pulseShapeID = hparam.recoShape(); // a5
370 
371  int q2bit[10];
372  // param2.
373  int useLeakCorrection = 0;
374  q2bit[0] = 1; // bool
375  int LeakCorrectionID = 0;
376  q2bit[1] = 4; // [0,15]
377  int correctForTimeslew = 0;
378  q2bit[2] = 1; // bool
379  int timeCorrectionID = 0;
380  q2bit[3] = 4; // [0,15]
381  int correctTiming = 0;
382  q2bit[4] = 1; // bool
383  int firstAuxTS = 0;
384  q2bit[5] = 4; // [0,15]
385  int specialCaseID = 0;
386  q2bit[6] = 4; // [0,15]
387  int noiseFlaggingID = 0;
388  q2bit[7] = 4; // [0,15]
389  int pileupCleaningID = 0;
390  q2bit[8] = 4; // [0,15]
391  int packingScheme = 1;
392  q2bit[9] = 4;
393 
396  // param1.
397  containmentCorrectionFlag = 1; // p0
398  containmentCorrectionPreSample = 0; // p1
399  float phase = 6.0;
400  float Xphase = (phase + 32.0) * 4.0; // never change this line
401  //(offset 50nsec, 0.25ns step)
402  Iphase = Xphase; // p2
403  firstSample = 4; // p3
404  samplesToAdd = 2; // p4
405 
406  // param2.
407  useLeakCorrection = 0; // q0
408  LeakCorrectionID = 0; // q1
409  correctForTimeslew = 1; // q2
410  timeCorrectionID = 0; // q3
411  correctTiming = 1; // q4
412  firstAuxTS = 4; // q5
413  specialCaseID = 0; // q6
414  noiseFlaggingID = 1; // q7
415  pileupCleaningID = 0; // q8
416  }
417 
418  else if (fId.genericSubdet() == HcalGenericDetId::HcalGenOuter) {
419  // param1.
420  containmentCorrectionFlag = 1; // p0
421  containmentCorrectionPreSample = 0; // p1
422  float phase = 13.0;
423  float Xphase = (phase + 32.0) * 4.0; // never change this line
424  // (offset 50nsec, 0.25ns step)
425  Iphase = Xphase; // p2
426  firstSample = 4; // p3
427  samplesToAdd = 4; // p4
428 
429  // param2.
430  useLeakCorrection = 0; // q0
431  LeakCorrectionID = 0; // q1
432  correctForTimeslew = 1; // q2
433  timeCorrectionID = 0; // q3
434  correctTiming = 1; // q4
435  firstAuxTS = 4; // q5
436  specialCaseID = 0; // q6
437  noiseFlaggingID = 1; // q7
438  pileupCleaningID = 0; // q8
439 
440  } else if (fId.genericSubdet() == HcalGenericDetId::HcalGenForward) {
441  // param1.
442  containmentCorrectionFlag = 0; // p0
443  containmentCorrectionPreSample = 0; // p1
444  float phase = 13.0;
445  float Xphase = (phase + 32.0) * 4.0; // never change this line
446  // (offset 50nsec, 0.25ns step)
447  Iphase = Xphase; // p2
448  firstSample = 2; // p3
449  samplesToAdd = 1; // p4
450 
451  // param2.
452  useLeakCorrection = 0; // q0
453  LeakCorrectionID = 0; // q1
454  correctForTimeslew = 0; // q2
455  timeCorrectionID = 0; // q3
456  correctTiming = 1; // q4
457  firstAuxTS = 1; // q5
458  specialCaseID = 0; // q6
459  noiseFlaggingID = 1; // q7
460  pileupCleaningID = 0; // q8
461  }
462 
463  // Packing parameters in two words
464 
465  int p1shift[7];
466  p1shift[0] = 0;
467  for (int k = 0; k < 6; k++) {
468  int j = k + 1;
469  p1shift[j] = p1shift[k] + p1bit[k];
470  // cout<<" j= "<<j<<" shift "<< p1shift[j]<<endl;
471  }
472  int param1 = 0;
473  param1 = containmentCorrectionFlag | (containmentCorrectionPreSample << p1shift[1]) | (Iphase << p1shift[2]) |
474  (firstSample << p1shift[3]) | (samplesToAdd << p1shift[4]) | (pulseShapeID << p1shift[5]);
475 
476  int q2shift[10];
477  q2shift[0] = 0;
478  for (int k = 0; k < 9; k++) {
479  int j = k + 1;
480  q2shift[j] = q2shift[k] + q2bit[k];
481  // cout<<" j= "<<j<<" shift "<< q2shift[j]<<endl;
482  }
483  int param2 = 0;
484  param2 = useLeakCorrection | (LeakCorrectionID << q2shift[1]) | (correctForTimeslew << q2shift[2]) |
485  (timeCorrectionID << q2shift[3]) | (correctTiming << q2shift[4]) | (firstAuxTS << q2shift[5]) |
486  (specialCaseID << q2shift[6]) | (noiseFlaggingID << q2shift[7]) | (pileupCleaningID << q2shift[8]) |
487  (packingScheme << q2shift[9]);
488 
489  HcalRecoParam result(fId.rawId(), param1, param2);
490 
491  return result;
492 }
const HcalHardcodeParameters & getParameters(HcalGenericDetId fId) const
HcalGenericSubdetector genericSubdet() const
constexpr uint32_t rawId() const
get the raw id
Definition: DetId.h:57

◆ makeTimingParam()

HcalTimingParam HcalDbHardcode::makeTimingParam ( HcalGenericDetId  fId) const

Definition at line 494 of file HcalDbHardcode.cc.

References HcalGenericDetId::genericSubdet(), HcalGenericDetId::HcalGenBarrel, HcalGenericDetId::HcalGenEndcap, HcalGenericDetId::HcalGenForward, HcalGenericDetId::HcalGenOuter, nhits, DetId::rawId(), mps_fire::result, and SiStripPI::rms.

Referenced by HcalHardcodeCalibrations::produceTimingParams().

494  {
495  int nhits = 0;
496  float phase = 0.0;
497  float rms = 0.0;
499  nhits = 4;
500  phase = 4.5;
501  rms = 6.5;
502  } else if (fId.genericSubdet() == HcalGenericDetId::HcalGenEndcap) {
503  nhits = 4;
504  phase = 9.3;
505  rms = 7.8;
506  } else if (fId.genericSubdet() == HcalGenericDetId::HcalGenOuter) {
507  nhits = 4;
508  phase = 8.6;
509  rms = 2.3;
510  } else if (fId.genericSubdet() == HcalGenericDetId::HcalGenForward) {
511  nhits = 4;
512  phase = 12.4;
513  rms = 12.29;
514  }
516 
517  return result;
518 }
HcalGenericSubdetector genericSubdet() const
constexpr uint32_t rawId() const
get the raw id
Definition: DetId.h:57

◆ makeZSThreshold()

HcalZSThreshold HcalDbHardcode::makeZSThreshold ( HcalGenericDetId  fId) const

Definition at line 218 of file HcalDbHardcode.cc.

References getParameters(), DetId::rawId(), mps_fire::result, relativeConstraints::value, and HcalHardcodeParameters::zsThreshold().

Referenced by HcalHardcodeCalibrations::produceZSThresholds().

218  {
219  int value = getParameters(fId).zsThreshold();
221  return result;
222 }
const HcalHardcodeParameters & getParameters(HcalGenericDetId fId) const
Definition: value.py:1
constexpr uint32_t rawId() const
get the raw id
Definition: DetId.h:57

◆ setHB()

void HcalDbHardcode::setHB ( HcalHardcodeParameters  p)
inline

◆ setHBUpgrade()

void HcalDbHardcode::setHBUpgrade ( HcalHardcodeParameters  p)
inline

◆ setHE()

void HcalDbHardcode::setHE ( HcalHardcodeParameters  p)
inline

◆ setHEUpgrade()

void HcalDbHardcode::setHEUpgrade ( HcalHardcodeParameters  p)
inline

◆ setHF()

void HcalDbHardcode::setHF ( HcalHardcodeParameters  p)
inline

◆ setHFUpgrade()

void HcalDbHardcode::setHFUpgrade ( HcalHardcodeParameters  p)
inline

◆ setHO()

void HcalDbHardcode::setHO ( HcalHardcodeParameters  p)
inline

◆ setKillHE()

void HcalDbHardcode::setKillHE ( bool  b)
inline

Definition at line 90 of file HcalDbHardcode.h.

References b, and killHE_.

Referenced by HcalHardcodeCalibrations::HcalHardcodeCalibrations().

90 { killHE_ = b; }
double b
Definition: hdecay.h:120

◆ setSiPMCharacteristics()

void HcalDbHardcode::setSiPMCharacteristics ( std::vector< edm::ParameterSet vps)
inline

Definition at line 89 of file HcalDbHardcode.h.

References theSiPMCharacteristics_.

Referenced by HcalHardcodeCalibrations::HcalHardcodeCalibrations().

89 { theSiPMCharacteristics_ = vps; }
std::vector< edm::ParameterSet > theSiPMCharacteristics_

◆ testHEPlan1()

void HcalDbHardcode::testHEPlan1 ( bool  b)
inline

Definition at line 88 of file HcalDbHardcode.h.

References b, and testHEPlan1_.

Referenced by HcalHardcodeCalibrations::HcalHardcodeCalibrations().

88 { testHEPlan1_ = b; }
double b
Definition: hdecay.h:120

◆ testHFQIE10()

void HcalDbHardcode::testHFQIE10 ( bool  b)
inline

Definition at line 87 of file HcalDbHardcode.h.

References b, and testHFQIE10_.

Referenced by HcalHardcodeCalibrations::HcalHardcodeCalibrations().

87 { testHFQIE10_ = b; }
double b
Definition: hdecay.h:120

◆ useHBUpgrade() [1/2]

void HcalDbHardcode::useHBUpgrade ( bool  b)
inline

Definition at line 83 of file HcalDbHardcode.h.

References b, and useHBUpgrade_.

Referenced by HcalHardcodeCalibrations::HcalHardcodeCalibrations().

83 { useHBUpgrade_ = b; }
double b
Definition: hdecay.h:120

◆ useHBUpgrade() [2/2]

const bool HcalDbHardcode::useHBUpgrade ( ) const
inline

Definition at line 93 of file HcalDbHardcode.h.

References useHBUpgrade_.

93 { return useHBUpgrade_; }

◆ useHEUpgrade() [1/2]

void HcalDbHardcode::useHEUpgrade ( bool  b)
inline

Definition at line 84 of file HcalDbHardcode.h.

References b, and useHEUpgrade_.

Referenced by HcalHardcodeCalibrations::HcalHardcodeCalibrations().

84 { useHEUpgrade_ = b; }
double b
Definition: hdecay.h:120

◆ useHEUpgrade() [2/2]

const bool HcalDbHardcode::useHEUpgrade ( ) const
inline

Definition at line 94 of file HcalDbHardcode.h.

References useHEUpgrade_.

94 { return useHEUpgrade_; }

◆ useHFUpgrade() [1/2]

void HcalDbHardcode::useHFUpgrade ( bool  b)
inline

Definition at line 86 of file HcalDbHardcode.h.

References b, and useHFUpgrade_.

Referenced by HcalHardcodeCalibrations::HcalHardcodeCalibrations().

86 { useHFUpgrade_ = b; }
double b
Definition: hdecay.h:120

◆ useHFUpgrade() [2/2]

const bool HcalDbHardcode::useHFUpgrade ( ) const
inline

Definition at line 96 of file HcalDbHardcode.h.

References useHFUpgrade_.

96 { return useHFUpgrade_; }

◆ useHOUpgrade() [1/2]

void HcalDbHardcode::useHOUpgrade ( bool  b)
inline

Definition at line 85 of file HcalDbHardcode.h.

References b, and useHOUpgrade_.

Referenced by HcalHardcodeCalibrations::HcalHardcodeCalibrations().

85 { useHOUpgrade_ = b; }
double b
Definition: hdecay.h:120

◆ useHOUpgrade() [2/2]

const bool HcalDbHardcode::useHOUpgrade ( ) const
inline

Definition at line 95 of file HcalDbHardcode.h.

References useHOUpgrade_.

95 { return useHOUpgrade_; }

Member Data Documentation

◆ killHE_

bool HcalDbHardcode::killHE_
private

Definition at line 129 of file HcalDbHardcode.h.

Referenced by killHE(), and setKillHE().

◆ setHB_

bool HcalDbHardcode::setHB_
private

Definition at line 129 of file HcalDbHardcode.h.

Referenced by getParameters(), and setHB().

◆ setHBUpgrade_

bool HcalDbHardcode::setHBUpgrade_
private

Definition at line 129 of file HcalDbHardcode.h.

Referenced by getParameters(), and setHBUpgrade().

◆ setHE_

bool HcalDbHardcode::setHE_
private

Definition at line 129 of file HcalDbHardcode.h.

Referenced by getParameters(), and setHE().

◆ setHEUpgrade_

bool HcalDbHardcode::setHEUpgrade_
private

Definition at line 129 of file HcalDbHardcode.h.

Referenced by getParameters(), and setHEUpgrade().

◆ setHF_

bool HcalDbHardcode::setHF_
private

Definition at line 129 of file HcalDbHardcode.h.

Referenced by getParameters(), and setHF().

◆ setHFUpgrade_

bool HcalDbHardcode::setHFUpgrade_
private

Definition at line 129 of file HcalDbHardcode.h.

Referenced by getParameters(), and setHFUpgrade().

◆ setHO_

bool HcalDbHardcode::setHO_
private

Definition at line 129 of file HcalDbHardcode.h.

Referenced by getParameters(), and setHO().

◆ testHEPlan1_

bool HcalDbHardcode::testHEPlan1_
private

Definition at line 130 of file HcalDbHardcode.h.

Referenced by getParameters(), makeHardcodeSiPMParameter(), and testHEPlan1().

◆ testHFQIE10_

bool HcalDbHardcode::testHFQIE10_
private

Definition at line 130 of file HcalDbHardcode.h.

Referenced by getParameters(), and testHFQIE10().

◆ theDefaultParameters_

HcalHardcodeParameters HcalDbHardcode::theDefaultParameters_
private

Definition at line 126 of file HcalDbHardcode.h.

Referenced by getParameters().

◆ theHBParameters_

HcalHardcodeParameters HcalDbHardcode::theHBParameters_
private

Definition at line 127 of file HcalDbHardcode.h.

Referenced by getParameters(), and setHB().

◆ theHBUpgradeParameters_

HcalHardcodeParameters HcalDbHardcode::theHBUpgradeParameters_
private

Definition at line 128 of file HcalDbHardcode.h.

Referenced by getParameters(), and setHBUpgrade().

◆ theHEParameters_

HcalHardcodeParameters HcalDbHardcode::theHEParameters_
private

Definition at line 127 of file HcalDbHardcode.h.

Referenced by getParameters(), and setHE().

◆ theHEUpgradeParameters_

HcalHardcodeParameters HcalDbHardcode::theHEUpgradeParameters_
private

Definition at line 128 of file HcalDbHardcode.h.

Referenced by getParameters(), and setHEUpgrade().

◆ theHFParameters_

HcalHardcodeParameters HcalDbHardcode::theHFParameters_
private

Definition at line 127 of file HcalDbHardcode.h.

Referenced by getParameters(), and setHF().

◆ theHFUpgradeParameters_

HcalHardcodeParameters HcalDbHardcode::theHFUpgradeParameters_
private

Definition at line 128 of file HcalDbHardcode.h.

Referenced by getParameters(), and setHFUpgrade().

◆ theHOParameters_

HcalHardcodeParameters HcalDbHardcode::theHOParameters_
private

Definition at line 127 of file HcalDbHardcode.h.

Referenced by getParameters(), and setHO().

◆ theLayersInDepths_

std::map<std::pair<int, int>, int> HcalDbHardcode::theLayersInDepths_
private

Definition at line 132 of file HcalDbHardcode.h.

Referenced by getLayersInDepth().

◆ theSiPMCharacteristics_

std::vector<edm::ParameterSet> HcalDbHardcode::theSiPMCharacteristics_
private

Definition at line 131 of file HcalDbHardcode.h.

Referenced by makeHardcodeSiPMCharacteristics(), and setSiPMCharacteristics().

◆ useHBUpgrade_

bool HcalDbHardcode::useHBUpgrade_
private

Definition at line 130 of file HcalDbHardcode.h.

Referenced by getParameters(), makeHardcodeSiPMParameter(), and useHBUpgrade().

◆ useHEUpgrade_

bool HcalDbHardcode::useHEUpgrade_
private

Definition at line 130 of file HcalDbHardcode.h.

Referenced by getParameters(), makeHardcodeSiPMParameter(), and useHEUpgrade().

◆ useHFUpgrade_

bool HcalDbHardcode::useHFUpgrade_
private

Definition at line 130 of file HcalDbHardcode.h.

Referenced by getParameters(), and useHFUpgrade().

◆ useHOUpgrade_

bool HcalDbHardcode::useHOUpgrade_
private

Definition at line 130 of file HcalDbHardcode.h.

Referenced by makeHardcodeSiPMParameter(), and useHOUpgrade().