CMS 3D CMS Logo

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

#include <DDTECPhiAltAlgo.h>

Inheritance diagram for DDTECPhiAltAlgo:

Public Member Functions

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

Private Attributes

std::string childName
 
std::string idNameSpace
 
double incrAngle
 
int incrCopyNo
 
int number
 
double radius
 
double startAngle
 
int startCopyNo
 
double zIn
 
double zOut
 

Detailed Description

Definition at line 10 of file DDTECPhiAltAlgo.h.

Constructor & Destructor Documentation

DDTECPhiAltAlgo::DDTECPhiAltAlgo ( )

Definition at line 17 of file DDTECPhiAltAlgo.cc.

References LogDebug.

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

Definition at line 21 of file DDTECPhiAltAlgo.cc.

21 {}

Member Function Documentation

void DDTECPhiAltAlgo::execute ( DDCompactView cpv)
override

Definition at line 54 of file DDTECPhiAltAlgo.cc.

References class-composition::child, childName, funct::cos(), DDrot(), DDSplit(), plotBeamSpotDB::first, mps_fire::i, idNameSpace, incrAngle, incrCopyNo, LogDebug, number, class-composition::parent, DDCompactView::position(), radius, idealTransformation::rotation, edm::second(), funct::sin(), startAngle, startCopyNo, AlCaHLTBitMon_QueryRunRegistry::string, theta(), zIn, and zOut.

54  {
55 
56  if (number > 0) {
57  double theta = 90.*CLHEP::deg;
58  int copyNo = startCopyNo;
59 
60  DDName mother = parent().name();
62  for (int i=0; i<number; i++) {
63  double phiz = startAngle + i*incrAngle;
64  double phix = phiz + 90.*CLHEP::deg;
65  double phideg = phiz/CLHEP::deg;
66 
68  std::string rotstr = DDSplit(childName).first + std::to_string(phideg*10.);
69  rotation = DDRotation(DDName(rotstr, idNameSpace));
70  if (!rotation) {
71  LogDebug("TECGeom") << "DDTECPhiAltAlgo test: Creating a new "
72  << "rotation " << rotstr << "\t"
73  << theta/CLHEP::deg << ", " << phix/CLHEP::deg
74  << ", 0, 0, " << theta/CLHEP::deg << ", "
75  << phiz/CLHEP::deg;
76  rotation = DDrot(DDName(rotstr, idNameSpace), theta, phix, 0., 0.,
77  theta, phiz);
78  }
79 
80  double xpos = radius*cos(phiz);
81  double ypos = radius*sin(phiz);
82  double zpos;
83  if (i%2 == 0) zpos = zIn;
84  else zpos = zOut;
85  DDTranslation tran(xpos, ypos, zpos);
86 
87  cpv.position(child, mother, copyNo, tran, rotation);
88  LogDebug("TECGeom") << "DDTECPhiAltAlgo test: " << child <<" number "
89  << copyNo << " positioned in " << mother <<" at "
90  << tran << " with " << rotation;
91  copyNo += incrCopyNo;
92  }
93  }
94 }
#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
std::string childName
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
std::string idNameSpace
void DDTECPhiAltAlgo::initialize ( const DDNumericArguments nArgs,
const DDVectorArguments vArgs,
const DDMapArguments mArgs,
const DDStringArguments sArgs,
const DDStringVectorArguments vsArgs 
)
override

Definition at line 23 of file DDTECPhiAltAlgo.cc.

References childName, idNameSpace, incrAngle, incrCopyNo, createfilelist::int, LogDebug, DDCurrentNamespace::ns(), number, class-composition::parent, radius, startAngle, startCopyNo, zIn, and zOut.

27  {
28 
29  startAngle = nArgs["StartAngle"];
30  incrAngle = nArgs["IncrAngle"];
31  radius = nArgs["Radius"];
32  zIn = nArgs["ZIn"];
33  zOut = nArgs["ZOut"];
34  number = int (nArgs["Number"]);
35  startCopyNo= int (nArgs["StartCopyNo"]);
36  incrCopyNo = int (nArgs["IncrCopyNo"]);
37 
38  LogDebug("TECGeom") << "DDTECPhiAltAlgo debug: Parameters for "
39  << "positioning--" << "\tStartAngle "
40  << startAngle/CLHEP::deg << "\tIncrAngle "
41  << incrAngle/CLHEP::deg << "\tRadius " << radius
42  << "\tZ in/out " << zIn << ", " << zOut
43  << "\tCopy Numbers " << number << " Start/Increment "
44  << startCopyNo << ", " << incrCopyNo;
45 
47  childName = sArgs["ChildName"];
48  DDName parentName = parent().name();
49  LogDebug("TECGeom") << "DDTECPhiAltAlgo debug: Parent " << parentName
50  << "\tChild " << childName << " NameSpace "
51  << idNameSpace;
52 }
#define LogDebug(id)
DDName is used to identify DDD entities uniquely.
Definition: DDName.h:15
static std::string & ns()
std::string childName
std::string idNameSpace

Member Data Documentation

std::string DDTECPhiAltAlgo::childName
private

Definition at line 37 of file DDTECPhiAltAlgo.h.

Referenced by execute(), and initialize().

std::string DDTECPhiAltAlgo::idNameSpace
private

Definition at line 36 of file DDTECPhiAltAlgo.h.

Referenced by execute(), and initialize().

double DDTECPhiAltAlgo::incrAngle
private

Definition at line 28 of file DDTECPhiAltAlgo.h.

Referenced by execute(), and initialize().

int DDTECPhiAltAlgo::incrCopyNo
private

Definition at line 34 of file DDTECPhiAltAlgo.h.

Referenced by execute(), and initialize().

int DDTECPhiAltAlgo::number
private

Definition at line 32 of file DDTECPhiAltAlgo.h.

Referenced by execute(), and initialize().

double DDTECPhiAltAlgo::radius
private

Definition at line 29 of file DDTECPhiAltAlgo.h.

Referenced by execute(), and initialize().

double DDTECPhiAltAlgo::startAngle
private

Definition at line 27 of file DDTECPhiAltAlgo.h.

Referenced by execute(), and initialize().

int DDTECPhiAltAlgo::startCopyNo
private

Definition at line 33 of file DDTECPhiAltAlgo.h.

Referenced by execute(), and initialize().

double DDTECPhiAltAlgo::zIn
private

Definition at line 30 of file DDTECPhiAltAlgo.h.

Referenced by execute(), and initialize().

double DDTECPhiAltAlgo::zOut
private

Definition at line 31 of file DDTECPhiAltAlgo.h.

Referenced by execute(), and initialize().