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 (const DetGeomDesc &)
 copy constructor and assignment operator More...
 
 DetGeomDesc (DDFilteredView *fv)
 Constructors to be used when looping over DDD. 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 34 of file DetGeomDesc.h.

Member Typedef Documentation

◆ Container

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

Definition at line 36 of file DetGeomDesc.h.

◆ RotationMatrix

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

Definition at line 37 of file DetGeomDesc.h.

◆ Translation

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

Definition at line 38 of file DetGeomDesc.h.

Constructor & Destructor Documentation

◆ DetGeomDesc() [1/3]

DetGeomDesc::DetGeomDesc ( DDFilteredView fv)

Constructors to be used when looping over DDD.

Definition at line 24 of file DetGeomDesc.cc.

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  std::string sensor_name = fv->geoHistory().back().logicalPart().name().fullname();
34  std::size_t found = sensor_name.find(DDD_CTPPS_PIXELS_SENSOR_NAME);
35  if (found != std::string::npos && sensor_name.substr(found - 4, 3) == DDD_CTPPS_PIXELS_SENSOR_TYPE_2x2) {
37  }

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

◆ DetGeomDesc() [2/3]

DetGeomDesc::DetGeomDesc ( const DetGeomDesc ref)

copy constructor and assignment operator

Definition at line 40 of file DetGeomDesc.cc.

◆ ~DetGeomDesc()

DetGeomDesc::~DetGeomDesc ( )
virtual

destructor

Definition at line 58 of file DetGeomDesc.cc.

References deepDeleteComponents().

◆ DetGeomDesc() [3/3]

DetGeomDesc::DetGeomDesc ( )
inlineprivate

Definition at line 74 of file DetGeomDesc.h.

74 :
75  DetGeomDesc() {}

Member Function Documentation

◆ addComponent()

void DetGeomDesc::addComponent ( DetGeomDesc det)

components (children) management

Definition at line 66 of file DetGeomDesc.cc.

References m_container.

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

◆ applyAlignment()

void DetGeomDesc::applyAlignment ( const CTPPSRPAlignmentCorrectionData t)

alignment

Definition at line 84 of file DetGeomDesc.cc.

