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
DDTECPhiAlgo Class Reference

#include <DDTECPhiAlgo.h>

Inheritance diagram for DDTECPhiAlgo:

Public Member Functions

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

Private Attributes

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

Detailed Description

Definition at line 10 of file DDTECPhiAlgo.h.

Constructor & Destructor Documentation

DDTECPhiAlgo::DDTECPhiAlgo ( )

Definition at line 18 of file DDTECPhiAlgo.cc.

References LogDebug.

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

Definition at line 22 of file DDTECPhiAlgo.cc.

22 {}

Member Function Documentation

void DDTECPhiAlgo::execute ( DDCompactView cpv)

Definition at line 54 of file DDTECPhiAlgo.cc.

References class-composition::child, childName, dbl_to_string(), DDrot(), DDSplit(), plotBeamSpotDB::first, i, idNameSpace, incrAngle, incrCopyNo, LogDebug, number, dbtoconf::parent, DDCompactView::position(), idealTransformation::rotation, edm::second(), 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 phix = startAngle + i*incrAngle;
64  double phiy = phix + 90.*CLHEP::deg;
65  double phideg = phix/CLHEP::deg;
66 
68  std::string rotstr = DDSplit(childName).first+dbl_to_string(phideg*10.);
69  rotation = DDRotation(DDName(rotstr, idNameSpace));
70  if (!rotation) {
71  LogDebug("TECGeom") << "DDTECPhiAlgo test: Creating a new "
72  << "rotation " << rotstr << "\t"
73  << theta/CLHEP::deg << ", " << phix/CLHEP::deg
74  << ", " << theta/CLHEP::deg << ", "
75  << phiy/CLHEP::deg << ", 0, 0";
76  rotation = DDrot(DDName(rotstr, idNameSpace), theta, phix, theta, phiy,
77  0., 0.);
78  }
79 
80  double zpos = zOut;
81  if (i%2 == 0) zpos = zIn;
82  DDTranslation tran(0., 0., zpos);
83 
84  cpv.position(child, mother, copyNo, tran, rotation);
85  LogDebug("TECGeom") << "DDTECPhiAlgo test: " << child <<" number "
86  << copyNo << " positioned in " << mother <<" at "
87  << tran << " with " << rotation;
88  copyNo += incrCopyNo;
89  }
90  }
91 }
#define LogDebug(id)
int i
Definition: DBlmapReader.cc:9
list parent
Definition: dbtoconf.py:74
Geom::Theta< T > theta() const
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
std::string dbl_to_string(const double &in)
Converts only the integer part of a double to a string.
Definition: DDutils.cc:12
double incrAngle
Definition: DDTECPhiAlgo.h:28
std::string idNameSpace
Definition: DDTECPhiAlgo.h:35
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)
DDRotation DDrot(const DDName &name, DDRotationMatrix *rot)
Definition of a uniquely identifiable rotation matrix named by DDName name.
Definition: DDRotation.cc:90
double startAngle
Definition: DDTECPhiAlgo.h:27
std::pair< std::string, std::string > DDSplit(const std::string &n)
split into (name,namespace), separator = &#39;:&#39;
Definition: DDSplit.cc:4
std::string childName
Definition: DDTECPhiAlgo.h:36
void DDTECPhiAlgo::initialize ( const DDNumericArguments nArgs,
const DDVectorArguments vArgs,
const DDMapArguments mArgs,
const DDStringArguments sArgs,
const DDStringVectorArguments vsArgs 
)

Definition at line 24 of file DDTECPhiAlgo.cc.

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

28  {
29 
30  startAngle = nArgs["StartAngle"];
31  incrAngle = nArgs["IncrAngle"];
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") << "DDTECPhiAlgo debug: Parameters for "
39  << "positioning--" << "\tStartAngle "
40  << startAngle/CLHEP::deg << "\tIncrAngle "
41  << incrAngle/CLHEP::deg << "\tZ in/out " << zIn << ", "
42  << zOut << "\tCopy Numbers " << number
43  << " Start/Increment " << startCopyNo << ", "
44  << incrCopyNo;
45 
47  childName = sArgs["ChildName"];
48  DDName parentName = parent().name();
49  LogDebug("TECGeom") << "DDTECPhiAlgo debug: Parent " << parentName
50  << "\tChild " << childName << " NameSpace "
51  << idNameSpace;
52 }
#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()
double incrAngle
Definition: DDTECPhiAlgo.h:28
std::string idNameSpace
Definition: DDTECPhiAlgo.h:35
double startAngle
Definition: DDTECPhiAlgo.h:27
std::string childName
Definition: DDTECPhiAlgo.h:36

Member Data Documentation

std::string DDTECPhiAlgo::childName
private

Definition at line 36 of file DDTECPhiAlgo.h.

Referenced by execute(), and initialize().

std::string DDTECPhiAlgo::idNameSpace
private

Definition at line 35 of file DDTECPhiAlgo.h.

Referenced by execute(), and initialize().

double DDTECPhiAlgo::incrAngle
private

Definition at line 28 of file DDTECPhiAlgo.h.

Referenced by execute(), and initialize().

int DDTECPhiAlgo::incrCopyNo
private

Definition at line 33 of file DDTECPhiAlgo.h.

Referenced by execute(), and initialize().

int DDTECPhiAlgo::number
private

Definition at line 31 of file DDTECPhiAlgo.h.

Referenced by execute(), and initialize().

double DDTECPhiAlgo::startAngle
private

Definition at line 27 of file DDTECPhiAlgo.h.

Referenced by execute(), and initialize().

int DDTECPhiAlgo::startCopyNo
private

Definition at line 32 of file DDTECPhiAlgo.h.

Referenced by execute(), and initialize().

double DDTECPhiAlgo::zIn
private

Definition at line 29 of file DDTECPhiAlgo.h.

Referenced by execute(), and initialize().

double DDTECPhiAlgo::zOut
private

Definition at line 30 of file DDTECPhiAlgo.h.

Referenced by execute(), and initialize().