CMS 3D CMS Logo

List of all members | Public Member Functions | Private Attributes
DDTECOptoHybAlgo Class Reference

#include <DDTECOptoHybAlgo.h>

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

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

Detailed Description

Definition at line 10 of file DDTECOptoHybAlgo.h.

Constructor & Destructor Documentation

DDTECOptoHybAlgo::DDTECOptoHybAlgo ( )

Definition at line 17 of file DDTECOptoHybAlgo.cc.

References LogDebug.

17  : angles(0) {
18  LogDebug("TECGeom") << "DDTECOptoHybAlgo info: Creating an instance";
19 }
#define LogDebug(id)
std::vector< double > angles
DDTECOptoHybAlgo::~DDTECOptoHybAlgo ( )
override

Definition at line 21 of file DDTECOptoHybAlgo.cc.

21 {}

Member Function Documentation

void DDTECOptoHybAlgo::execute ( DDCompactView cpv)
override

Definition at line 55 of file DDTECOptoHybAlgo.cc.

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

55  {
56 
57  LogDebug("TECGeom") << "==>> Constructing DDTECOptoHybAlgo...";
58 
59  DDName mother = parent().name();
61 
62  // given r positions are for the lower left corner
63  rpos += optoHeight/2;
64  int copyNo = startCopyNo;
65  for (double angle : angles) {
66  double phix = -angle;
67  // given phi positions are for the lower left corner
68  phix += asin(optoWidth/2/rpos);
69  double xpos = rpos * cos(phix);
70  double ypos = rpos * sin(phix);
71  DDTranslation tran(xpos, ypos, zpos);
72 
74  double phiy = phix + 90.*CLHEP::deg;
75  double phideg = phix/CLHEP::deg;
76  if (phideg != 0) {
77  std::string rotstr= DDSplit(childName).first + std::to_string(phideg*1000.);
78  rotation = DDRotation(DDName(rotstr, idNameSpace));
79  if (!rotation) {
80  double theta = 90.*CLHEP::deg;
81  LogDebug("TECGeom") << "DDTECOptoHybAlgo test: Creating a new "
82  << "rotation: " << rotstr << "\t90., "
83  << phix/CLHEP::deg << ", 90.," << phiy/CLHEP::deg
84  << ", 0, 0";
85  rotation = DDrot(DDName(rotstr, idNameSpace), theta, phix, theta, phiy,
86  0., 0.);
87  }
88  }
89 
90  cpv.position(child, mother, copyNo, tran, rotation);
91  LogDebug("TECGeom") << "DDTECOptoHybAlgo test " << child << " number "
92  << copyNo << " positioned in " << mother << " at "
93  << tran << " with " << rotation;
94  copyNo++;
95  }
96 
97  LogDebug("TECGeom") << "<<== End of DDTECOptoHybAlgo construction ...";
98 }
#define LogDebug(id)
Sin< T >::type sin(const T &t)
Definition: Sin.h:22
Geom::Theta< T > theta() const
DDName is used to identify DDD entities uniquely.
Definition: DDName.h:15
std::string idNameSpace
ROOT::Math::DisplacementVector3D< ROOT::Math::Cartesian3D< double > > DDTranslation
Definition: DDTranslation.h:7
Represents a uniquely identifyable rotation matrix.
Definition: DDTransform.h:68
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:80
std::string childName
void position(const DDLogicalPart &self, const DDLogicalPart &parent, const std::string &copyno, const DDTranslation &trans, const DDRotation &rot, const DDDivision *div=0)
std::pair< std::string, std::string > DDSplit(const std::string &n)
split into (name,namespace), separator = &#39;:&#39;
Definition: DDSplit.cc:3
std::vector< double > angles
T angle(T x1, T y1, T z1, T x2, T y2, T z2)
Definition: angle.h:11
void DDTECOptoHybAlgo::initialize ( const DDNumericArguments nArgs,
const DDVectorArguments vArgs,
const DDMapArguments mArgs,
const DDStringArguments sArgs,
const DDStringVectorArguments vsArgs 
)
override

Definition at line 23 of file DDTECOptoHybAlgo.cc.

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

27  {
28 
30  childName = sArgs["ChildName"];
31 
32  DDName parentName = parent().name();
33 
34  LogDebug("TECGeom") << "DDTECOptoHybAlgo debug: Parent " << parentName
35  << " Child " << childName << " NameSpace " <<idNameSpace;
36 
37  optoHeight = nArgs["OptoHeight"];
38  optoWidth = nArgs["OptoWidth"];
39  rpos = nArgs["Rpos"];
40  zpos = nArgs["Zpos"];
41  startCopyNo = int (nArgs["StartCopyNo"]);
42  angles = vArgs["Angles"];
43 
44  LogDebug("TECGeom") << "DDTECOptoHybAlgo debug: Height of the Hybrid "
45  << optoHeight << " and Width " << optoWidth
46  <<"Rpos " << rpos << " Zpos " << zpos
47  << " StartCopyNo " << startCopyNo << " Number "
48  << angles.size();
49 
50  for (int i = 0; i < (int)(angles.size()); i++)
51  LogDebug("TECGeom") << "\tAngles[" << i << "] = " << angles[i];
52 
53 }
#define LogDebug(id)
DDName is used to identify DDD entities uniquely.
Definition: DDName.h:15
std::string idNameSpace
static std::string & ns()
std::string childName
std::vector< double > angles

Member Data Documentation

std::vector<double> DDTECOptoHybAlgo::angles
private

Definition at line 33 of file DDTECOptoHybAlgo.h.

Referenced by execute(), and initialize().

std::string DDTECOptoHybAlgo::childName
private

Definition at line 27 of file DDTECOptoHybAlgo.h.

Referenced by execute(), and initialize().

std::string DDTECOptoHybAlgo::idNameSpace
private

Definition at line 26 of file DDTECOptoHybAlgo.h.

Referenced by execute(), and initialize().

double DDTECOptoHybAlgo::optoHeight
private

Definition at line 30 of file DDTECOptoHybAlgo.h.

Referenced by execute(), and initialize().

double DDTECOptoHybAlgo::optoWidth
private

Definition at line 31 of file DDTECOptoHybAlgo.h.

Referenced by execute(), and initialize().

double DDTECOptoHybAlgo::rpos
private

Definition at line 28 of file DDTECOptoHybAlgo.h.

Referenced by execute(), and initialize().

int DDTECOptoHybAlgo::startCopyNo
private

Definition at line 32 of file DDTECOptoHybAlgo.h.

Referenced by execute(), and initialize().

double DDTECOptoHybAlgo::zpos
private

Definition at line 29 of file DDTECOptoHybAlgo.h.

Referenced by execute(), and initialize().