CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
List of all members | Public Member Functions | Private Attributes
DDLinear Class Reference

#include <DDLinear.h>

Inheritance diagram for DDLinear:

Public Member Functions

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

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 7 of file DDLinear.h.

Constructor & Destructor Documentation

DDLinear::DDLinear ( void  )

Definition at line 8 of file DDLinear.cc.

References LogDebug.

9  : m_n( 1 ),
10  m_startCopyNo( 1 ),
11  m_incrCopyNo( 1 ),
12  m_theta( 0. ),
13  m_phi( 0. ),
14  m_delta( 0. )
15 {
16  LogDebug( "DDAlgorithm" ) << "DDLinear: Creating an instance.";
17 }
#define LogDebug(id)
int m_startCopyNo
Definition: DDLinear.h:23
double m_phi
Definition: DDLinear.h:26
int m_incrCopyNo
Definition: DDLinear.h:24
double m_delta
Definition: DDLinear.h:29
double m_theta
Definition: DDLinear.h:25
int m_n
Definition: DDLinear.h:22
DDLinear::~DDLinear ( void  )
virtual

Definition at line 19 of file DDLinear.cc.

20 {}

Member Function Documentation

void DDLinear::execute ( DDCompactView cpv)

Definition at line 58 of file DDLinear.cc.

References filterCSVwithJSON::copy, funct::cos(), DDrot(), i, LogDebug, m_base, m_childNmNs, m_delta, m_incrCopyNo, m_n, m_phi, m_startCopyNo, m_theta, confdb::parent, DDCompactView::position(), idealTransformation::rotation, and funct::sin().

59 {
60  DDName mother = parent().name();
61  DDName ddname( m_childNmNs.first, m_childNmNs.second );
62  int copy = m_startCopyNo;
63 
64  DDTranslation direction( sin( m_theta ) * cos( m_phi ),
65  sin( m_theta ) * sin( m_phi ),
66  cos( m_theta ));
67 
68  DDTranslation basetr( m_base[0],
69  m_base[1],
70  m_base[2] );
71 
72  DDRotation rotation = DDRotation( "IdentityRotation" );
73  if( !rotation )
74  {
75  LogDebug( "DDAlgorithm" ) << "DDLinear: Creating a new "
76  << "rotation: IdentityRotation for " << ddname;
77 
78  rotation = DDrot( "IdentityRotation", new DDRotationMatrix());
79  }
80 
81  for( int i = 0; i < m_n; ++i )
82  {
83  DDTranslation tran = basetr + ( /*m_offset + */ double( copy ) * m_delta ) * direction;
84  cpv.position( ddname, mother, copy, tran, rotation );
85  LogDebug( "DDAlgorithm" ) << "DDLinear: " << m_childNmNs.second << ":" << m_childNmNs.first << " number "
86  << copy << " positioned in " << mother << " at "
87  << tran << " with " << rotation;
88  copy += m_incrCopyNo;
89  }
90 }
#define LogDebug(id)
int i
Definition: DBlmapReader.cc:9
int m_startCopyNo
Definition: DDLinear.h:23
double m_phi
Definition: DDLinear.h:26
int m_incrCopyNo
Definition: DDLinear.h:24
parent
Definition: confdb.py:1052
Sin< T >::type sin(const T &t)
Definition: Sin.h:22
void position(const DDLogicalPart &self, const DDLogicalPart &parent, std::string copyno, const DDTranslation &trans, const DDRotation &rot, const DDDivision *div=NULL)
DDName is used to identify DDD entities uniquely.
Definition: DDName.h:14
double m_delta
Definition: DDLinear.h:29
std::pair< std::string, std::string > m_childNmNs
Definition: DDLinear.h:32
ROOT::Math::DisplacementVector3D< ROOT::Math::Cartesian3D< double > > DDTranslation
Definition: DDTranslation.h:7
Represents a uniquely identifyable rotation matrix.
Definition: DDTransform.h:66
double m_theta
Definition: DDLinear.h:25
Cos< T >::type cos(const T &t)
Definition: Cos.h:22
int m_n
Definition: DDLinear.h:22
DDRotation DDrot(const DDName &name, DDRotationMatrix *rot)
Definition of a uniquely identifiable rotation matrix named by DDName name.
Definition: DDRotation.cc:90
std::vector< double > m_base
Definition: DDLinear.h:30
ROOT::Math::Rotation3D DDRotationMatrix
A DDRotationMatrix is currently implemented with a ROOT Rotation3D.
void DDLinear::initialize ( const DDNumericArguments nArgs,
const DDVectorArguments vArgs,
const DDMapArguments mArgs,
const DDStringArguments sArgs,
const DDStringVectorArguments vsArgs 
)

