CMS 3D CMS Logo

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

Geometrical description of a sensor. More...

#include <DetGeomDesc.h>

Public Types

typedef std::vector< const DetGeomDesc * > ConstContainer
 
typedef std::vector< DetGeomDesc * > Container
 
typedef unsigned int GeometricEnumType
 a type (not used in the moment, left for the future) More...
 
typedef DDExpandedView::nav_type nav_type
 

Public Member Functions

void addComponent (DetGeomDesc *)
 
void addComponents (Container cont)
 
void ApplyAlignment (const RPAlignmentCorrectionData &)
 alignment More...
 
void clearComponents ()
 
virtual ConstContainer components () const
 access to the tree structure More...
 
virtual Container components ()
 
virtual int copyno () const
 
virtual ConstContainer deepComponents () const
 
void deepDeleteComponents ()
 deletes just the first daughters More...
 
void deleteComponents ()
 
virtual double density () const
 
 DetGeomDesc (nav_type navtype, GeometricEnumType dd=0)
 Constructors to be used when looping over DDD. More...
 
 DetGeomDesc (DDExpandedView *ev, GeometricEnumType dd=0)
 
 DetGeomDesc (DDFilteredView *fv, GeometricEnumType dd=0)
 
 DetGeomDesc (const DetGeomDesc &)
 copy constructor and assignment operator More...
 
virtual DetId geographicalID () const
 
bool isLeaf () const
 traverses the treee and deletes all nodes. More...
 
virtual std::string material () const
 
DDName name () const
 
nav_type navType () const
 
DetGeomDescoperator= (const DetGeomDesc &)
 
std::vector< double > params () const
 
virtual std::vector< DDExpandedNodeparents () const
 returns all the components below More...
 
DDRotationMatrix rotation () const
 geometry information More...
 
void setComponents (Container cont)
 components (children) management More...
 
void setGeographicalID (DetId id)
 ID stuff. More...
 
DDSolidShape shape () const
 
DDTranslation translation () const
 
GeometricEnumType type () const
 
virtual double volume () const
 
virtual double weight () const
 
virtual ~DetGeomDesc ()
 destructor More...
 

Private Attributes

Container _container
 
int _copy
 
nav_type _ddd
 
DDName _ddname
 
double _density
 
DetId _geographicalID
 
std::string _material
 
std::vector< double > _params
 
std::vector< DDExpandedNode_parents
 
DDRotationMatrix _rot
 
DDSolidShape _shape
 
DDTranslation _trans
 
GeometricEnumType _type
 
double _volume
 
double _weight
 

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 37 of file DetGeomDesc.h.

Member Typedef Documentation

typedef std::vector< const DetGeomDesc*> DetGeomDesc::ConstContainer

Definition at line 40 of file DetGeomDesc.h.

typedef std::vector< DetGeomDesc*> DetGeomDesc::Container

Definition at line 41 of file DetGeomDesc.h.

typedef unsigned int DetGeomDesc::GeometricEnumType

a type (not used in the moment, left for the future)

Definition at line 45 of file DetGeomDesc.h.

Definition at line 42 of file DetGeomDesc.h.

Constructor & Destructor Documentation

DetGeomDesc::DetGeomDesc ( nav_type  navtype,
GeometricEnumType  dd = 0 
)

Constructors to be used when looping over DDD.

Definition at line 24 of file DetGeomDesc.cc.

References _copy, _ddd, _ddname, _density, _material, _params, _parents, _rot, _shape, _trans, _volume, _weight, DDExpandedView::copyno(), density(), ev, DDExpandedView::geoHistory(), DDExpandedView::goTo(), DDExpandedView::logicalPart(), material(), name(), DDExpandedView::rotation(), shape(), DDExpandedView::translation(), and volume().

