CMS 3D CMS Logo

HcalPulseContainmentManager.cc
Go to the documentation of this file.
4 #include <iostream>
5 
7  : entries_(), shapes_(), max_fracerror_(max_fracerror) {
8  hcalTimeSlew_delay_ = nullptr;
9 }
10 
12  : entries_(),
13  shapes_(iC),
14  max_fracerror_(max_fracerror),
15  delayToken_(iC.esConsumes<edm::Transition::BeginRun>(edm::ESInputTag("", "HBHE"))) {}
16 
19 
20  shapes_.beginRun(es);
21 }
22 
25 
27 }
28 
29 double HcalPulseContainmentManager::correction(const HcalDetId& detId, int toAdd, float fixedphase_ns, double fc_ampl) {
30  /*
31  int sub = detId.subdet();
32  int depth = detId.depth();
33  int inteta = detId.ieta();
34  int intphi = detId.iphi();
35 
36  std::cout << "* HcalPulseContainmentManager::correction, cell:"
37  << " sub, ieta, iphi, depth = "
38  << sub << " " << inteta << " " << intphi
39  << " " << depth << " toAaa= " << toAdd
40  <<" phase = " << fixedphase_ns << " ampl = "
41  << fc_ampl
42  << std::endl;
43  */
44 
45  return get(detId, toAdd, fixedphase_ns)->getCorrection(fc_ampl);
46 }
47 
49  int toAdd,
50  float fixedphase_ns) {
51  // const HcalPulseShape * shape = &(shapes_.shape(detId));
52  const HcalPulseShape* shape = &(shapes_.shapeForReco(detId));
53  for (std::vector<HcalPulseContainmentEntry>::const_iterator entryItr = entries_.begin(); entryItr != entries_.end();
54  ++entryItr) {
55  if (entryItr->shape_ == shape && entryItr->toAdd_ == toAdd && entryItr->fixedphase_ns_ == fixedphase_ns) {
56  return &entryItr->correction_;
57  }
58  }
59 
60  /*
61  int sub = detId.subdet();
62  int depth = detId.depth();
63  int inteta = detId.ieta();
64  int intphi = detId.iphi();
65 
66  std::cout << "* HcalPulseContainmentManager::get new entry, cell:"
67  << " sub, ieta, iphi, depth = "
68  << sub << " " << inteta << " " << intphi
69  << " " << depth
70  << std::endl;
71  */
72 
73  // didn't find it. Make one.
75  toAdd,
76  fixedphase_ns,
77  shape,
79  entries_.push_back(entry);
80  return &(entries_.back().correction_);
81 }
HcalPulseContainmentManager::shapes_
HcalPulseShapes shapes_
Definition: HcalPulseContainmentManager.h:38
HcalPulseContainmentManager::entries_
std::vector< HcalPulseContainmentEntry > entries_
Definition: HcalPulseContainmentManager.h:37
HcalPulseContainmentManager.h
HcalPulseContainmentManager::max_fracerror_
float max_fracerror_
Definition: HcalPulseContainmentManager.h:40
ESInputTag
edm
HLT enums.
Definition: AlignableModifier.h:19
mps_splice.entry
entry
Definition: mps_splice.py:68
HcalPulseShapes::shapeForReco
const Shape & shapeForReco(const HcalDetId &detId) const
Definition: HcalPulseShapes.cc:524
HcalPulseContainmentCorrection
Definition: HcalPulseContainmentCorrection.h:15
HcalPulseContainmentManager::get
const HcalPulseContainmentCorrection * get(const HcalDetId &detId, int toAdd, float fixedphase_ns)
Definition: HcalPulseContainmentManager.cc:48
HcalTimeSlew
Definition: HcalTimeSlew.h:19
HcalPulseContainmentManager::HcalPulseContainmentEntry
Definition: HcalPulseContainmentManager.h:25
HcalPulseContainmentManager::HcalPulseContainmentManager
HcalPulseContainmentManager(float max_fracerror)
Definition: HcalPulseContainmentManager.cc:6
edm::Transition
Transition
Definition: Transition.h:12
HcalDetId
Definition: HcalDetId.h:12
HcalPulseShapes::beginRun
void beginRun(edm::EventSetup const &es)
Definition: HcalPulseShapes.cc:146
HcalPulseContainmentManager::hcalTimeSlew_delay_
const HcalTimeSlew * hcalTimeSlew_delay_
Definition: HcalPulseContainmentManager.h:43
edm::EventSetup
Definition: EventSetup.h:57
HcalPulseContainmentCorrection::getCorrection
double getCorrection(double fc_ampl) const
Definition: HcalPulseContainmentCorrection.cc:51
HcalPulseShape
Definition: HcalPulseShape.h:6
edm::EventSetup::getData
bool getData(T &iHolder) const
Definition: EventSetup.h:120
HcalDbService
Definition: HcalDbService.h:26
submitPVValidationJobs.conditions
list conditions
Definition: submitPVValidationJobs.py:674
EventSetup.h
phase2TrackerDigitizer_cfi.delay
delay
Definition: phase2TrackerDigitizer_cfi.py:49
ConsumesCollector.h
HcalPulseContainmentManager::correction
double correction(const HcalDetId &detId, int toAdd, float fixedphase_ns, double fc_ampl)
Definition: HcalPulseContainmentManager.cc:29
HcalPulseContainmentManager::beginRun
void beginRun(edm::EventSetup const &es)
Definition: HcalPulseContainmentManager.cc:17
HLT_FULL_cff.toAdd
toAdd
Definition: HLT_FULL_cff.py:52187
edm::ConsumesCollector
Definition: ConsumesCollector.h:45
HcalPulseContainmentManager::delayToken_
const edm::ESGetToken< HcalTimeSlew, HcalTimeSlewRecord > delayToken_
Definition: HcalPulseContainmentManager.h:41