CMS 3D CMS Logo

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) override
 
void initialize (const DDNumericArguments &nArgs, const DDVectorArguments &vArgs, const DDMapArguments &mArgs, const DDStringArguments &sArgs, const DDStringVectorArguments &vsArgs) override
 
 ~DDTrackerAngularV1 () override
 

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 17 of file DDTrackerAngularV1.cc.

References LogDebug.

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

Definition at line 21 of file DDTrackerAngularV1.cc.

21 {}

Member Function Documentation

void DDTrackerAngularV1::execute ( DDCompactView cpv)
override

Definition at line 63 of file DDTrackerAngularV1.cc.

References center, class-composition::child, childName, popcon2dropbox::copy(), funct::cos(), DDrot(), DDSplit(), delta, plotBeamSpotDB::first, mps_fire::i, idNameSpace, incrCopyNo, LogDebug, n, class-composition::parent, phi, DDCompactView::position(), radius, idealTransformation::rotation, edm::second(), funct::sin(), startAngle, startCopyNo, AlCaHLTBitMon_QueryRunRegistry::string, and theta().

63  {
64 
65  DDName mother = parent().name();
67  double theta = 90.*CLHEP::deg;
68  int copy = startCopyNo;
69  double phi = startAngle;
70  for (int i=0; i<n; i++) {
71  double phix = phi + 90.*CLHEP::deg;
72  double phiy = phix + 90.*CLHEP::deg;
73  double phideg = phix/CLHEP::deg;
74 
76  if (phideg != 0) {
77  std::string rotstr = DDSplit(childName).first + std::to_string(phideg*10.);
78  rotation = DDRotation(DDName(rotstr, idNameSpace));
79  if (!rotation) {
80  LogDebug("TrackerGeom") << "DDTrackerAngularV1 test: Creating a new "
81  << "rotation: " << rotstr << "\t90., "
82  << phix/CLHEP::deg << ", 90.,"
83  << phiy/CLHEP::deg <<", 0, 0";
84  rotation = DDrot(DDName(rotstr, idNameSpace), theta, phix, theta, phiy,
85  0., 0.);
86  }
87  }
88 
89  double xpos = radius*cos(phi) + center[0];
90  double ypos = radius*sin(phi) + center[1];
91  double zpos = center[2];
92  DDTranslation tran(xpos, ypos, zpos);
93 
94  cpv.position(child, mother, copy, tran, rotation);
95  LogDebug("TrackerGeom") << "DDTrackerAngularV1 test " << child << " number "
96  << copy << " positioned in " << mother << " at "
97  << tran << " with " << rotation;
98  copy += incrCopyNo;
99  phi += delta;
100  }
101 }
#define LogDebug(id)
def copy(args, dbName)
Sin< T >::type sin(const T &t)
Definition: Sin.h:22
Geom::Theta< T > theta() const
DDName is used to identify DDD entities uniquely.
Definition: DDName.h:15
ROOT::Math::DisplacementVector3D< ROOT::Math::Cartesian3D< double > > DDTranslation
Definition: DDTranslation.h:7
Represents a uniquely identifyable rotation matrix.
Definition: DDTransform.h:68
U second(std::pair< T, U > const &p)
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
void position(const DDLogicalPart &self, const DDLogicalPart &parent, const std::string &copyno, const DDTranslation &trans, const DDRotation &rot, const DDDivision *div=0)
std::pair< std::string, std::string > DDSplit(const std::string &n)
split into (name,namespace), separator = &#39;:&#39;
Definition: DDSplit.cc:3
std::vector< double > center
void DDTrackerAngularV1::initialize ( const DDNumericArguments nArgs,
const DDVectorArguments vArgs,
const DDMapArguments mArgs,
const DDStringArguments sArgs,
const DDStringVectorArguments vsArgs 
)
override

Definition at line 23 of file DDTrackerAngularV1.cc.

References center, childName, delta, idNameSpace, incrCopyNo, createfilelist::int, LogDebug, n, DDCurrentNamespace::ns(), class-composition::parent, radius, rangeAngle, startAngle, and startCopyNo.

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