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.

References l1ctLayer2EG_cff::id, and m_LA.

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

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

◆ getLorentzAngles()

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

Definition at line 32 of file SiPhase2OuterTrackerLorentzAngle.h.

References m_LA.

Referenced by printDebug().

32 { return m_LA; }
std::unordered_map< unsigned int, float > m_LA

◆ getLorentzAngles_2S()

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

Definition at line 42 of file SiPhase2OuterTrackerLorentzAngle.h.

References getLorentzAnglesByModuleType(), MillePedeFileConverter_cfg::out, and TrackerGeometry::Ph2SS.

42  {
44  }
void getLorentzAnglesByModuleType(const TrackerGeometry *trackerGeometry, const TrackerGeometry::ModuleType &theType, std::unordered_map< unsigned int, float > &out) const

◆ getLorentzAngles_PSP()

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

Definition at line 34 of file SiPhase2OuterTrackerLorentzAngle.h.

References getLorentzAnglesByModuleType(), MillePedeFileConverter_cfg::out, and TrackerGeometry::Ph2PSP.

34  {
36  }
void getLorentzAnglesByModuleType(const TrackerGeometry *trackerGeometry, const TrackerGeometry::ModuleType &theType, std::unordered_map< unsigned int, float > &out) const

◆ getLorentzAngles_PSS()

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

Definition at line 38 of file SiPhase2OuterTrackerLorentzAngle.h.

References getLorentzAnglesByModuleType(), MillePedeFileConverter_cfg::out, and TrackerGeometry::Ph2PSS.

38  {
40  }
void getLorentzAnglesByModuleType(const TrackerGeometry *trackerGeometry, const TrackerGeometry::ModuleType &theType, std::unordered_map< unsigned int, float > &out) const

◆ 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.

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

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

27  {
28  for (const auto& [det, LA] : m_LA) {
29  if (trackerGeometry->getDetectorType(det) == theType) {
30  out[det] = LA;
31  }
32  }
33 }
ModuleType getDetectorType(DetId) const
std::unordered_map< unsigned int, float > m_LA

◆ printDebug()

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

Definition at line 35 of file SiPhase2OuterTrackerLorentzAngle.cc.

References getLorentzAngles(), ALPAKA_ACCELERATOR_NAMESPACE::vertexFinder::it, and contentValuesCheck::ss.

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 }
const std::unordered_map< unsigned int, float > & getLorentzAngles() const

◆ putLorentzAngle()

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

Definition at line 4 of file SiPhase2OuterTrackerLorentzAngle.cc.

References m_LA, and relativeConstraints::value.

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 }
Log< level::Error, false > LogError
std::unordered_map< unsigned int, float > m_LA

◆ putLorentzAngles()

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

Definition at line 31 of file SiPhase2OuterTrackerLorentzAngle.h.

References m_LA.

31 { m_LA = LA; }
std::unordered_map< unsigned int, float > 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