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::SensitiveDetector &)
 
 DD4HEP_OPEN_PLUGIN (dd4hep, ddcms_det_element_DDCMS_forward_DDTotemAngular)
 

Function Documentation

◆ algorithm()

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

Definition at line 11 of file DDTotemAngular.cc.

14  {
15  cms::DDNamespace ns(ctxt, e, true);
17  double startAngle = args.value<double>("startAngle");
18  double stepAngle = args.value<double>("stepAngle");
19  double zoffset = args.value<double>("zoffset");
20  double roffset = args.value<double>("roffset");
21  int n = args.value<int>("n");
22  int startCopyNo = args.value<int>("startCopyNo");
23  int incrCopyNo = args.value<int>("incrCopyNo");
24 #ifdef EDM_ML_DEBUG
25  edm::LogVerbatim("ForwardGeom") << "DDTotemAngular: Parameters for positioning-- " << n << " copies in steps of "
26  << convertRadToDeg(stepAngle) << " from " << convertRadToDeg(startAngle)
27  << " \tZoffset " << zoffset << " \tRoffset " << roffset
28  << "\tStart and inremental copy nos " << startCopyNo << ", " << incrCopyNo;
29 #endif
30  std::string childName = args.value<std::string>("ChildName");
31  dd4hep::Volume parent = ns.volume(args.parentName());
32  dd4hep::Volume child = ns.volume(ns.prepend(childName));
33 #ifdef EDM_ML_DEBUG
34  edm::LogVerbatim("ForwardGeom") << "DDTotemAngular debug: Parent " << parent.name() << "\tChild " << child.name();
35 #endif
36 
37  double phi = startAngle;
38  int copyNo = startCopyNo;
39 
40  for (int ii = 0; ii < n; ii++) {
42 #ifdef EDM_ML_DEBUG
43  edm::LogVerbatim("ForwardGeom") << "DDTotemAngular: Creating a new rotation \t90, "
44  << convertRadToDeg(phitmp + 90._deg) << ", 0, 0, 90, " << convertRadToDeg(phitmp);
45 #endif
46  dd4hep::Rotation3D rotation = cms::makeRotation3D(90._deg, 90._deg + phitmp, 0., 0., 90._deg, phitmp);
47  dd4hep::Position tran(roffset * cos(phi), roffset * sin(phi), zoffset);
48 
49  parent.placeVolume(child, copyNo, dd4hep::Transform3D(rotation, tran));
50 #ifdef EDM_ML_DEBUG
51  edm::LogVerbatim("ForwardGeom") << "DDTotemAngular: " << child.name() << " number " << copyNo << " positioned in "
52  << parent.name() << " at " << tran << " with " << rotation;
53 #endif
54  phi += stepAngle;
55  copyNo += incrCopyNo;
56  }
57  return 1;
58 }

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

◆ DD4HEP_OPEN_PLUGIN()

DD4HEP_OPEN_PLUGIN ( dd4hep  ,
ddcms_det_element_DDCMS_forward_DDTotemAngular   
)

Definition at line 61 of file DDTotemAngular.cc.

writedatasetfile.args
args
Definition: writedatasetfile.py:18
dqmiodumpmetadata.n
n
Definition: dqmiodumpmetadata.py:28
angle_units::operators::convertRadToDeg
constexpr NumType convertRadToDeg(NumType radians)
Definition: angle_units.h:21
cms::DDNamespace
Definition: DDNamespace.h:16
cms::makeRotation3D
dd4hep::Rotation3D makeRotation3D(double thetaX, double phiX, double thetaY, double phiY, double thetaZ, double phiZ)
Definition: DDAlgoArguments.cc:20
funct::sin
Sin< T >::type sin(const T &t)
Definition: Sin.h:22
funct::cos
Cos< T >::type cos(const T &t)
Definition: Cos.h:22
PixelTestBeamValidation_cfi.Position
Position
Definition: PixelTestBeamValidation_cfi.py:62
AlCaHLTBitMon_QueryRunRegistry.string
string
Definition: AlCaHLTBitMon_QueryRunRegistry.py:256
cms::Volume
dd4hep::Volume Volume
Definition: DDFilteredView.h:45
idealTransformation.rotation
dictionary rotation
Definition: idealTransformation.py:1
PVValHelper::phi
Definition: PVValidationHelpers.h:68
edm::LogVerbatim
Definition: MessageLogger.h:297
Geom::Phi
Definition: Phi.h:52
cms::DDAlgoArguments
Definition: DDAlgoArguments.h:28
child
Definition: simpleInheritance.h:11
class-composition.parent
parent
Definition: class-composition.py:88
cuy.ii
ii
Definition: cuy.py:590
MillePedeFileConverter_cfg.e
e
Definition: MillePedeFileConverter_cfg.py:37