24  : _ddd(std::move(navtype)), _type(type)
25 {
26  DDCompactView cpv;
27  DDExpandedView ev(cpv);
28  ev.goTo(_ddd);
29  _params = ((ev.logicalPart()).solid()).parameters();
30  _trans = ev.translation();
31  _rot = ev.rotation();
32  _shape = ((ev.logicalPart()).solid()).shape();
33  _ddname = ((ev.logicalPart()).ddname()).name();
34  _parents = ev.geoHistory();
35  _volume = ((ev.logicalPart()).solid()).volume();
36  _density = ((ev.logicalPart()).material()).density();
37  _weight = _density * ( _volume / 1000.); // volume mm3->cm3
38  _copy = ev.copyno();
39  _material = ((ev.logicalPart()).material()).name();
40 }
std::vector< DDExpandedNode > _parents
Definition: DetGeomDesc.h:109
type
Definition: HCALResponse.h:21
DDSolidShape _shape
Definition: DetGeomDesc.h:104
DDRotationMatrix _rot
Definition: DetGeomDesc.h:103
virtual double density() const
Definition: DetGeomDesc.h:92
bool ev
double _volume
Definition: DetGeomDesc.h:110
type of data representation of DDCompactView
Definition: DDCompactView.h:90
DDTranslation _trans
Definition: DetGeomDesc.h:102
DDName name() const
Definition: DetGeomDesc.h:87
virtual std::string material() const
Definition: DetGeomDesc.h:94
GeometricEnumType _type
Definition: DetGeomDesc.h:106
virtual double volume() const
Definition: DetGeomDesc.h:91
double _density
Definition: DetGeomDesc.h:111
double _weight
Definition: DetGeomDesc.h:112
std::vector< double > _params
Definition: DetGeomDesc.h:107
nav_type _ddd
Definition: DetGeomDesc.h:101
DDName _ddname
Definition: DetGeomDesc.h:105
std::string _material
Definition: DetGeomDesc.h:114
Provides an exploded view of the detector (tree-view)
def move(src, dest)
Definition: eostools.py:510
DDSolidShape shape() const
Definition: DetGeomDesc.h:85
DetGeomDesc::DetGeomDesc ( DDExpandedView ev,
GeometricEnumType  dd = 0 
)

Definition at line 44 of file DetGeomDesc.cc.

References _copy, _ddd, _ddname, _density, _material, _params, _parents, _rot, _shape, _trans, _volume, _weight, DDExpandedView::copyno(), density(), DDExpandedView::geoHistory(), DDExpandedView::logicalPart(), material(), name(), DDExpandedView::navPos(), DDExpandedView::rotation(), shape(), DDExpandedView::translation(), and volume().

44  : _type(type)
45 {
46  _ddd = fv->navPos();
47  _params = ((fv->logicalPart()).solid()).parameters();
48  _trans = fv->translation();
49  _rot = fv->rotation();
50  _shape = ((fv->logicalPart()).solid()).shape();
51  _ddname = ((fv->logicalPart()).ddname()).name();
52  _parents = fv->geoHistory();
53  _volume = ((fv->logicalPart()).solid()).volume();
54  _density = ((fv->logicalPart()).material()).density();
55  _weight = _density * ( _volume / 1000.); // volume mm3->cm3
56  _copy = fv->copyno();
57  _material = ((fv->logicalPart()).material()).name();
58 }
std::vector< DDExpandedNode > _parents
Definition: DetGeomDesc.h:109
type
Definition: HCALResponse.h:21
DDSolidShape _shape
Definition: DetGeomDesc.h:104
DDRotationMatrix _rot
Definition: DetGeomDesc.h:103
virtual double density() const
Definition: DetGeomDesc.h:92
double _volume
Definition: DetGeomDesc.h:110
DDTranslation _trans
Definition: DetGeomDesc.h:102
DDName name() const
Definition: DetGeomDesc.h:87
virtual std::string material() const
Definition: DetGeomDesc.h:94
GeometricEnumType _type
Definition: DetGeomDesc.h:106
virtual double volume() const
Definition: DetGeomDesc.h:91
double _density
Definition: DetGeomDesc.h:111
double _weight
Definition: DetGeomDesc.h:112
std::vector< double > _params
Definition: DetGeomDesc.h:107
nav_type _ddd
Definition: DetGeomDesc.h:101
DDName _ddname
Definition: DetGeomDesc.h:105
std::string _material
Definition: DetGeomDesc.h:114
DDSolidShape shape() const
Definition: DetGeomDesc.h:85
DetGeomDesc::DetGeomDesc ( DDFilteredView fv,
GeometricEnumType  dd = 0 
)

Definition at line 62 of file DetGeomDesc.cc.

References _copy, _ddd, _ddname, _density, _material, _params, _parents, _rot, _shape, _trans, _volume, _weight, DDFilteredView::copyno(), density(), DDFilteredView::geoHistory(), DDFilteredView::logicalPart(), material(), name(), DDFilteredView::navPos(), DDFilteredView::rotation(), shape(), DDFilteredView::translation(), and volume().

