CMS 3D CMS Logo

SiPhase2OuterTrackerLorentzAngle.cc
Go to the documentation of this file.
3 
4 bool SiPhase2OuterTrackerLorentzAngle::putLorentzAngle(const uint32_t& detid, float value) {
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 }
14 
15 float SiPhase2OuterTrackerLorentzAngle::getLorentzAngle(const uint32_t& detid) const {
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 }
24 
26  const TrackerGeometry::ModuleType& theType,
27  std::unordered_map<unsigned int, float>& out) const {
28  for (const auto& [det, LA] : m_LA) {
29  if (trackerGeometry->getDetectorType(det) == theType) {
30  out[det] = LA;
31  }
32  }
33 }
34 
35 void SiPhase2OuterTrackerLorentzAngle::printDebug(std::stringstream& ss, const TrackerTopology* /*trackerTopo*/) const {
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 }
MessageLogger.h
SiPhase2OuterTrackerLorentzAngle::putLorentzAngle
bool putLorentzAngle(const uint32_t &, float)
Definition: SiPhase2OuterTrackerLorentzAngle.cc:4
SiPhase2OuterTrackerLorentzAngle::getLorentzAnglesByModuleType
void getLorentzAnglesByModuleType(const TrackerGeometry *trackerGeometry, const TrackerGeometry::ModuleType &theType, std::unordered_map< unsigned int, float > &out) const
Definition: SiPhase2OuterTrackerLorentzAngle.cc:25
TrackerTopology
Definition: TrackerTopology.h:16
TrackerGeometry::getDetectorType
ModuleType getDetectorType(DetId) const
Definition: TrackerGeometry.cc:247
contentValuesCheck.ss
ss
Definition: contentValuesCheck.py:33
SiPhase2OuterTrackerLorentzAngle::getLorentzAngle
float getLorentzAngle(const uint32_t &) const
Definition: SiPhase2OuterTrackerLorentzAngle.cc:15
SiPhase2OuterTrackerLorentzAngle::m_LA
std::unordered_map< unsigned int, float > m_LA
Definition: SiPhase2OuterTrackerLorentzAngle.h:57
TrackerGeometry::ModuleType
ModuleType
Definition: TrackerGeometry.h:29
value
Definition: value.py:1
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
SiPhase2OuterTrackerLorentzAngle::printDebug
void printDebug(std::stringstream &ss, const TrackerTopology *trackerTopo) const
Definition: SiPhase2OuterTrackerLorentzAngle.cc:35
SiPhase2OuterTrackerLorentzAngle.h
TrackerGeometry
Definition: TrackerGeometry.h:14