CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
List of all members | Public Types | Public Member Functions | Private Member Functions | Private Attributes
GeometricDet Class Reference

#include <GeometricDet.h>

Public Types

using ConstGeometricDetContainer = std::vector< GeometricDet const * >
 
enum  GDEnumType {
  unknown = 100, Tracker = 0, PixelBarrel = 1, PixelEndCap = 2,
  TIB = 3, TID = 4, TOB = 5, TEC = 6,
  layer = 8, wheel = 9, strng = 10, rod = 11,
  petal = 12, ring = 13, ladder = 14, mergedDet = 15,
  DetUnit = 16, disk = 17, panel = 18, PixelPhase1Barrel = 101,
  PixelPhase1EndCap = 102, PixelPhase1Disk = 117, OTPhase2EndCap = 204, OTPhase2Barrel = 205,
  OTPhase2Layer = 208, OTPhase2Stack = 215, PixelPhase2Barrel = 201, PixelPhase2EndCap = 202,
  OTPhase2Wheel = 209, PixelPhase2FullDisk = 217, PixelPhase2ReducedDisk = 227, PixelPhase2TDRDisk = 237
}
 
using GeometricDetContainer = std::vector< GeometricDet * >
 
typedef enum
GeometricDet::GDEnumType 
GeometricEnumType
 
using nav_type = std::vector< int >
 
using NavRange = std::pair< int const *, size_t >
 
using Position = Surface::PositionType
 
using Rotation = Surface::RotationType
 
using RotationMatrix = ROOT::Math::Rotation3D
 
using Translation = ROOT::Math::DisplacementVector3D< ROOT::Math::Cartesian3D< double > >
 

Public Member Functions

void addComponent (GeometricDet *)
 
void addComponents (GeometricDetContainer const &cont)
 
void addComponents (ConstGeometricDetContainer const &cont)
 
std::unique_ptr< Boundsbounds () const
 
void clearComponents ()
 
GeometricDetcomponent (size_t index)
 
ConstGeometricDetContainercomponents ()
 
const ConstGeometricDetContainercomponents () const
 
ConstGeometricDetContainer deepComponents () const
 
void deepComponents (ConstGeometricDetContainer &cont) const
 
void deleteComponents ()
 
const DetIdgeographicalId () const
 
 GeometricDet (DDFilteredView *fv, GeometricEnumType dd)
 
 GeometricDet (cms::DDFilteredView *fv, GeometricEnumType dd)
 
 GeometricDet (const PGeometricDet::Item &onePGD, GeometricEnumType dd)
 
bool isBricked () const
 
bool isFromDD4hep () const
 
bool isLeaf () const
 
bool isLowerSensor () const
 
bool isUpperSensor () const
 
const std::string & name () const
 
NavRange navpos () const
 
const nav_typenavType () const
 
const std::vector< double > & params () const
 
double phi () const
 
double pixROCCols () const
 
double pixROCRows () const
 
double pixROCx () const
 
double pixROCy () const
 
Position positionBounds () const
 
double radLength () const
 
double rho () const
 
const RotationMatrixrotation () const
 
Rotation rotationBounds () const
 
void setGeographicalID (DetId id)
 
LegacySolidShape shape () const
 
const cms::DDSolidShapeshape_dd4hep () const
 
double siliconAPVNum () const
 
bool stereo () const
 
const Translationtranslation () const
 
const GeometricEnumTypetype () const
 
double xi () const
 
 ~GeometricDet ()
 

Private Member Functions

std::vector< double > computeLegacyShapeParameters (const cms::DDSolidShape &mySolidShape, const dd4hep::Solid &mySolid) const
 

Private Attributes

ConstGeometricDetContainer container_
 
nav_type ddd_
 
std::string ddname_
 
DetId geographicalID_ = 0
 
bool isBricked_ = false
 
bool isFromDD4hep_ = false
 
bool isLowerSensor_ = false
 
bool isUpperSensor_ = false
 
std::vector< double > params_
 
double phi_ = 0.
 
double pixROCCols_ = 0.
 
double pixROCRows_ = 0.
 
double pixROCx_ = 0.
 
double pixROCy_ = 0.
 
double radLength_ = 0.
 
double rho_ = 0.
 
RotationMatrix rot_
 
cms::DDSolidShape shape_
 
double siliconAPVNum_ = 0.
 
bool stereo_ = false
 
Translation trans_
 
GeometricEnumType type_
 
double xi_ = 0.
 

Detailed Description

Composite class GeometricDet. A composite can contain other composites, and so on; You can understand what you are looking at via enum.

Definition at line 31 of file GeometricDet.h.

Member Typedef Documentation

Definition at line 34 of file GeometricDet.h.

Definition at line 35 of file GeometricDet.h.

using GeometricDet::nav_type = std::vector<int>

Definition at line 42 of file GeometricDet.h.

using GeometricDet::NavRange = std::pair<int const*, size_t>

Definition at line 33 of file GeometricDet.h.

Definition at line 45 of file GeometricDet.h.

Definition at line 46 of file GeometricDet.h.