62  : _type(type)
63 {
64  _ddd = fv->navPos();
65  _params = ((fv->logicalPart()).solid()).parameters();
66  _trans = fv->translation();
67  _rot = fv->rotation();
68  _shape = ((fv->logicalPart()).solid()).shape();
69  _ddname = ((fv->logicalPart()).ddname()).name();
70  _parents = fv->geoHistory();
71  _volume = ((fv->logicalPart()).solid()).volume();
72  _density = ((fv->logicalPart()).material()).density();
73  _weight = _density * ( _volume / 1000.); // volume mm3->cm3
74  _copy = fv->copyno();
75  _material = ((fv->logicalPart()).material()).name();
76 }
std::vector< DDExpandedNode > _parents
Definition: DetGeomDesc.h:109
type
Definition: HCALResponse.h:21
const DDLogicalPart & logicalPart() const
The logical-part of the current node in the filtered-view.
DDSolidShape _shape
Definition: DetGeomDesc.h:104
const DDRotationMatrix & rotation() const
The absolute rotation of the current node.
DDRotationMatrix _rot
Definition: DetGeomDesc.h:103
virtual double density() const
Definition: DetGeomDesc.h:92
nav_type navPos() const
return the stack of sibling numbers
double _volume
Definition: DetGeomDesc.h:110
const DDGeoHistory & geoHistory() const
The list of ancestors up to the root-node of the current node.
int copyno() const
Copy number associated with the current node.
DDTranslation _trans
Definition: DetGeomDesc.h:102
DDName name() const
Definition: DetGeomDesc.h:87
virtual std::string material() const
Definition: DetGeomDesc.h:94
GeometricEnumType _type
Definition: DetGeomDesc.h:106
virtual double volume() const
Definition: DetGeomDesc.h:91
double _density
Definition: DetGeomDesc.h:111
double _weight
Definition: DetGeomDesc.h:112
std::vector< double > _params
Definition: DetGeomDesc.h:107
nav_type _ddd
Definition: DetGeomDesc.h:101
DDName _ddname
Definition: DetGeomDesc.h:105
const DDTranslation & translation() const
The absolute translation of the current node.
std::string _material
Definition: DetGeomDesc.h:114
DDSolidShape shape() const
Definition: DetGeomDesc.h:85
DetGeomDesc::DetGeomDesc ( const DetGeomDesc ref)

copy constructor and assignment operator

Definition at line 80 of file DetGeomDesc.cc.

81 {
82  (*this) = ref;
83 }
DetGeomDesc::~DetGeomDesc ( )
virtual

destructor

Definition at line 109 of file DetGeomDesc.cc.

References deepDeleteComponents().

110 {
112 }
void deepDeleteComponents()
deletes just the first daughters
Definition: DetGeomDesc.cc:174

Member Function Documentation

void DetGeomDesc::addComponent ( DetGeomDesc det)

Definition at line 160 of file DetGeomDesc.cc.

References _container.

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

161 {
162  _container.emplace_back(det);
163 }
Container _container
Definition: DetGeomDesc.h:100
void DetGeomDesc::addComponents ( Container  cont)

Definition at line 151 of file DetGeomDesc.cc.

References _container.

Referenced by setComponents().

152 {
153  for(auto & ig : cont) {
154  _container.emplace_back(ig);
155  }
156 }
Container _container
Definition: DetGeomDesc.h:100
void DetGeomDesc::ApplyAlignment ( const RPAlignmentCorrectionData t)

alignment

Definition at line 185 of file DetGeomDesc.cc.

References _rot, _trans, RPAlignmentCorrectionData::getRotationMatrix(), and RPAlignmentCorrectionData::getTranslation().

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

186 {
187  //cout << " DetGeomDesc::ApplyAlignment > before: " << _trans << ", " << _rot << endl;
188  _rot = t.getRotationMatrix() * _rot;
189  _trans = t.getTranslation() + _trans;
190  //cout << " DetGeomDesc::ApplyAlignment > after: " << _trans << ", " << _rot << endl;
191 }
RotationMatrix getRotationMatrix() const
DDRotationMatrix _rot
Definition: DetGeomDesc.h:103
const math::XYZVectorD & getTranslation() const
DDTranslation _trans
Definition: DetGeomDesc.h:102
void DetGeomDesc::clearComponents ( )
inline

Definition at line 75 of file DetGeomDesc.h.

References _container, deepDeleteComponents(), and deleteComponents().

Referenced by deepDeleteComponents().

76  { _container.resize(0);}
Container _container
Definition: DetGeomDesc.h:100
DetGeomDesc::ConstContainer DetGeomDesc::components ( ) const
virtual

access to the tree structure

Definition at line 123 of file DetGeomDesc.cc.

References _container.

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

124 {
125  ConstContainer _temp;
126  for (auto it : _container) {
127  _temp.emplace_back(it);
128  }
129  return _temp;
130 }
std::vector< const DetGeomDesc * > ConstContainer
Definition: DetGeomDesc.h:40
Container _container
Definition: DetGeomDesc.h:100
DetGeomDesc::Container DetGeomDesc::components ( )
virtual

