CMS 3D CMS Logo

DetGeomDesc.cc
Go to the documentation of this file.
1 /****************************************************************************
2 *
3 * This is a part of the TOTEM offline software.
4 * Authors:
5 * Jan Kašpar (jan.kaspar@gmail.com)
6 * CMSSW developers (based on GeometricDet class)
7 *
8 ****************************************************************************/
9 
10 #include <utility>
11 
14 
17 
18 //#include "DataFormats/CTPPSAlignment/interface/RPAlignmentCorrectionData.h"
20 
21 using namespace std;
22 
23 //----------------------------------------------------------------------------------------------------
24 
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 }
39 
40 //----------------------------------------------------------------------------------------------------
42 {
43  (*this) = ref;
44 }
45 
46 //----------------------------------------------------------------------------------------------------
47 
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 }
60 
61 //----------------------------------------------------------------------------------------------------
62 
64 {
66 }
67 
68 //----------------------------------------------------------------------------------------------------
69 
71 {
72  return m_container;
73 }
74 
75 //----------------------------------------------------------------------------------------------------
76 
78 {
79  m_container.emplace_back( det );
80 }
81 
82 //----------------------------------------------------------------------------------------------------
83 
85 {
86  m_container.erase( m_container.begin(), m_container.end());
87 }
88 
89 //----------------------------------------------------------------------------------------------------
90 
92 {
93  for( auto & it : m_container ) {
94  it->deepDeleteComponents();
95  delete it;
96  }
98 }
99 
100 //----------------------------------------------------------------------------------------------------
101 
103 {
104  m_rot = t.getRotationMatrix() * m_rot;
106 }
Translation m_trans
Definition: DetGeomDesc.h:82
Container m_container
Definition: DetGeomDesc.h:81
std::string m_name
Definition: DetGeomDesc.h:84
DetGeomDesc & operator=(const DetGeomDesc &)
Definition: DetGeomDesc.cc:48
void applyAlignment(const CTPPSRPAlignmentCorrectionData &)
alignment
Definition: DetGeomDesc.cc:102
void clearComponents()
traverses the treee and deletes all nodes.
Definition: DetGeomDesc.h:79
std::string m_sensorType
Definition: DetGeomDesc.h:89
ROOT::Math::Rotation3D getRotationMatrix() const
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
void deepDeleteComponents()
deletes just the first daughters
Definition: DetGeomDesc.cc:91
std::vector< double > m_params
Definition: DetGeomDesc.h:85
virtual ~DetGeomDesc()
destructor
Definition: DetGeomDesc.cc:63
std::vector< DetGeomDesc * > Container
Definition: DetGeomDesc.h:38
Geometrical description of a sensor.
Definition: DetGeomDesc.h:35
Container components() const
access to the tree structure
Definition: DetGeomDesc.cc:70
void deleteComponents()
Definition: DetGeomDesc.cc:84
DetId m_geographicalID
Definition: DetGeomDesc.h:86
const std::string DDD_CTPPS_PIXELS_SENSOR_NAME
Definition: CTPPSDDDNames.h:15
void addComponent(DetGeomDesc *)
components (children) management
Definition: DetGeomDesc.cc:77
RotationMatrix m_rot
Definition: DetGeomDesc.h:83
Alignment correction for an element of the CT-PPS detector. Within the geometry description, every sensor (more generally every element) is given its translation and rotation. These two quantities shall be understood in local-to-global coordinate transform. That is, if r_l is a point in local coordinate system and x_g in global, then it holds.