CMS 3D CMS Logo

List of all members | Public Types | Public Member Functions | Private Member Functions | Private Attributes
DetGeomDesc Class Reference

Geometrical description of a sensor. More...

#include <DetGeomDesc.h>

Public Types

using Container = std::vector< DetGeomDesc * >
 
using RotationMatrix = ROOT::Math::Rotation3D
 
using Translation = ROOT::Math::DisplacementVector3D< ROOT::Math::Cartesian3D< double >>
 

Public Member Functions

void addComponent (DetGeomDesc *)
 components (children) management More...
 
void applyAlignment (const CTPPSRPAlignmentCorrectionData &)
 alignment More...
 
Container components () const
 access to the tree structure More...
 
int copyno () const
 
 DetGeomDesc (DDFilteredView *fv)
 Constructors to be used when looping over DDD. More...
 
 DetGeomDesc (const DetGeomDesc &)
 copy constructor and assignment operator More...
 
DetId geographicalID () const
 
bool isLeaf () const
 
const std::string & name () const
 
DetGeomDescoperator= (const DetGeomDesc &)
 
std::vector< double > params () const
 
float parentZPosition () const
 
RotationMatrix rotation () const
 geometry information More...
 
const std::string & sensorType () const
 
void setGeographicalID (DetId id)
 ID stuff. More...
 
Translation translation () const
 
virtual ~DetGeomDesc ()
 destructor More...
 

Private Member Functions

void clearComponents ()
 traverses the treee and deletes all nodes. More...
 
void deepDeleteComponents ()
 deletes just the first daughters More...
 
void deleteComponents ()
 
 DetGeomDesc ()
 

Private Attributes

Container m_container
 
int m_copy
 
DetId m_geographicalID
 
std::string m_name
 
std::vector< double > m_params
 
RotationMatrix m_rot
 
std::string m_sensorType
 
Translation m_trans
 
float m_z
 

Detailed Description

Geometrical description of a sensor.

Class resembling GeometricDet class. Slight changes were made to suit needs of the TOTEM RP description. Each instance is a tree node, with geometrical information from DDD (shift, rotation, material, ...), ID and list of children nodes.

The translation and rotation parameters are defined by local-to-global coordinate transform. That is, if r_l is a point in local coordinate system and x_g in global, then the transform reads:

   x_g = rotation * x_l + translation

Definition at line 35 of file DetGeomDesc.h.

Member Typedef Documentation

using DetGeomDesc::Container = std::vector< DetGeomDesc* >

Definition at line 38 of file DetGeomDesc.h.

using DetGeomDesc::RotationMatrix = ROOT::Math::Rotation3D

Definition at line 39 of file DetGeomDesc.h.

using DetGeomDesc::Translation = ROOT::Math::DisplacementVector3D<ROOT::Math::Cartesian3D<double>>

Definition at line 40 of file DetGeomDesc.h.

Constructor & Destructor Documentation

DetGeomDesc::DetGeomDesc ( DDFilteredView fv)

Constructors to be used when looping over DDD.

Definition at line 25 of file DetGeomDesc.cc.

References DDD_CTPPS_PIXELS_SENSOR_NAME, DDD_CTPPS_PIXELS_SENSOR_TYPE_2x2, runEdmFileComparison::found, DDFilteredView::geoHistory(), m_sensorType, and AlCaHLTBitMon_QueryRunRegistry::string.

