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...
 
const DetGeomDescGetDetector (const TotemRPDetId &id) const
 
const DetGeomDescGetDetector (const CTPPSDetId &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 39 of file TotemRPGeometry.h.

Member Typedef Documentation

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

Definition at line 44 of file TotemRPGeometry.h.

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

Definition at line 42 of file TotemRPGeometry.h.

Definition at line 43 of file TotemRPGeometry.h.

Constructor & Destructor Documentation

TotemRPGeometry::TotemRPGeometry ( )
inline

Definition at line 46 of file TotemRPGeometry.h.

46 {}
TotemRPGeometry::~TotemRPGeometry ( )
inline

Definition at line 47 of file TotemRPGeometry.h.

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

build up from DetGeomDesc

Definition at line 50 of file TotemRPGeometry.h.

References Build().

51  {
52  Build(gd);
53  }
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 51 of file TotemRPGeometry.cc.

52 {
53  // check if the ID is already in map
54  if (theMap.find(id) != theMap.end())
55  return 1;
56 
57  // add gD
58  theMap[id] = (DetGeomDesc*) gD;
59  return 0;
60 }
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 110 of file TotemRPGeometry.cc.

111 {
112  // check if the copy_no is already in map
113  if (theRomanPotMap.find(id) != theRomanPotMap.end())
114  return 1;
115 
116  // add gD
117  theRomanPotMap[id] = (DetGeomDesc*) gD;
118  return 0;
119 }
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 101 of file TotemRPGeometry.h.

References theMap.

Referenced by GeometryInfoModule::PrintGeometry().

102  {
103  return theMap.begin();
104  }
mapType theMap
map: detectorID –&gt; DetGeomDesc
RPDeviceMapType::const_iterator TotemRPGeometry::beginRP ( ) const
inline

begin iterator over RPs

Definition at line 113 of file TotemRPGeometry.h.

References theRomanPotMap.

Referenced by GeometryInfoModule::PrintGeometry().

114  {
115  return theRomanPotMap.begin();
116  }
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_CTPPS_DIAMONDS_DETECTOR_NAME, DDD_TOTEM_RP_DETECTOR_NAME, DDD_TOTEM_RP_PRIMARY_VACUUM_NAME, DetGeomDesc::geographicalID(), i, DDName::name(), DetGeomDesc::name(), and or.

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)
32  or d->name().name().compare(DDD_CTPPS_DIAMONDS_DETECTOR_NAME)==0)
34 
35  // check if it is RP device (primary vacuum)
36  if (! d->name().name().compare(DDD_TOTEM_RP_PRIMARY_VACUUM_NAME))
38 
39  for (unsigned int i = 0; i < d->components().size(); i++)
40  buffer.push_back(d->components()[i]);
41  }
42 
43  // build sets from theMap
44  BuildSets();
45 
46  return 0;
47 }
int i
Definition: DBlmapReader.cc:9
The Signals That Services Can Subscribe To This is based on ActivityRegistry and is current per Services can connect to the signals distributed by the ActivityRegistry in order to monitor the activity of the application Each possible callback has some defined which we here list in angle e< void, edm::EventIDconst &, edm::Timestampconst & > We also list in braces which AR_WATCH_USING_METHOD_ is used for those or
Definition: Activities.doc:12
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
const char DDD_CTPPS_DIAMONDS_DETECTOR_NAME[]
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:87
void TotemRPGeometry::BuildSets ( )

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

Definition at line 152 of file TotemRPGeometry.cc.

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

153 {
154  // reset
155  stationsInArm.clear();
156  rpsInStation.clear();
157  detsInRP.clear();
158 
159  // build
160  for (mapType::const_iterator it = theMap.begin(); it != theMap.end(); ++it)
161  {
162  const CTPPSDetId detId(it->first);
163  const CTPPSDetId rpId = detId.getRPId();
164  const CTPPSDetId stId = detId.getStationId();
165  const CTPPSDetId armId = detId.getArmId();
166 
167  stationsInArm[armId].insert(armId);
168  rpsInStation[stId].insert(rpId);
169  detsInRP[rpId].insert(detId);
170  }
171 }
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 194 of file TotemRPGeometry.cc.

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

