CMS 3D CMS Logo

All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Modules Pages
List of all members | Public Member Functions | Private Attributes
DDTrackerPhiAltAlgo Class Reference
Inheritance diagram for DDTrackerPhiAltAlgo:

Public Member Functions

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

Private Attributes

string childName
 
string idNameSpace
 
int incrCopyNo
 
int number
 
double radiusIn
 
double radiusOut
 
double rangeAngle
 
double startAngle
 
int startCopyNo
 
double tilt
 
double zpos
 

Detailed Description

Definition at line 20 of file DDTrackerPhiAltAlgo.cc.

Constructor & Destructor Documentation

◆ DDTrackerPhiAltAlgo()

DDTrackerPhiAltAlgo::DDTrackerPhiAltAlgo ( )

Definition at line 49 of file DDTrackerPhiAltAlgo.cc.

49  {
50  LogDebug("TrackerGeom") << "DDTrackerPhiAltAlgo info: Creating an instance";
51 }

References LogDebug.

◆ ~DDTrackerPhiAltAlgo()

DDTrackerPhiAltAlgo::~DDTrackerPhiAltAlgo ( )
override

Definition at line 53 of file DDTrackerPhiAltAlgo.cc.

53 {}

Member Function Documentation

◆ execute()

void DDTrackerPhiAltAlgo::execute ( DDCompactView cpv)
override

Definition at line 84 of file DDTrackerPhiAltAlgo.cc.

84  {
85  if (number > 0) {
86  double theta = 90. * CLHEP::deg;
87  double dphi;
88  if (number == 1 || fabs(rangeAngle - 360.0 * CLHEP::deg) < 0.001 * CLHEP::deg)
89  dphi = rangeAngle / number;
90  else
91  dphi = rangeAngle / (number - 1);
92  int copyNo = startCopyNo;
93 
94  DDName mother = parent().name();
96  for (int i = 0; i < number; i++) {
97  double phi = startAngle + i * dphi;
98  double phix = phi - tilt + 90. * CLHEP::deg;
99  double phiy = phix + 90. * CLHEP::deg;
100  double phideg = phix / CLHEP::deg;
101 
103  if (phideg != 0) {
104  string rotstr = DDSplit(childName).first + to_string(phideg * 10.);
106  if (!rotation) {
107  LogDebug("TrackerGeom") << "DDTrackerPhiAltAlgo test: Creating a new"
108  << " rotation " << rotstr << "\t"
109  << "90., " << phix / CLHEP::deg << ", 90.," << phiy / CLHEP::deg << ", 0, 0";
110  rotation = DDrot(DDName(rotstr, idNameSpace), theta, phix, theta, phiy, 0., 0.);
111  }
112  }
113 
114  double xpos, ypos;
115  if (i % 2 == 0) {
116  xpos = radiusIn * cos(phi);
117  ypos = radiusIn * sin(phi);
118  } else {
119  xpos = radiusOut * cos(phi);
120  ypos = radiusOut * sin(phi);
121  }
122  DDTranslation tran(xpos, ypos, zpos);
123 
124  cpv.position(child, mother, copyNo, tran, rotation);
125  LogDebug("TrackerGeom") << "DDTrackerPhiAltAlgo test: " << child << " number " << copyNo << " positioned in "
126  << mother << " at " << tran << " with " << rotation;
127  copyNo += incrCopyNo;
128  }
129  }
130 }

References submitPVValidationJobs::child, funct::cos(), DDrot(), DDSplit(), first, mps_fire::i, LogDebug, contentValuesFiles::number, class-composition::parent, DDCompactView::position(), idealTransformation::rotation, edm::second(), funct::sin(), and theta().

◆ initialize()

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

Definition at line 55 of file DDTrackerPhiAltAlgo.cc.

59  {
60  tilt = nArgs["Tilt"];
61  startAngle = nArgs["StartAngle"];
62  rangeAngle = nArgs["RangeAngle"];
63  radiusIn = nArgs["RadiusIn"];
64  radiusOut = nArgs["RadiusOut"];
65  zpos = nArgs["ZPosition"];
66  number = int(nArgs["Number"]);
67  startCopyNo = int(nArgs["StartCopyNo"]);
68  incrCopyNo = int(nArgs["IncrCopyNo"]);
69 
70  LogDebug("TrackerGeom") << "DDTrackerPhiAltAlgo debug: Parameters for "
71  << "positioning--"
72  << " Tilt " << tilt << "\tStartAngle " << startAngle / CLHEP::deg << "\tRangeAngle "
73  << rangeAngle / CLHEP::deg << "\tRin " << radiusIn << "\tRout " << radiusOut << "\t ZPos "
74  << zpos << "\tCopy Numbers " << number << " Start/Increment " << startCopyNo << ", "
75  << incrCopyNo;
76 
78  childName = sArgs["ChildName"];
79  DDName parentName = parent().name();
80  LogDebug("TrackerGeom") << "DDTrackerPhiAltAlgo debug: Parent " << parentName << "\tChild " << childName
81  << " NameSpace " << idNameSpace;
82 }

