CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros 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
 Prints BackPlaneCorrections for all detIds. More...
 
void printSummary (std::stringstream &ss) 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 30 of file SiStripBackPlaneCorrection.h.

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

Definition at line 31 of file SiStripBackPlaneCorrection.h.

31 {};

Member Function Documentation

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

Definition at line 14 of file SiStripBackPlaneCorrection.cc.

References m_BPC.

Referenced by StripCPE::fillParams().

14  {
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 }
std::map< unsigned int, float > m_BPC
const std::map<unsigned int,float>& SiStripBackPlaneCorrection::getBackPlaneCorrections ( ) const
inline
void SiStripBackPlaneCorrection::printDebug ( std::stringstream &  ss) const

Prints BackPlaneCorrections for all detIds.

Definition at line 23 of file SiStripBackPlaneCorrection.cc.

References prof2calltree::count, getBackPlaneCorrections(), and SiStripDetId::moduleGeometry().

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 }
const std::map< unsigned int, float > & getBackPlaneCorrections() const
Detector identifier class for the strip tracker.
Definition: SiStripDetId.h:17
void SiStripBackPlaneCorrection::printSummary ( std::stringstream &  ss) const

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

Definition at line 38 of file SiStripBackPlaneCorrection.cc.

References SiStripDetSummary::add(), cond::rpcobgas::detid, getBackPlaneCorrections(), SiStripDetSummary::print(), 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 
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 }
const std::map< unsigned int, float > & getBackPlaneCorrections() const
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...
bool SiStripBackPlaneCorrection::putBackPlaneCorrection ( const uint32_t &  detid,
float  value 
)

Definition at line 5 of file SiStripBackPlaneCorrection.cc.

References cond::rpcobgas::detid, m_BPC, and relativeConstraints::value.

Referenced by SiStripBackplaneCalibration::createFromTree(), SiStripBackPlaneCorrectionGenerator::createObject(), and SiStripBackplaneCalibration::endOfJob().

5  {
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 }
std::map< unsigned int, float > m_BPC
void SiStripBackPlaneCorrection::putLorentsAngles ( std::map< unsigned int, float > &  BPC)
inline

Definition at line 33 of file SiStripBackPlaneCorrection.h.

References m_BPC.

33 {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 47 of file SiStripBackPlaneCorrection.h.

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

Definition at line 47 of file SiStripBackPlaneCorrection.h.

Member Data Documentation

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