CMS 3D CMS Logo

HGCalTriggerGeometryESProducer.cc
Go to the documentation of this file.
1 
2 #include <memory>
3 
8 
10 
12 
14 {
15  public:
18 
19  typedef std::unique_ptr<HGCalTriggerGeometryBase> ReturnType;
20 
21  ReturnType produce(const CaloGeometryRecord&);
22 
23  private:
26 };
27 
30  geometry_config_(iConfig.getParameterSet("TriggerGeometry")),
31  geometry_name_(geometry_config_.getParameter<std::string>("TriggerGeometryName"))
32 {
33  setWhatProduced(this);
34 }
35 
36 
39 {
40 
41  // do anything here that needs to be done at desctruction time
42  // (e.g. close files, deallocate resources etc.)
43 
44 }
45 
48 produce(const CaloGeometryRecord& iRecord)
49 {
50  //using namespace edm::es;
52  geometry->reset();
53  edm::ESHandle<CaloGeometry> calo_geometry;
54  iRecord.get(calo_geometry);
55  // Initialize trigger geometry for V7/V8 HGCAL geometry
56  if(calo_geometry.isValid() &&
60  )
61  {
62  geometry->initialize(calo_geometry);
63  }
64  // Initialize trigger geometry for V9 HGCAL geometry
65  else
66  {
67  edm::ESHandle<HGCalGeometry> ee_geometry;
68  edm::ESHandle<HGCalGeometry> hsi_geometry;
69  edm::ESHandle<HGCalGeometry> hsc_geometry;
70  iRecord.getRecord<IdealGeometryRecord>().get("HGCalEESensitive",ee_geometry);
71  iRecord.getRecord<IdealGeometryRecord>().get("HGCalHESiliconSensitive",hsi_geometry);
72  iRecord.getRecord<IdealGeometryRecord>().get("HGCalHEScintillatorSensitive",hsc_geometry);
73  geometry->initialize(ee_geometry, hsi_geometry, hsc_geometry);
74  }
75  return geometry;
76 
77 }
78 
79 //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:116
def create(alignables, pedeDump, additionalData, outputFile, config)
HGCalTriggerGeometryESProducer(const edm::ParameterSet &)
ParameterSet const & getParameterSet(ParameterSetID const &id)
std::unique_ptr< HGCalTriggerGeometryBase > ReturnType
#define DEFINE_FWK_EVENTSETUP_MODULE(type)
Definition: ModuleFactory.h:60
ESHandle< TrackerGeometry > geometry
bool isValid() const
Definition: ESHandle.h:45
bool get(HolderT &iHolder) const
T get(const Candidate &c)
Definition: component.h:55