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
DDTrackerAngular Class Reference

#include <DDTrackerAngular.h>

Inheritance diagram for DDTrackerAngular:

Public Member Functions

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

Private Attributes

std::vector< double > center
 
std::string childName
 
double delta
 
std::string idNameSpace
 
int incrCopyNo
 
int n
 
double radius
 
double rangeAngle
 
double startAngle
 
int startCopyNo
 

Detailed Description

Definition at line 10 of file DDTrackerAngular.h.

Constructor & Destructor Documentation

DDTrackerAngular::DDTrackerAngular ( )

Definition at line 18 of file DDTrackerAngular.cc.

References LogDebug.

18  {
19  LogDebug("TrackerGeom") << "DDTrackerAngular info: Creating an instance";
20 }
#define LogDebug(id)
DDTrackerAngular::~DDTrackerAngular ( )
virtual

Definition at line 22 of file DDTrackerAngular.cc.

22 {}

Member Function Documentation

void DDTrackerAngular::execute ( DDCompactView cpv)

Definition at line 64 of file DDTrackerAngular.cc.

References center, childName, filterCSVwithJSON::copy, funct::cos(), dbl_to_string(), DDrot(), DDSplit(), delta, first, i, idNameSpace, incrCopyNo, LogDebug, n, dbtoconf::parent, phi, DDCompactView::position(), radius, edm::second(), funct::sin(), startAngle, startCopyNo, and theta().

64  {
65 
66  DDName mother = parent().name();
68  double theta = 90.*CLHEP::deg;
69  int copy = startCopyNo;
70  double phi = startAngle;
71  for (int i=0; i<n; i++) {
72  double phix = phi;
73  double phiy = phix + 90.*CLHEP::deg;
74  double phideg = phix/CLHEP::deg;
75 
76  DDRotation rotation;
77  if (phideg != 0) {
78  std::string rotstr = DDSplit(childName).first+dbl_to_string(phideg*10.);
79  rotation = DDRotation(DDName(rotstr, idNameSpace));
80  if (!rotation) {
81  LogDebug("TrackerGeom") << "DDTrackerAngular test: Creating a new "
82  << "rotation: " << rotstr << "\t90., "
83  << phix/CLHEP::deg << ", 90.,"
84  << phiy/CLHEP::deg <<", 0, 0";
85  rotation = DDrot(DDName(rotstr, idNameSpace), theta, phix, theta, phiy,
86  0., 0.);
87  }
88  }
89 
90  double xpos = radius*cos(phi) + center[0];
91  double ypos = radius*sin(phi) + center[1];
92  double zpos = center[2];
93  DDTranslation tran(xpos, ypos, zpos);
94 
95  cpv.position(child, mother, copy, tran, rotation);
96  LogDebug("TrackerGeom") << "DDTrackerAngular test " << child << " number "
97  << copy << " positioned in " << mother << " at "
98  << tran << " with " << rotation;
99  copy += incrCopyNo;
100  phi += delta;
101  }
102 }
#define LogDebug(id)
int i
Definition: DBlmapReader.cc:9
list parent
Definition: dbtoconf.py:74
Sin< T >::type sin(const T &t)
Definition: Sin.h:22
std::vector< double > center
Geom::Theta< T > theta() const
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:18
std::string dbl_to_string(const double &in)
Converts only the integer part of a double to a string.
Definition: DDutils.cc:12
ROOT::Math::DisplacementVector3D< ROOT::Math::Cartesian3D< double > > DDTranslation
Definition: DDTranslation.h:7
Represents a uniquely identifyable rotation matrix.
Definition: DDTransform.h:66
U second(std::pair< T, U > const &p)
std::string childName
Cos< T >::type cos(const T &t)
Definition: Cos.h:22
bool first
Definition: L1TdeRCT.cc:79
DDRotation DDrot(const DDName &name, DDRotationMatrix *rot)
Definition of a uniquely identifiable rotation matrix named by DDName name.
Definition: DDRotation.cc:94
std::pair< std::string, std::string > DDSplit(const std::string &n)
split into (name,namespace), separator = &#39;:&#39;
Definition: DDSplit.cc:4
std::string idNameSpace
Definition: DDAxes.h:10
void DDTrackerAngular::initialize ( const DDNumericArguments nArgs,
const DDVectorArguments vArgs,
const DDMapArguments mArgs,
const DDStringArguments sArgs,
const DDStringVectorArguments vsArgs 
)

