CMS 3D CMS Logo

List of all members | Public Member Functions | Private Attributes
DDTECPhiAltAlgo Class Reference
Inheritance diagram for DDTECPhiAltAlgo:

Public Member Functions

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

Private Attributes

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

Detailed Description

Definition at line 23 of file DDTECPhiAltAlgo.cc.

Constructor & Destructor Documentation

◆ DDTECPhiAltAlgo()

DDTECPhiAltAlgo::DDTECPhiAltAlgo ( )

Definition at line 51 of file DDTECPhiAltAlgo.cc.

References LogDebug.

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

◆ ~DDTECPhiAltAlgo()

DDTECPhiAltAlgo::~DDTECPhiAltAlgo ( )
override

Definition at line 53 of file DDTECPhiAltAlgo.cc.

53 {}

Member Function Documentation

◆ execute()

void DDTECPhiAltAlgo::execute ( DDCompactView cpv)
override

Definition at line 82 of file DDTECPhiAltAlgo.cc.

References submitPVValidationJobs::child, funct::cos(), DDrot(), DDSplit(), dqmdumpme::first, mps_fire::i, LogDebug, contentValuesFiles::number, class-composition::parent, DDCompactView::position(), CosmicsPD_Skims::radius, idealTransformation::rotation, edm::second(), funct::sin(), theta(), and to_string().

82  {
83  if (number > 0) {
84  double theta = 90. * CLHEP::deg;
85  int copyNo = startCopyNo;
86 
87  DDName mother = parent().name();
89  for (int i = 0; i < number; i++) {
90  double phiz = startAngle + i * incrAngle;
91  double phix = phiz + 90. * CLHEP::deg;
92  double phideg = phiz / CLHEP::deg;
93 
95  string rotstr = DDSplit(childName).first + to_string(phideg * 10.);
97  if (!rotation) {
98  LogDebug("TECGeom") << "DDTECPhiAltAlgo test: Creating a new "
99  << "rotation " << rotstr << "\t" << theta / CLHEP::deg << ", " << phix / CLHEP::deg
100  << ", 0, 0, " << theta / CLHEP::deg << ", " << phiz / CLHEP::deg;
101  rotation = DDrot(DDName(rotstr, idNameSpace), theta, phix, 0., 0., theta, phiz);
102  }
103 
104  double xpos = radius * cos(phiz);
105  double ypos = radius * sin(phiz);
106  double zpos;
107  if (i % 2 == 0)
108  zpos = zIn;
109  else
110  zpos = zOut;
111  DDTranslation tran(xpos, ypos, zpos);
112 
113  cpv.position(child, mother, copyNo, tran, rotation);
114  LogDebug("TECGeom") << "DDTECPhiAltAlgo test: " << child << " number " << copyNo << " positioned in " << mother
115  << " at " << tran << " with " << rotation;
116  copyNo += incrCopyNo;
117  }
118  }
119 }
void position(const DDLogicalPart &self, const DDLogicalPart &parent, const std::string &copyno, const DDTranslation &trans, const DDRotation &rot, const DDDivision *div=nullptr)
Sin< T >::type sin(const T &t)
Definition: Sin.h:22
DDName is used to identify DDD entities uniquely.
Definition: DDName.h:17
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)
Cos< T >::type cos(const T &t)
Definition: Cos.h:22
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
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 DDTECPhiAltAlgo::initialize ( const DDNumericArguments nArgs,
const DDVectorArguments vArgs,
const DDMapArguments mArgs,
const DDStringArguments sArgs,
const DDStringVectorArguments vsArgs 
)
override

Definition at line 55 of file DDTECPhiAltAlgo.cc.

References createfilelist::int, LogDebug, DDCurrentNamespace::ns(), contentValuesFiles::number, class-composition::parent, and CosmicsPD_Skims::radius.

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

Member Data Documentation

◆ childName

string DDTECPhiAltAlgo::childName
private

Definition at line 48 of file DDTECPhiAltAlgo.cc.

◆ idNameSpace

string DDTECPhiAltAlgo::idNameSpace
private

Definition at line 47 of file DDTECPhiAltAlgo.cc.

◆ incrAngle

double DDTECPhiAltAlgo::incrAngle
private

Definition at line 39 of file DDTECPhiAltAlgo.cc.

◆ incrCopyNo

int DDTECPhiAltAlgo::incrCopyNo
private

Definition at line 45 of file DDTECPhiAltAlgo.cc.

◆ number

int DDTECPhiAltAlgo::number
private

Definition at line 43 of file DDTECPhiAltAlgo.cc.

◆ radius

double DDTECPhiAltAlgo::radius
private

Definition at line 40 of file DDTECPhiAltAlgo.cc.

◆ startAngle

double DDTECPhiAltAlgo::startAngle
private

Definition at line 38 of file DDTECPhiAltAlgo.cc.

◆ startCopyNo

int DDTECPhiAltAlgo::startCopyNo
private

Definition at line 44 of file DDTECPhiAltAlgo.cc.

◆ zIn

double DDTECPhiAltAlgo::zIn
private

Definition at line 41 of file DDTECPhiAltAlgo.cc.

◆ zOut

double DDTECPhiAltAlgo::zOut
private

Definition at line 42 of file DDTECPhiAltAlgo.cc.