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

Constructor & Destructor Documentation

DDLinear::DDLinear ( void  )

Definition at line 19 of file DDLinear.cc.

References LogDebug.

20  : m_n( 1 ),
21  m_startCopyNo( 1 ),
22  m_incrCopyNo( 1 ),
23  m_theta( 0. ),
24  m_phi( 0. ),
25  m_delta( 0. )
26 {
27  LogDebug( "DDAlgorithm" ) << "DDLinear: Creating an instance.";
28 }
#define LogDebug(id)
int m_startCopyNo
Definition: DDLinear.h:29
double m_phi
Definition: DDLinear.h:32
int m_incrCopyNo
Definition: DDLinear.h:30
double m_delta
Definition: DDLinear.h:35
double m_theta
Definition: DDLinear.h:31
int m_n
Definition: DDLinear.h:28
DDLinear::~DDLinear ( void  )
virtual

Definition at line 30 of file DDLinear.cc.

31 {}

Member Function Documentation

void DDLinear::execute ( DDCompactView cpv)

Definition at line 69 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, SpecificationBuilder_cfi::parent(), DDCompactView::position(), idealTransformation::rotation, and funct::sin().

70 {
71  DDName mother = parent().name();
72  DDName ddname( m_childNmNs.first, m_childNmNs.second );
73  int copy = m_startCopyNo;
74 
75  DDTranslation direction( sin( m_theta ) * cos( m_phi ),
76  sin( m_theta ) * sin( m_phi ),
77  cos( m_theta ));
78 
79  DDTranslation basetr( m_base[0],
80  m_base[1],
81  m_base[2] );
82 
83  DDRotation rotation = DDRotation( "IdentityRotation" );
84  if( !rotation )
85  {
86  LogDebug( "DDAlgorithm" ) << "DDLinear: Creating a new "
87  << "rotation: IdentityRotation for " << ddname;
88 
89  rotation = DDrot( "IdentityRotation", new DDRotationMatrix());
90  }
91 
92  for( int i = 0; i < m_n; ++i )
93  {
94  DDTranslation tran = basetr + ( /*m_offset + */ double( copy ) * m_delta ) * direction;
95  cpv.position( ddname, mother, copy, tran, rotation );
96  LogDebug( "DDAlgorithm" ) << "DDLinear: " << m_childNmNs.second << ":" << m_childNmNs.first << " number "
97  << copy << " positioned in " << mother << " at "
98  << tran << " with " << rotation;
99  copy += m_incrCopyNo;
100  }
101 }
#define LogDebug(id)
int i
Definition: DBlmapReader.cc:9
int m_startCopyNo
Definition: DDLinear.h:29
double m_phi
Definition: DDLinear.h:32
int m_incrCopyNo
Definition: DDLinear.h:30
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:16
double m_delta
Definition: DDLinear.h:35
std::pair< std::string, std::string > m_childNmNs
Definition: DDLinear.h:38
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:31
Cos< T >::type cos(const T &t)
Definition: Cos.h:22
int m_n
Definition: DDLinear.h:28
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:36
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 34 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 SpecificationBuilder_cfi::parent().

39 {
40  m_n = int(nArgs["N"]);
41  m_startCopyNo = int(nArgs["StartCopyNo"]);
42  m_incrCopyNo = int(nArgs["IncrCopyNo"]);
43  m_theta = nArgs["Theta"];
44  m_phi = nArgs["Phi"];
45  // FIXME: m_offset = nArgs["Offset"];
46  m_delta = nArgs["Delta"];
47  m_base = vArgs["Base"];
48 
49  LogDebug( "DDAlgorithm" ) << "DDLinear: Parameters for position"
50  << "ing:: n " << m_n << " Direction Theta, Phi, Offset, Delta "
51  << m_theta/CLHEP::deg << " "
52  << m_phi/CLHEP::deg << " "
53  // FIXME: << m_offset/CLHEP::deg
54  << " " << m_delta/CLHEP::deg
55  << " Base " << m_base[0]
56  << ", " << m_base[1] << ", " << m_base[2];
57 
58  m_childNmNs = DDSplit( sArgs["ChildName"] );
59  if( m_childNmNs.second.empty())
61 
62  DDName parentName = parent().name();
63  LogDebug( "DDAlgorithm" ) << "DDLinear: Parent " << parentName
64  << "\tChild " << m_childNmNs.first << " NameSpace "
65  << m_childNmNs.second;
66 }
#define LogDebug(id)
int m_startCopyNo
Definition: DDLinear.h:29
double m_phi
Definition: DDLinear.h:32
int m_incrCopyNo
Definition: DDLinear.h:30
DDName is used to identify DDD entities uniquely.
Definition: DDName.h:16
double m_delta
Definition: DDLinear.h:35
static std::string & ns()
std::pair< std::string, std::string > m_childNmNs
Definition: DDLinear.h:38
double m_theta
Definition: DDLinear.h:31
int m_n
Definition: DDLinear.h:28
std::vector< double > m_base
Definition: DDLinear.h:36
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 36 of file DDLinear.h.

Referenced by execute(), and initialize().

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

Definition at line 38 of file DDLinear.h.

Referenced by execute(), and initialize().

double DDLinear::m_delta
private

Definition at line 35 of file DDLinear.h.

Referenced by execute(), and initialize().

int DDLinear::m_incrCopyNo
private

Definition at line 30 of file DDLinear.h.

Referenced by execute(), and initialize().

int DDLinear::m_n
private

Definition at line 28 of file DDLinear.h.

Referenced by execute(), and initialize().

double DDLinear::m_phi
private

Definition at line 32 of file DDLinear.h.

Referenced by execute(), and initialize().

int DDLinear::m_startCopyNo
private

Definition at line 29 of file DDLinear.h.

Referenced by execute(), and initialize().

double DDLinear::m_theta
private

Definition at line 31 of file DDLinear.h.

Referenced by execute(), and initialize().