CMS 3D CMS Logo

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

Public Member Functions

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

Private Attributes

vector< double > angles
 
string childName
 
string idNameSpace
 
double optoHeight
 
double optoWidth
 
double rpos
 
int startCopyNo
 
double zpos
 

Detailed Description

Definition at line 23 of file DDTECOptoHybAlgo.cc.

Constructor & Destructor Documentation

◆ DDTECOptoHybAlgo()

DDTECOptoHybAlgo::DDTECOptoHybAlgo ( )

Definition at line 48 of file DDTECOptoHybAlgo.cc.

48  : angles(0) {
49  LogDebug("TECGeom") << "DDTECOptoHybAlgo info: Creating an instance";
50 }

References LogDebug.

◆ ~DDTECOptoHybAlgo()

DDTECOptoHybAlgo::~DDTECOptoHybAlgo ( )
override

Definition at line 52 of file DDTECOptoHybAlgo.cc.

52 {}

Member Function Documentation

◆ execute()

void DDTECOptoHybAlgo::execute ( DDCompactView cpv)
override

Definition at line 82 of file DDTECOptoHybAlgo.cc.

82  {
83  LogDebug("TECGeom") << "==>> Constructing DDTECOptoHybAlgo...";
84 
85  DDName mother = parent().name();
87 
88  // given r positions are for the lower left corner
89  rpos += optoHeight / 2;
90  int copyNo = startCopyNo;
91  for (double angle : angles) {
92  double phix = -angle;
93  // given phi positions are for the lower left corner
94  phix += asin(optoWidth / 2 / rpos);
95  double xpos = rpos * cos(phix);
96  double ypos = rpos * sin(phix);
97  DDTranslation tran(xpos, ypos, zpos);
98 
100  double phiy = phix + 90. * CLHEP::deg;
101  double phideg = phix / CLHEP::deg;
102  if (phideg != 0) {
103  string rotstr = DDSplit(childName).first + to_string(phideg * 1000.);
105  if (!rotation) {
106  double theta = 90. * CLHEP::deg;
107  LogDebug("TECGeom") << "DDTECOptoHybAlgo test: Creating a new "
108  << "rotation: " << rotstr << "\t90., " << phix / CLHEP::deg << ", 90.," << phiy / CLHEP::deg
109  << ", 0, 0";
110  rotation = DDrot(DDName(rotstr, idNameSpace), theta, phix, theta, phiy, 0., 0.);
111  }
112  }
113 
114  cpv.position(child, mother, copyNo, tran, rotation);
115  LogDebug("TECGeom") << "DDTECOptoHybAlgo test " << child << " number " << copyNo << " positioned in " << mother
116  << " at " << tran << " with " << rotation;
117  copyNo++;
118  }
119 
120  LogDebug("TECGeom") << "<<== End of DDTECOptoHybAlgo construction ...";
121 }

References angle(), angles, childName, funct::cos(), DDrot(), DDSplit(), dqmdumpme::first, idNameSpace, LogDebug, optoHeight, optoWidth, class-composition::parent, DDCompactView::position(), idealTransformation::rotation, rpos, edm::second(), funct::sin(), startCopyNo, theta(), and zpos.

◆ initialize()

void DDTECOptoHybAlgo::initialize ( const DDNumericArguments nArgs,
const DDVectorArguments vArgs,
const DDMapArguments mArgs,
const DDStringArguments sArgs,
const DDStringVectorArguments vsArgs 
)
override

Definition at line 54 of file DDTECOptoHybAlgo.cc.

58  {
60  childName = sArgs["ChildName"];
61 
62  DDName parentName = parent().name();
63 
64  LogDebug("TECGeom") << "DDTECOptoHybAlgo debug: Parent " << parentName << " Child " << childName << " NameSpace "
65  << idNameSpace;
66 
67  optoHeight = nArgs["OptoHeight"];
68  optoWidth = nArgs["OptoWidth"];
69  rpos = nArgs["Rpos"];
70  zpos = nArgs["Zpos"];
71  startCopyNo = int(nArgs["StartCopyNo"]);
72  angles = vArgs["Angles"];
73 
74  LogDebug("TECGeom") << "DDTECOptoHybAlgo debug: Height of the Hybrid " << optoHeight << " and Width " << optoWidth
75  << "Rpos " << rpos << " Zpos " << zpos << " StartCopyNo " << startCopyNo << " Number "
76  << angles.size();
77 
78  for (int i = 0; i < (int)(angles.size()); i++)
79  LogDebug("TECGeom") << "\tAngles[" << i << "] = " << angles[i];
80 }

