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.) {}
double m_phi_obj
Definition: DDMTDLinear.cc:42
double m_theta_obj
Definition: DDMTDLinear.cc:43
double m_delta
Definition: DDMTDLinear.cc:41
double m_phi
Definition: DDMTDLinear.cc:40
int m_startCopyNo
Definition: DDMTDLinear.cc:37
double m_theta
Definition: DDMTDLinear.cc:39
int m_incrCopyNo
Definition: DDMTDLinear.cc:38

Member Function Documentation

◆ execute()

void DDMTDLinear::execute ( DDCompactView cpv)
override

Definition at line 81 of file DDMTDLinear.cc.

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.

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 }
double m_phi_obj
Definition: DDMTDLinear.cc:42
void position(const DDLogicalPart &self, const DDLogicalPart &parent, const std::string &copyno, const DDTranslation &trans, const DDRotation &rot, const DDDivision *div=nullptr)
double m_theta_obj
Definition: DDMTDLinear.cc:43
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: DDMTDLinear.cc:41
double m_phi
Definition: DDMTDLinear.cc:40
Represents a uniquely identifyable rotation matrix.
Definition: DDTransform.h:57
std::pair< std::string, std::string > m_childNmNs
Definition: DDMTDLinear.cc:46
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
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
int m_startCopyNo
Definition: DDMTDLinear.cc:37
double m_theta
Definition: DDMTDLinear.cc:39
std::vector< double > m_base
Definition: DDMTDLinear.cc:44
int m_incrCopyNo
Definition: DDMTDLinear.cc:38
ROOT::Math::DisplacementVector3D< ROOT::Math::Cartesian3D< double > > DDTranslation
Definition: DDTranslation.h:7
#define LogDebug(id)

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

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

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 }
double m_phi_obj
Definition: DDMTDLinear.cc:42
double m_theta_obj
Definition: DDMTDLinear.cc:43
constexpr NumType convertRadToDeg(NumType radians)
Definition: angle_units.h:21
DDName is used to identify DDD entities uniquely.
Definition: DDName.h:17
static std::string & ns()
double m_delta
Definition: DDMTDLinear.cc:41
double m_phi
Definition: DDMTDLinear.cc:40
std::pair< std::string, std::string > m_childNmNs
Definition: DDMTDLinear.cc:46
int m_startCopyNo
Definition: DDMTDLinear.cc:37
double m_theta
Definition: DDMTDLinear.cc:39
std::vector< double > m_base
Definition: DDMTDLinear.cc:44
int m_incrCopyNo
Definition: DDMTDLinear.cc:38
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> 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.