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 AddDetector (const DetId &id, const DetGeomDesc *&gd)
 
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) 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
 
std::set< unsigned int > DetsInRP (const DetId &id) 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...
 
DetGeomDescGetDetector (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 (int copy_no) 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...
 
double GetStationCentreZPosition (unsigned int) const
 
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
 
DetGeomDescoperator[] (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

ID conversions (based on the class TotRPDetID)
detector ID = |arm|station|RP|det|, i.e. 4-digit decimal number
Roman Pot ID = |arm|station|RP|, i.e. two digits
station ID = |arm|station|
arm ID = |arm|
where

Definition at line 51 of file TotemRPGeometry.h.

Member Typedef Documentation

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

Definition at line 56 of file TotemRPGeometry.h.

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

Definition at line 54 of file TotemRPGeometry.h.

Definition at line 55 of file TotemRPGeometry.h.

Constructor & Destructor Documentation

TotemRPGeometry::TotemRPGeometry ( )
inline

Definition at line 58 of file TotemRPGeometry.h.

58 {}
TotemRPGeometry::~TotemRPGeometry ( )
inline

Definition at line 59 of file TotemRPGeometry.h.

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

build up from DetGeomDesc

Definition at line 62 of file TotemRPGeometry.h.

References Build().

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

References theMap.

Referenced by Build().

54 {
55  // check if id is RP id?
56 
57  // check if the ID is already in map
58  //std::cout<<"TotemRPGeometry::AddDetector, Detector added: "<<id<<std::endl;
59  if (theMap.find(id) != theMap.end()) return 1;
60 
61  // add gD
62  theMap[id] = (DetGeomDesc*) gD;
63  return 0;
64 }
Geometrical description of a detector.
Definition: DetGeomDesc.h:40
mapType theMap
map: detectorID –&gt; DetGeomDesc
char TotemRPGeometry::AddDetector ( const DetId id,
const DetGeomDesc *&  gd 
)
inline

Definition at line 70 of file TotemRPGeometry.h.

References AddDetector().

Referenced by AddDetector().

70 { return AddDetector(id.rawId(), gd); }
char AddDetector(unsigned int, const DetGeomDesc *&)
adds an item to the map (detector ID –&gt; DetGeomDesc) performs necessary checks, returns 0 if succesfu...
char TotemRPGeometry::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 at line 113 of file TotemRPGeometry.cc.

References theRomanPotMap.

Referenced by Build().

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

References theMap.

Referenced by GeometryInfoModule::PrintGeometry().

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

begin iterator over RPs

Definition at line 107 of file TotemRPGeometry.h.

References theRomanPotMap.

Referenced by GeometryInfoModule::PrintGeometry().

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

build up from DetGeomDesc structure, return 0 = success

Definition at line 17 of file TotemRPGeometry.cc.

References AddDetector(), AddRPDevice(), BuildSets(), DetGeomDesc::components(), DetGeomDesc::copyno(), ztail::d, DDD_TOTEM_RP_DETECTOR_NAME, DDD_TOTEM_RP_PRIMARY_VACUUM_NAME, DetGeomDesc::geographicalID(), i, DDName::name(), DetGeomDesc::name(), and DetId::rawId().

Referenced by TotemRPGeometry().

18 {
19  using namespace std;
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  const DetGeomDesc *d = buffer.front();
27  buffer.pop_front();
28 
29  // check if it is RP detector
30  if (! d->name().name().compare(DDD_TOTEM_RP_DETECTOR_NAME)) {
31  //std::cout<<d->geographicalID().rawId()<<std::endl;
33  }
34 
35  // check if it is RP device (primary vacuum)
36  if (! d->name().name().compare(DDD_TOTEM_RP_PRIMARY_VACUUM_NAME)) {
37  AddRPDevice(d->copyno(), d);
38  }
39 
40  for (unsigned int i = 0; i < d->components().size(); i++) {
41  buffer.push_back( d->components()[i] );
42  }
43  }
44 
45  // build sets from theMap
46  BuildSets();
47 
48  return 0;
49 }
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.
uint32_t rawId() const
get the raw id
Definition: DetId.h:43
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
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) ...
virtual int copyno() const
Definition: DetGeomDesc.h:93
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 154 of file TotemRPGeometry.cc.

References TotemRPDetId::armOfDet(), detsInRP, TotemRPDetId::rawToDecId(), TotemRPDetId::rpOfDet(), rpsInStation, stationsInArm, TotemRPDetId::stOfDet(), and theMap.

Referenced by Build().