References createfilelist::int, LogDebug, DDCurrentNamespace::ns(), contentValuesFiles::number, and class-composition::parent.

Member Data Documentation

◆ childName

string DDTrackerPhiAltAlgo::childName
private

Definition at line 46 of file DDTrackerPhiAltAlgo.cc.

◆ idNameSpace

string DDTrackerPhiAltAlgo::idNameSpace
private

Definition at line 45 of file DDTrackerPhiAltAlgo.cc.

◆ incrCopyNo

int DDTrackerPhiAltAlgo::incrCopyNo
private

Definition at line 43 of file DDTrackerPhiAltAlgo.cc.

◆ number

int DDTrackerPhiAltAlgo::number
private

Definition at line 41 of file DDTrackerPhiAltAlgo.cc.

◆ radiusIn

double DDTrackerPhiAltAlgo::radiusIn
private

Definition at line 38 of file DDTrackerPhiAltAlgo.cc.

◆ radiusOut

double DDTrackerPhiAltAlgo::radiusOut
private

Definition at line 39 of file DDTrackerPhiAltAlgo.cc.

◆ rangeAngle

double DDTrackerPhiAltAlgo::rangeAngle
private

Definition at line 37 of file DDTrackerPhiAltAlgo.cc.

◆ startAngle

double DDTrackerPhiAltAlgo::startAngle
private

Definition at line 36 of file DDTrackerPhiAltAlgo.cc.

◆ startCopyNo

int DDTrackerPhiAltAlgo::startCopyNo
private

Definition at line 42 of file DDTrackerPhiAltAlgo.cc.

◆ tilt

double DDTrackerPhiAltAlgo::tilt
private

Definition at line 35 of file DDTrackerPhiAltAlgo.cc.

◆ zpos

double DDTrackerPhiAltAlgo::zpos
private

Definition at line 40 of file DDTrackerPhiAltAlgo.cc.

DDTrackerPhiAltAlgo::rangeAngle
double rangeAngle
Definition: DDTrackerPhiAltAlgo.cc:37
mps_fire.i
i
Definition: mps_fire.py:428
DDTrackerPhiAltAlgo::incrCopyNo
int incrCopyNo
Definition: DDTrackerPhiAltAlgo.cc:43
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
DDTrackerPhiAltAlgo::zpos
double zpos
Definition: DDTrackerPhiAltAlgo.cc:40
DDTrackerPhiAltAlgo::number
int number
Definition: DDTrackerPhiAltAlgo.cc:41
DDName
DDName is used to identify DDD entities uniquely.
Definition: DDName.h:15
edm::second
U second(std::pair< T, U > const &p)
Definition: ParameterSet.cc:222
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
DDTrackerPhiAltAlgo::radiusIn
double radiusIn
Definition: DDTrackerPhiAltAlgo.cc:38
DDTranslation
ROOT::Math::DisplacementVector3D< ROOT::Math::Cartesian3D< double > > DDTranslation
Definition: DDTranslation.h:7
theta
Geom::Theta< T > theta() const
Definition: Basic3DVectorLD.h:150
first
auto first
Definition: CAHitNtupletGeneratorKernelsImpl.h:112
LogDebug
#define LogDebug(id)
Definition: MessageLogger.h:233
idealTransformation.rotation
dictionary rotation
Definition: idealTransformation.py:1
DDTrackerPhiAltAlgo::childName
string childName
Definition: DDTrackerPhiAltAlgo.cc:46
createfilelist.int
int
Definition: createfilelist.py:10
DDTrackerPhiAltAlgo::startAngle
double startAngle
Definition: DDTrackerPhiAltAlgo.cc:36
DDTrackerPhiAltAlgo::tilt
double tilt
Definition: DDTrackerPhiAltAlgo.cc:35
DDTrackerPhiAltAlgo::startCopyNo
int startCopyNo
Definition: DDTrackerPhiAltAlgo.cc:42
DDAxes::phi
submitPVValidationJobs.child
child
Definition: submitPVValidationJobs.py:119
DDCurrentNamespace::ns
static std::string & ns()
Definition: DDCurrentNamespace.cc:3
DDTrackerPhiAltAlgo::idNameSpace
string idNameSpace
Definition: DDTrackerPhiAltAlgo.cc:45
DDRotation
Represents a uniquely identifyable rotation matrix.
Definition: DDTransform.h:57
child
Definition: simpleInheritance.h:11
class-composition.parent
parent
Definition: class-composition.py:88
DDTrackerPhiAltAlgo::radiusOut
double radiusOut
Definition: DDTrackerPhiAltAlgo.cc:39
DDSplit
std::pair< std::string, std::string > DDSplit(const std::string &n)
split into (name,namespace), separator = ':'
Definition: DDSplit.cc:3
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:76
DDRotation
ROOT::Math::Rotation3D DDRotation
Definition: DDEcalEndcapAlgo.cc:16