end iterator over (silicon) detectors

Definition at line 107 of file TotemRPGeometry.h.

References theMap.

Referenced by GeometryInfoModule::PrintGeometry().

108  {
109  return theMap.end();
110  }
mapType theMap
map: detectorID –&gt; DetGeomDesc
RPDeviceMapType::const_iterator TotemRPGeometry::endRP ( ) const
inline

end iterator over RPs

Definition at line 119 of file TotemRPGeometry.h.

References theRomanPotMap.

Referenced by GeometryInfoModule::PrintGeometry().

120  {
121  return theRomanPotMap.end();
122  }
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 64 of file TotemRPGeometry.cc.

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

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

Definition at line 70 of file TotemRPGeometry.h.

References GetDetector().

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

Definition at line 74 of file TotemRPGeometry.h.

References GetDetector().

75  {
76  return GetDetector( id.rawId() );
77  }
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 103 of file TotemRPGeometry.cc.

References mathSSE::sqrt().

104 {
105  return GetDetector(id)->rotation() * CLHEP::Hep3Vector(-sqrt(2)/2, -sqrt(2)/2, 0.);
106 }
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 84 of file TotemRPGeometry.cc.

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

85 {
86  // hardcoded for now, values taken from RP_Hybrid.xml
87  // +-------+
88  // | |
89  // | + (0,0)
90  // *(x,y) |
91  // \-----+
92  // x=-RP_Det_Size_a/2+RP_Det_Edge_Length/(2*sqrt(2))
93  // y=x
94  // ideally we would get this from the geometry in the event setup
95  double x=-36.07/2+22.276/(2*sqrt(2));
96  return LocalToGlobal(id, CLHEP::Hep3Vector(x, x, 0.));
97 }
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 264 of file TotemRPGeometry.cc.

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

Referenced by TotemRPLocalTrackFitterAlgorithm::prepareReconstAlgebraData().

265 {
266  DetGeomDesc *gd = GetDetector(id);
267  CLHEP::Hep3Vector tmp;
268  tmp.setX((gd->translation()).x());
269  tmp.setY((gd->translation()).y());
270  tmp.setZ((gd->translation()).z());
271  return tmp;
272 }
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 276 of file TotemRPGeometry.cc.

References ztail::d.

Referenced by GeometryInfoModule::PrintGeometry().

277 {
278  CLHEP::Hep3Vector d = LocalToGlobalDirection(id, CLHEP::Hep3Vector(0., 1., 0.));
279  dx = d.x();
280  dy = d.y();
281 }
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 123 of file TotemRPGeometry.cc.

124 {
125  // check if there is a corresponding key
126  RPDeviceMapType::const_iterator it = theRomanPotMap.find(id);
127  if (it == theRomanPotMap.end())
128  throw cms::Exception("TotemRPGeometry") << "Not found RP device with ID " << id << ", i.e. "
129  << TotemRPDetId(id);
130 
131  return (*it).second;
132 }
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 297 of file TotemRPGeometry.cc.

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

298 {
299  double xx, xy, xz, yx, yy, yz, zx, zy, zz;
300  GetRPDevice(copy_no)->rotation().GetComponents(xx, xy, xz, yx, yy, yz, zx, zy, zz);
301  CLHEP::HepRep3x3 rot_mat( xx, xy, xz, yx, yy, yz, zx, zy, zz);
302  CLHEP::HepRotation rot(rot_mat);
303  return rot;
304 }
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 285 of file TotemRPGeometry.cc.

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

286 {
287  CLHEP::Hep3Vector tmp;
288  DetGeomDesc * gd = GetRPDevice(copy_no);
289  tmp.setX((gd->translation()).x());
290  tmp.setY((gd->translation()).y());
291  tmp.setZ((gd->translation()).z());
292  return tmp;
293 }
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 145 of file TotemRPGeometry.cc.

