CMS 3D CMS Logo

ComponentShape.cc
Go to the documentation of this file.
1 #include <cmath>
2 
4 
5 void ComponentShape::fillShape(float& time_interval,
6  double& m_thresh,
8  const edm::EventSetup* es) const {
9  if (m_useDBShape) {
10  if (es == nullptr) {
11  throw cms::Exception("[ComponentShape] DB conditions are not available, const edm::EventSetup* es == nullptr ");
12  }
13  auto const& esps = es->getData(espsToken_);
14 
15  //barrel_shapes elements are vectors of floats, to save space in db
16  aVec = std::vector<double>(esps.barrel_shapes.at(shapeIndex_).begin(), esps.barrel_shapes.at(shapeIndex_).end());
17  time_interval = esps.time_interval;
18  m_thresh = esps.barrel_thresh;
19  }
20 
21  else { // fill with dummy values, since this code is only reached before the actual digi simulation
22  m_thresh = 0.00013;
23  time_interval = 1.0;
24  aVec.reserve(500);
25  for (unsigned int i(0); i != 500; ++i)
26  aVec.push_back(0.0);
27  }
28 }
29 
30 double ComponentShape::timeToRise() const { return kTimeToRise; } // hardcoded rather than computed because
31 // components need relative time shifts
T const & getData(const ESGetToken< T, R > &iToken) const noexcept(false)
Definition: EventSetup.h:119
static constexpr double kTimeToRise
std::vector< double > DVec
Definition: EcalShapeBase.h:26
void fillShape(float &time_interval, double &m_thresh, EcalShapeBase::DVec &aVec, const edm::EventSetup *es) const override
edm::ESGetToken< EcalSimComponentShape, EcalSimComponentShapeRcd > espsToken_
double timeToRise() const override