test
CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
List of all members | Public Types | Public Member Functions | Protected Attributes
TotemRPGeometry Class Reference

The manager class for TOTEM RP geometry. More...

#include <TotemRPGeometry.h>

Public Types

typedef std::map< unsigned int,
std::set< unsigned int > > 
mapSetType
 
typedef std::map< unsigned int,
DetGeomDesc * > 
mapType
 
typedef std::map< int,
DetGeomDesc * > 
RPDeviceMapType
 

Public Member Functions

char AddDetector (unsigned int, const DetGeomDesc *&)
 adds an item to the map (detector ID –> DetGeomDesc) performs necessary checks, returns 0 if succesful More...
 
char AddRPDevice (unsigned int id, const DetGeomDesc *&det_geom_desc)
 adds a RP package (primary vacuum) to a map More...
 
mapType::const_iterator beginDet () const
 begin iterator over (silicon) detectors More...
 
RPDeviceMapType::const_iterator beginRP () const
 begin iterator over RPs More...
 
char Build (const DetGeomDesc *)
 build up from DetGeomDesc structure, return 0 = success More...
 
void BuildSets ()
 builds maps element ID –> set of subelements (re)builds stationsInArm, rpsInStation, detsInRP out of theMap More...
 
std::set< unsigned int > DetsInRP (unsigned int) const
 
mapType::const_iterator endDet () const
 end iterator over (silicon) detectors More...
 
RPDeviceMapType::const_iterator endRP () const
 end iterator over RPs More...
 
DetGeomDescGetDetector (unsigned int) const
 returns geometry of a detector performs necessary checks, returns NULL if fails input is raw ID More...
 
DetGeomDesc const * GetDetector (const TotemRPDetId &id) const
 
CLHEP::Hep3Vector GetDetEdgeNormalVector (unsigned int id) const
 returns a normal vector for the edge of a detector More...
 
CLHEP::Hep3Vector GetDetEdgePosition (unsigned int id) const
 returns the position of the edge of a detector More...
 
CLHEP::Hep3Vector GetDetTranslation (unsigned int id) const
 
void GetReadoutDirection (unsigned int id, double &dx, double &dy) const
 
DetGeomDescGetRPDevice (unsigned int id) const
 returns geometry of a RP box More...
 
CLHEP::HepRotation GetRPGlobalRotation (int copy_no) const
 returns number of detectors in the geometry (size of theMap) More...
 
CLHEP::Hep3Vector GetRPGlobalTranslation (int copy_no) const
 position of a RP package (translation z corresponds to the first plane - TODO check it) More...
 
CLHEP::Hep3Vector GetRPThinFoilNormalVector (int copy_no) const
 returns a normal vector for the thin foil of a RP box More...
 
CLHEP::Hep3Vector GetRPThinFoilPosition (int copy_no) const
 returns the (outer) position of the thin foil of a RP box More...
 
CLHEP::Hep3Vector GlobalToLocal (DetGeomDesc *gd, const CLHEP::Hep3Vector r) const
 
CLHEP::Hep3Vector GlobalToLocal (unsigned int id, const CLHEP::Hep3Vector r) const
 
CLHEP::Hep3Vector GlobalToLocalDirection (unsigned int id, const CLHEP::Hep3Vector dir) const
 
CLHEP::Hep3Vector LocalToGlobal (DetGeomDesc *gd, const CLHEP::Hep3Vector r) const
 
CLHEP::Hep3Vector LocalToGlobal (unsigned int id, const CLHEP::Hep3Vector r) const
 
CLHEP::Hep3Vector LocalToGlobalDirection (unsigned int id, const CLHEP::Hep3Vector dir) const
 
unsigned int NumberOfDetsIncluded () const
 
DetGeomDesc const * operator[] (unsigned int id) const
 same as GetDetector More...
 
std::set< unsigned int > RPsInStation (unsigned int) const
 after checks returns set of RP corresponding to the given station ID More...
 
