CMS 3D CMS Logo

PCaloGeometryBuilder.cc
Go to the documentation of this file.
5 
16 
17 class PCaloGeometryBuilder : public edm::one::EDAnalyzer<edm::one::WatchRuns> {
18 public:
20  : m_ecalE(pset.getUntrackedParameter<bool>("EcalE", true)),
21  m_ecalP(pset.getUntrackedParameter<bool>("EcalP", true)),
22  m_hgcal(pset.getUntrackedParameter<bool>("HGCal", false)) {
23  const std::string toDB("_toDB");
24  ebGeomToken_ = esConsumes<edm::Transition::BeginRun>(edm::ESInputTag("", EcalBarrelGeometry::producerTag() + toDB));
25  eeGeomToken_ = esConsumes<edm::Transition::BeginRun>(edm::ESInputTag("", EcalEndcapGeometry::producerTag() + toDB));
26  esGeomToken_ =
27  esConsumes<edm::Transition::BeginRun>(edm::ESInputTag("", EcalPreshowerGeometry::producerTag() + toDB));
28  hgcalGeomToken_ = esConsumes<edm::Transition::BeginRun>(edm::ESInputTag("", HGCalGeometry::producerTag() + toDB));
29  hcalGeomToken_ = esConsumes<edm::Transition::BeginRun>(edm::ESInputTag("", HcalGeometry::producerTag() + toDB));
30  ctGeomToken_ = esConsumes<edm::Transition::BeginRun>(edm::ESInputTag("", CaloTowerGeometry::producerTag() + toDB));
31  zdcGeomToken_ = esConsumes<edm::Transition::BeginRun>(edm::ESInputTag("", ZdcGeometry::producerTag() + toDB));
32  castGeomToken_ = esConsumes<edm::Transition::BeginRun>(edm::ESInputTag("", CastorGeometry::producerTag() + toDB));
33  }
34 
35  void beginRun(edm::Run const& iEvent, edm::EventSetup const&) override;
36  void analyze(edm::Event const& iEvent, edm::EventSetup const&) override {}
37  void endRun(edm::Run const& iEvent, edm::EventSetup const&) override {}
38 
39 private:
40  bool m_ecalE;
41  bool m_ecalP;
42  bool m_hgcal;
51 };
52 
54  edm::LogInfo("PCaloGeometryBuilder") << "Writing out " << EcalBarrelGeometry::producerTag() << std::endl;
55  auto pGeb = es.getHandle(ebGeomToken_);
56  if (m_ecalE) {
57  edm::LogInfo("PCaloGeometryBuilder") << "Writing out " << EcalEndcapGeometry::producerTag() << std::endl;
58  auto pGeb = es.getHandle(eeGeomToken_);
59  }
60 
61  if (m_ecalP) {
62  edm::LogInfo("PCaloGeometryBuilder") << "Writing out " << EcalPreshowerGeometry::producerTag() << std::endl;
63  auto pGes = es.getHandle(esGeomToken_);
64  }
65 
66  if (m_hgcal) {
67  edm::LogInfo("PCaloGeometryBuilder") << "Writing out " << HGCalGeometry::producerTag() << std::endl;
68  auto pGhgcal = es.getHandle(hgcalGeomToken_);
69  ;
70  }
71 
72  edm::LogInfo("PCaloGeometryBuilder") << "Writing out " << HcalGeometry::producerTag() << std::endl;
73  auto pGhcal = es.getHandle(hcalGeomToken_);
74 
75  edm::LogInfo("PCaloGeometryBuilder") << "Writing out " << CaloTowerGeometry::producerTag() << std::endl;
76  auto pGct = es.getHandle(ctGeomToken_);
77 
78  edm::LogInfo("PCaloGeometryBuilder") << "Writing out " << ZdcGeometry::producerTag() << std::endl;
79  auto pGzdc = es.getHandle(zdcGeomToken_);
80 
81  edm::LogInfo("PCaloGeometryBuilder") << "Writing out " << CastorGeometry::producerTag() << std::endl;
82  auto pGcast = es.getHandle(castGeomToken_);
83 }
84 
edm::ESGetToken< CaloSubdetectorGeometry, EcalEndcapGeometry::AlignedRecord > eeGeomToken_
edm::ESGetToken< CaloSubdetectorGeometry, EcalPreshowerGeometry::AlignedRecord > esGeomToken_
static std::string producerTag()
Definition: ZdcGeometry.h:45
edm::ESGetToken< CaloSubdetectorGeometry, ZdcGeometry::AlignedRecord > zdcGeomToken_
edm::ESGetToken< CaloSubdetectorGeometry, CastorGeometry::AlignedRecord > castGeomToken_
static std::string producerTag()
static std::string producerTag()
Definition: HcalGeometry.h:65
static std::string producerTag()
void beginRun(edm::Run const &iEvent, edm::EventSetup const &) override
static std::string producerTag()
void endRun(edm::Run const &iEvent, edm::EventSetup const &) override
static std::string producerTag()
PCaloGeometryBuilder(const edm::ParameterSet &pset)
edm::ESGetToken< CaloSubdetectorGeometry, HGCalGeometry::AlignedRecord > hgcalGeomToken_
int iEvent
Definition: GenABIO.cc:224
#define DEFINE_FWK_MODULE(type)
Definition: MakerMacros.h:16
ESHandle< T > getHandle(const ESGetToken< T, R > &iToken) const
Definition: EventSetup.h:130
static std::string producerTag()
Log< level::Info, false > LogInfo
edm::ESGetToken< CaloSubdetectorGeometry, EcalBarrelGeometry::AlignedRecord > ebGeomToken_
static std::string producerTag()
edm::ESGetToken< CaloSubdetectorGeometry, HcalGeometry::AlignedRecord > hcalGeomToken_
void analyze(edm::Event const &iEvent, edm::EventSetup const &) override
edm::ESGetToken< CaloSubdetectorGeometry, CaloTowerGeometry::AlignedRecord > ctGeomToken_
Definition: Run.h:45