146 {
147  return GetRPDevice(copy_no)->rotation() * CLHEP::Hep3Vector(0., -1., 0.);
148 }
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 136 of file TotemRPGeometry.cc.

137 {
138  // hardcoded for now, taken from RP_Box.xml:RP_Box_primary_vacuum_y
139  // ideally we would get this from the geometry in the event setup
140  return LocalToGlobal(GetRPDevice(copy_no), CLHEP::Hep3Vector(0., -135.65/2.0, 0.));
141 }
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 227 of file TotemRPGeometry.cc.

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

228 {
229  CLHEP::Hep3Vector tmp = r;
230  tmp.setX(tmp.x() - (gd->translation()).x());
231  tmp.setY(tmp.y() - (gd->translation()).y());
232  tmp.setZ(tmp.z() - (gd->translation()).z());
233  return (gd->rotation()).Inverse() * tmp;
234 }
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 238 of file TotemRPGeometry.cc.

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

239 {
240  DetGeomDesc *gd = GetDetector(id);
241  CLHEP::Hep3Vector tmp = r;
242  tmp.setX(tmp.x() - (gd->translation()).x());
243  tmp.setY(tmp.y() - (gd->translation()).y());
244  tmp.setZ(tmp.z() - (gd->translation()).z());
245  return (gd->rotation()).Inverse() * tmp;
246 }
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 257 of file TotemRPGeometry.cc.

References dir, and idealTransformation::rotation.

258 {
259  return (GetDetector(id)->rotation()).Inverse() * dir;
260 }
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 204 of file TotemRPGeometry.cc.

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

205 {
206  CLHEP::Hep3Vector tmp = gd->rotation() * r;
207  tmp.setX(tmp.x() + (gd->translation()).x());
208  tmp.setY(tmp.y() + (gd->translation()).y());
209  tmp.setZ(tmp.z() + (gd->translation()).z());
210  return tmp;
211 }
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 215 of file TotemRPGeometry.cc.

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

216 {
217  DetGeomDesc *gd = GetDetector(id);
218  CLHEP::Hep3Vector tmp = gd->rotation() * r;
219  tmp.setX(tmp.x() + (gd->translation()).x());
220  tmp.setY(tmp.y() + (gd->translation()).y());
221  tmp.setZ(tmp.z() + (gd->translation()).z());
222  return tmp;
223 }
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 250 of file TotemRPGeometry.cc.

References dir.

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

251 {
252  return GetDetector(id)->rotation() * dir;
253 }
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 163 of file TotemRPGeometry.h.

References theMap.

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

same as GetDetector

Definition at line 80 of file TotemRPGeometry.h.

References GetDetector().

81  {
82  return GetDetector(id);
83  }
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 184 of file TotemRPGeometry.cc.

185 {
186  mapSetType::const_iterator it = rpsInStation.find(id);
187  if (it == rpsInStation.end())
188  throw cms::Exception("TotemRPGeometry") << "Station with ID " << id << " not found.";
189  return (*it).second;
190 }
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 174 of file TotemRPGeometry.cc.

175 {
176  mapSetType::const_iterator it = stationsInArm.find(id);
177  if (it == stationsInArm.end())
178  throw cms::Exception("TotemRPGeometry") << "Arm with ID " << id << " not found.";
179  return (*it).second;
180 }
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 174 of file TotemRPGeometry.h.

mapSetType TotemRPGeometry::rpsInStation
protected

Definition at line 174 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 174 of file TotemRPGeometry.h.

mapType TotemRPGeometry::theMap
protected

map: detectorID –> DetGeomDesc

Definition at line 169 of file TotemRPGeometry.h.

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

RPDeviceMapType TotemRPGeometry::theRomanPotMap
protected

map: RPID –> DetGeomDesc

Definition at line 170 of file TotemRPGeometry.h.

Referenced by beginRP(), and endRP().