using GeometricDet::RotationMatrix = ROOT::Math::Rotation3D

Definition at line 36 of file GeometricDet.h.

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

Definition at line 37 of file GeometricDet.h.

Member Enumeration Documentation

Enumerator
unknown 
Tracker 
PixelBarrel 
PixelEndCap 
TIB 
TID 
TOB 
TEC 
layer 
wheel 
strng 
rod 
petal 
ring 
ladder 
mergedDet 
DetUnit 
disk 
panel 
PixelPhase1Barrel 
PixelPhase1EndCap 
PixelPhase1Disk 
OTPhase2EndCap 
OTPhase2Barrel 
OTPhase2Layer 
OTPhase2Stack 
PixelPhase2Barrel 
PixelPhase2EndCap 
OTPhase2Wheel 
PixelPhase2FullDisk 
PixelPhase2ReducedDisk 
PixelPhase2TDRDisk 

Definition at line 48 of file GeometricDet.h.

48  {
49  unknown = 100,
50  Tracker = 0,
51  PixelBarrel = 1,
52  PixelEndCap = 2,
53  TIB = 3,
54  TID = 4,
55  TOB = 5,
56  TEC = 6,
57  layer = 8,
58  wheel = 9,
59  strng = 10,
60  rod = 11,
61  petal = 12,
62  ring = 13,
63  ladder = 14,
64  mergedDet = 15,
65  DetUnit = 16,
66  disk = 17,
67  panel = 18,
68  PixelPhase1Barrel = 101,
69  PixelPhase1EndCap = 102,
70  PixelPhase1Disk = 117,
71  OTPhase2EndCap = 204,
72  OTPhase2Barrel = 205,
73  OTPhase2Layer = 208,
74  OTPhase2Stack = 215,
75  PixelPhase2Barrel = 201,
76  PixelPhase2EndCap = 202,
77  OTPhase2Wheel = 209,
78  PixelPhase2FullDisk = 217,
80  PixelPhase2TDRDisk = 237
enum GeometricDet::GDEnumType GeometricEnumType

Constructor & Destructor Documentation

GeometricDet::GeometricDet ( DDFilteredView fv,
GeometricEnumType  dd 
)

Definition at line 73 of file GeometricDet.cc.

References ddd_, DetUnit, isBricked_, isLowerSensor_, isUpperSensor_, DDFilteredView::navPos(), nt, pixROCCols_, pixROCRows_, pixROCx_, pixROCy_, radLength_, siliconAPVNum_, stereo_, type_, and xi_.

74  : ddname_(fv->name()),
75  type_(type),
76  ddd_(), // To remove after DetExtra is removed (not used)
77  trans_(fv->translation()),
78  rho_(trans_.Rho()),
79  phi_(trans_.Phi()),
80  rot_(fv->rotation()),
82  params_(fv->parameters()),
83  isFromDD4hep_(false) {
84  // workaround instead of this at initialization
85  const DDFilteredView::nav_type& nt = fv->navPos();
86  ddd_ = nav_type(nt.begin(), nt.end());
87 
88  // Only look for sensor-related info on sensor volumes!
89  if (type_ == DetUnit) {
90  radLength_ = getDouble("TrackerRadLength", *fv);
91  xi_ = getDouble("TrackerXi", *fv);
92  isBricked_ = (getString("isBricked", *fv) == strue);
93  pixROCRows_ = getDouble("PixelROCRows", *fv);
94  pixROCCols_ = getDouble("PixelROCCols", *fv);
95  pixROCx_ = getDouble("PixelROC_X", *fv);
96  pixROCy_ = getDouble("PixelROC_Y", *fv);
97  stereo_ = (getString("TrackerStereoDetectors", *fv) == strue);
98  isLowerSensor_ = (getString("TrackerLowerDetectors", *fv) == strue);
99  isUpperSensor_ = (getString("TrackerUpperDetectors", *fv) == strue);
100  siliconAPVNum_ = getDouble("SiliconAPVNumber", *fv);
101  }
102 }
cms::DDSolidShape shape_
Definition: GeometricDet.h:182
bool isLowerSensor_
Definition: GeometricDet.h:193
const std::string & name() const
The name of a logical-part of the current node in the filtered-view.
double pixROCCols_
Definition: GeometricDet.h:189
std::vector< double > params_
Definition: GeometricDet.h:183
const DDRotationMatrix & rotation() const
The absolute rotation of the current node.
nav_type navPos() const
return the stack of sibling numbers
std::vector< int > nav_type
Definition: GeometricDet.h:42
bool isUpperSensor_
Definition: GeometricDet.h:194
nav_type ddd_
Definition: GeometricDet.h:174
double pixROCx_
Definition: GeometricDet.h:190
bool isFromDD4hep_
Definition: GeometricDet.h:197
GeometricEnumType type_
Definition: GeometricDet.h:172
double radLength_
Definition: GeometricDet.h:185
const std::vector< double > & parameters() const
const std::array< const cms::dd::ValuePair< LegacySolidShape, cms::DDSolidShape >, 21 > LegacySolidShapeMap
int nt
Definition: AMPTWrapper.h:42
double pixROCy_
Definition: GeometricDet.h:191
double pixROCRows_
Definition: GeometricDet.h:188
const DDSolidShape shape() const
Translation trans_
Definition: GeometricDet.h:177
DDExpandedView::nav_type nav_type
std::string ddname_
Definition: GeometricDet.h:171
Mapping::value_type::name_type name_from_value(Mapping a, V value)
Definition: DDSolidShapes.h:62
const DDTranslation & translation() const
The absolute translation of the current node.
RotationMatrix rot_
Definition: GeometricDet.h:180
double siliconAPVNum_
Definition: GeometricDet.h:195
GeometricDet::GeometricDet ( cms::DDFilteredView fv,
GeometricEnumType  dd 
)

Definition at line 107 of file GeometricDet.cc.

References angle_units::operators::almostEqual(), DetUnit, cms::DDFilteredView::findSpecPar(), cms::DDFilteredView::get(), cms::DDFilteredView::getNextValue(), isBricked_, isLowerSensor_, isUpperSensor_, phi_, pixROCCols_, pixROCRows_, pixROCx_, pixROCy_, radLength_, siliconAPVNum_, stereo_, type_, and xi_.

108  : ddname_(dd4hep::dd::noNamespace(fv->name())),
109  type_(type),
110  ddd_(fv->navPos()), // To remove after DetExtra is removed (not used)
111  trans_((fv->translation()) / dd4hep::mm),
112  rho_(trans_.Rho()),
113  phi_(trans_.Phi()),
114  rot_(fv->rotation()),
115  shape_(fv->shape()),
117  isFromDD4hep_(true) {
118  using namespace angle_units::operators;
119  if (almostEqual(phi_, -1._pi, 10)) {
120  phi_ = 1._pi;
121  // Standardize phi values of |pi| to be always +pi instead of sometimes -pi.
122  }
123 
124  // Only look for sensor-related info on sensor volumes!
125  if (type_ == DetUnit) {
126  // IT sensors only (NB: hence could add a branch here, but not a critical part on perf)
127  isBricked_ = (fv->get<std::string_view>("isBricked") == strue);
128  pixROCRows_ = fv->get<double>("PixelROCRows");
129  pixROCCols_ = fv->get<double>("PixelROCCols");
130  pixROCx_ = fv->get<double>("PixelROC_X");
131  pixROCy_ = fv->get<double>("PixelROC_Y");
132 
133  // Phase 1 OT sensors only (NB: hence could add a branch here, but not a critical part on perf)
134  stereo_ = (fv->get<std::string_view>("TrackerStereoDetectors") == strue);
135  siliconAPVNum_ = fv->get<double>("SiliconAPVNumber");
136 
137  // Phase 2 OT sensors only (NB: hence could add a branch here, but not a critical part on perf)
138  isLowerSensor_ = (fv->get<std::string_view>("TrackerLowerDetectors") == strue);
139  isUpperSensor_ = (fv->get<std::string_view>("TrackerUpperDetectors") == strue);
140 
141  // All sensors: IT or OT, Phase 1 or Phase 2 (NB: critical part on perf)
142  fv->findSpecPar("TrackerRadLength", "TrackerXi");
143  radLength_ = fv->getNextValue("TrackerRadLength");
144  xi_ = fv->getNextValue("TrackerXi");
145  }
146 }
cms::DDSolidShape shape_
Definition: GeometricDet.h:182
bool isLowerSensor_
Definition: GeometricDet.h:193
double pixROCCols_
Definition: GeometricDet.h:189
std::vector< double > params_
Definition: GeometricDet.h:183
const RotationMatrix rotation() const
void findSpecPar(T const &first, Ts const &...rest)
find a current Node SpecPar that has at least
std::enable_if<!std::numeric_limits< NumType >::is_integer, bool >::type almostEqual(NumType x, NumType y, int ulp)
Definition: angle_units.h:33
bool isUpperSensor_
Definition: GeometricDet.h:194
nav_type ddd_
Definition: GeometricDet.h:174
std::vector< double > computeLegacyShapeParameters(const cms::DDSolidShape &mySolidShape, const dd4hep::Solid &mySolid) const
const Translation translation() const
const cms::DDSolidShape shape() const
double pixROCx_
Definition: GeometricDet.h:190
bool isFromDD4hep_
Definition: GeometricDet.h:197
GeometricEnumType type_
Definition: GeometricDet.h:172
double radLength_
Definition: GeometricDet.h:185
double getNextValue(const std::string &) const
extract another value from the same SpecPar
nav_type navPos() const
return the stack of sibling numbers which indicates
std::string_view name() const
double pixROCy_
Definition: GeometricDet.h:191
double pixROCRows_
Definition: GeometricDet.h:188
T get(const std::string &)
extract attribute value
Translation trans_
Definition: GeometricDet.h:177
std::string ddname_
Definition: GeometricDet.h:171
RotationMatrix rot_
Definition: GeometricDet.h:180
dd4hep::Solid solid() const
double siliconAPVNum_
Definition: GeometricDet.h:195
GeometricDet::GeometricDet ( const PGeometricDet::Item onePGD,
GeometricEnumType  dd 
)

Definition at line 151 of file GeometricDet.cc.

References PGeometricDet::Item::_nt0, PGeometricDet::Item::_nt1, PGeometricDet::Item::_nt10, PGeometricDet::Item::_nt2, PGeometricDet::Item::_nt3, PGeometricDet::Item::_nt4, PGeometricDet::Item::_nt5, PGeometricDet::Item::_nt6, PGeometricDet::Item::_nt7, PGeometricDet::Item::_nt8, PGeometricDet::Item::_nt9, PGeometricDet::Item::_numnt, PGeometricDet::Item::_params0, PGeometricDet::Item::_params1, PGeometricDet::Item::_params10, PGeometricDet::Item::_params2, PGeometricDet::Item::_params3, PGeometricDet::Item::_params4, PGeometricDet::Item::_params5, PGeometricDet::Item::_params6, PGeometricDet::Item::_params7, PGeometricDet::Item::_params8, PGeometricDet::Item::_params9, PGeometricDet::Item::_shape, ddd_, and params_.

152  : ddname_(onePGD._name),
153  type_(type),
154  ddd_(),
156  trans_(onePGD._x, onePGD._y, onePGD._z),
157  rho_(onePGD._rho),
158  phi_(onePGD._phi),
159  rot_(onePGD._a11,
160  onePGD._a12,
161  onePGD._a13,
162  onePGD._a21,
163  onePGD._a22,
164  onePGD._a23,
165  onePGD._a31,
166  onePGD._a32,
167  onePGD._a33),
168  shape_(cms::dd::name_from_value(cms::LegacySolidShapeMap, static_cast<LegacySolidShape>(onePGD._shape))),
169  params_(),
170  radLength_(onePGD._radLength),
171  xi_(onePGD._xi),
172  pixROCRows_(onePGD._pixROCRows),
173  pixROCCols_(onePGD._pixROCCols),
174  pixROCx_(onePGD._pixROCx),
175  pixROCy_(onePGD._pixROCy),
176  stereo_(onePGD._stereo),
178 // NB: what about new data members isLowerSensor_, isUpperSensor_, isFromDD4hep_?
179 // They are presently not added to PGeometricDet (no change in info stored into DB).
180 {
181  // Solid shape parameters: only for box (1) and trapezoid (3)
182  if (onePGD._shape == 1 || onePGD._shape == 3) {
183  params_.reserve(11);
184  params_.emplace_back(onePGD._params0);
185  params_.emplace_back(onePGD._params1);
186  params_.emplace_back(onePGD._params2);
187  params_.emplace_back(onePGD._params3);
188  params_.emplace_back(onePGD._params4);
189  params_.emplace_back(onePGD._params5);
190  params_.emplace_back(onePGD._params6);
191  params_.emplace_back(onePGD._params7);
192  params_.emplace_back(onePGD._params8);
193  params_.emplace_back(onePGD._params9);
194  params_.emplace_back(onePGD._params10);
195  }
196 
197  ddd_.reserve(onePGD._numnt);
198  ddd_.emplace_back(onePGD._nt0);
199  ddd_.emplace_back(onePGD._nt1);
200  ddd_.emplace_back(onePGD._nt2);
201  ddd_.emplace_back(onePGD._nt3);
202  if (onePGD._numnt > 4) {
203  ddd_.emplace_back(onePGD._nt4);
204  if (onePGD._numnt > 5) {
205  ddd_.emplace_back(onePGD._nt5);
206  if (onePGD._numnt > 6) {
207  ddd_.emplace_back(onePGD._nt6);
208  if (onePGD._numnt > 7) {
209  ddd_.emplace_back(onePGD._nt7);
210  if (onePGD._numnt > 8) {
211  ddd_.emplace_back(onePGD._nt8);
212  if (onePGD._numnt > 9) {
213  ddd_.emplace_back(onePGD._nt9);
214  if (onePGD._numnt > 10) {
215  ddd_.emplace_back(onePGD._nt10);
216  }
217  }
218  }
219  }
220  }
221  }
222  }
223 }
cms::DDSolidShape shape_
Definition: GeometricDet.h:182
double pixROCCols_
Definition: GeometricDet.h:189
std::vector< double > params_
Definition: GeometricDet.h:183
DetId geographicalID_
Definition: GeometricDet.h:175
nav_type ddd_
Definition: GeometricDet.h:174
double pixROCx_
Definition: GeometricDet.h:190
GeometricEnumType type_
Definition: GeometricDet.h:172
double radLength_
Definition: GeometricDet.h:185
const std::array< const cms::dd::ValuePair< LegacySolidShape, cms::DDSolidShape >, 21 > LegacySolidShapeMap
double pixROCy_
Definition: GeometricDet.h:191
double pixROCRows_
Definition: GeometricDet.h:188
Translation trans_
Definition: GeometricDet.h:177
std::string ddname_
Definition: GeometricDet.h:171
Mapping::value_type::name_type name_from_value(Mapping a, V value)
Definition: DDSolidShapes.h:62
RotationMatrix rot_
Definition: GeometricDet.h:180
double siliconAPVNum_
Definition: GeometricDet.h:195
GeometricDet::~GeometricDet ( )

What to do in the destructor? destroy all the daughters!

Definition at line 68 of file GeometricDet.cc.

References deleteComponents().

68 { deleteComponents(); }
void deleteComponents()

Member Function Documentation

void GeometricDet::addComponent ( GeometricDet det)
void GeometricDet::addComponents ( GeometricDetContainer const &  cont)
void GeometricDet::addComponents ( ConstGeometricDetContainer const &  cont)

Definition at line 271 of file GeometricDet.cc.

References container_, and filterCSVwithJSON::copy.

271  {
272  container_.reserve(container_.size() + cont.size());
273  std::copy(cont.begin(), cont.end(), back_inserter(container_));
274 }
tuple cont
load Luminosity info ##
Definition: generateEDF.py:628
ConstGeometricDetContainer container_
Definition: GeometricDet.h:199
std::unique_ptr< Bounds > GeometricDet::bounds ( ) const

Definition at line 225 of file GeometricDet.cc.

References TrackerShapeToBounds::buildBounds(), params_, and shape_.

Referenced by TrackerGeometry::fillTestMap(), and PlaneBuilderFromGeometricDet::plane().

225  {
226  TrackerShapeToBounds shapeToBounds;
227  return std::unique_ptr<Bounds>(shapeToBounds.buildBounds(shape_, params_));
228 }
cms::DDSolidShape shape_
Definition: GeometricDet.h:182
std::vector< double > params_
Definition: GeometricDet.h:183
Bounds * buildBounds(const cms::DDSolidShape &, const std::vector< double > &) const
void GeometricDet::clearComponents ( )
inline
GeometricDet* GeometricDet::component ( size_t  index)
inline
ConstGeometricDetContainer& GeometricDet::components ( )
inline

Definition at line 150 of file GeometricDet.h.

References container_.

Referenced by PGeometricDetBuilder::beginRun(), TOBRodBuilder::build(), PixelBarrelLayerBuilder::build(), PixelRodBuilder::build(), TECLayerBuilder::build(), TECPetalBuilder::build(), TECWedgeBuilder::build(), TIBLayerBuilder::build(), TIDLayerBuilder::build(), TIDRingBuilder::build(), TOBLayerBuilder::build(), Phase2EndcapLayerBuilder::build(), Phase2EndcapRingBuilder::build(), Phase2OTBarrelLayerBuilder::build(), Phase2OTBarrelRodBuilder::build(), TrackerGeomBuilderFromGeometricDet::build(), GeometricSearchTrackerBuilder::build(), PixelBladeBuilder< T >::build(), PixelForwardLayerBuilder< T1, T2 >::build(), CmsTrackerLevelBuilderHelper::getPhiModule(), CmsTrackerDetIdBuilder::iterate(), DDDCmsTrackerContruction::printAllTrackerGeometricDets(), CmsTrackerRodBuilder< FilteredView >::sortNS(), CmsTrackerPanelBuilder< FilteredView >::sortNS(), CmsTrackerOTRingBuilder< FilteredView >::sortNS(), CmsTrackerPixelPhase2RingBuilder< FilteredView >::sortNS(), CmsTrackerLadderBuilder< FilteredView >::sortNS(), CmsTrackerOTDiscBuilder< FilteredView >::sortNS(), CmsTrackerRingBuilder< FilteredView >::sortNS(), CmsTrackerPhase1DiskBuilder< FilteredView >::sortNS(), CmsTrackerPetalBuilder< FilteredView >::sortNS(), CmsTrackerDiskBuilder< FilteredView >::sortNS(), CmsTrackerPixelPhase2DiskBuilder< FilteredView >::sortNS(), CmsTrackerLayerBuilder< FilteredView >::sortNS(), CmsTrackerOTLayerBuilder< FilteredView >::sortNS(), CmsTrackerStringBuilder< FilteredView >::sortNS(), CmsTrackerWheelBuilder< FilteredView >::sortNS(), CmsTrackerPhase2TPDiskBuilder< FilteredView >::sortNS(), CmsTrackerPixelPhase1EndcapBuilder< FilteredView >::sortNS(), CmsTrackerSubStrctBuilder< FilteredView >::sortNS(), CmsTrackerPixelPhase2EndcapBuilder< FilteredView >::sortNS(), CmsTrackerBuilder< FilteredView >::sortNS(), and TrackerGeometry::TrackerGeometry().

150 { return container_; }
ConstGeometricDetContainer container_
Definition: GeometricDet.h:199
const ConstGeometricDetContainer& GeometricDet::components ( ) const
inline

Definition at line 151 of file GeometricDet.h.

References container_.

151 { return container_; }
ConstGeometricDetContainer container_
Definition: GeometricDet.h:199
std::vector< double > GeometricDet::computeLegacyShapeParameters ( const cms::DDSolidShape mySolidShape,
const dd4hep::Solid &  mySolid 
) const
private

Definition at line 300 of file GeometricDet.cc.

References angle_units::operators::convertDegToRad(), cms::ddbox, cms::ddtrap, cms::ddtubs, angle0to2pi::make0To2pi(), and cms_rounding::roundIfNear0().

301  {
302  std::vector<double> myOldDDShapeParameters;
303 
304  // Box
305  if (mySolidShape == cms::DDSolidShape::ddbox) {
306  const dd4hep::Box& myBox = dd4hep::Box(mySolid);
307  myOldDDShapeParameters = {(myBox.x()) / dd4hep::mm, (myBox.y()) / dd4hep::mm, (myBox.z()) / dd4hep::mm};
308  }
309 
310  // Trapezoid
311  else if (mySolidShape == cms::DDSolidShape::ddtrap) {
312  const dd4hep::Trap& myTrap = dd4hep::Trap(mySolid);
313  myOldDDShapeParameters = {(myTrap->GetDZ()) / dd4hep::mm,
314  static_cast<double>(angle_units::operators::convertDegToRad(myTrap->GetTheta())),
315  static_cast<double>(angle_units::operators::convertDegToRad(myTrap->GetPhi())),
316  (myTrap->GetH1()) / dd4hep::mm,
317  (myTrap->GetBl1()) / dd4hep::mm,
318  (myTrap->GetTl1()) / dd4hep::mm,
319  static_cast<double>(angle_units::operators::convertDegToRad(myTrap->GetAlpha1())),
320  (myTrap->GetH2()) / dd4hep::mm,
321  (myTrap->GetBl2()) / dd4hep::mm,
322  (myTrap->GetTl2()) / dd4hep::mm,
323  static_cast<double>(angle_units::operators::convertDegToRad(myTrap->GetAlpha2()))};
324  }
325 
326  // Tub
327  else if (mySolidShape == cms::DDSolidShape::ddtubs) {
328  const dd4hep::Tube& myTube = dd4hep::Tube(mySolid);
329  double phi1 = static_cast<double>(angle_units::operators::convertDegToRad(myTube->GetPhi1()));
330  phi1 = cms_rounding::roundIfNear0(phi1);
331  if (phi1 != 0.0) {
332  using namespace angle0to2pi;
333  phi1 = make0To2pi(phi1) - 2._pi;
334  // Turn positive angle to negative
335  }
336  myOldDDShapeParameters = {
337  (myTube->GetDz()) / dd4hep::mm,
338  (myTube->GetRmin()) / dd4hep::mm,
339  (myTube->GetRmax()) / dd4hep::mm,
340  phi1,
341  static_cast<double>(angle_units::operators::convertDegToRad(myTube->GetPhi2() - myTube->GetPhi1()))};
342  }
343 
344  return myOldDDShapeParameters;
345 }
constexpr double convertDegToRad(NumType degrees)
Definition: angle_units.h:27
constexpr valType roundIfNear0(valType value, double tolerance=1.e-7)
Definition: Rounding.h:11
constexpr valType make0To2pi(valType angle)
Definition: deltaPhi.h:67
GeometricDet::ConstGeometricDetContainer GeometricDet::deepComponents ( ) const
void GeometricDet::deepComponents ( ConstGeometricDetContainer cont) const

Definition at line 259 of file GeometricDet.cc.

References container_, and isLeaf().

259  {
260  if (isLeaf())
261  cont.emplace_back(this);
262  else
263  std::for_each(container_.begin(), container_.end(), [&](const GeometricDet* iDet) { iDet->deepComponents(cont); });
264 }
tuple cont
load Luminosity info ##
Definition: generateEDF.py:628
bool isLeaf() const
Definition: GeometricDet.h:147
ConstGeometricDetContainer container_
Definition: GeometricDet.h:199
void GeometricDet::deleteComponents ( )

Definition at line 284 of file GeometricDet.cc.

References container_.

Referenced by ~GeometricDet().

284  {
285  std::for_each(container_.begin(), container_.end(), Deleter());
286  container_.clear();
287 }
ConstGeometricDetContainer container_
Definition: GeometricDet.h:199
const DetId& GeometricDet::geographicalId ( ) const
inline
bool GeometricDet::isBricked ( ) const
inline

Definition at line 131 of file GeometricDet.h.

References isBricked_.

131 { return isBricked_; }
bool GeometricDet::isFromDD4hep ( ) const
inline

Definition at line 143 of file GeometricDet.h.

References isFromDD4hep_.

143 { return isFromDD4hep_; }
bool isFromDD4hep_
Definition: GeometricDet.h:197
bool GeometricDet::isLeaf ( ) const
inline

Definition at line 147 of file GeometricDet.h.

References container_.

Referenced by deepComponents().

147 { return container_.empty(); }
ConstGeometricDetContainer container_
Definition: GeometricDet.h:199
bool GeometricDet::isLowerSensor ( ) const
inline
bool GeometricDet::isUpperSensor ( ) const
inline
const std::string& GeometricDet::name ( void  ) const
inline
NavRange GeometricDet::navpos ( ) const
inline

Definition at line 95 of file GeometricDet.h.

References ddd_.

95 { return NavRange(&ddd_.front(), ddd_.size()); }
nav_type ddd_
Definition: GeometricDet.h:174
std::pair< int const *, size_t > NavRange
Definition: GeometricDet.h:33
const nav_type& GeometricDet::navType ( ) const
inline

Definition at line 94 of file GeometricDet.h.

References ddd_.

Referenced by PGeometricDetBuilder::putOne().

94 { return ddd_; }
nav_type ddd_
Definition: GeometricDet.h:174
const std::vector<double>& GeometricDet::params ( ) const
inline

Definition at line 116 of file GeometricDet.h.

References cms::ddbox, cms::ddtrap, cms::ddtubs, params_, and shape_.

Referenced by DDDCmsTrackerContruction::printAllTrackerGeometricDets(), PGeometricDetBuilder::putOne(), and CmsTrackerLayerBuilder< FilteredView >::sortNS().

116  {
119  edm::LogError("GeometricDet::params()")
120  << "Called on a shape which is neither a box, a trap, nor a tub. This is not supported!";
121  }
122  return params_;
123  } // in mm
cms::DDSolidShape shape_
Definition: GeometricDet.h:182
std::vector< double > params_
Definition: GeometricDet.h:183
Log< level::Error, false > LogError
double GeometricDet::phi ( void  ) const
inline
double GeometricDet::pixROCCols ( ) const
inline

