CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
HcalPulseContainmentManager.cc
Go to the documentation of this file.
2 
4 : entries_(),
5  shapes_(),
6  max_fracerror_(max_fracerror)
7 {
8 }
9 
10 
12 {
13 
14  shapes_.beginRun(es);
15 }
16 
17 
19 {
20  shapes_.endRun();
21 }
22 
23 
25  int toAdd, float fixedphase_ns, double fc_ampl)
26 {
27 
28  /*
29  int sub = detId.subdet();
30  int depth = detId.depth();
31  int inteta = detId.ieta();
32  int intphi = detId.iphi();
33 
34  std::cout << "* HcalPulseContainmentManager::correction, cell:"
35  << " sub, ieta, iphi, depth = "
36  << sub << " " << inteta << " " << intphi
37  << " " << depth << " toAaa= " << toAdd
38  <<" phase = " << fixedphase_ns << " ampl = "
39  << fc_ampl
40  << std::endl;
41  */
42 
43  return get(detId, toAdd, fixedphase_ns)->getCorrection(fc_ampl);
44 }
45 
46 
48 HcalPulseContainmentManager::get(const HcalDetId & detId, int toAdd, float fixedphase_ns)
49 {
50  // const HcalPulseShape * shape = &(shapes_.shape(detId));
51  const HcalPulseShape * shape = &(shapes_.shapeForReco(detId));
52  for(std::vector<HcalPulseContainmentEntry>::const_iterator entryItr = entries_.begin();
53  entryItr != entries_.end(); ++entryItr)
54  {
55  if (entryItr->shape_ == shape && entryItr->toAdd_ == toAdd && entryItr->fixedphase_ns_ == fixedphase_ns)
56  {
57  return &entryItr->correction_;
58  }
59  }
60 
61  /*
62  int sub = detId.subdet();
63  int depth = detId.depth();
64  int inteta = detId.ieta();
65  int intphi = detId.iphi();
66 
67  std::cout << "* HcalPulseContainmentManager::get new entry, cell:"
68  << " sub, ieta, iphi, depth = "
69  << sub << " " << inteta << " " << intphi
70  << " " << depth
71  << std::endl;
72  */
73 
74  // didn't find it. Make one.
75  HcalPulseContainmentEntry entry(toAdd, fixedphase_ns, shape,
76  HcalPulseContainmentCorrection(shape, toAdd, fixedphase_ns, max_fracerror_));
77  entries_.push_back(entry);
78  return &(entries_.back().correction_);
79 }
80 
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_
std::pair< std::string, MonitorElement * > entry
Definition: ME_MAP.h:8
void beginRun(edm::EventSetup const &es)
HcalPulseContainmentManager(float max_fracerror)