Definition at line 116 of file DetGeomDesc.cc.

References _container.

117 {
118  return _container;
119 }
Container _container
Definition: DetGeomDesc.h:100
virtual int DetGeomDesc::copyno ( ) const
inlinevirtual

Definition at line 90 of file DetGeomDesc.h.

References _copy.

90 {return _copy;}
DetGeomDesc::ConstContainer DetGeomDesc::deepComponents ( ) const
virtual

Definition at line 134 of file DetGeomDesc.cc.

References _container, popcon2dropbox::copy(), and isLeaf().

Referenced by geographicalID().

135 {
136  ConstContainer _temp;
137  if (isLeaf())
138  _temp.emplace_back(const_cast<DetGeomDesc*>(this));
139  else {
140  for (auto it : _container){
141  ConstContainer _temp2 = (*it).deepComponents();
142  copy(_temp2.begin(), _temp2.end(), back_inserter(_temp));
143  }
144  }
145  return _temp;
146 }
std::vector< const DetGeomDesc * > ConstContainer
Definition: DetGeomDesc.h:40
Container _container
Definition: DetGeomDesc.h:100
bool isLeaf() const
traverses the treee and deletes all nodes.
Definition: DetGeomDesc.h:79
void DetGeomDesc::deepDeleteComponents ( )

deletes just the first daughters

Definition at line 174 of file DetGeomDesc.cc.

References _container, and clearComponents().

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

175 {
176  for (auto & it : _container) {
177  ( const_cast<DetGeomDesc*>(it) )->deepDeleteComponents();
178  delete it;
179  }
180  clearComponents();
181 }
void clearComponents()
Definition: DetGeomDesc.h:75
Geometrical description of a sensor.
Definition: DetGeomDesc.h:37
Container _container
Definition: DetGeomDesc.h:100
void DetGeomDesc::deleteComponents ( )

Definition at line 167 of file DetGeomDesc.cc.

References _container.

Referenced by clearComponents().

168 {
169  _container.erase(_container.begin(), _container.end());
170 }
Container _container
Definition: DetGeomDesc.h:100
virtual double DetGeomDesc::density ( ) const
inlinevirtual

Definition at line 92 of file DetGeomDesc.h.

References _density.

Referenced by DetGeomDesc().

92 {return _density;}
double _density
Definition: DetGeomDesc.h:111
virtual DetId DetGeomDesc::geographicalID ( ) const
inlinevirtual

Definition at line 61 of file DetGeomDesc.h.

References _geographicalID, components(), and deepComponents().

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

61 { return _geographicalID; }
DetId _geographicalID
Definition: DetGeomDesc.h:108
bool DetGeomDesc::isLeaf ( ) const
inline

traverses the treee and deletes all nodes.

Definition at line 79 of file DetGeomDesc.h.

References _container.

Referenced by deepComponents().

80  { return (_container.empty()); }
Container _container
Definition: DetGeomDesc.h:100
virtual std::string DetGeomDesc::material ( void  ) const
inlinevirtual

Definition at line 94 of file DetGeomDesc.h.

References _material, and ApplyAlignment().

Referenced by DetGeomDesc().

94 {return _material;}
std::string _material
Definition: DetGeomDesc.h:114
DDName DetGeomDesc::name ( void  ) const
inline
nav_type DetGeomDesc::navType ( ) const
inline

Definition at line 88 of file DetGeomDesc.h.

References _ddd.

88 {return _ddd;}
nav_type _ddd
Definition: DetGeomDesc.h:101
DetGeomDesc & DetGeomDesc::operator= ( const DetGeomDesc ref)

Definition at line 87 of file DetGeomDesc.cc.

References _copy, _ddd, _ddname, _density, _geographicalID, _material, _params, _parents, _rot, _shape, _trans, _type, _volume, and _weight.

88 {
89  _ddd = ref._ddd;
90  _params = ref._params;
91  _trans = ref._trans;
92  _rot = ref._rot;
93  _shape = ref._shape;
94  _ddname = ref._ddname;
95  _parents = ref._parents;
96  _volume = ref._volume;
97  _density = ref._density;
98  _weight = ref._weight;
99  _copy = ref._copy;
100  _material = ref._material;
102  _type = ref._type;
103 
104  return (*this);
105 }
std::vector< DDExpandedNode > _parents
Definition: DetGeomDesc.h:109
DDSolidShape _shape
Definition: DetGeomDesc.h:104
DetId _geographicalID
Definition: DetGeomDesc.h:108
DDRotationMatrix _rot
Definition: DetGeomDesc.h:103
double _volume
Definition: DetGeomDesc.h:110
DDTranslation _trans
Definition: DetGeomDesc.h:102
GeometricEnumType _type
Definition: DetGeomDesc.h:106
double _density
Definition: DetGeomDesc.h:111
double _weight
Definition: DetGeomDesc.h:112
std::vector< double > _params
Definition: DetGeomDesc.h:107
nav_type _ddd
Definition: DetGeomDesc.h:101
DDName _ddname
Definition: DetGeomDesc.h:105
std::string _material
Definition: DetGeomDesc.h:114
std::vector<double> DetGeomDesc::params ( ) const
inline

