CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
List of all members | Public Member Functions | Private Attributes
DDTECPhiAlgo Class Reference
Inheritance diagram for DDTECPhiAlgo:

Public Member Functions

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

Private Attributes

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

Detailed Description

Definition at line 23 of file DDTECPhiAlgo.cc.

Constructor & Destructor Documentation

DDTECPhiAlgo::DDTECPhiAlgo ( )

Definition at line 50 of file DDTECPhiAlgo.cc.

References LogDebug.

50 { LogDebug("TECGeom") << "DDTECPhiAlgo info: Creating an instance"; }
#define LogDebug(id)
DDTECPhiAlgo::~DDTECPhiAlgo ( )
override

Definition at line 52 of file DDTECPhiAlgo.cc.

52 {}

Member Function Documentation

void DDTECPhiAlgo::execute ( DDCompactView cpv)
override

Definition at line 80 of file DDTECPhiAlgo.cc.

References submitPVValidationJobs::child, DDrot(), DDSplit(), first, mps_fire::i, LogDebug, contentValuesFiles::number, SpecificationBuilder_cfi::parent(), DDCompactView::position(), idealTransformation::rotation, edm::second(), theta(), and cond::impl::to_string().

80  {
81  if (number > 0) {
82  double theta = 90. * CLHEP::deg;
83  int copyNo = startCopyNo;
84 
85  DDName mother = parent().name();
87  for (int i = 0; i < number; i++) {
88  double phix = startAngle + i * incrAngle;
89  double phiy = phix + 90. * CLHEP::deg;
90  double phideg = phix / CLHEP::deg;
91 
93  string rotstr = DDSplit(childName).first + to_string(phideg * 10.);
94  rotation = DDRotation(DDName(rotstr, idNameSpace));
95  if (!rotation) {
96  LogDebug("TECGeom") << "DDTECPhiAlgo test: Creating a new "
97  << "rotation " << rotstr << "\t" << theta / CLHEP::deg << ", " << phix / CLHEP::deg << ", "
98  << theta / CLHEP::deg << ", " << phiy / CLHEP::deg << ", 0, 0";
99  rotation = DDrot(DDName(rotstr, idNameSpace), theta, phix, theta, phiy, 0., 0.);
100  }
101 
102  double zpos = zOut;
103  if (i % 2 == 0)
104  zpos = zIn;
105  DDTranslation tran(0., 0., zpos);
106 
107  cpv.position(child, mother, copyNo, tran, rotation);
108  LogDebug("TECGeom") << "DDTECPhiAlgo test: " << child << " number " << copyNo << " positioned in " << mother
109  << " at " << tran << " with " << rotation;
110  copyNo += incrCopyNo;
111  }
112  }
113 }
void position(const DDLogicalPart &self, const DDLogicalPart &parent, const std::string &copyno, const DDTranslation &trans, const DDRotation &rot, const DDDivision *div=nullptr)
Geom::Theta< T > theta() const
DDName is used to identify DDD entities uniquely.
Definition: DDName.h:17
std::string to_string(const V &value)
Definition: OMSAccess.h:71
string childName
Definition: DDTECPhiAlgo.cc:47
double incrAngle
Definition: DDTECPhiAlgo.cc:39
Represents a uniquely identifyable rotation matrix.
Definition: DDTransform.h:57
U second(std::pair< T, U > const &p)
DDRotation DDrot(const DDName &name, std::unique_ptr< DDRotationMatrix > rot)
Definition of a uniquely identifiable rotation matrix named by DDName name.
Definition: DDRotation.cc:67
double startAngle
Definition: DDTECPhiAlgo.cc:38
string idNameSpace
Definition: DDTECPhiAlgo.cc:46
std::pair< std::string, std::string > DDSplit(const std::string &n)
split into (name,namespace), separator = &#39;:&#39;
Definition: DDSplit.cc:3
ROOT::Math::DisplacementVector3D< ROOT::Math::Cartesian3D< double > > DDTranslation
Definition: DDTranslation.h:7
#define LogDebug(id)
void DDTECPhiAlgo::initialize ( const DDNumericArguments nArgs,
const DDVectorArguments vArgs,
const DDMapArguments mArgs,
const DDStringArguments sArgs,
const DDStringVectorArguments vsArgs 
)
override

Definition at line 54 of file DDTECPhiAlgo.cc.

References LogDebug, DDCurrentNamespace::ns(), contentValuesFiles::number, and SpecificationBuilder_cfi::parent().

58  {
59  startAngle = nArgs["StartAngle"];
60  incrAngle = nArgs["IncrAngle"];
61  zIn = nArgs["ZIn"];
62  zOut = nArgs["ZOut"];
63  number = int(nArgs["Number"]);
64  startCopyNo = int(nArgs["StartCopyNo"]);
65  incrCopyNo = int(nArgs["IncrCopyNo"]);
66 
67  LogDebug("TECGeom") << "DDTECPhiAlgo debug: Parameters for "
68  << "positioning--"
69  << "\tStartAngle " << startAngle / CLHEP::deg << "\tIncrAngle " << incrAngle / CLHEP::deg
70  << "\tZ in/out " << zIn << ", " << zOut << "\tCopy Numbers " << number << " Start/Increment "
71  << startCopyNo << ", " << incrCopyNo;
72 
74  childName = sArgs["ChildName"];
75  DDName parentName = parent().name();
76  LogDebug("TECGeom") << "DDTECPhiAlgo debug: Parent " << parentName << "\tChild " << childName << " NameSpace "
77  << idNameSpace;
78 }
DDName is used to identify DDD entities uniquely.
Definition: DDName.h:17
string childName
Definition: DDTECPhiAlgo.cc:47
static std::string & ns()
double incrAngle
Definition: DDTECPhiAlgo.cc:39
double startAngle
Definition: DDTECPhiAlgo.cc:38
string idNameSpace
Definition: DDTECPhiAlgo.cc:46
#define LogDebug(id)

Member Data Documentation

string DDTECPhiAlgo::childName
private

Definition at line 47 of file DDTECPhiAlgo.cc.

string DDTECPhiAlgo::idNameSpace
private

Definition at line 46 of file DDTECPhiAlgo.cc.

double DDTECPhiAlgo::incrAngle
private

Definition at line 39 of file DDTECPhiAlgo.cc.

int DDTECPhiAlgo::incrCopyNo
private

Definition at line 44 of file DDTECPhiAlgo.cc.

int DDTECPhiAlgo::number
private

Definition at line 42 of file DDTECPhiAlgo.cc.

double DDTECPhiAlgo::startAngle
private

Definition at line 38 of file DDTECPhiAlgo.cc.

int DDTECPhiAlgo::startCopyNo
private

Definition at line 43 of file DDTECPhiAlgo.cc.

double DDTECPhiAlgo::zIn
private

Definition at line 40 of file DDTECPhiAlgo.cc.

double DDTECPhiAlgo::zOut
private

Definition at line 41 of file DDTECPhiAlgo.cc.