CMS 3D CMS Logo

SiStripLorentzAngle.cc
Go to the documentation of this file.
4 
5 bool SiStripLorentzAngle::putLorentzAngle(const uint32_t& detid, float value) {
6  std::map<unsigned int, float>::const_iterator id = m_LA.find(detid);
7  if (id != m_LA.end()) {
8  edm::LogError("SiStripLorentzAngle") << "SiStripLorentzAngle for DetID " << detid
9  << " is already stored. Skippig this put" << std::endl;
10  return false;
11  } else
12  m_LA[detid] = value;
13  return true;
14 }
15 float SiStripLorentzAngle::getLorentzAngle(const uint32_t& detid) const {
16  std::map<unsigned int, float>::const_iterator id = m_LA.find(detid);
17  if (id != m_LA.end())
18  return id->second;
19  else {
20  edm::LogError("SiStripLorentzAngle") << "SiStripLorentzAngle for DetID " << detid << " is not stored" << std::endl;
21  }
22  return 0;
23 }
24 
25 void SiStripLorentzAngle::printDebug(std::stringstream& ss, const TrackerTopology* /*trackerTopo*/) const {
26  std::map<unsigned int, float> detid_la = getLorentzAngles();
27  std::map<unsigned int, float>::const_iterator it;
28  size_t count = 0;
29  ss << "SiStripLorentzAngleReader:" << std::endl;
30  ss << "detid \t Lorentz angle" << std::endl;
31  for (it = detid_la.begin(); it != detid_la.end(); ++it) {
32  ss << it->first << "\t" << it->second << std::endl;
33  ++count;
34  }
35 }
36 
37 void SiStripLorentzAngle::printSummary(std::stringstream& ss, const TrackerTopology* trackerTopo) const {
38  std::map<unsigned int, float> detid_la = getLorentzAngles();
39  std::map<unsigned int, float>::const_iterator it;
40 
41  SiStripDetSummary summary{trackerTopo};
42 
43  for (it = detid_la.begin(); it != detid_la.end(); ++it) {
44  DetId detid(it->first);
45  float value = it->second;
46  summary.add(detid, value);
47  }
48  ss << "Summary of lorentz angles:" << std::endl;
49  summary.print(ss);
50 }
std::map< unsigned int, float > m_LA
void printSummary(std::stringstream &ss, const TrackerTopology *trackerTopo) const
Prints the mean value of the LorentzAngle divided by subdetector, layer and mono/stereo.
const std::map< unsigned int, float > & getLorentzAngles() const
bool putLorentzAngle(const uint32_t &, float)
float getLorentzAngle(const uint32_t &) const
Definition: value.py:1
Definition: DetId.h:17
void printDebug(std::stringstream &ss, const TrackerTopology *trackerTopo) const
Prints LorentzAngles for all detIds.