25  :
26  m_trans( fv->translation()),
27  m_rot( fv->rotation()),
28  m_name((( fv->logicalPart()).ddname()).name()),
29  m_params((( fv->logicalPart()).solid()).parameters()),
30  m_copy( fv->copyno()),
31  m_z( fv->geoHistory().back().absTranslation().z()),
32  m_sensorType("")
33 {
34  std::string sensor_name = fv->geoHistory().back().logicalPart().name().fullname();
35  std::size_t found = sensor_name.find(DDD_CTPPS_PIXELS_SENSOR_NAME);
36  if (found != std::string::npos && sensor_name.substr(found - 4, 3) == DDD_CTPPS_PIXELS_SENSOR_TYPE_2x2)
38 }
Translation m_trans
Definition: DetGeomDesc.h:82
const DDLogicalPart & logicalPart() const
The logical-part of the current node in the filtered-view.
std::string m_name
Definition: DetGeomDesc.h:84
const DDRotationMatrix & rotation() const
The absolute rotation of the current node.
std::string m_sensorType
Definition: DetGeomDesc.h:89
const DDGeoHistory & geoHistory() const
The list of ancestors up to the root-node of the current node.
const std::string DDD_CTPPS_PIXELS_SENSOR_TYPE_2x2
Definition: CTPPSDDDNames.h:16
std::vector< double > m_params
Definition: DetGeomDesc.h:85
int copyno() const
Copy number associated with the current node.
const std::string & name() const
Definition: DetGeomDesc.h:67
const DDTranslation & translation() const
The absolute translation of the current node.
const std::string DDD_CTPPS_PIXELS_SENSOR_NAME
Definition: CTPPSDDDNames.h:15
RotationMatrix m_rot
Definition: DetGeomDesc.h:83
DetGeomDesc::DetGeomDesc ( const DetGeomDesc ref)

copy constructor and assignment operator

Definition at line 41 of file DetGeomDesc.cc.

42 {
43  (*this) = ref;
44 }
DetGeomDesc::~DetGeomDesc ( )
virtual

destructor

Definition at line 63 of file DetGeomDesc.cc.

References deepDeleteComponents().

64 {
66 }
void deepDeleteComponents()
deletes just the first daughters
Definition: DetGeomDesc.cc:91
DetGeomDesc::DetGeomDesc ( )
inlineprivate

Definition at line 76 of file DetGeomDesc.h.

References deepDeleteComponents(), and deleteComponents().

76 {}

Member Function Documentation

void DetGeomDesc::addComponent ( DetGeomDesc det)

components (children) management

Definition at line 77 of file DetGeomDesc.cc.

References m_container.

Referenced by CTPPSGeometryESModule::applyAlignments(), CTPPSGeometryESModule::buildDetGeomDesc(), and parentZPosition().

78 {
79  m_container.emplace_back( det );
80 }
Container m_container
Definition: DetGeomDesc.h:81
void DetGeomDesc::applyAlignment ( const CTPPSRPAlignmentCorrectionData t)

alignment

Definition at line 102 of file DetGeomDesc.cc.

References CTPPSRPAlignmentCorrectionData::getRotationMatrix(), CTPPSRPAlignmentCorrectionData::getTranslation(), m_rot, and m_trans.

Referenced by CTPPSGeometryESModule::applyAlignments(), and sensorType().

103 {
104  m_rot = t.getRotationMatrix() * m_rot;
106 }
Translation m_trans
Definition: DetGeomDesc.h:82
ROOT::Math::Rotation3D getRotationMatrix() const
RotationMatrix m_rot
Definition: DetGeomDesc.h:83
void DetGeomDesc::clearComponents ( )
inlineprivate

traverses the treee and deletes all nodes.

Definition at line 79 of file DetGeomDesc.h.

References m_container.

Referenced by deepDeleteComponents().

79 { m_container.resize(0); }
Container m_container
Definition: DetGeomDesc.h:81
DetGeomDesc::Container DetGeomDesc::components ( ) const

access to the tree structure

Definition at line 70 of file DetGeomDesc.cc.

References m_container.

Referenced by CTPPSGeometryESModule::applyAlignments(), CTPPSGeometry::build(), and geographicalID().

71 {
72  return m_container;
73 }
Container m_container
Definition: DetGeomDesc.h:81
int DetGeomDesc::copyno ( ) const
inline

Definition at line 69 of file DetGeomDesc.h.

References m_copy.

69 { return m_copy; }
void DetGeomDesc::deepDeleteComponents ( )
private

deletes just the first daughters

Definition at line 91 of file DetGeomDesc.cc.

References clearComponents(), and m_container.

Referenced by DetGeomDesc(), and ~DetGeomDesc().

92 {
93  for( auto & it : m_container ) {
94  it->deepDeleteComponents();
95  delete it;
96  }
98 }
Container m_container
Definition: DetGeomDesc.h:81
void clearComponents()
traverses the treee and deletes all nodes.
Definition: DetGeomDesc.h:79
void DetGeomDesc::deleteComponents ( )
private

Definition at line 84 of file DetGeomDesc.cc.

