1 #include "DD4hep/DetFactoryHelper.h" 5 #include <Math/Cartesian3D.h> 6 #include <Math/DisplacementVector3D.h> 13 using DD3Vector = ROOT::Math::DisplacementVector3D<ROOT::Math::Cartesian3D<double> >;
23 int n = args.
value<
int>(
"N");
24 int startCopyNo = args.
find(
"StartCopyNo") ? args.
value<
int>(
"StartCopyNo") : 1;
25 int incrCopyNo = args.
find(
"IncrCopyNo") ? args.
value<
int>(
"IncrCopyNo") : 1;
26 double theta = args.
find(
"Theta") ? args.
value<
double>(
"Theta") : 0.;
27 double phi = args.
find(
"Phi") ? args.
value<
double>(
"Phi") : 0.;
28 double delta = args.
find(
"Delta") ? args.
value<
double>(
"Delta") : 0.;
29 vector<double>
base = args.
value<vector<double> >(
"Base");
32 int copy = startCopyNo;
34 LogDebug(
"DDAlgorithm") <<
"DDLinear: Parameters for positioning:: n " 35 << n <<
" Direction Theta, Phi, Delta " 38 <<
" Base " << base[0]
39 <<
", " << base[1] <<
", " << base[2];
41 LogDebug(
"DDAlgorithm") <<
"DDLinear: Parent " << mother.name()
42 <<
"\tChild " << child.name() <<
" NameSpace " 45 Position direction(
sin( theta ) *
cos( phi ),
49 Position basetr( base[0], base[1], base[2] );
53 for(
int i = 0;
i <
n; ++
i )
55 Position tran = basetr + ( double( copy ) *
delta ) * direction;
56 mother.placeVolume( child, copy, Transform3D( rotation, tran ));
57 LogDebug(
"DDAlgorithm" ) <<
"DDLinear: " << child.name() <<
" number " 58 << copy <<
" positioned in " << mother.name() <<
" at "
dd4hep::Volume volume(const std::string &name, bool exc=true) const
static long algorithm(Detector &, cms::DDParsingContext &ctxt, xml_h e, SensitiveDetector &)
Sin< T >::type sin(const T &t)
T value(const std::string &name) const
Geom::Theta< T > theta() const
constexpr NumType convertRadToDeg(NumType radians)
std::string_view name() const
ROOT::Math::DisplacementVector3D< ROOT::Math::Cartesian3D< double > > DD3Vector
A DD Translation is currently implemented with Root Vector3D.
Cos< T >::type cos(const T &t)
base
Make Sure CMSSW is Setup ##.
Namespace of DDCMS conversion namespace.
#define DECLARE_DDCMS_DETELEMENT(name, func)
bool find(const std::string &name) const
Check the existence of an argument by name.
std::string parentName() const
Access value of rParent child node.