CMS 3D CMS Logo

HGCalTriggerGeometryESProducer.cc
Go to the documentation of this file.
1 
2 #include <memory>
3 
8 
10 
12 
14 public:
17 
18  typedef std::unique_ptr<HGCalTriggerGeometryBase> ReturnType;
19 
20  ReturnType produce(const CaloGeometryRecord&);
21 
22 private:
25 };
26 
28  : geometry_config_(iConfig.getParameterSet("TriggerGeometry")),
29  geometry_name_(geometry_config_.getParameter<std::string>("TriggerGeometryName")) {
30  setWhatProduced(this);
31 }
32 
34  // do anything here that needs to be done at desctruction time
35  // (e.g. close files, deallocate resources etc.)
36 }
37 
39  //using namespace edm::es;
41  geometry->reset();
42  edm::ESHandle<CaloGeometry> calo_geometry;
43  iRecord.get(calo_geometry);
44  // Initialize trigger geometry for V7/V8 HGCAL geometry
45  if (calo_geometry.isValid() && calo_geometry->getSubdetectorGeometry(DetId::Forward, HGCEE) &&
46  calo_geometry->getSubdetectorGeometry(DetId::Forward, HGCHEF) &&
48  geometry->initialize(calo_geometry);
49  }
50  // Initialize trigger geometry for V9 HGCAL geometry
51  else {
52  edm::ESHandle<HGCalGeometry> ee_geometry;
53  edm::ESHandle<HGCalGeometry> hsi_geometry;
54  edm::ESHandle<HGCalGeometry> hsc_geometry;
55  iRecord.getRecord<IdealGeometryRecord>().get("HGCalEESensitive", ee_geometry);
56  iRecord.getRecord<IdealGeometryRecord>().get("HGCalHESiliconSensitive", hsi_geometry);
57  iRecord.getRecord<IdealGeometryRecord>().get("HGCalHEScintillatorSensitive", hsc_geometry);
58  geometry->initialize(ee_geometry, hsi_geometry, hsc_geometry);
59  }
60  return geometry;
61 }
62 
63 //define this as a plug-in
ReturnType produce(const CaloGeometryRecord &)
const CaloSubdetectorGeometry * getSubdetectorGeometry(const DetId &id) const
access the subdetector geometry for the given subdetector directly
Definition: CaloGeometry.cc:49
auto setWhatProduced(T *iThis, const es::Label &iLabel={})
Definition: ESProducer.h:124
def create(alignables, pedeDump, additionalData, outputFile, config)
HGCalTriggerGeometryESProducer(const edm::ParameterSet &)
ParameterSet const & getParameterSet(ParameterSetID const &id)
ProductT const & get(ESGetToken< ProductT, DepRecordT > const &iToken) const
#define DEFINE_FWK_EVENTSETUP_MODULE(type)
Definition: ModuleFactory.h:60
std::unique_ptr< HGCalTriggerGeometryBase > ReturnType
ESHandle< TrackerGeometry > geometry
bool isValid() const
Definition: ESHandle.h:44
T get(const Candidate &c)
Definition: component.h:55