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.) {}

Member Function Documentation

◆ execute()

void DDLinear::execute ( DDCompactView cpv)
override

Definition at line 74 of file DDLinear.cc.

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 }

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

◆ 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.

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 }

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

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.

mps_fire.i
i
Definition: mps_fire.py:428
DDrot
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
filterCSVwithJSON.copy
copy
Definition: filterCSVwithJSON.py:36
DDName
DDName is used to identify DDD entities uniquely.
Definition: DDName.h:15
angle_units::operators::convertRadToDeg
constexpr NumType convertRadToDeg(NumType radians)
Definition: angle_units.h:21
DDLinear::m_theta
double m_theta
Definition: DDLinear.cc:37
DDLinear::m_incrCopyNo
int m_incrCopyNo
Definition: DDLinear.cc:36
DDLinear::m_startCopyNo
int m_startCopyNo
Definition: DDLinear.cc:35
funct::sin
Sin< T >::type sin(const T &t)
Definition: Sin.h:22
DDLinear::m_n
int m_n
Definition: DDLinear.cc:34
funct::cos
Cos< T >::type cos(const T &t)
Definition: Cos.h:22
DDTranslation
ROOT::Math::DisplacementVector3D< ROOT::Math::Cartesian3D< double > > DDTranslation
Definition: DDTranslation.h:7
DDLinear::m_base
std::vector< double > m_base
Definition: DDLinear.cc:40
DDLinear::m_childNmNs
std::pair< std::string, std::string > m_childNmNs
Definition: DDLinear.cc:42
LogDebug
#define LogDebug(id)
Definition: MessageLogger.h:223
idealTransformation.rotation
dictionary rotation
Definition: idealTransformation.py:1
createfilelist.int
int
Definition: createfilelist.py:10
DDLinear::m_phi
double m_phi
Definition: DDLinear.cc:38
DDCurrentNamespace::ns
static std::string & ns()
Definition: DDCurrentNamespace.cc:3
DDRotation
Represents a uniquely identifyable rotation matrix.
Definition: DDTransform.h:57
class-composition.parent
parent
Definition: class-composition.py:88
DDLinear::m_delta
double m_delta
Definition: DDLinear.cc:39
DDSplit
std::pair< std::string, std::string > DDSplit(const std::string &n)
split into (name,namespace), separator = ':'
Definition: DDSplit.cc:3
DDCompactView::position
void position(const DDLogicalPart &self, const DDLogicalPart &parent, const std::string &copyno, const DDTranslation &trans, const DDRotation &rot, const DDDivision *div=nullptr)
Definition: DDCompactView.cc:76
DDRotation
ROOT::Math::Rotation3D DDRotation
Definition: DDEcalEndcapAlgo.cc:18