CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
List of all members | Public Member Functions | Private Member Functions | Private Attributes | Friends
SiStripBackPlaneCorrection Class Reference

#include <SiStripBackPlaneCorrection.h>

Public Member Functions

float getBackPlaneCorrection (const uint32_t &) const
 
const std::map< unsigned int,
float > & 
getBackPlaneCorrections () const
 
void printDebug (std::stringstream &ss, const TrackerTopology *trackerTopo) const
 Prints BackPlaneCorrections for all detIds. More...
 
void printSummary (std::stringstream &ss, const TrackerTopology *trackerTopo) const
 Prints the mean value of the BackPlaneCorrection divided by subdetector, layer and mono/stereo. More...
 
bool putBackPlaneCorrection (const uint32_t &, float)
 
void putLorentsAngles (std::map< unsigned int, float > &BPC)
 
 SiStripBackPlaneCorrection ()
 
 ~SiStripBackPlaneCorrection ()
 

Private Member Functions

template<class Archive >
void serialize (Archive &ar, const unsigned int version)
 

Private Attributes

std::map< unsigned int, float > m_BPC
 

Friends

class boost::serialization::access
 
template<typename CondSerializationT , typename Enabled >
struct cond::serialization::access
 

Detailed Description

Author: Loic Quertenmont. THis class is adapted from SiStripLorentzAngle Stores the lorentz angle value for all DetIds.
The values are saved internally in a std::map<detid, float backPlaneCorrection>.
It can be filled either by the complete map (putBackPlaneCorrections) or passing a single detIds and lorentzAngles (putBackPlaneCorrection).
In the same way getBackPlaneCorrections returns the complete map, while getBackPlaneCorrection the value corresponding to a given DetId.
The printDebug method prints BackPlaneCorrections for all detIds.
The printSummary mehtod uses the SiStripDetSummary class to produce a summary of BackPlaneCorrection values divided by subdetector and layer/disk.

Definition at line 27 of file SiStripBackPlaneCorrection.h.

Constructor & Destructor Documentation

SiStripBackPlaneCorrection::SiStripBackPlaneCorrection ( )
inline

Definition at line 29 of file SiStripBackPlaneCorrection.h.

29 {};
SiStripBackPlaneCorrection::~SiStripBackPlaneCorrection ( )
inline

Definition at line 30 of file SiStripBackPlaneCorrection.h.

30 {};

Member Function Documentation

float SiStripBackPlaneCorrection::getBackPlaneCorrection ( const uint32_t &  detid) const

Definition at line 15 of file SiStripBackPlaneCorrection.cc.

References m_BPC.

Referenced by StripCPE::fillParams().

15  {
16  std::map<unsigned int, float>::const_iterator id = m_BPC.find(detid);
17  if (id != m_BPC.end())
18  return id->second;
19  else {
20  edm::LogError("SiStripBackPlaneCorrection")
21  << "SiStripBackPlaneCorrection for DetID " << detid << " is not stored" << std::endl;
22  }
23  return 0;
24 }
std::map< unsigned int, float > m_BPC
const std::map<unsigned int, float>& SiStripBackPlaneCorrection::getBackPlaneCorrections ( ) const
inline
void SiStripBackPlaneCorrection::printDebug ( std::stringstream &  ss,
const TrackerTopology trackerTopo 
) const

Prints BackPlaneCorrections for all detIds.

Definition at line 26 of file SiStripBackPlaneCorrection.cc.

References submitPVResolutionJobs::count, getBackPlaneCorrections(), and TrackerTopology::moduleGeometry().

26  {
27  std::map<unsigned int, float> detid_la = getBackPlaneCorrections();
28  std::map<unsigned int, float>::const_iterator it;
29  size_t count = 0;
30  ss << "SiStripBackPlaneCorrectionReader:" << std::endl;
31  ss << "detid \t Geometry \t Back Plane Corrections" << std::endl;
32  for (it = detid_la.begin(); it != detid_la.end(); ++it) {
33  ss << it->first << "\t" << static_cast<int>(trackerTopo->moduleGeometry(it->first)) << "\t" << it->second
34  << std::endl;
35  ++count;
36  }
37 }
const std::map< unsigned int, float > & getBackPlaneCorrections() const
SiStripModuleGeometry moduleGeometry(const DetId &id) const
void SiStripBackPlaneCorrection::printSummary ( std::stringstream &  ss,
const TrackerTopology trackerTopo 
) const

Prints the mean value of the BackPlaneCorrection divided by subdetector, layer and mono/stereo.

Definition at line 39 of file SiStripBackPlaneCorrection.cc.

References getBackPlaneCorrections(), edmLumisInFiles::summary, and relativeConstraints::value.

39  {
40  std::map<unsigned int, float> detid_la = getBackPlaneCorrections();
41  std::map<unsigned int, float>::const_iterator it;
42 
43  SiStripDetSummary summary{trackerTopo};
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 }
const std::map< unsigned int, float > & getBackPlaneCorrections() const
Definition: DetId.h:17
bool SiStripBackPlaneCorrection::putBackPlaneCorrection ( const uint32_t &  detid,
float  value 
)

Definition at line 5 of file SiStripBackPlaneCorrection.cc.

References m_BPC, and relativeConstraints::value.

Referenced by SiStripBackplaneCalibration::createFromTree().

5  {
6  std::map<unsigned int, float>::const_iterator id = m_BPC.find(detid);
7  if (id != m_BPC.end()) {
8  edm::LogError("SiStripBackPlaneCorrection")
9  << "SiStripBackPlaneCorrection for DetID " << detid << " is already stored. Skipping this put" << std::endl;
10  return false;
11  } else
12  m_BPC[detid] = value;
13  return true;
14 }
Log< level::Error, false > LogError
std::map< unsigned int, float > m_BPC
void SiStripBackPlaneCorrection::putLorentsAngles ( std::map< unsigned int, float > &  BPC)
inline

Definition at line 32 of file SiStripBackPlaneCorrection.h.

References m_BPC.

32 { m_BPC = BPC; }
std::map< unsigned int, float > m_BPC
template<class Archive >
void SiStripBackPlaneCorrection::serialize ( Archive &  ar,
const unsigned int  version 
)
private

Friends And Related Function Documentation

friend class boost::serialization::access
friend

Definition at line 46 of file SiStripBackPlaneCorrection.h.

template<typename CondSerializationT , typename Enabled >
friend struct cond::serialization::access
friend

Definition at line 46 of file SiStripBackPlaneCorrection.h.

Member Data Documentation

std::map<unsigned int, float> SiStripBackPlaneCorrection::m_BPC
private