std::set< unsigned int > StationsInArm (unsigned int) const
 after checks returns set of stations corresponding to the given arm ID More...
 
 TotemRPGeometry ()
 
 TotemRPGeometry (const DetGeomDesc *gd)
 build up from DetGeomDesc More...
 
 ~TotemRPGeometry ()
 

Protected Attributes

mapSetType detsInRP
 
mapSetType rpsInStation
 
mapSetType stationsInArm
 map: parent ID -> set of subelements E.g. stationsInArm is map of arm ID -> set of stations (in that arm) More...
 
mapType theMap
 map: detectorID –> DetGeomDesc More...
 
RPDeviceMapType theRomanPotMap
 map: RPID –> DetGeomDesc More...
 

Detailed Description

The manager class for TOTEM RP geometry.

See schema of TOTEM RP geometry classes

This is kind of "public relation class" for the tree structure of DetGeomDesc. It provides convenient interface to answer frequently asked questions about the geometry of TOTEM Roman Pots. These questions are of type:
a) If detector ID is xxx, what is the ID of corresponding station?
b) What is the geometry (shift, roatation, material, etc.) of detector with id xxx?
c) If RP ID is xxx, which are the detector IDs inside this pot?
d) If hit position in local detector coordinate system is xxx, what is the hit position in global c.s.?
etc. (see the comments in definition bellow)
This class is built for both ideal and real geometry. I.e. it is produced by TotemRPIdealGeometryESModule in IdealGeometryRecord and similarly for the real geometry

Definition at line 38 of file TotemRPGeometry.h.

Member Typedef Documentation

typedef std::map<unsigned int, std::set<unsigned int> > TotemRPGeometry::mapSetType

Definition at line 43 of file TotemRPGeometry.h.

typedef std::map<unsigned int, DetGeomDesc* > TotemRPGeometry::mapType

Definition at line 41 of file TotemRPGeometry.h.

Definition at line 42 of file TotemRPGeometry.h.

Constructor & Destructor Documentation

TotemRPGeometry::TotemRPGeometry ( )
inline

Definition at line 45 of file TotemRPGeometry.h.

45 {}
TotemRPGeometry::~TotemRPGeometry ( )
inline

Definition at line 46 of file TotemRPGeometry.h.

46 {}
TotemRPGeometry::TotemRPGeometry ( const DetGeomDesc gd)
inline

build up from DetGeomDesc

Definition at line 49 of file TotemRPGeometry.h.

References Build().

50  {
51  Build(gd);
52  }
char Build(const DetGeomDesc *)
build up from DetGeomDesc structure, return 0 = success

Member Function Documentation

char TotemRPGeometry::AddDetector ( unsigned int  id,
const DetGeomDesc *&  gD 
)

adds an item to the map (detector ID –> DetGeomDesc) performs necessary checks, returns 0 if succesful

Definition at line 50 of file TotemRPGeometry.cc.

51 {
52  // check if the ID is already in map
53  if (theMap.find(id) != theMap.end())
54  return 1;
55 
56  // add gD
57  theMap[id] = (DetGeomDesc*) gD;
58  return 0;
59 }
Geometrical description of a detector.
Definition: DetGeomDesc.h:40
mapType theMap
map: detectorID –&gt; DetGeomDesc
char TotemRPGeometry::AddRPDevice ( unsigned int  id,
const DetGeomDesc *&  det_geom_desc 
)

adds a RP package (primary vacuum) to a map

Definition at line 109 of file TotemRPGeometry.cc.

110 {
111  // check if the copy_no is already in map
112  if (theRomanPotMap.find(id) != theRomanPotMap.end())
113  return 1;
114 
115  // add gD
116  theRomanPotMap[id] = (DetGeomDesc*) gD;
117  return 0;
118 }
Geometrical description of a detector.
Definition: DetGeomDesc.h:40
RPDeviceMapType theRomanPotMap
map: RPID –&gt; DetGeomDesc
mapType::const_iterator TotemRPGeometry::beginDet ( ) const
inline

