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

#include <DDTrackerAngularV1.h>

Inheritance diagram for DDTrackerAngularV1:

Public Member Functions

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

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 DDTrackerAngularV1.h.

Constructor & Destructor Documentation

DDTrackerAngularV1::DDTrackerAngularV1 ( )

Definition at line 18 of file DDTrackerAngularV1.cc.

References LogDebug.

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

Definition at line 22 of file DDTrackerAngularV1.cc.

22 {}

Member Function Documentation

void DDTrackerAngularV1::execute ( DDCompactView cpv)

Definition at line 64 of file DDTrackerAngularV1.cc.

References center, class-composition::child, childName, filterCSVwithJSON::copy, funct::cos(), dbl_to_string(), DDrot(), DDSplit(), delta, plotBeamSpotDB::first, i, idNameSpace, incrCopyNo, LogDebug, n, dbtoconf::parent, phi, DDCompactView::position(), radius, idealTransformation::rotation, edm::second(), funct::sin(), startAngle, startCopyNo, AlCaHLTBitMon_QueryRunRegistry::string, 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 + 90.*CLHEP::deg;
73  double phiy = phix + 90.*CLHEP::deg;
74  double phideg = phix/CLHEP::deg;
75 
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") << "DDTrackerAngularV1 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") << "DDTrackerAngularV1 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
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)
Cos< T >::type cos(const T &t)
Definition: Cos.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::pair< std::string, std::string > DDSplit(const std::string &n)
split into (name,namespace), separator = &#39;:&#39;
Definition: DDSplit.cc:4
std::vector< double > center
Definition: DDAxes.h:10
void DDTrackerAngularV1::initialize ( const DDNumericArguments nArgs,
const DDVectorArguments vArgs,
const DDMapArguments mArgs,
const DDStringArguments sArgs,
const DDStringVectorArguments vsArgs 
)

Definition at line 24 of file DDTrackerAngularV1.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") << "DDTrackerAngularV1 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") << "DDTrackerAngularV1 debug: Parent " << parentName
60  << "\tChild " << childName << " NameSpace "
61  << idNameSpace;
62 }
#define LogDebug(id)
list parent
Definition: dbtoconf.py:74
DDName is used to identify DDD entities uniquely.
Definition: DDName.h:18
static std::string & ns()
std::vector< double > center

Member Data Documentation

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

Definition at line 33 of file DDTrackerAngularV1.h.

Referenced by execute(), and initialize().

std::string DDTrackerAngularV1::childName
private

Definition at line 37 of file DDTrackerAngularV1.h.

Referenced by execute(), and initialize().

double DDTrackerAngularV1::delta
private

Definition at line 34 of file DDTrackerAngularV1.h.

Referenced by execute(), and initialize().

std::string DDTrackerAngularV1::idNameSpace
private

Definition at line 36 of file DDTrackerAngularV1.h.

Referenced by execute(), and initialize().

int DDTrackerAngularV1::incrCopyNo
private

Definition at line 29 of file DDTrackerAngularV1.h.

Referenced by execute(), and initialize().

int DDTrackerAngularV1::n
private

Definition at line 27 of file DDTrackerAngularV1.h.

Referenced by execute(), and initialize().

double DDTrackerAngularV1::radius
private

Definition at line 32 of file DDTrackerAngularV1.h.

Referenced by execute(), and initialize().

double DDTrackerAngularV1::rangeAngle
private

Definition at line 30 of file DDTrackerAngularV1.h.

Referenced by initialize().

double DDTrackerAngularV1::startAngle
private

Definition at line 31 of file DDTrackerAngularV1.h.

Referenced by execute(), and initialize().

int DDTrackerAngularV1::startCopyNo
private

Definition at line 28 of file DDTrackerAngularV1.h.

Referenced by execute(), and initialize().