CMS 3D CMS Logo

List of all members | Public Member Functions | Private Attributes
DDLinear Class Reference
Inheritance diagram for DDLinear:

Public Member Functions

 DDLinear ()
 
void execute (DDCompactView &cpv) override
 
void initialize (const DDNumericArguments &nArgs, const DDVectorArguments &vArgs, const DDMapArguments &mArgs, const DDStringArguments &sArgs, const DDStringVectorArguments &vsArgs) override
 

Private Attributes

std::vector< double > m_base
 
std::pair< std::string, std::string > m_childNmNs
 
double m_delta
 
int m_incrCopyNo
 
int m_n
 
double m_phi
 
int m_startCopyNo
 
double m_theta
 

Detailed Description

Definition at line 21 of file DDLinear.cc.

Constructor & Destructor Documentation

◆ DDLinear()

DDLinear::DDLinear ( )
inline

Definition at line 23 of file DDLinear.cc.

23 : m_n(1), m_startCopyNo(1), m_incrCopyNo(1), m_theta(0.), m_phi(0.), m_delta(0.) {}
int m_startCopyNo
Definition: DDLinear.cc:35
double m_phi
Definition: DDLinear.cc:38
int m_incrCopyNo
Definition: DDLinear.cc:36
double m_delta
Definition: DDLinear.cc:39
double m_theta
Definition: DDLinear.cc:37
int m_n
Definition: DDLinear.cc:34

Member Function Documentation

◆ execute()

void DDLinear::execute ( DDCompactView cpv)
override

Definition at line 74 of file DDLinear.cc.

References filterCSVwithJSON::copy, funct::cos(), DDrot(), mps_fire::i, LogDebug, class-composition::parent, DDCompactView::position(), idealTransformation::rotation, and funct::sin().

74  {
75  DDName mother = parent().name();
76  DDName ddname(m_childNmNs.first, m_childNmNs.second);
77  int copy = m_startCopyNo;
78 
80 
81  DDTranslation basetr(m_base[0], m_base[1], m_base[2]);
82 
83  DDRotation rotation = DDRotation("IdentityRotation");
84  if (!rotation) {
85  LogDebug("DDAlgorithm") << "DDLinear: Creating a new "
86  << "rotation: IdentityRotation for " << ddname;
87 
88  rotation = DDrot("IdentityRotation", std::make_unique<DDRotationMatrix>());
89  }
90 
91  for (int i = 0; i < m_n; ++i) {
92  DDTranslation tran = basetr + (double(copy) * m_delta) * direction;
93  cpv.position(ddname, mother, copy, tran, rotation);
94  LogDebug("DDAlgorithm") << "DDLinear: " << m_childNmNs.second << ":" << m_childNmNs.first << " number " << copy
95  << " positioned in " << mother << " at " << tran << " with " << rotation;
96  copy += m_incrCopyNo;
97  }
98 }
int m_startCopyNo
Definition: DDLinear.cc:35
void position(const DDLogicalPart &self, const DDLogicalPart &parent, const std::string &copyno, const DDTranslation &trans, const DDRotation &rot, const DDDivision *div=nullptr)
double m_phi
Definition: DDLinear.cc:38
int m_incrCopyNo
Definition: DDLinear.cc:36
Sin< T >::type sin(const T &t)
Definition: Sin.h:22
DDName is used to identify DDD entities uniquely.
Definition: DDName.h:17
double m_delta
Definition: DDLinear.cc:39
std::pair< std::string, std::string > m_childNmNs
Definition: DDLinear.cc:42
Represents a uniquely identifyable rotation matrix.
Definition: DDTransform.h:57
double m_theta
Definition: DDLinear.cc:37
Cos< T >::type cos(const T &t)
Definition: Cos.h:22
DDRotation DDrot(const DDName &name, std::unique_ptr< DDRotationMatrix > rot)
Definition of a uniquely identifiable rotation matrix named by DDName name.
Definition: DDRotation.cc:67
int m_n
Definition: DDLinear.cc:34
std::vector< double > m_base
Definition: DDLinear.cc:40
ROOT::Math::DisplacementVector3D< ROOT::Math::Cartesian3D< double > > DDTranslation
Definition: DDTranslation.h:7
#define LogDebug(id)

◆ initialize()

void DDLinear::initialize ( const DDNumericArguments nArgs,
const DDVectorArguments vArgs,
const DDMapArguments mArgs,
const DDStringArguments sArgs,
const DDStringVectorArguments vsArgs 
)
override

Definition at line 46 of file DDLinear.cc.

References angle_units::operators::convertRadToDeg(), DDSplit(), createfilelist::int, LogDebug, DDCurrentNamespace::ns(), and class-composition::parent.

50  {
51  m_n = int(nArgs["N"]);
52  m_startCopyNo = int(nArgs["StartCopyNo"]);
53  m_incrCopyNo = int(nArgs["IncrCopyNo"]);
54  m_theta = nArgs["Theta"];
55  m_phi = nArgs["Phi"];
56  m_delta = nArgs["Delta"];
57  m_base = vArgs["Base"];
58 
59  LogDebug("DDAlgorithm") << "DDLinear: Parameters for position"
60  << "ing:: n " << m_n << " Direction Theta, Phi, Offset, Delta " << convertRadToDeg(m_theta)
61  << " " << convertRadToDeg(m_phi) << " "
62  << " " << convertRadToDeg(m_delta) << " Base " << m_base[0] << ", " << m_base[1] << ", "
63  << m_base[2];
64 
65  m_childNmNs = DDSplit(sArgs["ChildName"]);
66  if (m_childNmNs.second.empty())
68 
69  DDName parentName = parent().name();
70  LogDebug("DDAlgorithm") << "DDLinear: Parent " << parentName << "\tChild " << m_childNmNs.first << " NameSpace "
71  << m_childNmNs.second;
72 }
int m_startCopyNo
Definition: DDLinear.cc:35
double m_phi
Definition: DDLinear.cc:38
int m_incrCopyNo
Definition: DDLinear.cc:36
constexpr NumType convertRadToDeg(NumType radians)
Definition: angle_units.h:21
DDName is used to identify DDD entities uniquely.
Definition: DDName.h:17
double m_delta
Definition: DDLinear.cc:39
static std::string & ns()
std::pair< std::string, std::string > m_childNmNs
Definition: DDLinear.cc:42
double m_theta
Definition: DDLinear.cc:37
int m_n
Definition: DDLinear.cc:34
std::vector< double > m_base
Definition: DDLinear.cc:40
std::pair< std::string, std::string > DDSplit(const std::string &n)
split into (name,namespace), separator = &#39;:&#39;
Definition: DDSplit.cc:3
#define LogDebug(id)

Member Data Documentation

◆ m_base

std::vector<double> DDLinear::m_base
private

Definition at line 40 of file DDLinear.cc.

◆ m_childNmNs

std::pair<std::string, std::string> DDLinear::m_childNmNs
private

Definition at line 42 of file DDLinear.cc.

◆ m_delta

double DDLinear::m_delta
private

Definition at line 39 of file DDLinear.cc.

◆ m_incrCopyNo

int DDLinear::m_incrCopyNo
private

Definition at line 36 of file DDLinear.cc.

◆ m_n

int DDLinear::m_n
private

Definition at line 34 of file DDLinear.cc.

◆ m_phi

double DDLinear::m_phi
private

Definition at line 38 of file DDLinear.cc.

◆ m_startCopyNo

int DDLinear::m_startCopyNo
private

Definition at line 35 of file DDLinear.cc.

◆ m_theta

double DDLinear::m_theta
private

Definition at line 37 of file DDLinear.cc.