CMS 3D CMS Logo

Typedefs | Functions
DDLinear.cc File Reference
#include "DD4hep/DetFactoryHelper.h"
#include "DataFormats/Math/interface/CMSUnits.h"
#include "DetectorDescription/DDCMS/interface/DDPlugins.h"
#include "FWCore/MessageLogger/interface/MessageLogger.h"
#include <Math/Cartesian3D.h>
#include <Math/DisplacementVector3D.h>

Go to the source code of this file.

Typedefs

using DD3Vector = ROOT::Math::DisplacementVector3D< ROOT::Math::Cartesian3D< double > >
 

Functions

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

Typedef Documentation

◆ DD3Vector

using DD3Vector = ROOT::Math::DisplacementVector3D<ROOT::Math::Cartesian3D<double> >

Definition at line 13 of file DDLinear.cc.

Function Documentation

◆ algorithm()

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

Definition at line 15 of file DDLinear.cc.

15  {
16  cms::DDNamespace ns(ctxt, e, true);
17  DDAlgoArguments args(ctxt, e);
18 
19  int n = args.value<int>("N");
20  int startCopyNo = args.find("StartCopyNo") ? args.value<int>("StartCopyNo") : 1;
21  int incrCopyNo = args.find("IncrCopyNo") ? args.value<int>("IncrCopyNo") : 1;
22  double theta = args.find("Theta") ? args.value<double>("Theta") : 0.;
23  double phi = args.find("Phi") ? args.value<double>("Phi") : 0.;
24  double delta = args.find("Delta") ? args.value<double>("Delta") : 0.;
25  vector<double> base = args.value<vector<double> >("Base");
26  Volume mother = ns.volume(args.parentName());
27  Volume child = ns.volume(args.value<string>("ChildName"));
28  int copy = startCopyNo;
29 
30  LogDebug("DDAlgorithm") << "DDLinear: Parameters for positioning:: n " << n << " Direction Theta, Phi, Delta "
32  << " Base " << base[0] << ", " << base[1] << ", " << base[2];
33 
34  LogDebug("DDAlgorithm") << "DDLinear: Parent " << mother.name() << "\tChild " << child.name() << " NameSpace "
35  << ns.name();
36 
37  Position direction(sin(theta) * cos(phi), sin(theta) * sin(phi), cos(theta));
38 
39  Position basetr(base[0], base[1], base[2]);
40 
41  Rotation3D rotation = Rotation3D(); // Identity rotation
42 
43  for (int i = 0; i < n; ++i) {
44  Position tran = basetr + (double(copy) * delta) * direction;
45  mother.placeVolume(child, copy, Transform3D(rotation, tran));
46  LogDebug("DDAlgorithm") << "DDLinear: " << child.name() << " number " << copy << " positioned in " << mother.name()
47  << " at " << tran << " with " << rotation;
48 
49  copy += incrCopyNo;
50  }
51 
52  return 1;
53 }

References writedatasetfile::args, newFWLiteAna::base, angle_units::operators::convertRadToDeg(), filterCSVwithJSON::copy, funct::cos(), dumpMFGeometry_cfg::delta, MillePedeFileConverter_cfg::e, mps_fire::i, LogDebug, dqmiodumpmetadata::n, cms::DDNamespace::name(), PixelTestBeamValidation_cfi::Position, idealTransformation::rotation, funct::sin(), theta(), and cms::DDNamespace::volume().

◆ DD4HEP_OPEN_PLUGIN()

DD4HEP_OPEN_PLUGIN ( dd4hep  ,
ddcms_det_element_DDCMS_global_DDLinear   
)

Definition at line 56 of file DDLinear.cc.

writedatasetfile.args
args
Definition: writedatasetfile.py:18
mps_fire.i
i
Definition: mps_fire.py:428
dqmiodumpmetadata.n
n
Definition: dqmiodumpmetadata.py:28
filterCSVwithJSON.copy
copy
Definition: filterCSVwithJSON.py:36
angle_units::operators::convertRadToDeg
constexpr NumType convertRadToDeg(NumType radians)
Definition: angle_units.h:21
cms::DDNamespace
Definition: DDNamespace.h:16
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
theta
Geom::Theta< T > theta() const
Definition: Basic3DVectorLD.h:150
PixelTestBeamValidation_cfi.Position
Position
Definition: PixelTestBeamValidation_cfi.py:75
cms::Volume
dd4hep::Volume Volume
Definition: DDFilteredView.h:47
LogDebug
#define LogDebug(id)
Definition: MessageLogger.h:233
idealTransformation.rotation
dictionary rotation
Definition: idealTransformation.py:1
PVValHelper::phi
Definition: PVValidationHelpers.h:69
dumpMFGeometry_cfg.delta
delta
Definition: dumpMFGeometry_cfg.py:25
cms::DDAlgoArguments
Definition: DDAlgoArguments.h:28
child
Definition: simpleInheritance.h:11
newFWLiteAna.base
base
Definition: newFWLiteAna.py:92
MillePedeFileConverter_cfg.e
e
Definition: MillePedeFileConverter_cfg.py:37