Definition at line 133 of file GeometricDet.h.

References pixROCCols_.

Referenced by DDDCmsTrackerContruction::printAllTrackerGeometricDets(), and PGeometricDetBuilder::putOne().

133 { return pixROCCols_; }
double pixROCCols_
Definition: GeometricDet.h:189
double GeometricDet::pixROCRows ( ) const
inline

Definition at line 132 of file GeometricDet.h.

References pixROCRows_.

Referenced by DDDCmsTrackerContruction::printAllTrackerGeometricDets(), and PGeometricDetBuilder::putOne().

132 { return pixROCRows_; }
double pixROCRows_
Definition: GeometricDet.h:188
double GeometricDet::pixROCx ( ) const
inline

Definition at line 134 of file GeometricDet.h.

References pixROCx_.

Referenced by DDDCmsTrackerContruction::printAllTrackerGeometricDets(), and PGeometricDetBuilder::putOne().

134 { return pixROCx_; }
double pixROCx_
Definition: GeometricDet.h:190
double GeometricDet::pixROCy ( ) const
inline

Definition at line 135 of file GeometricDet.h.

References pixROCy_.

Referenced by DDDCmsTrackerContruction::printAllTrackerGeometricDets(), and PGeometricDetBuilder::putOne().

135 { return pixROCy_; }
double pixROCy_
Definition: GeometricDet.h:191
GeometricDet::Position GeometricDet::positionBounds ( ) const

