CMS 3D CMS Logo

FastTimeParametersESModule.cc
Go to the documentation of this file.
10 
11 //#define EDM_ML_DEBUG
12 
14 public:
16  ~FastTimeParametersESModule(void) override;
17 
18  using ReturnType = std::unique_ptr<FastTimeParameters>;
19 
21 
23 
24 private:
26  std::vector<std::string> name_;
27  std::vector<int> type_;
28 };
29 
31  : cpvToken_{setWhatProduced(this).consumes<DDCompactView>(edm::ESInputTag{})} {
32  name_ = iC.getUntrackedParameter<std::vector<std::string> >("Names");
33  type_ = iC.getUntrackedParameter<std::vector<int> >("Types");
34 #ifdef EDM_ML_DEBUG
35  edm::LogVerbatim("HGCalGeom") << "FastTimeParametersESModule for " << name_.size() << " types:";
36  for (unsigned int k = 0; k < name_.size(); ++k)
37  edm::LogVerbatim("HGCalGeom") << " [" << k << "] " << name_[k] << ":" << type_[k];
38 #endif
39 }
40 
42 
44  edm::LogVerbatim("HGCalGeom") << "FastTimeParametersESModule::produce(const IdealGeometryRecord& iRecord)";
46 
47  auto ptp = std::make_unique<FastTimeParameters>();
49  for (unsigned int k = 0; k < name_.size(); ++k)
50  builder.build(cpv.product(), *ptp, name_[k], type_[k]);
51 
52 #ifdef EDM_ML_DEBUG
53  edm::LogVerbatim("HGCalGeom") << "FastTimeParametersESModule:: Barrel Parameters: "
54  << " number of cells along z|phi = " << ptp->nZBarrel_ << "|" << ptp->nPhiBarrel_
55  << " Geometry parameters:";
56  for (unsigned k = 0; k < ptp->geomParBarrel_.size(); ++k)
57  edm::LogVerbatim("HGCalGeom") << "[" << k << "] " << ptp->geomParBarrel_[k];
58  edm::LogVerbatim("HGCalGeom") << "FastTimeParametersESModule:: Endcap Parameters: "
59  << " number of cells along eta|phi = " << ptp->nEtaEndcap_ << "|" << ptp->nPhiEndcap_
60  << " Geometry parameters:";
61  for (unsigned k = 0; k < ptp->geomParEndcap_.size(); ++k)
62  edm::LogVerbatim("HGCalGeom") << "[" << k << "] " << ptp->geomParEndcap_[k];
63 #endif
64  return ptp;
65 }
66 
67 // define this as a plug-in
ESTransientHandle< ProductT > getTransientHandle(ESGetToken< ProductT, DepRecordT > const &iToken) const
Log< level::Info, true > LogVerbatim
auto setWhatProduced(T *iThis, const es::Label &iLabel={})
Definition: ESProducer.h:163
FastTimeParametersESModule(const edm::ParameterSet &)
Compact representation of the geometrical detector hierarchy.
Definition: DDCompactView.h:81
edm::ESGetToken< DDCompactView, IdealGeometryRecord > cpvToken_
bool build(const DDCompactView *, FastTimeParameters &, const std::string &, const int)
std::unique_ptr< FastTimeParameters > ReturnType
#define DEFINE_FWK_EVENTSETUP_MODULE(type)
Definition: ModuleFactory.h:60
T const * product() const
ReturnType produce(const IdealGeometryRecord &)
static void fillDescriptions(edm::ConfigurationDescriptions &)
std::vector< std::string > name_