29 m_rangeAngle( 360._deg ),
68 m_n =
int(nArgs[
"N"]);
69 m_startCopyNo =
int(nArgs[
"StartCopyNo"]);
70 m_incrCopyNo =
int(nArgs[
"IncrCopyNo"]);
71 m_rangeAngle = nArgs[
"RangeAngle"];
72 m_startAngle = nArgs[
"StartAngle"];
73 m_radius = nArgs[
"Radius"];
74 m_center = vArgs[
"Center"];
75 m_rotateSolid = vArgs[
"RotateSolid"];
79 if(
std::abs( m_rangeAngle - 360.0_deg ) < 0.001_deg )
81 m_delta = m_rangeAngle / double( m_n );
87 m_delta = m_rangeAngle / double( m_n - 1 );
95 LogDebug(
"DDAlgorithm" ) <<
"DDAngular: Parameters for position" 96 <<
"ing:: n " << m_n <<
" Start, Range, Delta " 99 <<
" Radius " << m_radius <<
" Centre " << m_center[0]
100 <<
", " << m_center[1] <<
", " << m_center[2];
104 sz_type sz = m_rotateSolid.size();
107 LogDebug(
"DDAlgorithm" ) <<
"\trotateSolid must occur 3*n times (defining n subsequent rotations)\n" 108 <<
"\t currently it appears " << sz <<
" times!\n";
110 for( sz_type
i = 0;
i < sz;
i += 3 )
112 if(( m_rotateSolid[
i] > 180._deg ) || ( m_rotateSolid[
i] < 0._deg ))
114 LogDebug(
"DDAlgorithm" ) <<
"\trotateSolid \'theta\' must be in range [0,180*deg]\n" 116 <<
"*deg in rotateSolid[" << double(i) <<
"]!\n";
119 m_rotateSolid[i + 2] );
120 LogDebug(
"DDAlgorithm" ) <<
" rotsolid[" << i <<
"] axis=" << temp.Axis() <<
" rot.angle=" <<
convertRadToDeg( temp.Angle() );
121 m_solidRot = temp * m_solidRot;
125 m_childNmNs =
DDSplit( sArgs[
"ChildName"] );
126 if( m_childNmNs.second.empty())
130 LogDebug(
"DDAlgorithm" ) <<
"DDAngular: Parent " << parentName
131 <<
"\tChild " << m_childNmNs.first <<
"\tNameSpace " 132 << m_childNmNs.second;
139 DDName ddname( m_childNmNs.first, m_childNmNs.second );
140 double theta = 90._deg;
141 int copy = m_startCopyNo;
142 double phi = m_startAngle;
144 for(
int i = 0;
i < m_n; ++
i )
147 double phiy = phix + 90._deg;
150 std::string rotstr = m_childNmNs.first +
"_" + std::to_string( phideg * 10.);
154 LogDebug(
"DDAlgorithm" ) <<
"DDAngular: Creating a new " 155 <<
"rotation: " << rotstr <<
"\t90., " 161 0., 0. ) * m_solidRot ));
164 double xpos = m_radius *
cos( phi ) + m_center[0];
165 double ypos = m_radius *
sin( phi ) + m_center[1];
166 double zpos = m_center[2];
169 cpv.
position( ddname, mother, copy, tran, rotation );
170 LogDebug(
"DDAlgorithm" ) <<
"DDAngular: child " << m_childNmNs.second <<
":" << m_childNmNs.first <<
" number " 171 << copy <<
" positioned in " << mother <<
" at " 172 << tran <<
" with " << rotation <<
"\n";
173 copy += m_incrCopyNo;
182 sin( phi ) *
sin( theta ),
static AlgebraicMatrix initialize()
Sin< T >::type sin(const T &t)
ROOT::Math::Rotation3D DDRotationMatrix
A DDRotationMatrix is currently implemented with a ROOT Rotation3D.
Geom::Theta< T > theta() const
DDName is used to identify DDD entities uniquely.
constexpr NumType convertRadToDeg(NumType radians)
void initialize(const DDNumericArguments &nArgs, const DDVectorArguments &vArgs, const DDMapArguments &mArgs, const DDStringArguments &sArgs, const DDStringVectorArguments &vsArgs) override
static std::string & ns()
DD3Vector fUnitVector(double theta, double phi)
Compact representation of the geometrical detector hierarchy.
DDRotationMatrix m_solidRot
ROOT::Math::DisplacementVector3D< ROOT::Math::Cartesian3D< double > > DDTranslation
Represents a uniquely identifyable rotation matrix.
void execute(DDCompactView &cpv) override
ROOT::Math::DisplacementVector3D< ROOT::Math::Cartesian3D< double > > DD3Vector
A DD Translation is currently implemented with Root Vector3D.
Cos< T >::type cos(const T &t)
Abs< T >::type abs(const T &t)
std::vector< double > m_rotateSolid
std::vector< double > m_center
ROOT::Math::DisplacementVector3D< ROOT::Math::Cartesian3D< double > > DD3Vector
std::string m_idNameSpace
void position(const DDLogicalPart &self, const DDLogicalPart &parent, const std::string ©no, const DDTranslation &trans, const DDRotation &rot, const DDDivision *div=0)
std::pair< std::string, std::string > m_childNmNs
#define DEFINE_EDM_PLUGIN(factory, type, name)
std::pair< std::string, std::string > DDSplit(const std::string &n)
split into (name,namespace), separator = ':'
ROOT::Math::AxisAngle DDAxisAngle