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 "CLHEP/Vector/ThreeVector.h"
17 #include "CLHEP/Vector/Rotation.h"
18 
19 #include <map>
20 #include <set>
21 
34 {
35  public:
36  typedef std::map<unsigned int, const DetGeomDesc* > mapType;
37  typedef std::map<int, const DetGeomDesc* > RPDeviceMapType;
38  typedef std::map<unsigned int, std::set<unsigned int> > mapSetType;
39 
42 
44  CTPPSGeometry( const DetGeomDesc* gd ) { build( gd ); }
45 
47  void build( const DetGeomDesc* );
48 
49  //----- setters and getters
50 
54  bool addSensor( unsigned int, const DetGeomDesc*& );
55 
58  bool addRP( unsigned int id, const DetGeomDesc*& );
59 
62  const DetGeomDesc* getSensor( unsigned int id ) const;
63 
65  const DetGeomDesc* getRP( unsigned int id ) const;
66 
67  //----- objects iterators
68 
70  mapType::const_iterator beginSensor() const { return sensors_map_.begin(); }
72  mapType::const_iterator endSensor() const { return sensors_map_.end(); }
73 
75  RPDeviceMapType::const_iterator beginRP() const { return rps_map_.begin(); }
77  RPDeviceMapType::const_iterator endRP() const { return rps_map_.end(); }
78 
79  //----- translators
80 
84  CLHEP::Hep3Vector localToGlobal( const DetGeomDesc*, const CLHEP::Hep3Vector& ) const;
85  CLHEP::Hep3Vector globalToLocal( const DetGeomDesc*, const CLHEP::Hep3Vector& ) const;
86  CLHEP::Hep3Vector localToGlobal( unsigned int, const CLHEP::Hep3Vector& ) const;
87  CLHEP::Hep3Vector globalToLocal( unsigned int, const CLHEP::Hep3Vector& ) const;
88 
91  CLHEP::Hep3Vector localToGlobalDirection( unsigned int id, const CLHEP::Hep3Vector& ) const;
94  CLHEP::Hep3Vector globalToLocalDirection( unsigned int id, const CLHEP::Hep3Vector& ) const;
95 
98  CLHEP::Hep3Vector getSensorTranslation( unsigned int id ) const;
99 
102  CLHEP::Hep3Vector getRPTranslation( unsigned int id ) const;
103 
105  const std::set<unsigned int>& getStationsInArm( unsigned int ) const;
106 
108  const std::set<unsigned int>& getRPsInStation( unsigned int ) const;
109 
111  const std::set<unsigned int>& getSensorsInRP( unsigned int ) const;
112 
113  protected:
115  mapType sensors_map_;
116 
118  RPDeviceMapType rps_map_;
119 
123 };
124 
125 #endif
std::map< unsigned int, const DetGeomDesc * > mapType
Definition: CTPPSGeometry.h:36
CTPPSGeometry(const DetGeomDesc *gd)
build up from DetGeomDesc
Definition: CTPPSGeometry.h:44
const std::set< unsigned int > & getStationsInArm(unsigned int) const
after checks returns set of station ids corresponding to the given arm id
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...
mapType::const_iterator beginSensor() const
begin iterator over sensors
Definition: CTPPSGeometry.h:70
const std::set< unsigned int > & getRPsInStation(unsigned int) const
after checks returns set of RP ids corresponding to the given station id
const DetGeomDesc * getSensor(unsigned int id) const
returns geometry of a detector performs necessary checks, returns NULL if fails
std::map< int, const DetGeomDesc * > RPDeviceMapType
Definition: CTPPSGeometry.h:37
void build(const DetGeomDesc *)
build up from DetGeomDesc structure
RPDeviceMapType::const_iterator beginRP() const
begin iterator over RPs
Definition: CTPPSGeometry.h:75
Geometrical description of a sensor.
Definition: DetGeomDesc.h:37
CLHEP::Hep3Vector localToGlobal(const DetGeomDesc *, const CLHEP::Hep3Vector &) const
The manager class for TOTEM RP geometry.
Definition: CTPPSGeometry.h:33
CLHEP::Hep3Vector getRPTranslation(unsigned int id) const
mapSetType rps_in_station_
CLHEP::Hep3Vector localToGlobalDirection(unsigned int id, const CLHEP::Hep3Vector &) const
mapType::const_iterator endSensor() const
end iterator over sensors
Definition: CTPPSGeometry.h:72
RPDeviceMapType::const_iterator endRP() const
end iterator over RPs
Definition: CTPPSGeometry.h:77
RPDeviceMapType rps_map_
map: rp id –> DetGeomDesc
CLHEP::Hep3Vector globalToLocalDirection(unsigned int id, const CLHEP::Hep3Vector &) const
bool addSensor(unsigned int, const DetGeomDesc *&)
adds an item to the map (detector ID –> DetGeomDesc) performs necessary checks
CLHEP::Hep3Vector getSensorTranslation(unsigned int id) const
std::map< unsigned int, std::set< unsigned int > > mapSetType
Definition: CTPPSGeometry.h:38
mapSetType dets_in_rp_
const std::set< unsigned int > & getSensorsInRP(unsigned int) const
after checks returns set of sensor ids corresponding to the given RP id
mapType sensors_map_
map: sensor id –> DetGeomDesc
CLHEP::Hep3Vector globalToLocal(const DetGeomDesc *, const CLHEP::Hep3Vector &) const
const DetGeomDesc * getRP(unsigned int id) const
returns geometry of a RP box
bool addRP(unsigned int id, const DetGeomDesc *&)
adds a RP box to a map