CMS 3D CMS Logo

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 17 of file DDTECPhiAlgo.cc.

References LogDebug.

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

Definition at line 21 of file DDTECPhiAlgo.cc.

21 {}

Member Function Documentation

void DDTECPhiAlgo::execute ( DDCompactView cpv)

Definition at line 53 of file DDTECPhiAlgo.cc.

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

53  {
54 
55  if (number > 0) {
56  double theta = 90.*CLHEP::deg;
57  int copyNo = startCopyNo;
58 
59  DDName mother = parent().name();
61  for (int i=0; i<number; i++) {
62  double phix = startAngle + i*incrAngle;
63  double phiy = phix + 90.*CLHEP::deg;
64  double phideg = phix/CLHEP::deg;
65 
67  std::string rotstr = DDSplit(childName).first + std::to_string(phideg*10.);
68  rotation = DDRotation(DDName(rotstr, idNameSpace));
69  if (!rotation) {
70  LogDebug("TECGeom") << "DDTECPhiAlgo test: Creating a new "
71  << "rotation " << rotstr << "\t"
72  << theta/CLHEP::deg << ", " << phix/CLHEP::deg
73  << ", " << theta/CLHEP::deg << ", "
74  << phiy/CLHEP::deg << ", 0, 0";
75  rotation = DDrot(DDName(rotstr, idNameSpace), theta, phix, theta, phiy,
76  0., 0.);
77  }
78 
79  double zpos = zOut;
80  if (i%2 == 0) zpos = zIn;
81  DDTranslation tran(0., 0., zpos);
82 
83  cpv.position(child, mother, copyNo, tran, rotation);
84  LogDebug("TECGeom") << "DDTECPhiAlgo test: " << child <<" number "
85  << copyNo << " positioned in " << mother <<" at "
86  << tran << " with " << rotation;
87  copyNo += incrCopyNo;
88  }
89  }
90 }
#define LogDebug(id)
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:16
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:64
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 23 of file DDTECPhiAlgo.cc.

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

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