85  {
86  m_rot = t.getRotationMatrix() * m_rot;
87  m_trans = t.getTranslation() + m_trans;

References m_rot, m_trans, and OrderedSet::t.

Referenced by CTPPSGeometryESModule::applyAlignments().

◆ clearComponents()

void DetGeomDesc::clearComponents ( )
inlineprivate

traverses the treee and deletes all nodes.

Definition at line 77 of file DetGeomDesc.h.

78 { m_container.resize(0); }

Referenced by deepDeleteComponents().

◆ components()

DetGeomDesc::Container DetGeomDesc::components ( ) const

access to the tree structure

Definition at line 62 of file DetGeomDesc.cc.

References m_container.

Referenced by CTPPSGeometryESModule::applyAlignments().

◆ copyno()

int DetGeomDesc::copyno ( ) const
inline

Definition at line 67 of file DetGeomDesc.h.

67 { return m_params; }

References m_params.

◆ deepDeleteComponents()

void DetGeomDesc::deepDeleteComponents ( )
private

deletes just the first daughters

Definition at line 74 of file DetGeomDesc.cc.

75  {
76  for (auto& it : m_container) {
77  it->deepDeleteComponents();
78  delete it;
79  }

References clearComponents(), and m_container.

Referenced by ~DetGeomDesc().

◆ deleteComponents()

void DetGeomDesc::deleteComponents ( )
private

Definition at line 70 of file DetGeomDesc.cc.

References m_container.

◆ geographicalID()

DetId DetGeomDesc::geographicalID ( ) const
inline

Definition at line 52 of file DetGeomDesc.h.

52 { m_geographicalID = id; }

References triggerObjects_cff::id, and m_geographicalID.

Referenced by CTPPSGeometryESModule::applyAlignments().

◆ isLeaf()

bool DetGeomDesc::isLeaf ( ) const
inline

Definition at line 60 of file DetGeomDesc.h.

61 { return m_container.empty(); }

◆ name()

const std::string& DetGeomDesc::name ( void  ) const
inline

◆ operator=()

DetGeomDesc & DetGeomDesc::operator= ( const DetGeomDesc ref)

Definition at line 44 of file DetGeomDesc.cc.

45  {
46  m_params = ref.m_params;
47  m_trans = ref.m_trans;
48  m_rot = ref.m_rot;
49  m_name = ref.m_name;
50  m_copy = ref.m_copy;
52  m_z = ref.m_z;
54  return (*this);

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

◆ params()

std::vector<double> DetGeomDesc::params ( ) const
inline

◆ parentZPosition()

float DetGeomDesc::parentZPosition ( ) const
inline

Definition at line 56 of file DetGeomDesc.h.

57 { return m_z; }

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

◆ rotation()

RotationMatrix DetGeomDesc::rotation ( void  ) const
inline

◆ sensorType()

const std::string& DetGeomDesc::sensorType ( ) const
inline

Definition at line 68 of file DetGeomDesc.h.

68 { return m_copy; }

References m_copy.

◆ setGeographicalID()

void DetGeomDesc::setGeographicalID ( DetId  id)
inline

ID stuff.

Definition at line 51 of file DetGeomDesc.h.

52 { m_geographicalID = id; }

Referenced by CTPPSGeometryESModule::buildDetGeomDesc().

◆ translation()

Translation DetGeomDesc::translation ( void  ) const
inline

Member Data Documentation

◆ m_container

Container DetGeomDesc::m_container
private

Definition at line 79 of file DetGeomDesc.h.

Referenced by addComponent(), components(), deepDeleteComponents(), and deleteComponents().

◆ m_copy

int DetGeomDesc::m_copy
private

Definition at line 85 of file DetGeomDesc.h.

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

◆ m_geographicalID

DetId DetGeomDesc::m_geographicalID
private

Definition at line 84 of file DetGeomDesc.h.

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

◆ m_name

std::string DetGeomDesc::m_name
private

Definition at line 82 of file DetGeomDesc.h.

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

◆ m_params

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

Definition at line 83 of file DetGeomDesc.h.

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

◆ m_rot

RotationMatrix DetGeomDesc::m_rot
private

Definition at line 81 of file DetGeomDesc.h.

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

◆ m_sensorType

std::string DetGeomDesc::m_sensorType
private

Definition at line 87 of file DetGeomDesc.h.

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

◆ m_trans

Translation DetGeomDesc::m_trans
private

Definition at line 80 of file DetGeomDesc.h.

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

◆ m_z

float DetGeomDesc::m_z
private

Definition at line 86 of file DetGeomDesc.h.

Referenced by operator=().

DDD_CTPPS_PIXELS_SENSOR_NAME
const std::string DDD_CTPPS_PIXELS_SENSOR_NAME
Definition: CTPPSDDDNames.h:14
DDFilteredView::logicalPart
const DDLogicalPart & logicalPart() const
The logical-part of the current node in the filtered-view.
Definition: DDFilteredView.cc:16
DetGeomDesc::m_copy
int m_copy
Definition: DetGeomDesc.h:85
DetGeomDesc::m_sensorType
std::string m_sensorType
Definition: DetGeomDesc.h:87
DetGeomDesc::m_container
Container m_container
Definition: DetGeomDesc.h:79
DetGeomDesc::m_name
std::string m_name
Definition: DetGeomDesc.h:82
DDD_CTPPS_PIXELS_SENSOR_TYPE_2x2
const std::string DDD_CTPPS_PIXELS_SENSOR_TYPE_2x2
Definition: CTPPSDDDNames.h:15
DetGeomDesc::m_params
std::vector< double > m_params
Definition: DetGeomDesc.h:83
newFWLiteAna.found
found
Definition: newFWLiteAna.py:118
DetGeomDesc::clearComponents
void clearComponents()
traverses the treee and deletes all nodes.
Definition: DetGeomDesc.h:77
DetGeomDesc::m_z
float m_z
Definition: DetGeomDesc.h:86
parameters
parameters
Definition: BeamSpot_PayloadInspector.cc:14
OrderedSet.t
t
Definition: OrderedSet.py:90
AlCaHLTBitMon_QueryRunRegistry.string
string
Definition: AlCaHLTBitMon_QueryRunRegistry.py:256
DetGeomDesc::name
const std::string & name() const
Definition: DetGeomDesc.h:65
DDFilteredView::geoHistory
const DDGeoHistory & geoHistory() const
The list of ancestors up to the root-node of the current node.
Definition: DDFilteredView.cc:30
triggerObjects_cff.id
id
Definition: triggerObjects_cff.py:31
DDFilteredView::translation
const DDTranslation & translation() const
The absolute translation of the current node.
Definition: DDFilteredView.cc:26
DDFilteredView::rotation
const DDRotationMatrix & rotation() const
The absolute rotation of the current node.
Definition: DDFilteredView.cc:28
DetGeomDesc::m_geographicalID
DetId m_geographicalID
Definition: DetGeomDesc.h:84
DetGeomDesc::DetGeomDesc
DetGeomDesc()
Definition: DetGeomDesc.h:74
DDFilteredView::copyno
int copyno() const
Copy number associated with the current node.
Definition: DDFilteredView.cc:48
DetGeomDesc::m_trans
Translation m_trans
Definition: DetGeomDesc.h:80
DetGeomDesc::m_rot
RotationMatrix m_rot
Definition: DetGeomDesc.h:81