CMS 3D CMS Logo

HcalTBParameterTester.cc
Go to the documentation of this file.
1 #include <iostream>
2 #include <map>
3 
8 
12 
14 public:
16  ~HcalTBParameterTester() override {}
17 
18  void beginJob() override {}
19  void analyze(edm::Event const& iEvent, edm::EventSetup const&) override;
20  void endJob() override {}
21 
22 private:
26  const int mode_;
27 };
28 
30  : name_(ic.getUntrackedParameter<std::string>("Name")),
32  token2_(esConsumes<HcalTB06BeamParameters, IdealGeometryRecord>(edm::ESInputTag{})),
33  mode_(ic.getUntrackedParameter<int>("Mode")) {}
34 
36  if (mode_ == 0) {
37  const auto& hcp = iSetup.getData(token1_);
38  const auto* php = &hcp;
39  std::cout << "TB02Parameters for " << name_ << "\n";
40  std::cout << "Length map with " << php->lengthMap_.size() << " elements\n";
41  std::map<std::string, double>::const_iterator itr = php->lengthMap_.begin();
42  int i(0);
43  for (; itr != php->lengthMap_.end(); ++itr, ++i)
44  std::cout << "[" << i << "] " << itr->first << " " << itr->second << " mm\n";
45  } else {
46  const auto& hcp = iSetup.getData(token2_);
47  const auto* php = &hcp;
48  std::cout << "TB06BeamParameters:: Material " << php->material_ << "\n";
49  std::cout << "TB06BeamParameters:: " << php->wchambers_.size() << " wire chambers:\n";
50  for (unsigned int k = 0; k < php->wchambers_.size(); ++k)
51  std::cout << "[" << k << "] " << php->wchambers_[k] << "\n";
52  }
53 }
54 
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 &)