CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
TotemRPGeometry.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_TotemRPGeometry
9 #define Geometry_VeryForwardGeometryBuilder_TotemRPGeometry
10 
12 #include "CLHEP/Vector/ThreeVector.h"
13 #include "CLHEP/Vector/Rotation.h"
14 //#include "HepMC/SimpleVector.h"
16 
17 #include <map>
18 #include <set>
19 
20 class DetId;
21 
52 {
53  public:
54  typedef std::map<unsigned int, DetGeomDesc* > mapType;
55  typedef std::map<int, DetGeomDesc* > RPDeviceMapType;
56  typedef std::map<unsigned int, std::set<unsigned int> > mapSetType;
57 
60 
62  TotemRPGeometry(const DetGeomDesc * gd) { Build(gd); }
63 
65  char Build(const DetGeomDesc *);
66 
69  char AddDetector(unsigned int, const DetGeomDesc * &);
70  char AddDetector(const DetId & id, const DetGeomDesc * &gd) { return AddDetector(id.rawId(), gd); }
71 
74  char AddRPDevice(int copy_no, const DetGeomDesc * &det_geom_desc);
75 
79  DetGeomDesc *GetDetector(unsigned int) const;
80  DetGeomDesc *GetDetector(const TotemRPDetId & id) const { return GetDetector(id.rawId()); }
82  DetGeomDesc *operator[] (unsigned int id) const { return GetDetector(id); }
83 
85  CLHEP::Hep3Vector GetDetEdgePosition(unsigned int id) const;
86 
88  CLHEP::Hep3Vector GetDetEdgeNormalVector(unsigned int id) const;
89 
91  DetGeomDesc *GetRPDevice(int copy_no) const;
92 
94  CLHEP::Hep3Vector GetRPThinFoilPosition(int copy_no) const;
95 
97  CLHEP::Hep3Vector GetRPThinFoilNormalVector(int copy_no) const;
98 
100  mapType::const_iterator beginDet()const { return theMap.begin(); }
101 
103  mapType::const_iterator endDet() const { return theMap.end(); }
104 
105 
107  RPDeviceMapType::const_iterator beginRP()const { return theRomanPotMap.begin(); }
108 
110  RPDeviceMapType::const_iterator endRP() const { return theRomanPotMap.end(); }
111 
112 
115  void BuildSets();
116 
118  std::set < unsigned int > StationsInArm(unsigned int) const;
119 
121  std::set < unsigned int > RPsInStation(unsigned int) const;
122 
125  double GetStationCentreZPosition(unsigned int) const;
126 
129  std::set<unsigned int> DetsInRP(unsigned int) const;
130  std::set<unsigned int> DetsInRP(const DetId & id) const { return DetsInRP(id.rawId()); }
131 
132 
135  CLHEP::Hep3Vector LocalToGlobal(DetGeomDesc *gd, const CLHEP::Hep3Vector r) const;
136  CLHEP::Hep3Vector GlobalToLocal(DetGeomDesc *gd, const CLHEP::Hep3Vector r) const;
137  CLHEP::Hep3Vector LocalToGlobal(unsigned int id, const CLHEP::Hep3Vector r) const;
138  CLHEP::Hep3Vector GlobalToLocal(unsigned int id, const CLHEP::Hep3Vector r) const;
139 
142  CLHEP::Hep3Vector LocalToGlobalDirection(unsigned int id, const CLHEP::Hep3Vector dir) const;
143  CLHEP::Hep3Vector GlobalToLocalDirection(unsigned int id, const CLHEP::Hep3Vector dir) const;
144 
147  CLHEP::Hep3Vector GetDetTranslation(unsigned int id) const;
148 
151  void GetReadoutDirection(unsigned int id, double &dx, double &dy) const;
152 
154  CLHEP::Hep3Vector GetRPGlobalTranslation(int copy_no) const;
155  CLHEP::HepRotation GetRPGlobalRotation(int copy_no) const;
156 
158  unsigned int NumberOfDetsIncluded() const { return theMap.size(); }
159 
160  protected:
163 
167 };
168 
169 #endif
170 
Roman Pot detector ID.
Definition: TotemRPDetId.h:51
TotemRPGeometry(const DetGeomDesc *gd)
build up from DetGeomDesc
CLHEP::Hep3Vector GetDetEdgePosition(unsigned int id) const
returns the position of the edge of a detector
CLHEP::Hep3Vector GetRPGlobalTranslation(int copy_no) const
position of a RP package (translation z corresponds to the first plane - TODO check it) ...
double GetStationCentreZPosition(unsigned int) const
CLHEP::Hep3Vector GetRPThinFoilPosition(int copy_no) const
returns the (outer) position of the thin foil of a RP box
char Build(const DetGeomDesc *)
build up from DetGeomDesc structure, return 0 = success
unsigned int NumberOfDetsIncluded() const
RPDeviceMapType::const_iterator endRP() const
end iterator over RPs
void BuildSets()
builds maps element ID –&gt; set of subelements (re)builds stationsInArm, rpsInStation, detsInRP out of theMap
DetGeomDesc * GetDetector(unsigned int) const
returns geometry of a detector performs necessary checks, returns NULL if fails input is raw ID ...
std::map< int, DetGeomDesc * > RPDeviceMapType
void GetReadoutDirection(unsigned int id, double &dx, double &dy) const
std::map< unsigned int, std::set< unsigned int > > mapSetType
std::set< unsigned int > RPsInStation(unsigned int) const
after checks returns set of RP corresponding to the given station ID
mapType::const_iterator endDet() const
end iterator over (silicon) detectors
std::set< unsigned int > DetsInRP(unsigned int) const
CLHEP::Hep3Vector GlobalToLocalDirection(unsigned int id, const CLHEP::Hep3Vector dir) const
RPDeviceMapType::const_iterator beginRP() const
begin iterator over RPs
CLHEP::Hep3Vector GetDetTranslation(unsigned int id) const
mapSetType stationsInArm
map: parent ID -&gt; set of subelements E.g. stationsInArm is map of arm ID -&gt; set of stations (in that ...
Geometrical description of a detector.
Definition: DetGeomDesc.h:40
mapType theMap
map: detectorID –&gt; DetGeomDesc
CLHEP::Hep3Vector GetDetEdgeNormalVector(unsigned int id) const
returns a normal vector for the edge of a detector
CLHEP::Hep3Vector GlobalToLocal(DetGeomDesc *gd, const CLHEP::Hep3Vector r) const
CLHEP::Hep3Vector LocalToGlobalDirection(unsigned int id, const CLHEP::Hep3Vector dir) const
DetGeomDesc * GetRPDevice(int copy_no) const
returns geometry of a RP box
char AddRPDevice(int copy_no, const DetGeomDesc *&det_geom_desc)
adds a RP package (primary vacuum) to a map copy_no means RPId (i.e. 3 digit decimal number) ...
Definition: DetId.h:18
CLHEP::HepRotation GetRPGlobalRotation(int copy_no) const
returns number of detectors in the geometry (size of theMap)
DetGeomDesc * GetDetector(const TotemRPDetId &id) const
DetGeomDesc * operator[](unsigned int id) const
same as GetDetector
char AddDetector(const DetId &id, const DetGeomDesc *&gd)
The manager class for TOTEM RP geometry.
CLHEP::Hep3Vector LocalToGlobal(DetGeomDesc *gd, const CLHEP::Hep3Vector r) const
std::set< unsigned int > StationsInArm(unsigned int) const
after checks returns set of stations corresponding to the given arm ID
std::map< unsigned int, DetGeomDesc * > mapType
mapSetType rpsInStation
mapType::const_iterator beginDet() const
begin iterator over (silicon) detectors
RPDeviceMapType theRomanPotMap
map: RPID –&gt; DetGeomDesc
dbl *** dir
Definition: mlp_gen.cc:35
char AddDetector(unsigned int, const DetGeomDesc *&)
adds an item to the map (detector ID –&gt; DetGeomDesc) performs necessary checks, returns 0 if succesfu...
std::set< unsigned int > DetsInRP(const DetId &id) const
CLHEP::Hep3Vector GetRPThinFoilNormalVector(int copy_no) const
returns a normal vector for the thin foil of a RP box
mapSetType detsInRP