CMS 3D CMS Logo

List of all members | Public Member Functions | Private Member Functions | Private Attributes | Friends
SiPhase2OuterTrackerLorentzAngle Class Reference

#include <SiPhase2OuterTrackerLorentzAngle.h>

Public Member Functions

float getLorentzAngle (const uint32_t &) const
 
const std::unordered_map< unsigned int, float > & getLorentzAngles () const
 
void getLorentzAngles_2S (const TrackerGeometry *geo, std::unordered_map< unsigned int, float > &out) const
 
void getLorentzAngles_PSP (const TrackerGeometry *geo, std::unordered_map< unsigned int, float > &out) const
 
void getLorentzAngles_PSS (const TrackerGeometry *geo, std::unordered_map< unsigned int, float > &out) const
 
void printDebug (std::stringstream &ss, const TrackerTopology *trackerTopo) const
 
bool putLorentzAngle (const uint32_t &, float)
 
void putLorentzAngles (std::unordered_map< unsigned int, float > &LA)
 
 SiPhase2OuterTrackerLorentzAngle ()
 
 ~SiPhase2OuterTrackerLorentzAngle ()
 

Private Member Functions

void getLorentzAnglesByModuleType (const TrackerGeometry *trackerGeometry, const TrackerGeometry::ModuleType &theType, std::unordered_map< unsigned int, float > &out) const
 
template<class Archive >
void serialize (Archive &ar, const unsigned int version)
 

Private Attributes

std::unordered_map< unsigned int, float > m_LA
 

Friends

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

Detailed Description

Stores the Lorentz Angle value for all DetIds. The values are saved internally in a std::unordered_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 three methods getLorentzAngles_PSP, getLorentzAngles_PSS and getLorentzAngles_2S are provided to retrieve by reference the Lorentz Angle values map for the P- and S- sensors, in the PS modules separately, as well as the values for the S-senors in the 2S modules. The printDebug method prints LorentzAngles for all detIds.

Definition at line 26 of file SiPhase2OuterTrackerLorentzAngle.h.

Constructor & Destructor Documentation

◆ SiPhase2OuterTrackerLorentzAngle()

SiPhase2OuterTrackerLorentzAngle::SiPhase2OuterTrackerLorentzAngle ( )
inline

Definition at line 28 of file SiPhase2OuterTrackerLorentzAngle.h.

28 {};

◆ ~SiPhase2OuterTrackerLorentzAngle()

SiPhase2OuterTrackerLorentzAngle::~SiPhase2OuterTrackerLorentzAngle ( )
inline

Definition at line 29 of file SiPhase2OuterTrackerLorentzAngle.h.

29 {};

Member Function Documentation

◆ getLorentzAngle()

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

Definition at line 15 of file SiPhase2OuterTrackerLorentzAngle.cc.

15  {
16  std::unordered_map<unsigned int, float>::const_iterator id = m_LA.find(detid);
17  if (id != m_LA.end())
18  return id->second;
19  else {
20  throw cms::Exception("SiPhase2OuterTrackerLorentzAngle")
21  << "SiPhase2OuterTrackerLorentzAngle for DetID " << detid << " is not stored" << std::endl;
22  }
23 }

References triggerObjects_cff::id, and m_LA.

Referenced by Phase2StripCPE::driftDirection(), and Phase2TrackerDigitizerAlgorithm::DriftDirection().

◆ getLorentzAngles()

const std::unordered_map<unsigned int, float>& SiPhase2OuterTrackerLorentzAngle::getLorentzAngles ( ) const
inline

Definition at line 32 of file SiPhase2OuterTrackerLorentzAngle.h.

32 { return m_LA; }

References m_LA.

Referenced by printDebug().

◆ getLorentzAngles_2S()

void SiPhase2OuterTrackerLorentzAngle::getLorentzAngles_2S ( const TrackerGeometry geo,
std::unordered_map< unsigned int, float > &  out 
) const
inline

◆ getLorentzAngles_PSP()

void SiPhase2OuterTrackerLorentzAngle::getLorentzAngles_PSP ( const TrackerGeometry geo,
std::unordered_map< unsigned int, float > &  out 
) const
inline

◆ getLorentzAngles_PSS()

void SiPhase2OuterTrackerLorentzAngle::getLorentzAngles_PSS ( const TrackerGeometry geo,
std::unordered_map< unsigned int, float > &  out 
) const
inline

◆ getLorentzAnglesByModuleType()