Definition at line 89 of file DetGeomDesc.h.

References _params.

Referenced by CTPPSDiamondRecHitProducerAlgorithm::build().

89 {return _params;}
std::vector< double > _params
Definition: DetGeomDesc.h:107
virtual std::vector< DDExpandedNode > DetGeomDesc::parents ( ) const
inlinevirtual

returns all the components below

retuns the geometrical history

Definition at line 67 of file DetGeomDesc.h.

References _parents.

Referenced by CTPPSDiamondRecHitProducerAlgorithm::build().

68  { return _parents; }
std::vector< DDExpandedNode > _parents
Definition: DetGeomDesc.h:109
DDRotationMatrix DetGeomDesc::rotation ( void  ) const
inline
void DetGeomDesc::setComponents ( Container  cont)
inline

components (children) management

Definition at line 71 of file DetGeomDesc.h.

References _container, addComponent(), addComponents(), and eostools::move().

72  { _container = std::move(cont); }
Container _container
Definition: DetGeomDesc.h:100
def move(src, dest)
Definition: eostools.py:510
void DetGeomDesc::setGeographicalID ( DetId  id)
inline

ID stuff.

Definition at line 60 of file DetGeomDesc.h.

References _geographicalID, and triggerObjects_cff::id.

Referenced by CTPPSGeometryESModule::buildDetGeomDesc().

DDSolidShape DetGeomDesc::shape ( void  ) const
inline

Definition at line 85 of file DetGeomDesc.h.

References _shape.

Referenced by DetGeomDesc().

85 {return _shape;}
DDSolidShape _shape
Definition: DetGeomDesc.h:104
DDTranslation DetGeomDesc::translation ( void  ) const
inline
GeometricEnumType DetGeomDesc::type ( ) const
inline

Definition at line 86 of file DetGeomDesc.h.

References _type.

86 {return _type;}
GeometricEnumType _type
Definition: DetGeomDesc.h:106
virtual double DetGeomDesc::volume ( void  ) const
inlinevirtual

Definition at line 91 of file DetGeomDesc.h.

References _volume.

Referenced by DetGeomDesc().

91 {return _volume;}
double _volume
Definition: DetGeomDesc.h:110
virtual double DetGeomDesc::weight ( void  ) const
inlinevirtual

Definition at line 93 of file DetGeomDesc.h.

References _weight.

93 {return _weight;}
double _weight
Definition: DetGeomDesc.h:112

Member Data Documentation

Container DetGeomDesc::_container
private
int DetGeomDesc::_copy
private

Definition at line 113 of file DetGeomDesc.h.

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

nav_type DetGeomDesc::_ddd
private

Definition at line 101 of file DetGeomDesc.h.

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

DDName DetGeomDesc::_ddname
private

Definition at line 105 of file DetGeomDesc.h.

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

double DetGeomDesc::_density
private

Definition at line 111 of file DetGeomDesc.h.

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

DetId DetGeomDesc::_geographicalID
private

Definition at line 108 of file DetGeomDesc.h.

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

std::string DetGeomDesc::_material
private

Definition at line 114 of file DetGeomDesc.h.

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

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

Definition at line 107 of file DetGeomDesc.h.

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

std::vector< DDExpandedNode > DetGeomDesc::_parents
private

Definition at line 109 of file DetGeomDesc.h.

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

DDRotationMatrix DetGeomDesc::_rot
private

Definition at line 103 of file DetGeomDesc.h.

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

DDSolidShape DetGeomDesc::_shape
private

Definition at line 104 of file DetGeomDesc.h.

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

DDTranslation DetGeomDesc::_trans
private

Definition at line 102 of file DetGeomDesc.h.

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

GeometricEnumType DetGeomDesc::_type
private

Definition at line 106 of file DetGeomDesc.h.

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

double DetGeomDesc::_volume
private

Definition at line 110 of file DetGeomDesc.h.

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

double DetGeomDesc::_weight
private

Definition at line 112 of file DetGeomDesc.h.

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