References m_container.

Referenced by DetGeomDesc().

85 {
86  m_container.erase( m_container.begin(), m_container.end());
87 }
Container m_container
Definition: DetGeomDesc.h:81
DetId DetGeomDesc::geographicalID ( ) const
inline

Definition at line 54 of file DetGeomDesc.h.

References components(), and m_geographicalID.

Referenced by CTPPSGeometryESModule::applyAlignments(), and CTPPSGeometry::build().

54 { return m_geographicalID; }
DetId m_geographicalID
Definition: DetGeomDesc.h:86
bool DetGeomDesc::isLeaf ( ) const
inline

Definition at line 62 of file DetGeomDesc.h.

References m_container.

62 { return m_container.empty(); }
Container m_container
Definition: DetGeomDesc.h:81
const std::string& DetGeomDesc::name ( void  ) const
inline
DetGeomDesc & DetGeomDesc::operator= ( const DetGeomDesc ref)

Definition at line 48 of file DetGeomDesc.cc.

References m_copy, m_geographicalID, m_name, m_params, m_rot, m_sensorType, m_trans, and m_z.

49 {
50  m_params = ref.m_params;
51  m_trans = ref.m_trans;
52  m_rot = ref.m_rot;
53  m_name = ref.m_name;
54  m_copy = ref.m_copy;
56  m_z = ref.m_z;
58  return (*this);
59 }
Translation m_trans
Definition: DetGeomDesc.h:82
std::string m_name
Definition: DetGeomDesc.h:84
std::string m_sensorType
Definition: DetGeomDesc.h:89
std::vector< double > m_params
Definition: DetGeomDesc.h:85
DetId m_geographicalID
Definition: DetGeomDesc.h:86
RotationMatrix m_rot
Definition: DetGeomDesc.h:83
std::vector<double> DetGeomDesc::params ( ) const
inline
float DetGeomDesc::parentZPosition ( ) const
inline

Definition at line 58 of file DetGeomDesc.h.

References addComponent(), and m_z.

Referenced by CTPPSDiamondRecHitProducerAlgorithm::build(), and TotemTimingRecHitProducerAlgorithm::build().

58 { return m_z; }
RotationMatrix DetGeomDesc::rotation ( void  ) const
inline
const std::string& DetGeomDesc::sensorType ( ) const
inline

Definition at line 70 of file DetGeomDesc.h.

References applyAlignment(), and m_sensorType.

Referenced by CTPPSDirectProtonSimulation::processProton().

70 { return m_sensorType; }
std::string m_sensorType
Definition: DetGeomDesc.h:89
void DetGeomDesc::setGeographicalID ( DetId  id)
inline

ID stuff.

Definition at line 53 of file DetGeomDesc.h.

References triggerObjects_cff::id, and m_geographicalID.

Referenced by CTPPSGeometryESModule::buildDetGeomDesc().

Translation DetGeomDesc::translation ( void  ) const
inline

Member Data Documentation

Container DetGeomDesc::m_container
private
int DetGeomDesc::m_copy
private

Definition at line 87 of file DetGeomDesc.h.

Referenced by copyno(), and operator=().

DetId DetGeomDesc::m_geographicalID
private

Definition at line 86 of file DetGeomDesc.h.

Referenced by geographicalID(), operator=(), and setGeographicalID().

std::string DetGeomDesc::m_name
private

Definition at line 84 of file DetGeomDesc.h.

Referenced by name(), and operator=().

std::vector<double> DetGeomDesc::m_params
private

Definition at line 85 of file DetGeomDesc.h.

Referenced by operator=(), and params().

RotationMatrix DetGeomDesc::m_rot
private

Definition at line 83 of file DetGeomDesc.h.

Referenced by applyAlignment(), operator=(), and rotation().

std::string DetGeomDesc::m_sensorType
private

Definition at line 89 of file DetGeomDesc.h.

Referenced by DetGeomDesc(), operator=(), and sensorType().

Translation DetGeomDesc::m_trans
private

Definition at line 82 of file DetGeomDesc.h.

Referenced by applyAlignment(), operator=(), and translation().

float DetGeomDesc::m_z
private

Definition at line 88 of file DetGeomDesc.h.

Referenced by operator=(), and parentZPosition().