32 for (
const auto&
token : ecToken_)
33 ecpar_.emplace_back(es.getHandle(
token));
41 int k =
static_cast<int>(
std::find(name_, name_ + num_, iname) - name_);
42 auto const& par = ((k < num_) && ecpar_[k].
isValid()) ? ecpar_[k].product() :
nullptr;
43 auto sd = std::make_unique<ECalSD>(iname, par, clg,
p, man);
49 static constexpr
unsigned int nameSize_ = 3;
50 const std::string name_[nameSize_] = {
"EcalHitsEB",
"EcalHitsEE",
"EcalHitsES"};
52 std::vector<edm::ESGetToken<EcalSimulationParameters, IdealGeometryRecord>>
ecToken_;
53 std::vector<edm::ESHandle<EcalSimulationParameters>>
ecpar_;
std::vector< edm::ESGetToken< EcalSimulationParameters, IdealGeometryRecord > > ecToken_
T getUntrackedParameter(std::string const &, T const &) const
EcalSensitiveDetectorBuilder(edm::ParameterSet const &p, edm::ConsumesCollector cc)
const bool isValid(const Frame &aFrame, const FrameQuality &aQuality, const uint16_t aExpectedPos)
const std::string name_[nameSize_]
std::unique_ptr< SensitiveDetector > make(const std::string &iname, const SensitiveDetectorCatalog &clg, const edm::ParameterSet &p, const SimTrackManager *man, SimActivityRegistry ®) const final
void find(edm::Handle< EcalRecHitCollection > &hits, DetId thisDet, std::vector< EcalRecHitCollection::const_iterator > &hit, bool debug=false)
static void enroll(SimActivityRegistry &iReg, T *iObj)
#define DEFINE_SENSITIVEDETECTORBUILDER(type, name)
void beginRun(const edm::EventSetup &es) final
T getParameter(std::string const &) const
ECalSD EcalSensitiveDetector
std::vector< edm::ESHandle< EcalSimulationParameters > > ecpar_