Definition at line 230 of file GeometricDet.cc.

References geant_units::operators::convertMmToCm(), and trans_.

Referenced by PlaneBuilderFromGeometricDet::plane().

230  {
231  Position pos_(static_cast<float>(geant_units::operators::convertMmToCm(trans_.x())),
232  static_cast<float>(geant_units::operators::convertMmToCm(trans_.y())),
233  static_cast<float>(geant_units::operators::convertMmToCm(trans_.z())));
234  return pos_;
235 }
Translation trans_
Definition: GeometricDet.h:177
constexpr NumType convertMmToCm(NumType millimeters)
Definition: GeantUnits.h:63
Surface::PositionType Position
Definition: GeometricDet.h:45
double GeometricDet::radLength ( ) const
inline
double GeometricDet::rho ( ) const
inline
const RotationMatrix& GeometricDet::rotation ( void  ) const
inline

Definition at line 103 of file GeometricDet.h.

References rot_.

Referenced by DDDCmsTrackerContruction::printAllTrackerGeometricDets(), and PGeometricDetBuilder::putOne().

103 { return rot_; }
RotationMatrix rot_
Definition: GeometricDet.h:180
GeometricDet::Rotation GeometricDet::rotationBounds ( ) const

Definition at line 237 of file GeometricDet.cc.