References angles, childName, mps_fire::i, idNameSpace, createfilelist::int, LogDebug, DDCurrentNamespace::ns(), optoHeight, optoWidth, class-composition::parent, rpos, startCopyNo, and zpos.

Member Data Documentation

◆ angles

vector<double> DDTECOptoHybAlgo::angles
private

Definition at line 45 of file DDTECOptoHybAlgo.cc.

Referenced by execute(), and initialize().

◆ childName

string DDTECOptoHybAlgo::childName
private

Definition at line 39 of file DDTECOptoHybAlgo.cc.

Referenced by execute(), and initialize().

◆ idNameSpace

string DDTECOptoHybAlgo::idNameSpace
private

Definition at line 38 of file DDTECOptoHybAlgo.cc.

Referenced by execute(), and initialize().

◆ optoHeight

double DDTECOptoHybAlgo::optoHeight
private

Definition at line 42 of file DDTECOptoHybAlgo.cc.

Referenced by execute(), and initialize().

◆ optoWidth

double DDTECOptoHybAlgo::optoWidth
private

Definition at line 43 of file DDTECOptoHybAlgo.cc.

Referenced by execute(), and initialize().

◆ rpos

double DDTECOptoHybAlgo::rpos
private

Definition at line 40 of file DDTECOptoHybAlgo.cc.

Referenced by execute(), and initialize().

◆ startCopyNo

int DDTECOptoHybAlgo::startCopyNo
private

Definition at line 44 of file DDTECOptoHybAlgo.cc.

Referenced by execute(), and initialize().

◆ zpos

double DDTECOptoHybAlgo::zpos
private

Definition at line 41 of file DDTECOptoHybAlgo.cc.

Referenced by execute(), and initialize().

mps_fire.i
i
Definition: mps_fire.py:428
DDrot
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
DDTECOptoHybAlgo::startCopyNo
int startCopyNo
Definition: DDTECOptoHybAlgo.cc:44
DDName
DDName is used to identify DDD entities uniquely.
Definition: DDName.h:15
DDTECOptoHybAlgo::angles
vector< double > angles
Definition: DDTECOptoHybAlgo.cc:45
edm::second
U second(std::pair< T, U > const &p)
Definition: ParameterSet.cc:222
dqmdumpme.first
first
Definition: dqmdumpme.py:55
DDTECOptoHybAlgo::childName
string childName
Definition: DDTECOptoHybAlgo.cc:39
funct::sin
Sin< T >::type sin(const T &t)
Definition: Sin.h:22
funct::cos
Cos< T >::type cos(const T &t)
Definition: Cos.h:22
DDTECOptoHybAlgo::rpos
double rpos
Definition: DDTECOptoHybAlgo.cc:40
DDTranslation
ROOT::Math::DisplacementVector3D< ROOT::Math::Cartesian3D< double > > DDTranslation
Definition: DDTranslation.h:7
theta
Geom::Theta< T > theta() const
Definition: Basic3DVectorLD.h:150
LogDebug
#define LogDebug(id)
Definition: MessageLogger.h:223
idealTransformation.rotation
dictionary rotation
Definition: idealTransformation.py:1
createfilelist.int
int
Definition: createfilelist.py:10
DDTECOptoHybAlgo::idNameSpace
string idNameSpace
Definition: DDTECOptoHybAlgo.cc:38
DDTECOptoHybAlgo::zpos
double zpos
Definition: DDTECOptoHybAlgo.cc:41
DDTECOptoHybAlgo::optoWidth
double optoWidth
Definition: DDTECOptoHybAlgo.cc:43
DDCurrentNamespace::ns
static std::string & ns()
Definition: DDCurrentNamespace.cc:3
angle
T angle(T x1, T y1, T z1, T x2, T y2, T z2)
Definition: angle.h:11
DDRotation
Represents a uniquely identifyable rotation matrix.
Definition: DDTransform.h:57
child
Definition: simpleInheritance.h:11
class-composition.parent
parent
Definition: class-composition.py:88
DDTECOptoHybAlgo::optoHeight
double optoHeight
Definition: DDTECOptoHybAlgo.cc:42
DDSplit
std::pair< std::string, std::string > DDSplit(const std::string &n)
split into (name,namespace), separator = ':'
Definition: DDSplit.cc:3
DDCompactView::position
void position(const DDLogicalPart &self, const DDLogicalPart &parent, const std::string &copyno, const DDTranslation &trans, const DDRotation &rot, const DDDivision *div=nullptr)
Definition: DDCompactView.cc:76
DDRotation
ROOT::Math::Rotation3D DDRotation
Definition: DDEcalEndcapAlgo.cc:18