CMS 3D CMS Logo

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.

References LogDebug.

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

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

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

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

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

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

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.