References rot_, x, y, and z.

Referenced by PlaneBuilderFromGeometricDet::plane().

237  {
238  Translation x, y, z;
239  rot_.GetComponents(x, y, z);
240  Rotation rotation_(float(x.X()),
241  float(x.Y()),
242  float(x.Z()),
243  float(y.X()),
244  float(y.Y()),
245  float(y.Z()),
246  float(z.X()),
247  float(z.Y()),
248  float(z.Z()));
249  return rotation_;
250 }
Surface::RotationType Rotation
Definition: GeometricDet.h:46
RotationMatrix rot_
Definition: GeometricDet.h:180
ROOT::Math::DisplacementVector3D< ROOT::Math::Cartesian3D< double >> Translation
void GeometricDet::setGeographicalID ( DetId  id)
inline
LegacySolidShape GeometricDet::shape ( void  ) const
inline

Definition at line 112 of file GeometricDet.h.

References cms::LegacySolidShapeMap, shape_, and cms::dd::value().

Referenced by DDDCmsTrackerContruction::printAllTrackerGeometricDets().

cms::DDSolidShape shape_
Definition: GeometricDet.h:182
Mapping::value_type::value_type value(Mapping a, const std::string &name)
Definition: DDSolidShapes.h:42
const std::array< const cms::dd::ValuePair< LegacySolidShape, cms::DDSolidShape >, 21 > LegacySolidShapeMap
const cms::DDSolidShape& GeometricDet::shape_dd4hep ( ) const
inline

