CMS 3D CMS Logo

HGCalTriggerGeometryESProducer.cc
Go to the documentation of this file.
1 
2 #include <memory>
3 
7 
9 
11 
13 public:
16 
17  typedef std::unique_ptr<HGCalTriggerGeometryBase> ReturnType;
18 
20 
21 private:
29 };
30 
32  : geometry_config_(iConfig.getParameterSet("TriggerGeometry")),
33  geometry_name_(geometry_config_.getParameter<std::string>("TriggerGeometryName")) {
34  auto cc = setWhatProduced(this);
35  ee_geometry_token_ = cc.consumes(edm::ESInputTag{"", "HGCalEESensitive"});
36  hsi_geometry_token_ = cc.consumes(edm::ESInputTag{"", "HGCalHESiliconSensitive"});
37  hsc_geometry_token_ = cc.consumes(edm::ESInputTag{"", "HGCalHEScintillatorSensitive"});
38  nose_geometry_token_ = cc.consumes(edm::ESInputTag{"", "HGCalHFNoseSensitive"});
39 }
40 
42  // do anything here that needs to be done at desctruction time
43  // (e.g. close files, deallocate resources etc.)
44 }
45 
48 
49  // Initialization with or without nose geometry
50  if (iRecord.getHandle(nose_geometry_token_)) {
51  geometry->setWithNoseGeometry(true);
52  geometry->initialize(&iRecord.get(ee_geometry_token_),
53  &iRecord.get(hsi_geometry_token_),
54  &iRecord.get(hsc_geometry_token_),
55  &iRecord.get(nose_geometry_token_));
56  } else {
57  geometry->initialize(
58  &iRecord.get(ee_geometry_token_), &iRecord.get(hsi_geometry_token_), &iRecord.get(hsc_geometry_token_));
59  }
60  return geometry;
61 }
62 
63 // define this as a plug-in
ReturnType produce(const CaloGeometryRecord &)
auto setWhatProduced(T *iThis, const es::Label &iLabel={})
Definition: ESProducer.h:163
def create(alignables, pedeDump, additionalData, outputFile, config)
HGCalTriggerGeometryESProducer(const edm::ParameterSet &)
uint32_t cc[maxCellsPerHit]
Definition: gpuFishbone.h:49
edm::ESGetToken< HGCalGeometry, IdealGeometryRecord > nose_geometry_token_
ESHandle< ProductT > getHandle(ESGetToken< ProductT, DepRecordT > const &iToken) const
#define DEFINE_FWK_EVENTSETUP_MODULE(type)
Definition: ModuleFactory.h:61
edm::ESGetToken< HGCalGeometry, IdealGeometryRecord > hsi_geometry_token_
std::unique_ptr< HGCalTriggerGeometryBase > ReturnType
ParameterSet const & getParameterSet(ParameterSetID const &id)
edm::ESGetToken< HGCalGeometry, IdealGeometryRecord > hsc_geometry_token_
#define get
ProductT const & get(ESGetToken< ProductT, DepRecordT > const &iToken) const
edm::ESGetToken< HGCalGeometry, IdealGeometryRecord > ee_geometry_token_