CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
HcalPulseContainmentManager.cc
Go to the documentation of this file.
4 #include <iostream>
5 
6 HcalPulseContainmentManager::HcalPulseContainmentManager(float max_fracerror, bool phaseAsInSim)
7  : entries_(), shapes_(), max_fracerror_(max_fracerror), phaseAsInSim_(phaseAsInSim) {
8  hcalTimeSlew_delay_ = nullptr;
9 }
10 
12  bool phaseAsInSim,
14  : entries_(),
15  shapes_(iC),
16  max_fracerror_(max_fracerror),
17  phaseAsInSim_(phaseAsInSim),
18  delayToken_(iC.esConsumes<edm::Transition::BeginRun>(edm::ESInputTag("", "HBHE"))) {}
19 
22 
23  shapes_.beginRun(es);
24 }
25 
27  hcalTimeSlew_delay_ = delay;
28 
29  shapes_.beginRun(conditions);
30 }
31 
32 double HcalPulseContainmentManager::correction(const HcalDetId& detId, int toAdd, float fixedphase_ns, double fc_ampl) {
33  /*
34  int sub = detId.subdet();
35  int depth = detId.depth();
36  int inteta = detId.ieta();
37  int intphi = detId.iphi();
38 
39  std::cout << "* HcalPulseContainmentManager::correction, cell:"
40  << " sub, ieta, iphi, depth = "
41  << sub << " " << inteta << " " << intphi
42  << " " << depth << " toAaa= " << toAdd
43  <<" phase = " << fixedphase_ns << " ampl = "
44  << fc_ampl
45  << std::endl;
46  */
47 
48  return get(detId, toAdd, fixedphase_ns)->getCorrection(fc_ampl);
49 }
50 
52  int toAdd,
53  float fixedphase_ns) {
54  // const HcalPulseShape * shape = &(shapes_.shape(detId));
55  const HcalPulseShape* shape = &(shapes_.shapeForReco(detId));
56  for (std::vector<HcalPulseContainmentEntry>::const_iterator entryItr = entries_.begin(); entryItr != entries_.end();
57  ++entryItr) {
58  if (entryItr->shape_ == shape && entryItr->toAdd_ == toAdd && entryItr->fixedphase_ns_ == fixedphase_ns) {
59  return &entryItr->correction_;
60  }
61  }
62 
63  /*
64  int sub = detId.subdet();
65  int depth = detId.depth();
66  int inteta = detId.ieta();
67  int intphi = detId.iphi();
68 
69  std::cout << "* HcalPulseContainmentManager::get new entry, cell:"
70  << " sub, ieta, iphi, depth = "
71  << sub << " " << inteta << " " << intphi
72  << " " << depth
73  << std::endl;
74  */
75 
76  // didn't find it. Make one.
78  toAdd,
79  fixedphase_ns,
80  shape,
82  entries_.push_back(entry);
83  return &(entries_.back().correction_);
84 }
const HcalPulseContainmentCorrection * get(const HcalDetId &detId, int toAdd, float fixedphase_ns)
void beginRun(edm::EventSetup const &es)
const Shape & shapeForReco(const HcalDetId &detId) const
double correction(const HcalDetId &detId, int toAdd, float fixedphase_ns, double fc_ampl)
std::vector< HcalPulseContainmentEntry > entries_
const edm::ESGetToken< HcalTimeSlew, HcalTimeSlewRecord > delayToken_
bool getData(T &iHolder) const
Definition: EventSetup.h:128
HcalPulseContainmentManager(float max_fracerror, bool phaseAsInSim)
Transition
Definition: Transition.h:12
void beginRun(edm::EventSetup const &es)
list entry
Definition: mps_splice.py:68
ESGetTokenH3DDVariant esConsumes(std::string const &Reccord, edm::ConsumesCollector &)
Definition: DeDxTools.cc:283