#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.
|
using | DD3Vector = ROOT::Math::DisplacementVector3D< ROOT::Math::Cartesian3D< double > > |
|
using DD3Vector = ROOT::Math::DisplacementVector3D<ROOT::Math::Cartesian3D<double> > |
Definition at line 15 of file DDLinear.cc.
References writedatasetfile::args, newFWLiteAna::base, angle_units::operators::convertRadToDeg(), filterCSVwithJSON::copy, funct::cos(), dumpMFGeometry_cfg::delta, cms::DDAlgoArguments::find(), mps_fire::i, LogDebug, dqmiodumpmetadata::n, cms::DDNamespace::name(), cms::DDAlgoArguments::parentName(), idealTransformation::rotation, funct::sin(), theta(), cms::DDAlgoArguments::value(), and cms::DDNamespace::volume().
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");
28 int copy = startCopyNo;
30 LogDebug(
"DDAlgorithm") <<
"DDLinear: Parameters for positioning:: n " << n <<
" Direction Theta, Phi, Delta " 32 <<
" Base " << base[0] <<
", " << base[1] <<
", " << base[2];
34 LogDebug(
"DDAlgorithm") <<
"DDLinear: Parent " << mother.name() <<
"\tChild " << child.name() <<
" NameSpace " 37 Position direction(
sin(theta) *
cos(phi),
sin(theta) *
sin(phi),
cos(theta));
39 Position basetr(base[0], base[1], base[2]);
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;
constexpr NumType convertRadToDeg(NumType radians)
Sin< T >::type sin(const T &t)
Geom::Theta< T > theta() const
Cos< T >::type cos(const T &t)
DD4HEP_OPEN_PLUGIN |
( |
dd4hep |
, |
|
|
ddcms_det_element_DDCMS_global_DDLinear |
|
|
) |
| |