CMS 3D CMS Logo

List of all members | Public Member Functions | Private Attributes
DDTrackerAngular Class Reference
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

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

Detailed Description

Definition at line 20 of file DDTrackerAngular.cc.

Constructor & Destructor Documentation

◆ DDTrackerAngular()

DDTrackerAngular::DDTrackerAngular ( )

Definition at line 48 of file DDTrackerAngular.cc.

48 { LogDebug("TrackerGeom") << "DDTrackerAngular info: Creating an instance"; }

References LogDebug.

◆ ~DDTrackerAngular()

DDTrackerAngular::~DDTrackerAngular ( )
override

Definition at line 50 of file DDTrackerAngular.cc.

50 {}

Member Function Documentation

◆ execute()

void DDTrackerAngular::execute ( DDCompactView cpv)
override

Definition at line 88 of file DDTrackerAngular.cc.

88  {
89  DDName mother = parent().name();
91  double theta = 90. * CLHEP::deg;
92  int copy = startCopyNo;
93  double phi = startAngle;
94  for (int i = 0; i < n; i++) {
95  double phix = phi;
96  double phiy = phix + 90. * CLHEP::deg;
97  double phideg = phix / CLHEP::deg;
98 
100  if (phideg != 0) {
101  string rotstr = DDSplit(childName).first + to_string(phideg * 10.);
103  if (!rotation) {
104  LogDebug("TrackerGeom") << "DDTrackerAngular test: Creating a new "
105  << "rotation: " << rotstr << "\t90., " << phix / CLHEP::deg << ", 90.,"
106  << phiy / CLHEP::deg << ", 0, 0";
107  rotation = DDrot(DDName(rotstr, idNameSpace), theta, phix, theta, phiy, 0., 0.);
108  }
109  }
110 
111  double xpos = radius * cos(phi) + center[0];
112  double ypos = radius * sin(phi) + center[1];
113  double zpos = center[2];
114  DDTranslation tran(xpos, ypos, zpos);
115 
116  cpv.position(child, mother, copy, tran, rotation);
117  LogDebug("TrackerGeom") << "DDTrackerAngular test " << child << " number " << copy << " positioned in " << mother
118  << " at " << tran << " with " << rotation;
119  copy += incrCopyNo;
120  phi += delta;
121  }
122 }

References class-composition::child, filterCSVwithJSON::copy, funct::cos(), DDrot(), DDSplit(), dumpMFGeometry_cfg::delta, dqmdumpme::first, mps_fire::i, LogDebug, dqmiodumpmetadata::n, class-composition::parent, DDCompactView::position(), CosmicsPD_Skims::radius, idealTransformation::rotation, edm::second(), funct::sin(), and theta().

◆ initialize()

void DDTrackerAngular::initialize ( const DDNumericArguments nArgs,
const DDVectorArguments vArgs,
const DDMapArguments mArgs,
const DDStringArguments sArgs,
const DDStringVectorArguments vsArgs 
)
override

Definition at line 52 of file DDTrackerAngular.cc.

56  {
57  n = int(nArgs["N"]);
58  startCopyNo = int(nArgs["StartCopyNo"]);
59  incrCopyNo = int(nArgs["IncrCopyNo"]);
60  rangeAngle = nArgs["RangeAngle"];
61  startAngle = nArgs["StartAngle"];
62  radius = nArgs["Radius"];
63  center = vArgs["Center"];
64 
65  if (fabs(rangeAngle - 360.0 * CLHEP::deg) < 0.001 * CLHEP::deg) {
66  delta = rangeAngle / double(n);
67  } else {
68  if (n > 1) {
69  delta = rangeAngle / double(n - 1);
70  } else {
71  delta = 0.;
72  }
73  }
74 
75  LogDebug("TrackerGeom") << "DDTrackerAngular debug: Parameters for position"
76  << "ing:: n " << n << " Start, Range, Delta " << startAngle / CLHEP::deg << " "
77  << rangeAngle / CLHEP::deg << " " << delta / CLHEP::deg << " Radius " << radius << " Centre "
78  << center[0] << ", " << center[1] << ", " << center[2];
79 
81  childName = sArgs["ChildName"];
82 
83  DDName parentName = parent().name();
84  LogDebug("TrackerGeom") << "DDTrackerAngular debug: Parent " << parentName << "\tChild " << childName << " NameSpace "
85  << idNameSpace;
86 }

References dumpMFGeometry_cfg::delta, createfilelist::int, LogDebug, dqmiodumpmetadata::n, DDCurrentNamespace::ns(), class-composition::parent, and CosmicsPD_Skims::radius.

