File indexing completed on 2024-04-06 12:29:26
0001 #include <cmath>
0002
0003 #include "SimCalorimetry/EcalSimAlgos/interface/ComponentShape.h"
0004
0005 void ComponentShape::fillShape(float& time_interval,
0006 double& m_thresh,
0007 EcalShapeBase::DVec& aVec,
0008 const edm::EventSetup* es) const {
0009 if (m_useDBShape) {
0010 if (es == nullptr) {
0011 throw cms::Exception("[ComponentShape] DB conditions are not available, const edm::EventSetup* es == nullptr ");
0012 }
0013 auto const& esps = es->getData(espsToken_);
0014
0015
0016 aVec = std::vector<double>(esps.barrel_shapes.at(shapeIndex_).begin(), esps.barrel_shapes.at(shapeIndex_).end());
0017 time_interval = esps.time_interval;
0018 m_thresh = esps.barrel_thresh;
0019 }
0020
0021 else {
0022 m_thresh = 0.00013;
0023 time_interval = 1.0;
0024 aVec.reserve(500);
0025 for (unsigned int i(0); i != 500; ++i)
0026 aVec.push_back(0.0);
0027 }
0028 }
0029
0030 double ComponentShape::timeToRise() const {
0031 return kTimeToRise;
0032 }
0033