CMS 3D CMS Logo

Functions
DDTotemAngular.cc File Reference
#include "DataFormats/GeometryVector/interface/Phi.h"
#include "DataFormats/Math/interface/GeantUnits.h"
#include "DetectorDescription/Core/interface/DDSplit.h"
#include "DetectorDescription/DDCMS/interface/DDPlugins.h"
#include "FWCore/MessageLogger/interface/MessageLogger.h"
#include "DD4hep/DetFactoryHelper.h"

Go to the source code of this file.

Functions

static long algorithm (dd4hep::Detector &, cms::DDParsingContext &ctxt, xml_h e)
 
 DD4HEP_OPEN_PLUGIN (dd4hep, ddcms_det_element_DDCMS_forward_DDTotemAngular)
 

Function Documentation

◆ algorithm()

static long algorithm ( dd4hep::Detector &  ,
cms::DDParsingContext ctxt,
xml_h  e 
)
static

Definition at line 11 of file DDTotemAngular.cc.

References writedatasetfile::args, angle_units::operators::convertRadToDeg(), funct::cos(), MillePedeFileConverter_cfg::e, cuy::ii, cms::makeRotation3D(), create_idmaps::n, class-composition::parent, PixelTestBeamValidation_cfi::Position, cms::DDNamespace::prepend(), idealTransformation::rotation, funct::sin(), AlCaHLTBitMon_QueryRunRegistry::string, and cms::DDNamespace::volume().

11  {
12  cms::DDNamespace ns(ctxt, e, true);
14  double startAngle = args.value<double>("startAngle");
15  double stepAngle = args.value<double>("stepAngle");
16  double zoffset = args.value<double>("zoffset");
17  double roffset = args.value<double>("roffset");
18  int n = args.value<int>("n");
19  int startCopyNo = args.value<int>("startCopyNo");
20  int incrCopyNo = args.value<int>("incrCopyNo");
21 #ifdef EDM_ML_DEBUG
22  edm::LogVerbatim("ForwardGeom") << "DDTotemAngular: Parameters for positioning-- " << n << " copies in steps of "
23  << convertRadToDeg(stepAngle) << " from " << convertRadToDeg(startAngle)
24  << " \tZoffset " << zoffset << " \tRoffset " << roffset
25  << "\tStart and inremental copy nos " << startCopyNo << ", " << incrCopyNo;
26 #endif
27  std::string childName = args.value<std::string>("ChildName");
28  dd4hep::Volume parent = ns.volume(args.parentName());
29  dd4hep::Volume child = ns.volume(ns.prepend(childName));
30 #ifdef EDM_ML_DEBUG
31  edm::LogVerbatim("ForwardGeom") << "DDTotemAngular debug: Parent " << parent.name() << "\tChild " << child.name();
32 #endif
33 
34  double phi = startAngle;
35  int copyNo = startCopyNo;
36 
37  for (int ii = 0; ii < n; ii++) {
39 #ifdef EDM_ML_DEBUG
40  edm::LogVerbatim("ForwardGeom") << "DDTotemAngular: Creating a new rotation \t90, "
41  << convertRadToDeg(phitmp + 90._deg) << ", 0, 0, 90, " << convertRadToDeg(phitmp);
42 #endif
43  dd4hep::Rotation3D rotation = cms::makeRotation3D(90._deg, 90._deg + phitmp, 0., 0., 90._deg, phitmp);
44  dd4hep::Position tran(roffset * cos(phi), roffset * sin(phi), zoffset);
45 
46  parent.placeVolume(child, copyNo, dd4hep::Transform3D(rotation, tran));
47 #ifdef EDM_ML_DEBUG
48  edm::LogVerbatim("ForwardGeom") << "DDTotemAngular: " << child.name() << " number " << copyNo << " positioned in "
49  << parent.name() << " at " << tran << " with " << rotation;
50 #endif
51  phi += stepAngle;
52  copyNo += incrCopyNo;
53  }
54  return 1;
55 }
Log< level::Info, true > LogVerbatim
constexpr NumType convertRadToDeg(NumType radians)
Definition: angle_units.h:21
Sin< T >::type sin(const T &t)
Definition: Sin.h:22
DDRotationMatrix makeRotation3D(double thetaX, double phiX, double thetaY, double phiY, double thetaZ, double phiZ)
Cos< T >::type cos(const T &t)
Definition: Cos.h:22
dd4hep::Volume Volume
ii
Definition: cuy.py:589
Definition: Phi.h:52

◆ DD4HEP_OPEN_PLUGIN()

DD4HEP_OPEN_PLUGIN ( dd4hep  ,
ddcms_det_element_DDCMS_forward_DDTotemAngular   
)

Definition at line 58 of file DDTotemAngular.cc.