Definition at line 114 of file GeometricDet.h.

References shape_.

Referenced by DDDCmsTrackerContruction::printAllTrackerGeometricDets(), and PGeometricDetBuilder::putOne().

114 { return shape_; }
cms::DDSolidShape shape_
Definition: GeometricDet.h:182
double GeometricDet::siliconAPVNum ( ) const
inline

Definition at line 140 of file GeometricDet.h.

References siliconAPVNum_.

Referenced by DDDCmsTrackerContruction::printAllTrackerGeometricDets(), and PGeometricDetBuilder::putOne().

140 { return siliconAPVNum_; }
double siliconAPVNum_
Definition: GeometricDet.h:195
bool GeometricDet::stereo ( ) const
inline
const Translation& GeometricDet::translation ( void  ) const
inline
const GeometricEnumType& GeometricDet::type ( ) const
inline
double GeometricDet::xi ( ) const
inline

Member Data Documentation

ConstGeometricDetContainer GeometricDet::container_
private
nav_type GeometricDet::ddd_
private

Definition at line 174 of file GeometricDet.h.

Referenced by GeometricDet(), navpos(), and navType().

std::string GeometricDet::ddname_
private

Definition at line 171 of file GeometricDet.h.

Referenced by name().

DetId GeometricDet::geographicalID_ = 0
private

