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.

References LogDebug.

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

◆ ~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.

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

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 }
void position(const DDLogicalPart &self, const DDLogicalPart &parent, const std::string &copyno, const DDTranslation &trans, const DDRotation &rot, const DDDivision *div=nullptr)
Sin< T >::type sin(const T &t)
Definition: Sin.h:22
DDName is used to identify DDD entities uniquely.
Definition: DDName.h:17
std::string to_string(const V &value)
Definition: OMSAccess.h:71
Represents a uniquely identifyable rotation matrix.
Definition: DDTransform.h:57
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:67
vector< double > center
std::pair< std::string, std::string > DDSplit(const std::string &n)
split into (name,namespace), separator = &#39;:&#39;
Definition: DDSplit.cc:3
Geom::Theta< T > theta() const
ROOT::Math::DisplacementVector3D< ROOT::Math::Cartesian3D< double > > DDTranslation
Definition: DDTranslation.h:7
#define LogDebug(id)

◆ 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.

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

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 }
DDName is used to identify DDD entities uniquely.
Definition: DDName.h:17
static std::string & ns()
vector< double > center
#define LogDebug(id)

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.