CMS 3D CMS Logo

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

Public Member Functions

 DDMTDLinear ()
 
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
 
double m_phi_obj
 
int m_startCopyNo
 
double m_theta
 
double m_theta_obj
 

Detailed Description

Definition at line 22 of file DDMTDLinear.cc.

Constructor & Destructor Documentation

◆ DDMTDLinear()

DDMTDLinear::DDMTDLinear ( )
inline

Definition at line 24 of file DDMTDLinear.cc.

25  : m_n(1), m_startCopyNo(1), m_incrCopyNo(1), m_theta(0.), m_phi(0.), m_delta(0.), m_phi_obj(0.), m_theta_obj(0.) {}

Member Function Documentation

◆ execute()

void DDMTDLinear::execute ( DDCompactView cpv)
override

Definition at line 81 of file DDMTDLinear.cc.

81  {
82  DDName mother = parent().name();
83  DDName ddname(m_childNmNs.first, m_childNmNs.second);
84  int copy = m_startCopyNo;
85 
87 
88  DDTranslation basetr(m_base[0], m_base[1], m_base[2]);
89 
90  //rotation is in xy plane
91  double thetaZ = m_theta_obj - 0.5_pi;
92  double phiZ = m_phi_obj;
93  double thetaX = m_theta_obj;
94  double thetaY = m_theta_obj;
95  double phiX = m_phi_obj;
96  double phiY = m_phi_obj + 0.5_pi;
97 
98  DDRotation rotation = DDRotation("Rotation");
99 
100  if (!rotation) {
101  LogDebug("DDAlgorithm") << "DDMTDLinear: Creating a new "
102  << "rotation for " << ddname;
103 
104  rotation = DDrot("Rotation", DDcreateRotationMatrix(thetaX, phiX, thetaY, phiY, thetaZ, phiZ));
105  }
106 
107  for (int i = 0; i < m_n; ++i) {
108  DDTranslation tran = basetr + (double(i) * m_delta) * direction;
109  cpv.position(ddname, mother, copy, tran, rotation);
110  LogDebug("DDAlgorithm") << "DDMTDLinear: " << m_childNmNs.second << ":" << m_childNmNs.first << " number " << copy
111  << " positioned in " << mother << " at " << tran << " with " << rotation;
112  copy += m_incrCopyNo;
113  }
114 }

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

◆ initialize()

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

Definition at line 50 of file DDMTDLinear.cc.

54  {
55  m_n = int(nArgs["N"]);
56  m_startCopyNo = int(nArgs["StartCopyNo"]);
57  m_incrCopyNo = int(nArgs["IncrCopyNo"]);
58  m_theta = nArgs["Theta"];
59  m_phi = nArgs["Phi"];
60  m_delta = nArgs["Delta"];
61  m_base = vArgs["Base"];
62  m_phi_obj = nArgs["Phi_obj"];
63  m_theta_obj = nArgs["Theta_obj"];
64 
65  LogDebug("DDAlgorithm") << "DDMTDLinear: Parameters for position"
66  << "ing:: n " << m_n << " Direction Theta, Phi, Offset, Delta " << convertRadToDeg(m_theta)
67  << " " << convertRadToDeg(m_phi) << " "
68  << " " << convertRadToDeg(m_delta) << " Base " << m_base[0] << ", " << m_base[1] << ", "
69  << m_base[2] << "Objects placement Phi_obj, Theta_obj " << convertRadToDeg(m_phi_obj) << " "
71 
72  m_childNmNs = DDSplit(sArgs["ChildName"]);
73  if (m_childNmNs.second.empty())
75 
76  DDName parentName = parent().name();
77  LogDebug("DDAlgorithm") << "DDMTDLinear: Parent " << parentName << "\tChild " << m_childNmNs.first << " NameSpace "
78  << m_childNmNs.second;
79 }

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

Member Data Documentation

◆ m_base

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