Definition at line 175 of file GeometricDet.h.

Referenced by geographicalId(), and setGeographicalID().

bool GeometricDet::isBricked_ = false
private

Definition at line 187 of file GeometricDet.h.

Referenced by GeometricDet(), and isBricked().

bool GeometricDet::isFromDD4hep_ = false
private

Definition at line 197 of file GeometricDet.h.

Referenced by isFromDD4hep().

bool GeometricDet::isLowerSensor_ = false
private

Definition at line 193 of file GeometricDet.h.

Referenced by GeometricDet(), and isLowerSensor().

bool GeometricDet::isUpperSensor_ = false
private

Definition at line 194 of file GeometricDet.h.

Referenced by GeometricDet(), and isUpperSensor().

std::vector<double> GeometricDet::params_
private

Definition at line 183 of file GeometricDet.h.

Referenced by bounds(), GeometricDet(), and params().

double GeometricDet::phi_ = 0.
private

Definition at line 179 of file GeometricDet.h.

Referenced by GeometricDet(), and phi().

double GeometricDet::pixROCCols_ = 0.
private

Definition at line 189 of file GeometricDet.h.

Referenced by GeometricDet(), and pixROCCols().

double GeometricDet::pixROCRows_ = 0.
private

Definition at line 188 of file GeometricDet.h.

