CMS 3D CMS Logo

CTPPSGeometry.h
Go to the documentation of this file.
1 /****************************************************************************
2 *
3 * Authors:
4 * Jan Kašpar (jan.kaspar@gmail.com)
5 *
6 ****************************************************************************/
7 
8 #ifndef Geometry_VeryForwardGeometryBuilder_CTPPSGeometry
9 #define Geometry_VeryForwardGeometryBuilder_CTPPSGeometry
10 
12 
15 
16 #include <map>
17 #include <set>
18 
30 class CTPPSGeometry {
31 public:
32  typedef std::map<unsigned int, const DetGeomDesc*> mapType;
33  typedef std::map<int, const DetGeomDesc*> RPDeviceMapType;
34  typedef std::map<unsigned int, std::set<unsigned int> > mapSetType;
35 
37 
39  CTPPSGeometry(const DetGeomDesc* gd, unsigned int verbosity) { build(gd, verbosity); }
40 
42  void build(const DetGeomDesc*, unsigned int verbosity);
43 
44  //----- setters and getters
45 
49  bool addSensor(unsigned int, const DetGeomDesc*&);
50 
53  bool addRP(unsigned int id, const DetGeomDesc*&);
54 
57  const DetGeomDesc* sensor(unsigned int id) const;
58  const DetGeomDesc* sensorNoThrow(unsigned int id) const noexcept;
59 
61  const DetGeomDesc* rp(unsigned int id) const;
62  const DetGeomDesc* rpNoThrow(unsigned int id) const noexcept;
63 
64  //----- objects iterators
65 
67  mapType::const_iterator beginSensor() const { return sensors_map_.begin(); }
69  mapType::const_iterator endSensor() const { return sensors_map_.end(); }
70 
72  RPDeviceMapType::const_iterator beginRP() const { return rps_map_.begin(); }
74  RPDeviceMapType::const_iterator endRP() const { return rps_map_.end(); }
75 
76  //----- translators
77 
81  Vector localToGlobal(const DetGeomDesc*, const Vector&) const;
82  Vector globalToLocal(const DetGeomDesc*, const Vector&) const;
83  Vector localToGlobal(unsigned int, const Vector&) const;
84  Vector globalToLocal(unsigned int, const Vector&) const;
85 
88  Vector localToGlobalDirection(unsigned int id, const Vector&) const;
91  Vector globalToLocalDirection(unsigned int id, const Vector&) const;
92 
95  Vector sensorTranslation(unsigned int id) const;
96 
99  Vector rpTranslation(unsigned int id) const;
100 
102  const std::set<unsigned int>& stationsInArm(unsigned int) const;
103 
105  const std::set<unsigned int>& rpsInStation(unsigned int) const;
106 
108  const std::set<unsigned int>& sensorsInRP(unsigned int) const;
109 
110 protected:
113 
116 
120 };
121 
122 #endif
HIPAlignmentAlgorithm_cfi.verbosity
verbosity
Definition: HIPAlignmentAlgorithm_cfi.py:7
CTPPSGeometry::globalToLocal
Vector globalToLocal(const DetGeomDesc *, const Vector &) const
Definition: CTPPSGeometry.cc:170
CTPPSGeometry::rpTranslation
Vector rpTranslation(unsigned int id) const
Definition: CTPPSGeometry.cc:201
CTPPSGeometry::globalToLocalDirection
Vector globalToLocalDirection(unsigned int id, const Vector &) const
Definition: CTPPSGeometry.cc:188
CTPPSGeometry::beginRP
RPDeviceMapType::const_iterator beginRP() const
begin iterator over RPs
Definition: CTPPSGeometry.h:75
CTPPSGeometry
The manager class for TOTEM RP geometry.
Definition: CTPPSGeometry.h:29
CTPPSGeometry::stationsInArm
const std::set< unsigned int > & stationsInArm(unsigned int) const
after checks returns set of station ids corresponding to the given arm id
Definition: CTPPSGeometry.cc:131
CTPPSGeometry::mapSetType
std::map< unsigned int, std::set< unsigned int > > mapSetType
Definition: CTPPSGeometry.h:37
CTPPSGeometry::stations_in_arm_
mapSetType stations_in_arm_
map: parent ID -> set of subelements E.g. stations_in_arm_ is map of arm ID -> set of stations (in th...
Definition: CTPPSGeometry.h:122
CTPPSGeometry::sensors_map_
mapType sensors_map_
map: sensor id --> DetGeomDesc
Definition: CTPPSGeometry.h:115
CTPPSGeometry::localToGlobalDirection
Vector localToGlobalDirection(unsigned int id, const Vector &) const
Definition: CTPPSGeometry.cc:182
CTPPSGeometry::beginSensor
mapType::const_iterator beginSensor() const
begin iterator over sensors
Definition: CTPPSGeometry.h:70
CTPPSGeometry::sensorTranslation
Vector sensorTranslation(unsigned int id) const
Definition: CTPPSGeometry.cc:194
CTPPSGeometry::sensorNoThrow
const DetGeomDesc * sensorNoThrow(unsigned int id) const noexcept
Definition: CTPPSGeometry.cc:101
CTPPSGeometry::dets_in_rp_
mapSetType dets_in_rp_
Definition: CTPPSGeometry.h:122
DetGeomDesc.h
CTPPSGeometry::rps_map_
RPDeviceMapType rps_map_
map: rp id --> DetGeomDesc
Definition: CTPPSGeometry.h:118
DetGeomDesc
Definition: DetGeomDesc.h:49
CTPPSGeometry::rpNoThrow
const DetGeomDesc * rpNoThrow(unsigned int id) const noexcept
Definition: CTPPSGeometry.cc:121
CTPPSDDDNames.h
CTPPSGeometry::rpsInStation
const std::set< unsigned int > & rpsInStation(unsigned int) const
after checks returns set of RP ids corresponding to the given station id
Definition: CTPPSGeometry.cc:140
CTPPSGeometry::endSensor
mapType::const_iterator endSensor() const
end iterator over sensors
Definition: CTPPSGeometry.h:72
CTPPSGeometry::mapType
std::map< unsigned int, const DetGeomDesc * > mapType
Definition: CTPPSGeometry.h:35
CTPPSGeometry::addRP
bool addRP(unsigned int id, const DetGeomDesc *&)
adds a RP box to a map
Definition: CTPPSGeometry.cc:81
CTPPSGeometry::addSensor
bool addSensor(unsigned int, const DetGeomDesc *&)
adds an item to the map (detector ID --> DetGeomDesc) performs necessary checks
Definition: CTPPSGeometry.cc:71
DetGeomDesc::Translation
ROOT::Math::DisplacementVector3D< ROOT::Math::Cartesian3D< double > > Translation
Definition: DetGeomDesc.h:53
CTPPSGeometry::sensorsInRP
const std::set< unsigned int > & sensorsInRP(unsigned int) const
after checks returns set of sensor ids corresponding to the given RP id
Definition: CTPPSGeometry.cc:149
CTPPSGeometry::rp
const DetGeomDesc * rp(unsigned int id) const
returns geometry of a RP box
Definition: CTPPSGeometry.cc:111
CTPPSGeometry::CTPPSGeometry
CTPPSGeometry(const DetGeomDesc *gd, unsigned int verbosity)
build up from DetGeomDesc
Definition: CTPPSGeometry.h:42
CTPPSDetId.h
CTPPSGeometry::build
void build(const DetGeomDesc *, unsigned int verbosity)
build up from DetGeomDesc structure
Definition: CTPPSGeometry.cc:14
CTPPSGeometry::localToGlobal
Vector localToGlobal(const DetGeomDesc *, const Vector &) const
Definition: CTPPSGeometry.cc:158
CTPPSGeometry::RPDeviceMapType
std::map< int, const DetGeomDesc * > RPDeviceMapType
Definition: CTPPSGeometry.h:36
CTPPSGeometry::rps_in_station_
mapSetType rps_in_station_
Definition: CTPPSGeometry.h:122
CTPPSGeometry::endRP
RPDeviceMapType::const_iterator endRP() const
end iterator over RPs
Definition: CTPPSGeometry.h:77
CTPPSGeometry::sensor
const DetGeomDesc * sensor(unsigned int id) const
returns geometry of a detector performs necessary checks, returns NULL if fails
Definition: CTPPSGeometry.cc:91
CTPPSGeometry::Vector
DetGeomDesc::Translation Vector
Definition: CTPPSGeometry.h:39