CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
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 
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
void build(const DetGeomDesc *, unsigned int verbosity)
build up from DetGeomDesc structure
ROOT::Math::Plane3D::Vector Vector
Definition: EcalHitMaker.cc:29
mapSetType stations_in_arm_
map: parent ID -&gt; set of subelements E.g. stations_in_arm_ is map of arm ID -&gt; set of stations (in th...
ROOT::Math::DisplacementVector3D< ROOT::Math::Cartesian3D< double >> Translation
Definition: DetGeomDesc.h:55
const DetGeomDesc * rp(unsigned int id) const
returns geometry of a RP box
std::map< int, const DetGeomDesc * > RPDeviceMapType
Definition: CTPPSGeometry.h:33
mapType::const_iterator beginSensor() const
begin iterator over sensors
Definition: CTPPSGeometry.h:67
const std::set< unsigned int > & rpsInStation(unsigned int) const
after checks returns set of RP ids corresponding to the given station id
DetGeomDesc::Translation Vector
Definition: CTPPSGeometry.h:36
Vector localToGlobal(const DetGeomDesc *, const Vector &) const
std::map< unsigned int, const DetGeomDesc * > mapType
Definition: CTPPSGeometry.h:32
Vector globalToLocal(const DetGeomDesc *, const Vector &) const
const DetGeomDesc * sensorNoThrow(unsigned int id) const noexcept
RPDeviceMapType::const_iterator beginRP() const
begin iterator over RPs
Definition: CTPPSGeometry.h:72
Vector globalToLocalDirection(unsigned int id, const Vector &) const
The manager class for TOTEM RP geometry.
Definition: CTPPSGeometry.h:30
const std::set< unsigned int > & sensorsInRP(unsigned int) const
after checks returns set of sensor ids corresponding to the given RP id
const DetGeomDesc * sensor(unsigned int id) const
returns geometry of a detector performs necessary checks, returns NULL if fails
mapSetType rps_in_station_
mapType::const_iterator endSensor() const
end iterator over sensors
Definition: CTPPSGeometry.h:69
RPDeviceMapType::const_iterator endRP() const
end iterator over RPs
Definition: CTPPSGeometry.h:74
RPDeviceMapType rps_map_
map: rp id –&gt; DetGeomDesc
Vector localToGlobalDirection(unsigned int id, const Vector &) const
Vector sensorTranslation(unsigned int id) const
const DetGeomDesc * rpNoThrow(unsigned int id) const noexcept
const std::set< unsigned int > & stationsInArm(unsigned int) const
after checks returns set of station ids corresponding to the given arm id
Vector rpTranslation(unsigned int id) const
bool addSensor(unsigned int, const DetGeomDesc *&)
adds an item to the map (detector ID –&gt; DetGeomDesc) performs necessary checks
std::map< unsigned int, std::set< unsigned int > > mapSetType
Definition: CTPPSGeometry.h:34
mapSetType dets_in_rp_
mapType sensors_map_
map: sensor id –&gt; DetGeomDesc
bool addRP(unsigned int id, const DetGeomDesc *&)
adds a RP box to a map
CTPPSGeometry(const DetGeomDesc *gd, unsigned int verbosity)
build up from DetGeomDesc
Definition: CTPPSGeometry.h:39