CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
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)
 
void initialize (const DDNumericArguments &nArgs, const DDVectorArguments &vArgs, const DDMapArguments &mArgs, const DDStringArguments &sArgs, const DDStringVectorArguments &vsArgs)
 
virtual ~DDTECPhiAltAlgo ()
 

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 18 of file DDTECPhiAltAlgo.cc.

References LogDebug.

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

Definition at line 22 of file DDTECPhiAltAlgo.cc.

22 {}

Member Function Documentation

void DDTECPhiAltAlgo::execute ( DDCompactView cpv)

Definition at line 55 of file DDTECPhiAltAlgo.cc.

References childName, funct::cos(), dbl_to_string(), DDrot(), DDSplit(), first, i, idNameSpace, incrAngle, incrCopyNo, LogDebug, number, dbtoconf::parent, DDCompactView::position(), radius, edm::second(), funct::sin(), startAngle, startCopyNo, theta(), zIn, and zOut.

55  {
56 
57  if (number > 0) {
58  double theta = 90.*CLHEP::deg;
59  int copyNo = startCopyNo;
60 
61  DDName mother = parent().name();
63  for (int i=0; i<number; i++) {
64  double phiz = startAngle + i*incrAngle;
65  double phix = phiz + 90.*CLHEP::deg;
66  double phideg = phiz/CLHEP::deg;
67 
68  DDRotation rotation;
69  std::string rotstr = DDSplit(childName).first+dbl_to_string(phideg*10.);
70  rotation = DDRotation(DDName(rotstr, idNameSpace));
71  if (!rotation) {
72  LogDebug("TECGeom") << "DDTECPhiAltAlgo test: Creating a new "
73  << "rotation " << rotstr << "\t"
74  << theta/CLHEP::deg << ", " << phix/CLHEP::deg
75  << ", 0, 0, " << theta/CLHEP::deg << ", "
76  << phiz/CLHEP::deg;
77  rotation = DDrot(DDName(rotstr, idNameSpace), theta, phix, 0., 0.,
78  theta, phiz);
79  }
80 
81  double xpos = radius*cos(phiz);
82  double ypos = radius*sin(phiz);
83  double zpos;
84  if (i%2 == 0) zpos = zIn;
85  else zpos = zOut;
86  DDTranslation tran(xpos, ypos, zpos);
87 
88  cpv.position(child, mother, copyNo, tran, rotation);
89  LogDebug("TECGeom") << "DDTECPhiAltAlgo test: " << child <<" number "
90  << copyNo << " positioned in " << mother <<" at "
91  << tran << " with " << rotation;
92  copyNo += incrCopyNo;
93  }
94  }
95 }
#define LogDebug(id)
int i
Definition: DBlmapReader.cc:9
list parent
Definition: dbtoconf.py:74
Sin< T >::type sin(const T &t)
Definition: Sin.h:22
void position(const DDLogicalPart &self, const DDLogicalPart &parent, std::string copyno, const DDTranslation &trans, const DDRotation &rot, const DDDivision *div=NULL)
DDName is used to identify DDD entities uniquely.
Definition: DDName.h:18
Geom::Theta< T > theta() const
std::string dbl_to_string(const double &in)
Converts only the integer part of a double to a string.
Definition: DDutils.cc:12
std::string childName
ROOT::Math::DisplacementVector3D< ROOT::Math::Cartesian3D< double > > DDTranslation
Definition: DDTranslation.h:7
Represents a uniquely identifyable rotation matrix.
Definition: DDTransform.h:66
U second(std::pair< T, U > const &p)
Cos< T >::type cos(const T &t)
Definition: Cos.h:22
bool first
Definition: L1TdeRCT.cc:79
DDRotation DDrot(const DDName &name, DDRotationMatrix *rot)
Definition of a uniquely identifiable rotation matrix named by DDName name.
Definition: DDRotation.cc:94
std::pair< std::string, std::string > DDSplit(const std::string &n)
split into (name,namespace), separator = &#39;:&#39;
Definition: DDSplit.cc:4
std::string idNameSpace
void DDTECPhiAltAlgo::initialize ( const DDNumericArguments nArgs,
const DDVectorArguments vArgs,
const DDMapArguments mArgs,
const DDStringArguments sArgs,
const DDStringVectorArguments vsArgs 
)

Definition at line 24 of file DDTECPhiAltAlgo.cc.

References childName, idNameSpace, incrAngle, incrCopyNo, LogDebug, DDCurrentNamespace::ns(), number, dbtoconf::parent, radius, startAngle, startCopyNo, zIn, and zOut.

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