CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
SiStripBackPlaneCorrection.cc
Go to the documentation of this file.
4 
6  std::map<unsigned int,float>::const_iterator id=m_BPC.find(detid);
7  if(id!=m_BPC.end()){
8  edm::LogError("SiStripBackPlaneCorrection") << "SiStripBackPlaneCorrection for DetID " << detid << " is already stored. Skippig this put" << std::endl;
9  return false;
10  }
11  else m_BPC[detid]=value;
12  return true;
13 }
15  std::map<unsigned int,float>::const_iterator id=m_BPC.find(detid);
16  if(id!=m_BPC.end()) return id->second;
17  else {
18  edm::LogError("SiStripBackPlaneCorrection") << "SiStripBackPlaneCorrection for DetID " << detid << " is not stored" << std::endl;
19  }
20  return 0;
21 }
22 
23 void SiStripBackPlaneCorrection::printDebug(std::stringstream& ss) const
24 {
25  std::map<unsigned int,float> detid_la = getBackPlaneCorrections();
26  std::map<unsigned int,float>::const_iterator it;
27  size_t count=0;
28  ss << "SiStripBackPlaneCorrectionReader:" << std::endl;
29  ss << "detid \t Geometry \t Back Plane Corrections" << std::endl;
30  for( it=detid_la.begin(); it!=detid_la.end(); ++it ) {
31  SiStripDetId SSdetId(it->first);
32  unsigned int moduleGeometry = SSdetId.moduleGeometry();
33  ss << it->first << "\t" << moduleGeometry << "\t" << it->second << std::endl;
34  ++count;
35  }
36 }
37 
38 void SiStripBackPlaneCorrection::printSummary(std::stringstream& ss) const
39 {
40  std::map<unsigned int,float> detid_la = getBackPlaneCorrections();
41  std::map<unsigned int,float>::const_iterator it;
42 
44 
45  for( it=detid_la.begin(); it!=detid_la.end(); ++it ) {
46  DetId detid(it->first);
47  float value = it->second;
48  summary.add(detid, value);
49  }
50  ss << "Summary of BackPlane corrections:" << std::endl;
51  summary.print(ss);
52 
53 }
bool putBackPlaneCorrection(const uint32_t &, float)
void printSummary(std::stringstream &ss) const
Prints the mean value of the BackPlaneCorrection divided by subdetector, layer and mono/stereo...
const std::map< unsigned int, float > & getBackPlaneCorrections() const
float getBackPlaneCorrection(const uint32_t &) const
void print(std::stringstream &ss, const bool mean=true) const
std::map< unsigned int, float > m_BPC
Detector identifier class for the strip tracker.
Definition: SiStripDetId.h:17
Definition: DetId.h:18
void printDebug(std::stringstream &ss) const
Prints BackPlaneCorrections for all detIds.
ModuleGeometry moduleGeometry() const
Definition: SiStripDetId.h:134
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...