23 deque<const DetGeomDesc *> buffer;
25 while (buffer.size() > 0)
53 if (theMap.find(
id) != theMap.end())
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. "
94 double x=-36.07/2+22.276/(2*
sqrt(2));
95 return LocalToGlobal(
id, CLHEP::Hep3Vector(x, x, 0.));
104 return GetDetector(
id)->rotation() * CLHEP::Hep3Vector(-
sqrt(2)/2, -
sqrt(2)/2, 0.);
112 if (theRomanPotMap.find(
id) != theRomanPotMap.end())
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. "
139 return LocalToGlobal(GetRPDevice(copy_no), CLHEP::Hep3Vector(0., -135.65/2.0, 0.));
146 return GetRPDevice(copy_no)->rotation() * CLHEP::Hep3Vector(0., -1., 0.);
154 stationsInArm.clear();
155 rpsInStation.clear();
159 for (mapType::const_iterator it = theMap.begin(); it != theMap.end(); ++it)
166 stationsInArm[armId].insert(armId);
167 rpsInStation[stId].insert(rpId);
168 detsInRP[rpId].insert(detId);
175 mapSetType::const_iterator it = stationsInArm.find(
id);
176 if (it == stationsInArm.end())
177 throw cms::Exception(
"TotemRPGeometry") <<
"Arm with ID " <<
id <<
" not found.";
185 mapSetType::const_iterator it = rpsInStation.find(
id);
186 if (it == rpsInStation.end())
187 throw cms::Exception(
"TotemRPGeometry") <<
"Station with ID " <<
id <<
" not found.";
195 mapSetType::const_iterator it = detsInRP.find(
id);
196 if (it == detsInRP.end())
197 throw cms::Exception(
"TotemRPGeometry") <<
"RP with ID " <<
id <<
" not found.";
228 CLHEP::Hep3Vector
tmp =
r;
240 CLHEP::Hep3Vector
tmp =
r;
251 return GetDetector(
id)->rotation() *
dir;
258 return (GetDetector(
id)->
rotation()).Inverse() *
dir;
266 CLHEP::Hep3Vector
tmp;
277 CLHEP::Hep3Vector
d = LocalToGlobalDirection(
id, CLHEP::Hep3Vector(0., 1., 0.));
286 CLHEP::Hep3Vector
tmp;
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);
Detector ID class for TOTEM Si strip detectors.
DetGeomDesc * GetRPDevice(unsigned int id) const
returns geometry of a RP box
DDRotationMatrix rotation() const
geometry information
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) ...
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
void BuildSets()
builds maps element ID –> set of subelements (re)builds stationsInArm, rpsInStation, detsInRP out of theMap
const char DDD_TOTEM_RP_PRIMARY_VACUUM_NAME[]
DDD name of RP.
DetGeomDesc * GetDetector(unsigned int) const
returns geometry of a detector performs necessary checks, returns NULL if fails input is raw ID ...
CTPPSDetId getStationId() const
char AddRPDevice(unsigned int id, const DetGeomDesc *&det_geom_desc)
adds a RP package (primary vacuum) to a map
void GetReadoutDirection(unsigned int id, double &dx, double &dy) const
std::set< unsigned int > RPsInStation(unsigned int) const
after checks returns set of RP corresponding to the given station ID
std::set< unsigned int > DetsInRP(unsigned int) const
T x() const
Cartesian x coordinate.
CLHEP::Hep3Vector GlobalToLocalDirection(unsigned int id, const CLHEP::Hep3Vector dir) const
CLHEP::Hep3Vector GetDetTranslation(unsigned int id) const
virtual ConstContainer components() const
access to the tree structure
Geometrical description of a detector.
DDTranslation translation() const
CTPPSDetId getRPId() const
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
CLHEP::HepRotation GetRPGlobalRotation(int copy_no) const
returns number of detectors in the geometry (size of theMap)
CTPPSDetId getArmId() const
virtual DetId geographicalID() const
CLHEP::Hep3Vector LocalToGlobal(DetGeomDesc *gd, const CLHEP::Hep3Vector r) const
Base class for CTPPS detector IDs.
std::set< unsigned int > StationsInArm(unsigned int) const
after checks returns set of stations corresponding to the given arm ID
std::vector< std::vector< double > > tmp
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 –> DetGeomDesc) performs necessary checks, returns 0 if succesfu...
const std::string & name() const
Returns the name.
CLHEP::Hep3Vector GetRPThinFoilNormalVector(int copy_no) const
returns a normal vector for the thin foil of a RP box