begin iterator over (silicon) detectors

Definition at line 96 of file TotemRPGeometry.h.

References theMap.

Referenced by GeometryInfoModule::PrintGeometry().

97  {
98  return theMap.begin();
99  }
mapType theMap
map: detectorID –&gt; DetGeomDesc
RPDeviceMapType::const_iterator TotemRPGeometry::beginRP ( ) const
inline

begin iterator over RPs

Definition at line 108 of file TotemRPGeometry.h.

References theRomanPotMap.

Referenced by GeometryInfoModule::PrintGeometry().

109  {
110  return theRomanPotMap.begin();
111  }
RPDeviceMapType theRomanPotMap
map: RPID –&gt; DetGeomDesc
char TotemRPGeometry::Build ( const DetGeomDesc gD)

build up from DetGeomDesc structure, return 0 = success

Definition at line 19 of file TotemRPGeometry.cc.

References DetGeomDesc::components(), ztail::d, DDD_TOTEM_RP_DETECTOR_NAME, DDD_TOTEM_RP_PRIMARY_VACUUM_NAME, DetGeomDesc::geographicalID(), i, DDName::name(), and DetGeomDesc::name().

Referenced by TotemRPGeometry().

20 {
21  // propagate through the GeometricalDet structure and add
22  // all detectors to 'theMap'
23  deque<const DetGeomDesc *> buffer;
24  buffer.push_back(gD);
25  while (buffer.size() > 0)
26  {
27  const DetGeomDesc *d = buffer.front();
28  buffer.pop_front();
29 
30  // check if it is RP detector
31  if (! d->name().name().compare(DDD_TOTEM_RP_DETECTOR_NAME))
33 
34  // check if it is RP device (primary vacuum)
35  if (! d->name().name().compare(DDD_TOTEM_RP_PRIMARY_VACUUM_NAME))
37 
38  for (unsigned int i = 0; i < d->components().size(); i++)
39  buffer.push_back(d->components()[i]);
40  }
41 
42  // build sets from theMap
43  BuildSets();
44 
45  return 0;
46 }
int i
Definition: DBlmapReader.cc:9
void BuildSets()
builds maps element ID –&gt; set of subelements (re)builds stationsInArm, rpsInStation, detsInRP out of theMap
const char DDD_TOTEM_RP_PRIMARY_VACUUM_NAME[]
DDD name of RP.
char AddRPDevice(unsigned int id, const DetGeomDesc *&det_geom_desc)
adds a RP package (primary vacuum) to a map
tuple d
Definition: ztail.py:151
virtual ConstContainer components() const
access to the tree structure
Definition: DetGeomDesc.cc:121
Geometrical description of a detector.
Definition: DetGeomDesc.h:40
DDName name() const
Definition: DetGeomDesc.h:90
virtual DetId geographicalID() const
Definition: DetGeomDesc.h:64
const char DDD_TOTEM_RP_DETECTOR_NAME[]
DDD name of RP detector.
char AddDetector(unsigned int, const DetGeomDesc *&)
adds an item to the map (detector ID –&gt; DetGeomDesc) performs necessary checks, returns 0 if succesfu...
const std::string & name() const
Returns the name.
Definition: DDName.cc:90
void TotemRPGeometry::BuildSets ( )

builds maps element ID –> set of subelements (re)builds stationsInArm, rpsInStation, detsInRP out of theMap

Definition at line 151 of file TotemRPGeometry.cc.

References CTPPSDetId::getArmId(), CTPPSDetId::getRPId(), and CTPPSDetId::getStationId().