Definition at line 44 of file DDMTDLinear.cc.

◆ m_childNmNs

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

Definition at line 46 of file DDMTDLinear.cc.

◆ m_delta

double DDMTDLinear::m_delta
private

Definition at line 41 of file DDMTDLinear.cc.

◆ m_incrCopyNo

int DDMTDLinear::m_incrCopyNo
private

Definition at line 38 of file DDMTDLinear.cc.

◆ m_n

int DDMTDLinear::m_n
private

Definition at line 36 of file DDMTDLinear.cc.

◆ m_phi

double DDMTDLinear::m_phi
private

Definition at line 40 of file DDMTDLinear.cc.

◆ m_phi_obj

double DDMTDLinear::m_phi_obj
private

Definition at line 42 of file DDMTDLinear.cc.

◆ m_startCopyNo

int DDMTDLinear::m_startCopyNo
private

Definition at line 37 of file DDMTDLinear.cc.

◆ m_theta

double DDMTDLinear::m_theta
private

Definition at line 39 of file DDMTDLinear.cc.

◆ m_theta_obj

double DDMTDLinear::m_theta_obj
private

Definition at line 43 of file DDMTDLinear.cc.

mps_fire.i
i
Definition: mps_fire.py:355
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
DDMTDLinear::m_phi_obj
double m_phi_obj
Definition: DDMTDLinear.cc:42
DDMTDLinear::m_theta_obj
double m_theta_obj
Definition: DDMTDLinear.cc:43
funct::sin
Sin< T >::type sin(const T &t)
Definition: Sin.h:22
funct::cos
Cos< T >::type cos(const T &t)
Definition: Cos.h:22
DDMTDLinear::m_delta
double m_delta
Definition: DDMTDLinear.cc:41
DDTranslation
ROOT::Math::DisplacementVector3D< ROOT::Math::Cartesian3D< double > > DDTranslation
Definition: DDTranslation.h:7
DDMTDLinear::m_phi
double m_phi
Definition: DDMTDLinear.cc:40
DDMTDLinear::m_childNmNs
std::pair< std::string, std::string > m_childNmNs
Definition: DDMTDLinear.cc:46
LogDebug
#define LogDebug(id)
Definition: MessageLogger.h:670
idealTransformation.rotation
dictionary rotation
Definition: idealTransformation.py:1
DDMTDLinear::m_n
int m_n
Definition: DDMTDLinear.cc:36
createfilelist.int
int
Definition: createfilelist.py:10
DOFs::thetaY
Definition: AlignPCLThresholdsWriter.cc:37
DDMTDLinear::m_base
std::vector< double > m_base
Definition: DDMTDLinear.cc:44
DOFs::thetaX
Definition: AlignPCLThresholdsWriter.cc:37
DDMTDLinear::m_startCopyNo
int m_startCopyNo
Definition: DDMTDLinear.cc:37
DOFs::thetaZ
Definition: AlignPCLThresholdsWriter.cc:37
DDCurrentNamespace::ns
static std::string & ns()
Definition: DDCurrentNamespace.cc:3
DDMTDLinear::m_theta
double m_theta
Definition: DDMTDLinear.cc:39
DDRotation
Represents a uniquely identifyable rotation matrix.
Definition: DDTransform.h:57
DDcreateRotationMatrix
std::unique_ptr< DDRotationMatrix > DDcreateRotationMatrix(double thetaX, double phiX, double thetaY, double phiY, double thetaZ, double phiZ)
create a new DDRotationMatrix in the GEANT3 style.
Definition: DDRotation.cc:120
DDMTDLinear::m_incrCopyNo
int m_incrCopyNo
Definition: DDMTDLinear.cc:38
class-composition.parent
parent
Definition: class-composition.py:88
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:66
DDRotation
ROOT::Math::Rotation3D DDRotation
Definition: DDEcalEndcapAlgo.cc:18