CMS 3D CMS Logo

List of all members | Public Member Functions | Private Attributes
DDTrackerPhiAltAlgo Class Reference

#include <DDTrackerPhiAltAlgo.h>

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

std::string childName
 
std::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 10 of file DDTrackerPhiAltAlgo.h.

Constructor & Destructor Documentation

DDTrackerPhiAltAlgo::DDTrackerPhiAltAlgo ( )

Definition at line 17 of file DDTrackerPhiAltAlgo.cc.

References LogDebug.

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

Definition at line 21 of file DDTrackerPhiAltAlgo.cc.

21 {}

Member Function Documentation

void DDTrackerPhiAltAlgo::execute ( DDCompactView cpv)
override

Definition at line 56 of file DDTrackerPhiAltAlgo.cc.

References class-composition::child, childName, funct::cos(), DDrot(), DDSplit(), plotBeamSpotDB::first, mps_fire::i, idNameSpace, incrCopyNo, LogDebug, number, class-composition::parent, phi, DDCompactView::position(), radiusIn, radiusOut, rangeAngle, idealTransformation::rotation, edm::second(), funct::sin(), startAngle, startCopyNo, AlCaHLTBitMon_QueryRunRegistry::string, theta(), tilt, and zpos.

56  {
57 
58  if (number > 0) {
59  double theta = 90.*CLHEP::deg;
60  double dphi;
61  if (number == 1 || fabs(rangeAngle-360.0*CLHEP::deg)<0.001*CLHEP::deg)
62  dphi = rangeAngle/number;
63  else
64  dphi = rangeAngle/(number-1);
65  int copyNo = startCopyNo;
66 
67  DDName mother = parent().name();
69  for (int i=0; i<number; i++) {
70  double phi = startAngle + i*dphi;
71  double phix = phi - tilt + 90.*CLHEP::deg;
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") << "DDTrackerPhiAltAlgo test: Creating a new"
81  << " rotation " << rotstr << "\t" << "90., "
82  << phix/CLHEP::deg << ", 90.,"
83  << phiy/CLHEP::deg << ", 0, 0";
84  rotation = DDrot(DDName(rotstr, idNameSpace), theta, phix, theta,
85  phiy, 0., 0.);
86  }
87  }
88 
89  double xpos, ypos;
90  if (i%2 == 0) {
91  xpos = radiusIn*cos(phi);
92  ypos = radiusIn*sin(phi);
93  } else {
94  xpos = radiusOut*cos(phi);
95  ypos = radiusOut*sin(phi);
96  }
97  DDTranslation tran(xpos, ypos, zpos);
98 
99  cpv.position(child, mother, copyNo, tran, rotation);
100  LogDebug("TrackerGeom") << "DDTrackerPhiAltAlgo test: " << child
101  << " number " << copyNo << " positioned in "
102  << mother << " at " << tran << " with "
103  << rotation;
104  copyNo += incrCopyNo;
105  }
106  }
107 }
#define LogDebug(id)
Sin< T >::type sin(const T &t)
Definition: Sin.h:22
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:67
U second(std::pair< T, U > const &p)
Cos< T >::type cos(const T &t)
Definition: Cos.h:22
DDRotation DDrot(const DDName &name, DDRotationMatrix *rot)
Definition of a uniquely identifiable rotation matrix named by DDName name.
Definition: DDRotation.cc:90
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
void DDTrackerPhiAltAlgo::initialize ( const DDNumericArguments nArgs,
const DDVectorArguments vArgs,
const DDMapArguments mArgs,
const DDStringArguments sArgs,
const DDStringVectorArguments vsArgs 
)
override

Definition at line 23 of file DDTrackerPhiAltAlgo.cc.

References childName, idNameSpace, incrCopyNo, createfilelist::int, LogDebug, DDCurrentNamespace::ns(), number, class-composition::parent, radiusIn, radiusOut, rangeAngle, startAngle, startCopyNo, tilt, and zpos.

27  {
28 
29  tilt = nArgs["Tilt"];
30  startAngle = nArgs["StartAngle"];
31  rangeAngle = nArgs["RangeAngle"];
32  radiusIn = nArgs["RadiusIn"];
33  radiusOut = nArgs["RadiusOut"];
34  zpos = nArgs["ZPosition"];
35  number = int (nArgs["Number"]);
36  startCopyNo= int (nArgs["StartCopyNo"]);
37  incrCopyNo = int (nArgs["IncrCopyNo"]);
38 
39  LogDebug("TrackerGeom") << "DDTrackerPhiAltAlgo debug: Parameters for "
40  << "positioning--" << " Tilt " << tilt
41  << "\tStartAngle " << startAngle/CLHEP::deg
42  << "\tRangeAngle " << rangeAngle/CLHEP::deg
43  << "\tRin " << radiusIn << "\tRout " << radiusOut
44  << "\t ZPos " << zpos << "\tCopy Numbers " << number
45  << " Start/Increment " << startCopyNo << ", "
46  << incrCopyNo;
47 
49  childName = sArgs["ChildName"];
50  DDName parentName = parent().name();
51  LogDebug("TrackerGeom") << "DDTrackerPhiAltAlgo debug: Parent " << parentName
52  << "\tChild " << childName << " NameSpace "
53  << idNameSpace;
54 }
#define LogDebug(id)
DDName is used to identify DDD entities uniquely.
Definition: DDName.h:15
static std::string & ns()

Member Data Documentation

std::string DDTrackerPhiAltAlgo::childName
private

Definition at line 38 of file DDTrackerPhiAltAlgo.h.

Referenced by execute(), and initialize().

std::string DDTrackerPhiAltAlgo::idNameSpace
private

Definition at line 37 of file DDTrackerPhiAltAlgo.h.

Referenced by execute(), and initialize().

int DDTrackerPhiAltAlgo::incrCopyNo
private

Definition at line 35 of file DDTrackerPhiAltAlgo.h.

Referenced by execute(), and initialize().

int DDTrackerPhiAltAlgo::number
private

Definition at line 33 of file DDTrackerPhiAltAlgo.h.

Referenced by execute(), and initialize().

double DDTrackerPhiAltAlgo::radiusIn
private

Definition at line 30 of file DDTrackerPhiAltAlgo.h.

Referenced by execute(), and initialize().

double DDTrackerPhiAltAlgo::radiusOut
private

Definition at line 31 of file DDTrackerPhiAltAlgo.h.

Referenced by execute(), and initialize().

double DDTrackerPhiAltAlgo::rangeAngle
private

Definition at line 29 of file DDTrackerPhiAltAlgo.h.

Referenced by execute(), and initialize().

double DDTrackerPhiAltAlgo::startAngle
private

Definition at line 28 of file DDTrackerPhiAltAlgo.h.

Referenced by execute(), and initialize().

int DDTrackerPhiAltAlgo::startCopyNo
private

Definition at line 34 of file DDTrackerPhiAltAlgo.h.

Referenced by execute(), and initialize().

double DDTrackerPhiAltAlgo::tilt
private

Definition at line 27 of file DDTrackerPhiAltAlgo.h.

Referenced by execute(), and initialize().

double DDTrackerPhiAltAlgo::zpos
private

Definition at line 32 of file DDTrackerPhiAltAlgo.h.

Referenced by execute(), and initialize().