CMS 3D CMS Logo

All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Modules Pages
HcalTBParameterTester.cc
Go to the documentation of this file.
1 #include <iostream>
2 #include <map>
3 
9 
13 
15 public:
17  ~HcalTBParameterTester() override = default;
18 
19  void beginJob() override {}
20  void analyze(edm::Event const& iEvent, edm::EventSetup const&) override;
21  void endJob() override {}
22 
23 private:
27  const int mode_;
28 };
29 
31  : name_(ic.getUntrackedParameter<std::string>("Name")),
33  token2_(esConsumes<HcalTB06BeamParameters, IdealGeometryRecord>(edm::ESInputTag{})),
34  mode_(ic.getUntrackedParameter<int>("Mode")) {}
35 
37  if (mode_ == 0) {
38  const auto& hcp = iSetup.getData(token1_);
39  const auto* php = &hcp;
40  edm::LogVerbatim("HCalGeom") << "TB02Parameters for " << name_;
41  edm::LogVerbatim("HCalGeom") << "Length map with " << php->lengthMap_.size() << " elements";
42  std::map<std::string, double>::const_iterator itr = php->lengthMap_.begin();
43  int i(0);
44  for (; itr != php->lengthMap_.end(); ++itr, ++i)
45  edm::LogVerbatim("HCalGeom") << "[" << i << "] " << itr->first << " " << itr->second << " mm";
46  } else {
47  const auto& hcp = iSetup.getData(token2_);
48  const auto* php = &hcp;
49  edm::LogVerbatim("HCalGeom") << "TB06BeamParameters:: Material " << php->material_;
50  edm::LogVerbatim("HCalGeom") << "TB06BeamParameters:: " << php->wchambers_.size() << " wire chambers:";
51  for (unsigned int k = 0; k < php->wchambers_.size(); ++k)
52  edm::LogVerbatim("HCalGeom") << "[" << k << "] " << php->wchambers_[k];
53  }
54 }
55 
Log< level::Info, true > LogVerbatim
ESGetTokenH3DDVariant esConsumes(std::string const &Record, edm::ConsumesCollector &)
Definition: DeDxTools.cc:283
T const & getData(const ESGetToken< T, R > &iToken) const noexcept(false)
Definition: EventSetup.h:119
int iEvent
Definition: GenABIO.cc:224
void analyze(edm::Event const &iEvent, edm::EventSetup const &) override
#define DEFINE_FWK_MODULE(type)
Definition: MakerMacros.h:16
edm::ESGetToken< HcalTB06BeamParameters, IdealGeometryRecord > token2_
edm::ESGetToken< HcalTB02Parameters, IdealGeometryRecord > token1_
HLT enums.
HcalTBParameterTester(const edm::ParameterSet &)
~HcalTBParameterTester() override=default