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 ( )
inline

Definition at line 24 of file DDLinear.cc.

References cmsIgProf_Analysis::execute(), and initialize().

25  : m_n( 1 ),
26  m_startCopyNo( 1 ),
27  m_incrCopyNo( 1 ),
28  m_theta( 0. ),
29  m_phi( 0. ),
30  m_delta( 0. ) {}
int m_startCopyNo
Definition: DDLinear.cc:43
double m_phi
Definition: DDLinear.cc:46
int m_incrCopyNo
Definition: DDLinear.cc:44
double m_delta
Definition: DDLinear.cc:47
double m_theta
Definition: DDLinear.cc:45
int m_n
Definition: DDLinear.cc:42

Member Function Documentation

void DDLinear::execute ( DDCompactView cpv)
override

Definition at line 88 of file DDLinear.cc.

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

89 {
90  DDName mother = parent().name();
91  DDName ddname( m_childNmNs.first, m_childNmNs.second );
92  int copy = m_startCopyNo;
93 
94  DDTranslation direction( sin( m_theta ) * cos( m_phi ),
95  sin( m_theta ) * sin( m_phi ),
96  cos( m_theta ));
97 
98  DDTranslation basetr( m_base[0],
99  m_base[1],
100  m_base[2] );
101 
102  DDRotation rotation = DDRotation( "IdentityRotation" );
103  if( !rotation )
104  {
105  LogDebug( "DDAlgorithm" ) << "DDLinear: Creating a new "
106  << "rotation: IdentityRotation for " << ddname;
107 
108  rotation = DDrot( "IdentityRotation", std::make_unique< DDRotationMatrix >());
109  }
110 
111  for( int i = 0; i < m_n; ++i )
112  {
113  DDTranslation tran = basetr + ( double( copy ) * m_delta ) * direction;
114  cpv.position( ddname, mother, copy, tran, rotation );
115  LogDebug( "DDAlgorithm" ) << "DDLinear: " << m_childNmNs.second << ":" << m_childNmNs.first << " number "
116  << copy << " positioned in " << mother << " at "
117  << tran << " with " << rotation;
118  copy += m_incrCopyNo;
119  }
120 }
#define LogDebug(id)
int m_startCopyNo
Definition: DDLinear.cc:43
def copy(args, dbName)
double m_phi
Definition: DDLinear.cc:46
int m_incrCopyNo
Definition: DDLinear.cc:44
Sin< T >::type sin(const T &t)
Definition: Sin.h:22
DDName is used to identify DDD entities uniquely.
Definition: DDName.h:15
double m_delta
Definition: DDLinear.cc:47
std::pair< std::string, std::string > m_childNmNs
Definition: DDLinear.cc:50
ROOT::Math::DisplacementVector3D< ROOT::Math::Cartesian3D< double > > DDTranslation
Definition: DDTranslation.h:7
Represents a uniquely identifyable rotation matrix.
Definition: DDTransform.h:68
double m_theta
Definition: DDLinear.cc:45
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:80
int m_n
Definition: DDLinear.cc:42
std::vector< double > m_base
Definition: DDLinear.cc:48
void position(const DDLogicalPart &self, const DDLogicalPart &parent, const std::string &copyno, const DDTranslation &trans, const DDRotation &rot, const DDDivision *div=0)
void DDLinear::initialize ( const DDNumericArguments nArgs,
const DDVectorArguments vArgs,
const DDMapArguments mArgs,
const DDStringArguments sArgs,
const DDStringVectorArguments vsArgs 
)
override

Definition at line 55 of file DDLinear.cc.

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

60 {
61  m_n = int(nArgs["N"]);
62  m_startCopyNo = int(nArgs["StartCopyNo"]);
63  m_incrCopyNo = int(nArgs["IncrCopyNo"]);
64  m_theta = nArgs["Theta"];
65  m_phi = nArgs["Phi"];
66  m_delta = nArgs["Delta"];
67  m_base = vArgs["Base"];
68 
69  LogDebug( "DDAlgorithm" ) << "DDLinear: Parameters for position"
70  << "ing:: n " << m_n << " Direction Theta, Phi, Offset, Delta "
71  << convertRadToDeg( m_theta ) << " "
72  << convertRadToDeg( m_phi ) << " "
73  << " " << convertRadToDeg( m_delta )
74  << " Base " << m_base[0]
75  << ", " << m_base[1] << ", " << m_base[2];
76 
77  m_childNmNs = DDSplit( sArgs["ChildName"] );
78  if( m_childNmNs.second.empty())
80 
81  DDName parentName = parent().name();
82  LogDebug( "DDAlgorithm" ) << "DDLinear: Parent " << parentName
83  << "\tChild " << m_childNmNs.first << " NameSpace "
84  << m_childNmNs.second;
85 }
#define LogDebug(id)
int m_startCopyNo
Definition: DDLinear.cc:43
double m_phi
Definition: DDLinear.cc:46
int m_incrCopyNo
Definition: DDLinear.cc:44
DDName is used to identify DDD entities uniquely.
Definition: DDName.h:15
constexpr NumType convertRadToDeg(NumType radians)
Definition: GeantUnits.h:98
double m_delta
Definition: DDLinear.cc:47
static std::string & ns()
std::pair< std::string, std::string > m_childNmNs
Definition: DDLinear.cc:50
double m_theta
Definition: DDLinear.cc:45
int m_n
Definition: DDLinear.cc:42
std::vector< double > m_base
Definition: DDLinear.cc:48
std::pair< std::string, std::string > DDSplit(const std::string &n)
split into (name,namespace), separator = &#39;:&#39;
Definition: DDSplit.cc:3

Member Data Documentation

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

Definition at line 48 of file DDLinear.cc.

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

Definition at line 50 of file DDLinear.cc.

double DDLinear::m_delta
private

Definition at line 47 of file DDLinear.cc.

int DDLinear::m_incrCopyNo
private

Definition at line 44 of file DDLinear.cc.

int DDLinear::m_n
private

Definition at line 42 of file DDLinear.cc.

double DDLinear::m_phi
private

Definition at line 46 of file DDLinear.cc.

int DDLinear::m_startCopyNo
private

Definition at line 43 of file DDLinear.cc.

double DDLinear::m_theta
private

Definition at line 45 of file DDLinear.cc.