CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
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 
#define DEFINE_FWK_MODULE(type)
Definition: MakerMacros.h:16
bool getData(T &iHolder) const
Definition: EventSetup.h:128
void analyze(const edm::Event &, const edm::EventSetup &) override
Log< level::Info, false > LogInfo
const edm::ESGetToken< SiStripLorentzAngle, SiStripLorentzAngleRcd > laToken_
~SiStripLorentzAngleReader() override=default
SiStripLorentzAngleReader(const edm::ParameterSet &)
ESGetTokenH3DDVariant esConsumes(std::string const &Reccord, edm::ConsumesCollector &)
Definition: DeDxTools.cc:283