Definition at line 23 of file DDLinear.cc.

References DDSplit(), LogDebug, m_base, m_childNmNs, m_delta, m_incrCopyNo, m_n, m_phi, m_startCopyNo, m_theta, DDCurrentNamespace::ns(), and confdb::parent.

28 {
29  m_n = int(nArgs["N"]);
30  m_startCopyNo = int(nArgs["StartCopyNo"]);
31  m_incrCopyNo = int(nArgs["IncrCopyNo"]);
32  m_theta = nArgs["Theta"];
33  m_phi = nArgs["Phi"];
34  // FIXME: m_offset = nArgs["Offset"];
35  m_delta = nArgs["Delta"];
36  m_base = vArgs["Base"];
37 
38  LogDebug( "DDAlgorithm" ) << "DDLinear: Parameters for position"
39  << "ing:: n " << m_n << " Direction Theta, Phi, Offset, Delta "
40  << m_theta/CLHEP::deg << " "
41  << m_phi/CLHEP::deg << " "
42  // FIXME: << m_offset/CLHEP::deg
43  << " " << m_delta/CLHEP::deg
44  << " Base " << m_base[0]
45  << ", " << m_base[1] << ", " << m_base[2];
46 
47  m_childNmNs = DDSplit( sArgs["ChildName"] );
48  if( m_childNmNs.second.empty())
50 
51  DDName parentName = parent().name();
52  LogDebug( "DDAlgorithm" ) << "DDLinear: Parent " << parentName
53  << "\tChild " << m_childNmNs.first << " NameSpace "
54  << m_childNmNs.second;
55 }
#define LogDebug(id)
int m_startCopyNo
Definition: DDLinear.h:23
double m_phi
Definition: DDLinear.h:26
int m_incrCopyNo
Definition: DDLinear.h:24
parent
Definition: confdb.py:1052
DDName is used to identify DDD entities uniquely.
Definition: DDName.h:14
double m_delta
Definition: DDLinear.h:29
static std::string & ns()
std::pair< std::string, std::string > m_childNmNs
Definition: DDLinear.h:32
double m_theta
Definition: DDLinear.h:25
int m_n
Definition: DDLinear.h:22
std::vector< double > m_base
Definition: DDLinear.h:30
std::pair< std::string, std::string > DDSplit(const std::string &n)
split into (name,namespace), separator = &#39;:&#39;
Definition: DDSplit.cc:4

Member Data Documentation

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

Definition at line 30 of file DDLinear.h.

Referenced by execute(), and initialize().

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

Definition at line 32 of file DDLinear.h.

Referenced by execute(), and initialize().

double DDLinear::m_delta
private

Definition at line 29 of file DDLinear.h.

Referenced by execute(), and initialize().

int DDLinear::m_incrCopyNo
private

Definition at line 24 of file DDLinear.h.

Referenced by execute(), and initialize().

int DDLinear::m_n
private

Definition at line 22 of file DDLinear.h.

Referenced by execute(), and initialize().

double DDLinear::m_phi
private

Definition at line 26 of file DDLinear.h.

Referenced by execute(), and initialize().

int DDLinear::m_startCopyNo
private

Definition at line 23 of file DDLinear.h.

Referenced by execute(), and initialize().

double DDLinear::m_theta
private

Definition at line 25 of file DDLinear.h.

Referenced by execute(), and initialize().