CMS 3D CMS Logo

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

Constructor & Destructor Documentation

DDTrackerAngular::DDTrackerAngular ( )

Definition at line 17 of file DDTrackerAngular.cc.

References LogDebug.

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

Definition at line 21 of file DDTrackerAngular.cc.

21 {}

Member Function Documentation

void DDTrackerAngular::execute ( DDCompactView cpv)
override

Definition at line 63 of file DDTrackerAngular.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;
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") << "DDTrackerAngular 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") << "DDTrackerAngular 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
std::vector< double > center
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)
std::string childName
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::string idNameSpace
void DDTrackerAngular::initialize ( const DDNumericArguments nArgs,
const DDVectorArguments vArgs,
const DDMapArguments mArgs,
const DDStringArguments sArgs,
const DDStringVectorArguments vsArgs 
)
override

Definition at line 23 of file DDTrackerAngular.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") << "DDTrackerAngular 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") << "DDTrackerAngular debug: Parent " << parentName
59  << "\tChild " << childName << " NameSpace "
60  << idNameSpace;
61 }
#define LogDebug(id)
std::vector< double > center
DDName is used to identify DDD entities uniquely.
Definition: DDName.h:15
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().