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 Attributes
SiStripLorentzAngle Class Reference

#include <SiStripLorentzAngle.h>

Public Member Functions

const float & getLorentzAngle (const uint32_t &) const
 
const std::map< unsigned int,
float > & 
getLorentzAngles () const
 
void printDebug (std::stringstream &ss) const
 Prints LorentzAngles for all detIds. More...
 
void printSummary (std::stringstream &ss) const
 Prints the mean value of the LorentzAngle divided by subdetector, layer and mono/stereo. More...
 
void putLorentsAngles (std::map< unsigned int, float > &LA)
 
bool putLorentzAngle (const uint32_t &, float &)
 
 SiStripLorentzAngle ()
 
 ~SiStripLorentzAngle ()
 

Private Attributes

std::map< unsigned int, float > m_LA
 

Detailed Description

Stores the lorentz angle value for all DetIds.
The values are saved internally in a std::map<detid, lorentzAngle>.
It can be filled either by the complete map (putLorentzAngles) or passing a single detIds and lorentzAngles (putLorentzAngle).
In the same way getLorentzAngles returns the complete map, while getLorentzAngle the value corresponding to a given DetId.
The printDebug method prints LorentzAngles for all detIds.
The printSummary mehtod uses the SiStripDetSummary class to produce a summary of LorentzAngle values divided by subdetector and layer/disk.

Definition at line 24 of file SiStripLorentzAngle.h.

Constructor & Destructor Documentation

SiStripLorentzAngle::SiStripLorentzAngle ( )
inline

Definition at line 27 of file SiStripLorentzAngle.h.

27 {};
SiStripLorentzAngle::~SiStripLorentzAngle ( )
inline

Definition at line 28 of file SiStripLorentzAngle.h.

28 {};

Member Function Documentation

const float & SiStripLorentzAngle::getLorentzAngle ( const uint32_t &  detid) const

Definition at line 14 of file SiStripLorentzAngle.cc.

References m_LA.

Referenced by shallow::drift(), and StripCPE::driftDirection().

14  {
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  static float temp = 0.; // added by R.B.
21  return temp;
22 }
std::map< unsigned int, float > m_LA
const std::map<unsigned int,float>& SiStripLorentzAngle::getLorentzAngles ( ) const
inline

Definition at line 31 of file SiStripLorentzAngle.h.

References m_LA.

Referenced by printDebug(), and printSummary().

31 {return m_LA;}
std::map< unsigned int, float > m_LA
void SiStripLorentzAngle::printDebug ( std::stringstream &  ss) const

Prints LorentzAngles for all detIds.

Definition at line 24 of file SiStripLorentzAngle.cc.

References prof2calltree::count, and getLorentzAngles().

25 {
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 }
const std::map< unsigned int, float > & getLorentzAngles() const
void SiStripLorentzAngle::printSummary ( std::stringstream &  ss) const

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

Definition at line 37 of file SiStripLorentzAngle.cc.

References SiStripDetSummary::add(), cond::rpcobgas::detid, getLorentzAngles(), SiStripDetSummary::print(), edmLumisInFiles::summary, and relativeConstraints::value.

38 {
39  std::map<unsigned int,float> detid_la = getLorentzAngles();
40  std::map<unsigned int,float>::const_iterator it;
41 
43 
44  for( it=detid_la.begin(); it!=detid_la.end(); ++it ) {
45  DetId detid(it->first);
46  float value = it->second;
47  summary.add(detid, value);
48  }
49  ss << "Summary of lorentz angles:" << std::endl;
50  summary.print(ss);
51 
52 }
const std::map< unsigned int, float > & getLorentzAngles() const
void print(std::stringstream &ss, const bool mean=true) const
Definition: DetId.h:20
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 SiStripLorentzAngle::putLorentsAngles ( std::map< unsigned int, float > &  LA)
inline

Definition at line 30 of file SiStripLorentzAngle.h.

References m_LA.

30 {m_LA=LA;}
std::map< unsigned int, float > m_LA
bool SiStripLorentzAngle::putLorentzAngle ( const uint32_t &  detid,
float &  value 
)

Definition at line 5 of file SiStripLorentzAngle.cc.

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

Referenced by SiStripLorentzAngleGenerator::createObject(), and SiStripCalibLorentzAngle::getNewObject().

5  {
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 }
std::map< unsigned int, float > m_LA

Member Data Documentation

std::map<unsigned int,float> SiStripLorentzAngle::m_LA
private