Definition at line 24 of file DDTrackerAngular.cc.

References center, childName, delta, idNameSpace, incrCopyNo, LogDebug, n, DDCurrentNamespace::ns(), dbtoconf::parent, radius, rangeAngle, startAngle, and startCopyNo.

28  {
29 
30  n = int(nArgs["N"]);
31  startCopyNo = int(nArgs["StartCopyNo"]);
32  incrCopyNo = int(nArgs["IncrCopyNo"]);
33  rangeAngle = nArgs["RangeAngle"];
34  startAngle = nArgs["StartAngle"];
35  radius = nArgs["Radius"];
36  center = vArgs["Center"];
37 
38  if (fabs(rangeAngle-360.0*CLHEP::deg)<0.001*CLHEP::deg) {
39  delta = rangeAngle/double(n);
40  } else {
41  if (n > 1) {
42  delta = rangeAngle/double(n-1);
43  } else {
44  delta = 0.;
45  }
46  }
47 
48  LogDebug("TrackerGeom") << "DDTrackerAngular debug: Parameters for position"
49  << "ing:: n " << n << " Start, Range, Delta "
50  << startAngle/CLHEP::deg << " "
51  << rangeAngle/CLHEP::deg << " " << delta/CLHEP::deg
52  << " Radius " << radius << " Centre " << center[0]
53  << ", " << center[1] << ", "<<center[2];
54 
56  childName = sArgs["ChildName"];
57 
58  DDName parentName = parent().name();
59  LogDebug("TrackerGeom") << "DDTrackerAngular debug: Parent " << parentName
60  << "\tChild " << childName << " NameSpace "
61  << idNameSpace;
62 }
#define LogDebug(id)
list parent
Definition: dbtoconf.py:74
std::vector< double > center
DDName is used to identify DDD entities uniquely.
Definition: DDName.h:18
static std::string & ns()
std::string childName
std::string idNameSpace

Member Data Documentation

std::vector<double> DDTrackerAngular::center
private

Definition at line 33 of file DDTrackerAngular.h.

Referenced by execute(), and initialize().

std::string DDTrackerAngular::childName
private

Definition at line 37 of file DDTrackerAngular.h.

Referenced by execute(), and initialize().

double DDTrackerAngular::delta
private

Definition at line 34 of file DDTrackerAngular.h.

Referenced by execute(), and initialize().

std::string DDTrackerAngular::idNameSpace
private

Definition at line 36 of file DDTrackerAngular.h.

Referenced by execute(), and initialize().

int DDTrackerAngular::incrCopyNo
private

Definition at line 29 of file DDTrackerAngular.h.

Referenced by execute(), and initialize().

int DDTrackerAngular::n
private

Definition at line 27 of file DDTrackerAngular.h.

Referenced by execute(), and initialize().

double DDTrackerAngular::radius
private

Definition at line 32 of file DDTrackerAngular.h.

Referenced by execute(), and initialize().

double DDTrackerAngular::rangeAngle
private

Definition at line 30 of file DDTrackerAngular.h.

Referenced by initialize().

double DDTrackerAngular::startAngle
private

Definition at line 31 of file DDTrackerAngular.h.

Referenced by execute(), and initialize().

int DDTrackerAngular::startCopyNo
private

Definition at line 28 of file DDTrackerAngular.h.

Referenced by execute(), and initialize().