void SiPhase2OuterTrackerLorentzAngle::getLorentzAnglesByModuleType ( const TrackerGeometry trackerGeometry,
const TrackerGeometry::ModuleType theType,
std::unordered_map< unsigned int, float > &  out 
) const
private

Definition at line 25 of file SiPhase2OuterTrackerLorentzAngle.cc.

27  {
28  for (const auto& [det, LA] : m_LA) {
29  if (trackerGeometry->getDetectorType(det) == theType) {
30  out[det] = LA;
31  }
32  }
33 }

References TrackerGeometry::getDetectorType(), m_LA, and MillePedeFileConverter_cfg::out.

Referenced by getLorentzAngles_2S(), getLorentzAngles_PSP(), and getLorentzAngles_PSS().

◆ printDebug()

void SiPhase2OuterTrackerLorentzAngle::printDebug ( std::stringstream &  ss,
const TrackerTopology trackerTopo 
) const

Definition at line 35 of file SiPhase2OuterTrackerLorentzAngle.cc.

35  {
36  const std::unordered_map<unsigned int, float>& detid_la = getLorentzAngles();
37  ss << "SiPhase2OuterTrackerLorentzAngleReader:" << std::endl;
38  ss << "detid \t Lorentz angle" << std::endl;
39  for (const auto& it : detid_la) {
40  ss << it.first << "\t" << it.second << std::endl;
41  }
42 }

References getLorentzAngles(), and contentValuesCheck::ss.

◆ putLorentzAngle()

bool SiPhase2OuterTrackerLorentzAngle::putLorentzAngle ( const uint32_t &  detid,
float  value 
)

Definition at line 4 of file SiPhase2OuterTrackerLorentzAngle.cc.

4  {
5  std::unordered_map<unsigned int, float>::const_iterator id = m_LA.find(detid);
6  if (id != m_LA.end()) {
7  edm::LogError("SiPhase2OuterTrackerLorentzAngle") << "SiPhase2OuterTrackerLorentzAngle for DetID " << detid
8  << " is already stored. Skipping this put" << std::endl;
9  return false;
10  } else
11  m_LA[detid] = value;
12  return true;
13 }

References m_LA, and relativeConstraints::value.

◆ putLorentzAngles()

void SiPhase2OuterTrackerLorentzAngle::putLorentzAngles ( std::unordered_map< unsigned int, float > &  LA)
inline

Definition at line 31 of file SiPhase2OuterTrackerLorentzAngle.h.

31 { m_LA = LA; }

References m_LA.

◆ serialize()

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

Friends And Related Function Documentation

◆ boost::serialization::access

friend class boost::serialization::access
friend

Definition at line 59 of file SiPhase2OuterTrackerLorentzAngle.h.

◆ cond::serialization::access

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

Definition at line 59 of file SiPhase2OuterTrackerLorentzAngle.h.

Member Data Documentation

◆ m_LA

std::unordered_map<unsigned int, float> SiPhase2OuterTrackerLorentzAngle::m_LA
private
SiPhase2OuterTrackerLorentzAngle::getLorentzAnglesByModuleType
void getLorentzAnglesByModuleType(const TrackerGeometry *trackerGeometry, const TrackerGeometry::ModuleType &theType, std::unordered_map< unsigned int, float > &out) const
Definition: SiPhase2OuterTrackerLorentzAngle.cc:25
TrackerGeometry::ModuleType::Ph2SS
TrackerGeometry::getDetectorType
ModuleType getDetectorType(DetId) const
Definition: TrackerGeometry.cc:247
contentValuesCheck.ss
ss
Definition: contentValuesCheck.py:33
SiPhase2OuterTrackerLorentzAngle::m_LA
std::unordered_map< unsigned int, float > m_LA
Definition: SiPhase2OuterTrackerLorentzAngle.h:57
TrackerGeometry::ModuleType::Ph2PSS
edm::LogError
Log< level::Error, false > LogError
Definition: MessageLogger.h:123
SiPhase2OuterTrackerLorentzAngle::getLorentzAngles
const std::unordered_map< unsigned int, float > & getLorentzAngles() const
Definition: SiPhase2OuterTrackerLorentzAngle.h:32
triggerObjects_cff.id
id
Definition: triggerObjects_cff.py:29
relativeConstraints.value
value
Definition: relativeConstraints.py:53
MillePedeFileConverter_cfg.out
out
Definition: MillePedeFileConverter_cfg.py:31
cms::Exception
Definition: Exception.h:70
TrackerGeometry::ModuleType::Ph2PSP