Referenced by GeometricDet(), and pixROCRows().

double GeometricDet::pixROCx_ = 0.
private

Definition at line 190 of file GeometricDet.h.

Referenced by GeometricDet(), and pixROCx().

double GeometricDet::pixROCy_ = 0.
private

Definition at line 191 of file GeometricDet.h.

Referenced by GeometricDet(), and pixROCy().

double GeometricDet::radLength_ = 0.
private

Definition at line 185 of file GeometricDet.h.

Referenced by GeometricDet(), and radLength().

double GeometricDet::rho_ = 0.
private

Definition at line 178 of file GeometricDet.h.

Referenced by rho().

RotationMatrix GeometricDet::rot_
private

Definition at line 180 of file GeometricDet.h.

Referenced by rotation(), and rotationBounds().

cms::DDSolidShape GeometricDet::shape_
private

Definition at line 182 of file GeometricDet.h.

Referenced by bounds(), params(), shape(), and shape_dd4hep().

double GeometricDet::siliconAPVNum_ = 0.
private

Definition at line 195 of file GeometricDet.h.

Referenced by GeometricDet(), and siliconAPVNum().

bool GeometricDet::stereo_ = false
private

Definition at line 192 of file GeometricDet.h.

Referenced by GeometricDet(), and stereo().

Translation GeometricDet::trans_
private

Definition at line 177 of file GeometricDet.h.

Referenced by positionBounds(), and translation().

GeometricEnumType GeometricDet::type_
private
double GeometricDet::xi_ = 0.
private

Definition at line 186 of file GeometricDet.h.

Referenced by GeometricDet(), and xi().