Member Data Documentation

◆ center

vector<double> DDTrackerAngular::center
private

Definition at line 41 of file DDTrackerAngular.cc.

◆ childName

string DDTrackerAngular::childName
private

Definition at line 45 of file DDTrackerAngular.cc.

◆ delta

double DDTrackerAngular::delta
private

Definition at line 42 of file DDTrackerAngular.cc.

◆ idNameSpace

string DDTrackerAngular::idNameSpace
private

Definition at line 44 of file DDTrackerAngular.cc.

◆ incrCopyNo

int DDTrackerAngular::incrCopyNo
private

Definition at line 37 of file DDTrackerAngular.cc.

◆ n

int DDTrackerAngular::n
private

Definition at line 35 of file DDTrackerAngular.cc.

◆ radius

double DDTrackerAngular::radius
private

Definition at line 40 of file DDTrackerAngular.cc.

◆ rangeAngle

double DDTrackerAngular::rangeAngle
private

Definition at line 38 of file DDTrackerAngular.cc.

◆ startAngle

double DDTrackerAngular::startAngle
private

Definition at line 39 of file DDTrackerAngular.cc.

◆ startCopyNo

int DDTrackerAngular::startCopyNo
private

Definition at line 36 of file DDTrackerAngular.cc.

mps_fire.i
i
Definition: mps_fire.py:355
DDrot
DDRotation DDrot(const DDName &name, std::unique_ptr< DDRotationMatrix > rot)
Definition of a uniquely identifiable rotation matrix named by DDName name.
Definition: DDRotation.cc:67
filterCSVwithJSON.copy
copy
Definition: filterCSVwithJSON.py:36
DDName
DDName is used to identify DDD entities uniquely.
Definition: DDName.h:15
DDTrackerAngular::incrCopyNo
int incrCopyNo
Definition: DDTrackerAngular.cc:37
edm::second
U second(std::pair< T, U > const &p)
Definition: ParameterSet.cc:215
DDTrackerAngular::n
int n
Definition: DDTrackerAngular.cc:35
DDTrackerAngular::idNameSpace
string idNameSpace
Definition: DDTrackerAngular.cc:44
dqmdumpme.first
first
Definition: dqmdumpme.py:55
funct::sin
Sin< T >::type sin(const T &t)
Definition: Sin.h:22
funct::cos
Cos< T >::type cos(const T &t)
Definition: Cos.h:22
DDTranslation
ROOT::Math::DisplacementVector3D< ROOT::Math::Cartesian3D< double > > DDTranslation
Definition: DDTranslation.h:7
theta
Geom::Theta< T > theta() const
Definition: Basic3DVectorLD.h:150
DDTrackerAngular::center
vector< double > center
Definition: DDTrackerAngular.cc:41
LogDebug
#define LogDebug(id)
Definition: MessageLogger.h:670
idealTransformation.rotation
dictionary rotation
Definition: idealTransformation.py:1
createfilelist.int
int
Definition: createfilelist.py:10
DDTrackerAngular::radius
double radius
Definition: DDTrackerAngular.cc:40
DDAxes::phi
DDCurrentNamespace::ns
static std::string & ns()
Definition: DDCurrentNamespace.cc:3
DDTrackerAngular::delta
double delta
Definition: DDTrackerAngular.cc:42
DDRotation
Represents a uniquely identifyable rotation matrix.
Definition: DDTransform.h:57
DDTrackerAngular::startAngle
double startAngle
Definition: DDTrackerAngular.cc:39
class-composition.child
child
Definition: class-composition.py:91
DDTrackerAngular::childName
string childName
Definition: DDTrackerAngular.cc:45
child
Definition: simpleInheritance.h:11
class-composition.parent
parent
Definition: class-composition.py:88
DDTrackerAngular::startCopyNo
int startCopyNo
Definition: DDTrackerAngular.cc:36
DDSplit
std::pair< std::string, std::string > DDSplit(const std::string &n)
split into (name,namespace), separator = ':'
Definition: DDSplit.cc:3
DDTrackerAngular::rangeAngle
double rangeAngle
Definition: DDTrackerAngular.cc:38
DDCompactView::position
void position(const DDLogicalPart &self, const DDLogicalPart &parent, const std::string &copyno, const DDTranslation &trans, const DDRotation &rot, const DDDivision *div=nullptr)
Definition: DDCompactView.cc:66
DDRotation
ROOT::Math::Rotation3D DDRotation
Definition: DDEcalEndcapAlgo.cc:18