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  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  }
38 }
39 
40 //----------------------------------------------------------------------------------------------------
41 DetGeomDesc::DetGeomDesc(const DetGeomDesc& ref) { (*this) = ref; }
42 
43 //----------------------------------------------------------------------------------------------------
44 
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);
55 }
56 
57 //----------------------------------------------------------------------------------------------------
58 
60 
61 //----------------------------------------------------------------------------------------------------
62 
64 
65 //----------------------------------------------------------------------------------------------------
66 
67 void DetGeomDesc::addComponent(DetGeomDesc* det) { m_container.emplace_back(det); }
68 
69 //----------------------------------------------------------------------------------------------------
70 
71 void DetGeomDesc::deleteComponents() { m_container.erase(m_container.begin(), m_container.end()); }
72 
73 //----------------------------------------------------------------------------------------------------
74 
76  for (auto& it : m_container) {
77  it->deepDeleteComponents();
78  delete it;
79  }
81 }
82 
83 //----------------------------------------------------------------------------------------------------
84 
86  m_rot = t.getRotationMatrix() * m_rot;
87  m_trans = t.getTranslation() + m_trans;
88 }
DetGeomDesc::operator=
DetGeomDesc & operator=(const DetGeomDesc &)
Definition: DetGeomDesc.cc:44
DetGeomDesc::applyAlignment
void applyAlignment(const CTPPSRPAlignmentCorrectionData &)
alignment
Definition: DetGeomDesc.cc:84
DDD_CTPPS_PIXELS_SENSOR_NAME
const std::string DDD_CTPPS_PIXELS_SENSOR_NAME
Definition: CTPPSDDDNames.h:14
DetGeomDesc::addComponent
void addComponent(DetGeomDesc *)
components (children) management
Definition: DetGeomDesc.cc:66
DetGeomDesc::components
Container components() const
access to the tree structure
Definition: DetGeomDesc.cc:62
DetGeomDesc::Container
std::vector< DetGeomDesc * > Container
Definition: DetGeomDesc.h:36
DetGeomDesc::deepDeleteComponents
void deepDeleteComponents()
deletes just the first daughters
Definition: DetGeomDesc.cc:74
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::~DetGeomDesc
virtual ~DetGeomDesc()
destructor
Definition: DetGeomDesc.cc:58
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
DDFilteredView.h
DDSolid.h
OrderedSet.t
t
Definition: OrderedSet.py:90
AlCaHLTBitMon_QueryRunRegistry.string
string
Definition: AlCaHLTBitMon_QueryRunRegistry.py:256
CTPPSRPAlignmentCorrectionData.h
idealTransformation.rotation
dictionary rotation
Definition: idealTransformation.py:1
DetGeomDesc.h
DetGeomDesc
Geometrical description of a sensor.
Definition: DetGeomDesc.h:34
DDFilteredView::geoHistory
const DDGeoHistory & geoHistory() const
The list of ancestors up to the root-node of the current node.
Definition: DDFilteredView.cc:30
CTPPSDDDNames.h
DetGeomDesc::deleteComponents
void deleteComponents()
Definition: DetGeomDesc.cc:70
std
Definition: JetResolutionObject.h:76
Skims_PA_cff.name
name
Definition: Skims_PA_cff.py:17
DDFilteredView
Definition: DDFilteredView.h:20
DetGeomDesc::m_geographicalID
DetId m_geographicalID
Definition: DetGeomDesc.h:84
CTPPSRPAlignmentCorrectionData
Alignment correction for an element of the CT-PPS detector. Within the geometry description,...
Definition: CTPPSRPAlignmentCorrectionData.h:58
DetGeomDesc::DetGeomDesc
DetGeomDesc()
Definition: DetGeomDesc.h:74
DetGeomDesc::m_trans
Translation m_trans
Definition: DetGeomDesc.h:80
DetGeomDesc::m_rot
RotationMatrix m_rot
Definition: DetGeomDesc.h:81