155 {
156  // reset
157  stationsInArm.clear();
158  rpsInStation.clear();
159  detsInRP.clear();
160 
161  // build
162  for (mapType::const_iterator it = theMap.begin(); it != theMap.end(); ++it) {
163  unsigned int id = TotemRPDetId::rawToDecId((*it).first);
166  detsInRP[TotemRPDetId::rpOfDet(id)].insert(id);
167  }
168 }
static unsigned int rpOfDet(unsigned int i)
returns ID of RP for given detector ID &#39;&#39;i&#39;&#39;
Definition: TotemRPDetId.h:141
static unsigned int rawToDecId(unsigned int raw)
fast conversion Raw to Decimal ID
Definition: TotemRPDetId.h:120
static unsigned int stOfDet(unsigned int i)
returns ID of station for given detector ID &#39;&#39;i&#39;&#39;
Definition: TotemRPDetId.h:144
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
static unsigned int armOfDet(unsigned int i)
returns ID of arm for given detector ID &#39;&#39;i&#39;&#39;
Definition: TotemRPDetId.h:147
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 204 of file TotemRPGeometry.cc.

References detsInRP.

205 {
206  mapSetType::const_iterator it = detsInRP.find(id);
207  if (it == detsInRP.end())
208  throw cms::Exception("TotemRPGeometry") << "RP with ID " << id << " not found.";
209  return (*it).second;
210 }
mapSetType detsInRP
std::set<unsigned int> TotemRPGeometry::DetsInRP ( const DetId id) const
inline

Definition at line 130 of file TotemRPGeometry.h.

References DetsInRP().

Referenced by DetsInRP().

130 { return DetsInRP(id.rawId()); }
std::set< unsigned int > DetsInRP(unsigned int) const
mapType::const_iterator TotemRPGeometry::endDet ( ) const
inline

end iterator over (silicon) detectors

Definition at line 103 of file TotemRPGeometry.h.

References theMap.

Referenced by GeometryInfoModule::PrintGeometry().

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

end iterator over RPs

Definition at line 110 of file TotemRPGeometry.h.

References theRomanPotMap.

Referenced by GeometryInfoModule::PrintGeometry().

110 { return theRomanPotMap.end(); }
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 68 of file TotemRPGeometry.cc.

References theMap.

Referenced by GetDetEdgeNormalVector(), GetDetTranslation(), FastLineRecognition::getGeomData(), GlobalToLocal(), GlobalToLocalDirection(), LocalToGlobal(), LocalToGlobalDirection(), and operator[]().

69 {
70  // check if id is RP id?
71 
72  // check if there is a corresponding key
73 // std::cout<<"TotemRPGeometry::GetDetector entered, id="<<id<<std::endl;
74  mapType::const_iterator it = theMap.find(id);
75  if (it == theMap.end())
76  throw cms::Exception("TotemRPGeometry") << "Detector with ID " << id << " not found.";
77 
78  // the [] operator cannot be used as this method is const
79  // and it must be const and one gets TotemRPGeometry const
80  // from EventSetup
81  //std::cout<<"det. retrieved:"<<id<<std::endl;
82  return (*it).second;
83 }
mapType theMap
map: detectorID –&gt; DetGeomDesc
DetGeomDesc* TotemRPGeometry::GetDetector ( const TotemRPDetId id) const
inline

Definition at line 80 of file TotemRPGeometry.h.

References GetDetector().

Referenced by GetDetector().

80 { return GetDetector(id.rawId()); }
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 106 of file TotemRPGeometry.cc.

References GetDetector(), DetGeomDesc::rotation(), and mathSSE::sqrt().

107 {
108  return GetDetector(id)->rotation() * CLHEP::Hep3Vector(-sqrt(2)/2, -sqrt(2)/2, 0.);
109 }
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 87 of file TotemRPGeometry.cc.

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

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

References GetDetector(), tmp, DetGeomDesc::translation(), x, y, and z.

Referenced by GetStationCentreZPosition(), TotemRPLocalTrackFitterAlgorithm::prepareReconstAlgebraData(), and BuildElasticCorrectionsFile::ProcessOnePot().

275 {
276  DetGeomDesc *gd = GetDetector(id);
277  CLHEP::Hep3Vector tmp;
278  tmp.setX((gd->translation()).x());
279  tmp.setY((gd->translation()).y());
280  tmp.setZ((gd->translation()).z());
281  return tmp;
282 }
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 286 of file TotemRPGeometry.cc.

References ztail::d, and LocalToGlobalDirection().

Referenced by GeometryInfoModule::PrintGeometry().

287 {
288  CLHEP::Hep3Vector d = LocalToGlobalDirection(id, CLHEP::Hep3Vector(0., 1., 0.));
289  dx = d.x();
290  dy = d.y();
291 }
tuple d
Definition: ztail.py:151
CLHEP::Hep3Vector LocalToGlobalDirection(unsigned int id, const CLHEP::Hep3Vector dir) const
DetGeomDesc * TotemRPGeometry::GetRPDevice ( int  copy_no) const

returns geometry of a RP box

Definition at line 126 of file TotemRPGeometry.cc.

References theRomanPotMap.

Referenced by GetRPGlobalRotation(), GetRPGlobalTranslation(), GetRPThinFoilNormalVector(), and GetRPThinFoilPosition().

