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 << " is already stored. Skippig this put" << std::endl;
9  return false;
10  }
11  else m_LA[detid]=value;
12  return true;
13 }
14 float SiStripLorentzAngle::getLorentzAngle(const uint32_t& detid) const {
15  std::map<unsigned int,float>::const_iterator id=m_LA.find(detid);
16  if(id!=m_LA.end()) return id->second;
17  else {
18  edm::LogError("SiStripLorentzAngle") << "SiStripLorentzAngle for DetID " << detid << " is not stored" << std::endl;
19  }
20  return 0;
21 }
22 
23 void SiStripLorentzAngle::printDebug(std::stringstream& ss) const
24 {
25  std::map<unsigned int,float> detid_la = getLorentzAngles();
26  std::map<unsigned int,float>::const_iterator it;
27  size_t count=0;
28  ss << "SiStripLorentzAngleReader:" << std::endl;
29  ss << "detid \t Lorentz angle" << std::endl;
30  for( it=detid_la.begin(); it!=detid_la.end(); ++it ) {
31  ss << it->first << "\t" << it->second << std::endl;
32  ++count;
33  }
34 }
35 
36 void SiStripLorentzAngle::printSummary(std::stringstream& ss) const
37 {
38  std::map<unsigned int,float> detid_la = getLorentzAngles();
39  std::map<unsigned int,float>::const_iterator it;
40 
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 
51 }
std::map< unsigned int, float > m_LA
bool putLorentzAngle(const uint32_t &, float)
const std::map< unsigned int, float > & getLorentzAngles() const
float getLorentzAngle(const uint32_t &) const
Definition: value.py:1
void print(std::stringstream &ss, const bool mean=true) const
Definition: DetId.h:18
void add(const DetId &detid, const float &value)
Used to compute the mean value of the value variable divided by subdetector, layer and mono/stereo...
void printDebug(std::stringstream &ss) const
Prints LorentzAngles for all detIds.
void printSummary(std::stringstream &ss) const
Prints the mean value of the LorentzAngle divided by subdetector, layer and mono/stereo.