CMS 3D CMS Logo

SiStripLorentzAngleReader.cc
Go to the documentation of this file.
1 // system include files
2 #include <iostream>
3 #include <cstdio>
4 #include <sys/time.h>
5 
6 // user include files
16 
17 //
18 //
19 // class decleration
20 //
22 public:
24  ~SiStripLorentzAngleReader() override = default;
25 
26  void analyze(const edm::Event&, const edm::EventSetup&) override;
27 
28 private:
29  uint32_t printdebug_;
32 };
33 
34 using namespace cms;
35 
37  : printdebug_(iConfig.getUntrackedParameter<uint32_t>("printDebug", 5)),
38  label_(iConfig.getUntrackedParameter<std::string>("label", "")),
39  laToken_(esConsumes(edm::ESInputTag{"", label_})) {}
40 
42  const auto& lorentzAngles = iSetup.getData(laToken_);
43  edm::LogInfo("SiStripLorentzAngleReader")
44  << "[SiStripLorentzAngleReader::analyze] End Reading SiStripLorentzAngle with label " << label_ << std::endl;
45 
46  std::map<unsigned int, float> detid_la = lorentzAngles.getLorentzAngles();
47  std::map<unsigned int, float>::const_iterator it;
48  size_t count = 0;
49  for (it = detid_la.begin(); it != detid_la.end() && count < printdebug_; it++) {
50  edm::LogInfo("SiStripLorentzAngleReader") << "detid " << it->first << " \t"
51  << " Lorentz angle " << it->second;
52  count++;
53  }
54 }
55 
58 
ESGetTokenH3DDVariant esConsumes(std::string const &Record, edm::ConsumesCollector &)
Definition: DeDxTools.cc:283
#define DEFINE_FWK_MODULE(type)
Definition: MakerMacros.h:16
bool getData(T &iHolder) const
Definition: EventSetup.h:122
void analyze(const edm::Event &, const edm::EventSetup &) override
Namespace of DDCMS conversion namespace.
Log< level::Info, false > LogInfo
const edm::ESGetToken< SiStripLorentzAngle, SiStripLorentzAngleRcd > laToken_
~SiStripLorentzAngleReader() override=default
HLT enums.
SiStripLorentzAngleReader(const edm::ParameterSet &)