File indexing completed on 2024-09-07 04:35:40
0001 #ifndef CondCore_SiPhase2TrackerObjects_SiPhase2OuterTrackerLorentzAngle_h
0002 #define CondCore_SiPhase2TrackerObjects_SiPhase2OuterTrackerLorentzAngle_h
0003
0004 #include "CondFormats/Serialization/interface/Serializable.h"
0005 #include "DataFormats/TrackerCommon/interface/TrackerTopology.h"
0006 #include "Geometry/TrackerGeometryBuilder/interface/TrackerGeometry.h"
0007
0008 #include <vector>
0009 #include <map>
0010 #include <iostream>
0011 #include <cstdint>
0012
0013
0014
0015
0016
0017
0018
0019
0020
0021
0022
0023
0024
0025
0026 class SiPhase2OuterTrackerLorentzAngle {
0027 public:
0028 SiPhase2OuterTrackerLorentzAngle() {}
0029 ~SiPhase2OuterTrackerLorentzAngle() {}
0030
0031 inline void putLorentzAngles(std::unordered_map<unsigned int, float>& LA) { m_LA = LA; }
0032 inline const std::unordered_map<unsigned int, float>& getLorentzAngles() const { return m_LA; }
0033
0034 void getLorentzAngles_PSP(const TrackerGeometry* geo, std::unordered_map<unsigned int, float>& out) const {
0035 getLorentzAnglesByModuleType(geo, TrackerGeometry::ModuleType::Ph2PSP, out);
0036 }
0037
0038 void getLorentzAngles_PSS(const TrackerGeometry* geo, std::unordered_map<unsigned int, float>& out) const {
0039 getLorentzAnglesByModuleType(geo, TrackerGeometry::ModuleType::Ph2PSS, out);
0040 }
0041
0042 void getLorentzAngles_2S(const TrackerGeometry* geo, std::unordered_map<unsigned int, float>& out) const {
0043 getLorentzAnglesByModuleType(geo, TrackerGeometry::ModuleType::Ph2SS, out);
0044 }
0045
0046 bool putLorentzAngle(const uint32_t&, float);
0047 float getLorentzAngle(const uint32_t&) const;
0048
0049
0050 void printDebug(std::stringstream& ss, const TrackerTopology* trackerTopo) const;
0051
0052 private:
0053 void getLorentzAnglesByModuleType(const TrackerGeometry* trackerGeometry,
0054 const TrackerGeometry::ModuleType& theType,
0055 std::unordered_map<unsigned int, float>& out) const;
0056
0057 std::unordered_map<unsigned int, float> m_LA;
0058
0059 COND_SERIALIZABLE;
0060 };
0061
0062 #endif