CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
APDShape.cc
Go to the documentation of this file.
1 #include <cmath>
2 
4 
5 #include <cassert>
6 
7 void APDShape::fillShape(float& time_interval,
8  double& m_thresh,
10  const edm::EventSetup* es) const {
11  if (m_useDBShape) {
12  if (es == nullptr) {
13  throw cms::Exception("EcalShapeBase:: DB conditions are not available, const edm::EventSetup* es == nullptr ");
14  }
15  auto const& esps = es->getData(espsToken_);
16 
17  aVec = esps.apd_shape;
18  time_interval = esps.time_interval;
19  m_thresh = esps.apd_thresh;
20  } else {
21  m_thresh = 0.0;
22  time_interval = 1.0;
23  aVec.reserve(500);
24  const double m_tStart = 74.5;
25  const double m_tau = 40.5;
26 
27  for (unsigned int i(0); i != 500; ++i) {
28  const double ctime((1. * i + 0.5 - m_tStart) / m_tau);
29  double val = 0 > ctime ? 0 : ctime * exp(1. - ctime);
30  aVec.push_back(val);
31  }
32  }
33 }
Exp< T >::type exp(const T &t)
Definition: Exp.h:22
void fillShape(float &time_interval, double &m_thresh, EcalShapeBase::DVec &aVec, const edm::EventSetup *es) const override
Definition: APDShape.cc:7
bool getData(T &iHolder) const
Definition: EventSetup.h:122
std::vector< double > DVec
Definition: EcalShapeBase.h:26
edm::ESGetToken< EcalSimPulseShape, EcalSimPulseShapeRcd > espsToken_
Definition: APDShape.h:21