152 {
153  // reset
154  stationsInArm.clear();
155  rpsInStation.clear();
156  detsInRP.clear();
157 
158  // build
159  for (mapType::const_iterator it = theMap.begin(); it != theMap.end(); ++it)
160  {
161  const TotemRPDetId detId(it->first);
162  const CTPPSDetId rpId = detId.getRPId();
163  const CTPPSDetId stId = detId.getStationId();
164  const CTPPSDetId armId = detId.getArmId();
165 
166  stationsInArm[armId].insert(armId);
167  rpsInStation[stId].insert(rpId);
168  detsInRP[rpId].insert(detId);
169  }
170 }
Detector ID class for TOTEM Si strip detectors.
Definition: TotemRPDetId.h:30
CTPPSDetId getStationId() const
Definition: CTPPSDetId.h:92
mapSetType stationsInArm
map: parent ID -&gt; set of subelements E.g. stationsInArm is map of arm ID -&gt; set of stations (in that ...
mapType theMap
map: detectorID –&gt; DetGeomDesc
CTPPSDetId getRPId() const
Definition: CTPPSDetId.h:97
CTPPSDetId getArmId() const
Definition: CTPPSDetId.h:87
Base class for CTPPS detector IDs.
Definition: CTPPSDetId.h:32
mapSetType rpsInStation
mapSetType detsInRP
std::set< unsigned int > TotemRPGeometry::DetsInRP ( unsigned int  id) const

after checks returns set of detectors corresponding to the given RP ID containts decimal detetector IDs

Definition at line 193 of file TotemRPGeometry.cc.

194 {
195  mapSetType::const_iterator it = detsInRP.find(id);
196  if (it == detsInRP.end())
197  throw cms::Exception("TotemRPGeometry") << "RP with ID " << id << " not found.";
198  return (*it).second;
199 }
mapSetType detsInRP
mapType::const_iterator TotemRPGeometry::endDet ( ) const
inline

end iterator over (silicon) detectors

Definition at line 102 of file TotemRPGeometry.h.

References theMap.

Referenced by GeometryInfoModule::PrintGeometry().

103  {
104  return theMap.end();
105  }
mapType theMap
map: detectorID –&gt; DetGeomDesc
RPDeviceMapType::const_iterator TotemRPGeometry::endRP ( ) const
inline

end iterator over RPs

Definition at line 114 of file TotemRPGeometry.h.

References theRomanPotMap.

Referenced by GeometryInfoModule::PrintGeometry().

115  {
116  return theRomanPotMap.end();
117  }
RPDeviceMapType theRomanPotMap
map: RPID –&gt; DetGeomDesc
DetGeomDesc * TotemRPGeometry::GetDetector ( unsigned int  id) const

returns geometry of a detector performs necessary checks, returns NULL if fails input is raw ID

Definition at line 63 of file TotemRPGeometry.cc.

Referenced by GetDetector(), FastLineRecognition::getGeomData(), and operator[]().

64 {
65  // check if id is RP id?
66 
67  // check if there is a corresponding key
68 // std::cout<<"TotemRPGeometry::GetDetector entered, id="<<id<<std::endl;
69  mapType::const_iterator it = theMap.find(id);
70  if (it == theMap.end())
71  throw cms::Exception("TotemRPGeometry") << "Not found detector with ID " << id << ", i.e. "
72  << TotemRPDetId(id);
73 
74  // the [] operator cannot be used as this method is const
75  // and it must be const and one gets TotemRPGeometry const
76  // from EventSetup
77  //std::cout<<"det. retrieved:"<<id<<std::endl;
78  return (*it).second;
79 }
Detector ID class for TOTEM Si strip detectors.
Definition: TotemRPDetId.h:30
mapType theMap
map: detectorID –&gt; DetGeomDesc
DetGeomDesc const* TotemRPGeometry::GetDetector ( const TotemRPDetId id) const
inline

Definition at line 69 of file TotemRPGeometry.h.

References GetDetector().

70  {
71  return GetDetector(id.rawId());
72  }
DetGeomDesc * GetDetector(unsigned int) const
returns geometry of a detector performs necessary checks, returns NULL if fails input is raw ID ...
CLHEP::Hep3Vector TotemRPGeometry::GetDetEdgeNormalVector ( unsigned int  id) const

returns a normal vector for the edge of a detector

Definition at line 102 of file TotemRPGeometry.cc.

References mathSSE::sqrt().

103 {
104  return GetDetector(id)->rotation() * CLHEP::Hep3Vector(-sqrt(2)/2, -sqrt(2)/2, 0.);
105 }
DDRotationMatrix rotation() const
geometry information
Definition: DetGeomDesc.h:86
DetGeomDesc * GetDetector(unsigned int) const
returns geometry of a detector performs necessary checks, returns NULL if fails input is raw ID ...
T sqrt(T t)
Definition: SSEVec.h:18
CLHEP::Hep3Vector TotemRPGeometry::GetDetEdgePosition ( unsigned int  id) const

returns the position of the edge of a detector

Definition at line 83 of file TotemRPGeometry.cc.

References mathSSE::sqrt(), and x().

84 {
85  // hardcoded for now, values taken from RP_Hybrid.xml
86  // +-------+
87  // | |
88  // | + (0,0)
89  // *(x,y) |
90  // \-----+
91  // x=-RP_Det_Size_a/2+RP_Det_Edge_Length/(2*sqrt(2))
92  // y=x
93  // ideally we would get this from the geometry in the event setup
94  double x=-36.07/2+22.276/(2*sqrt(2));
95  return LocalToGlobal(id, CLHEP::Hep3Vector(x, x, 0.));
96 }
T sqrt(T t)
Definition: SSEVec.h:18
CLHEP::Hep3Vector LocalToGlobal(DetGeomDesc *gd, const CLHEP::Hep3Vector r) const
CLHEP::Hep3Vector TotemRPGeometry::GetDetTranslation ( unsigned int  id) const

returns translation (position) of a detector raw ID as input

Definition at line 263 of file TotemRPGeometry.cc.

References tmp, DetGeomDesc::translation(), and x().

Referenced by TotemRPLocalTrackFitterAlgorithm::prepareReconstAlgebraData().

264 {
265  DetGeomDesc *gd = GetDetector(id);
266  CLHEP::Hep3Vector tmp;
267  tmp.setX((gd->translation()).x());
268  tmp.setY((gd->translation()).y());
269  tmp.setZ((gd->translation()).z());
270  return tmp;
271 }
DetGeomDesc * GetDetector(unsigned int) const
returns geometry of a detector performs necessary checks, returns NULL if fails input is raw ID ...
Geometrical description of a detector.
Definition: DetGeomDesc.h:40
DDTranslation translation() const
Definition: DetGeomDesc.h:87
std::vector< std::vector< double > > tmp
Definition: MVATrainer.cc:100
void TotemRPGeometry::GetReadoutDirection ( unsigned int  id,
double &  dx,
double &  dy 
) const

returns (the transverse part of) the readout direction in global coordinates raw ID expected

Definition at line 275 of file TotemRPGeometry.cc.

References ztail::d.

Referenced by GeometryInfoModule::PrintGeometry().

276 {
277  CLHEP::Hep3Vector d = LocalToGlobalDirection(id, CLHEP::Hep3Vector(0., 1., 0.));
278  dx = d.x();
279  dy = d.y();
280 }
tuple d
Definition: ztail.py:151
CLHEP::Hep3Vector LocalToGlobalDirection(unsigned int id, const CLHEP::Hep3Vector dir) const
DetGeomDesc * TotemRPGeometry::GetRPDevice ( unsigned int  id) const

returns geometry of a RP box

Definition at line 122 of file TotemRPGeometry.cc.

123 {
124  // check if there is a corresponding key
125  RPDeviceMapType::const_iterator it = theRomanPotMap.find(id);
126  if (it == theRomanPotMap.end())
127  throw cms::Exception("TotemRPGeometry") << "Not found RP device with ID " << id << ", i.e. "
128  << TotemRPDetId(id);
129 
130  return (*it).second;
131 }
Detector ID class for TOTEM Si strip detectors.
Definition: TotemRPDetId.h:30
RPDeviceMapType theRomanPotMap
map: RPID –&gt; DetGeomDesc
CLHEP::HepRotation TotemRPGeometry::GetRPGlobalRotation ( int  copy_no) const

returns number of detectors in the geometry (size of theMap)

Definition at line 296 of file TotemRPGeometry.cc.

References makeMuonMisalignmentScenario::rot, and create_public_lumi_plots::xy.

297 {
298  double xx, xy, xz, yx, yy, yz, zx, zy, zz;
299  GetRPDevice(copy_no)->rotation().GetComponents(xx, xy, xz, yx, yy, yz, zx, zy, zz);
300  CLHEP::HepRep3x3 rot_mat( xx, xy, xz, yx, yy, yz, zx, zy, zz);
301  CLHEP::HepRotation rot(rot_mat);
302  return rot;
303 }
DetGeomDesc * GetRPDevice(unsigned int id) const
returns geometry of a RP box
DDRotationMatrix rotation() const
geometry information
Definition: DetGeomDesc.h:86
CLHEP::Hep3Vector TotemRPGeometry::GetRPGlobalTranslation ( int  copy_no) const

position of a RP package (translation z corresponds to the first plane - TODO check it)

Definition at line 284 of file TotemRPGeometry.cc.

References tmp, DetGeomDesc::translation(), and x().

285 {
286  CLHEP::Hep3Vector tmp;
287  DetGeomDesc * gd = GetRPDevice(copy_no);
288  tmp.setX((gd->translation()).x());
289  tmp.setY((gd->translation()).y());
290  tmp.setZ((gd->translation()).z());
291  return tmp;
292 }
DetGeomDesc * GetRPDevice(unsigned int id) const
returns geometry of a RP box
Geometrical description of a detector.
Definition: DetGeomDesc.h:40
DDTranslation translation() const
Definition: DetGeomDesc.h:87
std::vector< std::vector< double > > tmp
Definition: MVATrainer.cc:100
CLHEP::Hep3Vector TotemRPGeometry::GetRPThinFoilNormalVector ( int  copy_no) const

returns a normal vector for the thin foil of a RP box

Definition at line 144 of file TotemRPGeometry.cc.

145 {
146  return GetRPDevice(copy_no)->rotation() * CLHEP::Hep3Vector(0., -1., 0.);
147 }
DetGeomDesc * GetRPDevice(unsigned int id) const
returns geometry of a RP box
DDRotationMatrix rotation() const
geometry information
Definition: DetGeomDesc.h:86
CLHEP::Hep3Vector TotemRPGeometry::GetRPThinFoilPosition ( int  copy_no) const

returns the (outer) position of the thin foil of a RP box

Definition at line 135 of file TotemRPGeometry.cc.

136 {
137  // hardcoded for now, taken from RP_Box.xml:RP_Box_primary_vacuum_y
138  // ideally we would get this from the geometry in the event setup
139  return LocalToGlobal(GetRPDevice(copy_no), CLHEP::Hep3Vector(0., -135.65/2.0, 0.));
140 }
DetGeomDesc * GetRPDevice(unsigned int id) const
returns geometry of a RP box
CLHEP::Hep3Vector LocalToGlobal(DetGeomDesc *gd, const CLHEP::Hep3Vector r) const
CLHEP::Hep3Vector TotemRPGeometry::GlobalToLocal ( DetGeomDesc gd,
const CLHEP::Hep3Vector  r 
) const

Definition at line 226 of file TotemRPGeometry.cc.

References alignCSCRings::r, DetGeomDesc::rotation(), tmp, DetGeomDesc::translation(), and x().

227 {
228  CLHEP::Hep3Vector tmp = r;
229  tmp.setX(tmp.x() - (gd->translation()).x());
230  tmp.setY(tmp.y() - (gd->translation()).y());
231  tmp.setZ(tmp.z() - (gd->translation()).z());
232  return (gd->rotation()).Inverse() * tmp;
233 }
DDRotationMatrix rotation() const
geometry information
Definition: DetGeomDesc.h:86
DDTranslation translation() const
Definition: DetGeomDesc.h:87
std::vector< std::vector< double > > tmp
Definition: MVATrainer.cc:100
CLHEP::Hep3Vector TotemRPGeometry::GlobalToLocal ( unsigned int  id,
const CLHEP::Hep3Vector  r 
) const

Definition at line 237 of file TotemRPGeometry.cc.

References alignCSCRings::r, DetGeomDesc::rotation(), tmp, DetGeomDesc::translation(), and x().

238 {
239  DetGeomDesc *gd = GetDetector(id);
240  CLHEP::Hep3Vector tmp = r;
241  tmp.setX(tmp.x() - (gd->translation()).x());
242  tmp.setY(tmp.y() - (gd->translation()).y());
243  tmp.setZ(tmp.z() - (gd->translation()).z());
244  return (gd->rotation()).Inverse() * tmp;
245 }
DDRotationMatrix rotation() const
geometry information
Definition: DetGeomDesc.h:86
DetGeomDesc * GetDetector(unsigned int) const
returns geometry of a detector performs necessary checks, returns NULL if fails input is raw ID ...
Geometrical description of a detector.
Definition: DetGeomDesc.h:40
DDTranslation translation() const
Definition: DetGeomDesc.h:87
std::vector< std::vector< double > > tmp
Definition: MVATrainer.cc:100
CLHEP::Hep3Vector TotemRPGeometry::GlobalToLocalDirection ( unsigned int  id,
const CLHEP::Hep3Vector  dir 
) const

Definition at line 256 of file TotemRPGeometry.cc.

References dir, and idealTransformation::rotation.

257 {
258  return (GetDetector(id)->rotation()).Inverse() * dir;
259 }
DetGeomDesc * GetDetector(unsigned int) const
returns geometry of a detector performs necessary checks, returns NULL if fails input is raw ID ...
dbl *** dir
Definition: mlp_gen.cc:35
CLHEP::Hep3Vector TotemRPGeometry::LocalToGlobal ( DetGeomDesc gd,
const CLHEP::Hep3Vector  r 
) const

coordinate transformations between local<–>global reference frames dimensions in mm, raw ID expected

Definition at line 203 of file TotemRPGeometry.cc.

References alignCSCRings::r, DetGeomDesc::rotation(), tmp, DetGeomDesc::translation(), and x().

204 {
205  CLHEP::Hep3Vector tmp = gd->rotation() * r;
206  tmp.setX(tmp.x() + (gd->translation()).x());
207  tmp.setY(tmp.y() + (gd->translation()).y());
208  tmp.setZ(tmp.z() + (gd->translation()).z());
209  return tmp;
210 }
DDRotationMatrix rotation() const
geometry information
Definition: DetGeomDesc.h:86
DDTranslation translation() const
Definition: DetGeomDesc.h:87
std::vector< std::vector< double > > tmp
Definition: MVATrainer.cc:100
CLHEP::Hep3Vector TotemRPGeometry::LocalToGlobal ( unsigned int  id,
const CLHEP::Hep3Vector  r 
) const

Definition at line 214 of file TotemRPGeometry.cc.

References alignCSCRings::r, DetGeomDesc::rotation(), tmp, DetGeomDesc::translation(), and x().

215 {
216  DetGeomDesc *gd = GetDetector(id);
217  CLHEP::Hep3Vector tmp = gd->rotation() * r;
218  tmp.setX(tmp.x() + (gd->translation()).x());
219  tmp.setY(tmp.y() + (gd->translation()).y());
220  tmp.setZ(tmp.z() + (gd->translation()).z());
221  return tmp;
222 }
DDRotationMatrix rotation() const
geometry information
Definition: DetGeomDesc.h:86
DetGeomDesc * GetDetector(unsigned int) const
returns geometry of a detector performs necessary checks, returns NULL if fails input is raw ID ...
Geometrical description of a detector.
Definition: DetGeomDesc.h:40
DDTranslation translation() const
Definition: DetGeomDesc.h:87
std::vector< std::vector< double > > tmp
Definition: MVATrainer.cc:100
CLHEP::Hep3Vector TotemRPGeometry::LocalToGlobalDirection ( unsigned int  id,
const CLHEP::Hep3Vector  dir 
) const

direction transformations between local<–>global reference frames (dimensions in mm), raw ID expected

Definition at line 249 of file TotemRPGeometry.cc.

References dir.

Referenced by FastLineRecognition::getGeomData(), and TotemRPLocalTrackFitterAlgorithm::prepareReconstAlgebraData().

250 {
251  return GetDetector(id)->rotation() * dir;
252 }
DDRotationMatrix rotation() const
geometry information
Definition: DetGeomDesc.h:86
DetGeomDesc * GetDetector(unsigned int) const
returns geometry of a detector performs necessary checks, returns NULL if fails input is raw ID ...
dbl *** dir
Definition: mlp_gen.cc:35
unsigned int TotemRPGeometry::NumberOfDetsIncluded ( ) const
inline

Definition at line 158 of file TotemRPGeometry.h.

References theMap.

159  {
160  return theMap.size();
161  }
mapType theMap
map: detectorID –&gt; DetGeomDesc
DetGeomDesc const* TotemRPGeometry::operator[] ( unsigned int  id) const
inline

same as GetDetector

Definition at line 75 of file TotemRPGeometry.h.

References GetDetector().

76  {
77  return GetDetector(id);
78  }
DetGeomDesc * GetDetector(unsigned int) const
returns geometry of a detector performs necessary checks, returns NULL if fails input is raw ID ...
std::set< unsigned int > TotemRPGeometry::RPsInStation ( unsigned int  id) const

after checks returns set of RP corresponding to the given station ID

Definition at line 183 of file TotemRPGeometry.cc.

184 {
185  mapSetType::const_iterator it = rpsInStation.find(id);
186  if (it == rpsInStation.end())
187  throw cms::Exception("TotemRPGeometry") << "Station with ID " << id << " not found.";
188  return (*it).second;
189 }
mapSetType rpsInStation
std::set< unsigned int > TotemRPGeometry::StationsInArm ( unsigned int  id) const

after checks returns set of stations corresponding to the given arm ID

Definition at line 173 of file TotemRPGeometry.cc.

174 {
175  mapSetType::const_iterator it = stationsInArm.find(id);
176  if (it == stationsInArm.end())
177  throw cms::Exception("TotemRPGeometry") << "Arm with ID " << id << " not found.";
178  return (*it).second;
179 }
mapSetType stationsInArm
map: parent ID -&gt; set of subelements E.g. stationsInArm is map of arm ID -&gt; set of stations (in that ...

Member Data Documentation

mapSetType TotemRPGeometry::detsInRP
protected

Definition at line 169 of file TotemRPGeometry.h.

mapSetType TotemRPGeometry::rpsInStation
protected

Definition at line 169 of file TotemRPGeometry.h.

mapSetType TotemRPGeometry::stationsInArm
protected

map: parent ID -> set of subelements E.g. stationsInArm is map of arm ID -> set of stations (in that arm)

Definition at line 169 of file TotemRPGeometry.h.

mapType TotemRPGeometry::theMap
protected

map: detectorID –> DetGeomDesc

Definition at line 164 of file TotemRPGeometry.h.

Referenced by beginDet(), endDet(), and NumberOfDetsIncluded().

RPDeviceMapType TotemRPGeometry::theRomanPotMap
protected

map: RPID –> DetGeomDesc

Definition at line 165 of file TotemRPGeometry.h.

Referenced by beginRP(), and endRP().