127 {
128  // check if there is a corresponding key
129  RPDeviceMapType::const_iterator it = theRomanPotMap.find(copy_no);
130  if (it == theRomanPotMap.end())
131  throw cms::Exception("TotemRPGeometry") << "RP device with ID " << copy_no << " not found.";
132 
133  return (*it).second;
134 }
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 307 of file TotemRPGeometry.cc.

References GetRPDevice(), makeMuonMisalignmentScenario::rot, DetGeomDesc::rotation(), and create_public_lumi_plots::xy.

308 {
309  double xx, xy, xz, yx, yy, yz, zx, zy, zz;
310  GetRPDevice(copy_no)->rotation().GetComponents(xx, xy, xz, yx, yy, yz, zx, zy, zz);
311  CLHEP::HepRep3x3 rot_mat( xx, xy, xz, yx, yy, yz, zx, zy, zz);
312  CLHEP::HepRotation rot(rot_mat);
313  return rot;
314 }
DDRotationMatrix rotation() const
geometry information
Definition: DetGeomDesc.h:86
DetGeomDesc * GetRPDevice(int copy_no) const
returns geometry of a RP box
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 295 of file TotemRPGeometry.cc.

References GetRPDevice(), tmp, DetGeomDesc::translation(), x, y, and z.

296 {
297  CLHEP::Hep3Vector tmp;
298  DetGeomDesc * gd = GetRPDevice(copy_no);
299  tmp.setX((gd->translation()).x());
300  tmp.setY((gd->translation()).y());
301  tmp.setZ((gd->translation()).z());
302  return tmp;
303 }
Geometrical description of a detector.
Definition: DetGeomDesc.h:40
DDTranslation translation() const
Definition: DetGeomDesc.h:87
DetGeomDesc * GetRPDevice(int copy_no) const
returns geometry of a RP box
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 147 of file TotemRPGeometry.cc.

References GetRPDevice(), and DetGeomDesc::rotation().

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

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

Definition at line 138 of file TotemRPGeometry.cc.

References GetRPDevice(), and LocalToGlobal().

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

after checks returns the centre of a given station

Parameters
id2-digit decimal number

Definition at line 191 of file TotemRPGeometry.cc.

References GetDetTranslation(), and z.

192 {
193  unsigned int st_id = id%10;
194  unsigned int arm_id = id/10;
195 
196  TotemRPDetId near = TotemRPDetId(arm_id, st_id, 0, 0);
197  TotemRPDetId far = TotemRPDetId(arm_id, st_id, 5, 9);
198 
199  return (GetDetTranslation(near).z() + GetDetTranslation(far).z()) / 2.0;
200 }
Roman Pot detector ID.
Definition: TotemRPDetId.h:51
CLHEP::Hep3Vector GetDetTranslation(unsigned int id) const
CLHEP::Hep3Vector TotemRPGeometry::GlobalToLocal ( DetGeomDesc gd,
const CLHEP::Hep3Vector  r 
) const

Definition at line 237 of file TotemRPGeometry.cc.

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

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

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

249 {
250  DetGeomDesc *gd = GetDetector(id);
251  CLHEP::Hep3Vector tmp = r;
252  tmp.setX(tmp.x() - (gd->translation()).x());
253  tmp.setY(tmp.y() - (gd->translation()).y());
254  tmp.setZ(tmp.z() - (gd->translation()).z());
255  return (gd->rotation()).Inverse() * tmp;
256 }
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 267 of file TotemRPGeometry.cc.

References dir, GetDetector(), and idealTransformation::rotation.

268 {
269  return (GetDetector(id)->rotation()).Inverse() * dir;
270 }
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 214 of file TotemRPGeometry.cc.

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

Referenced by GetDetEdgePosition(), and GetRPThinFoilPosition().

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

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

226 {
227  DetGeomDesc *gd = GetDetector(id);
228  CLHEP::Hep3Vector tmp = gd->rotation() * 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 tmp;
233 }
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 260 of file TotemRPGeometry.cc.

References dir, GetDetector(), and DetGeomDesc::rotation().

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

261 {
262  return GetDetector(id)->rotation() * dir;
263 }
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.

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

same as GetDetector

Definition at line 82 of file TotemRPGeometry.h.

References GetDetector().

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

References rpsInStation.

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

References stationsInArm.

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

Referenced by BuildSets(), and DetsInRP().

mapSetType TotemRPGeometry::rpsInStation
protected

Definition at line 166 of file TotemRPGeometry.h.

Referenced by BuildSets(), and RPsInStation().

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 166 of file TotemRPGeometry.h.

Referenced by BuildSets(), and StationsInArm().

mapType TotemRPGeometry::theMap
protected

map: detectorID –> DetGeomDesc

Definition at line 161 of file TotemRPGeometry.h.

Referenced by AddDetector(), beginDet(), BuildSets(), endDet(), GetDetector(), and NumberOfDetsIncluded().

RPDeviceMapType TotemRPGeometry::theRomanPotMap
protected

map: RPID –> DetGeomDesc

Definition at line 162 of file TotemRPGeometry.h.

Referenced by AddRPDevice(), beginRP(), endRP(), and GetRPDevice().