CMS 3D CMS Logo

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::DDTECPhiAlgo ( )

Definition at line 50 of file DDTECPhiAlgo.cc.

References LogDebug.

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

◆ ~DDTECPhiAlgo()

DDTECPhiAlgo::~DDTECPhiAlgo ( )
override

Definition at line 52 of file DDTECPhiAlgo.cc.

52 {}

Member Function Documentation

◆ execute()

void DDTECPhiAlgo::execute ( DDCompactView cpv)
override

Definition at line 80 of file DDTECPhiAlgo.cc.

References submitPVValidationJobs::child, DDrot(), DDSplit(), dqmdumpme::first, mps_fire::i, LogDebug, contentValuesFiles::number, class-composition::parent, DDCompactView::position(), idealTransformation::rotation, edm::second(), theta(), and 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.);
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)
DDName is used to identify DDD entities uniquely.
Definition: DDName.h:17
string childName
Definition: DDTECPhiAlgo.cc:47
double incrAngle
Definition: DDTECPhiAlgo.cc:39
static std::string to_string(const XMLCh *ch)
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
Geom::Theta< T > theta() const
ROOT::Math::DisplacementVector3D< ROOT::Math::Cartesian3D< double > > DDTranslation
Definition: DDTranslation.h:7
#define LogDebug(id)

◆ initialize()

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 createfilelist::int, LogDebug, DDCurrentNamespace::ns(), contentValuesFiles::number, and class-composition::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

◆ childName

string DDTECPhiAlgo::childName
private

Definition at line 47 of file DDTECPhiAlgo.cc.

◆ idNameSpace

string DDTECPhiAlgo::idNameSpace
private

Definition at line 46 of file DDTECPhiAlgo.cc.

◆ incrAngle

double DDTECPhiAlgo::incrAngle
private

Definition at line 39 of file DDTECPhiAlgo.cc.

◆ incrCopyNo

int DDTECPhiAlgo::incrCopyNo
private

Definition at line 44 of file DDTECPhiAlgo.cc.

◆ number

int DDTECPhiAlgo::number
private

Definition at line 42 of file DDTECPhiAlgo.cc.

◆ startAngle

double DDTECPhiAlgo::startAngle
private

Definition at line 38 of file DDTECPhiAlgo.cc.

◆ startCopyNo

int DDTECPhiAlgo::startCopyNo
private

Definition at line 43 of file DDTECPhiAlgo.cc.

◆ zIn

double DDTECPhiAlgo::zIn
private

Definition at line 40 of file DDTECPhiAlgo.cc.

◆ zOut

double DDTECPhiAlgo::zOut
private

Definition at line 41 of file DDTECPhiAlgo.cc.