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

Definition at line 48 of file DDTECOptoHybAlgo.cc.

References LogDebug.

48  : angles(0) {
49  LogDebug("TECGeom") << "DDTECOptoHybAlgo info: Creating an instance";
50 }
vector< double > angles
#define LogDebug(id)
DDTECOptoHybAlgo::~DDTECOptoHybAlgo ( )
override

Definition at line 52 of file DDTECOptoHybAlgo.cc.

52 {}

Member Function Documentation

void DDTECOptoHybAlgo::execute ( DDCompactView cpv)
override

Definition at line 82 of file DDTECOptoHybAlgo.cc.

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

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.);
104  rotation = DDRotation(DDName(rotstr, idNameSpace));
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 }
vector< double > angles
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
Geom::Theta< T > theta() const
DDName is used to identify DDD entities uniquely.
Definition: DDName.h:17
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
ROOT::Math::DisplacementVector3D< ROOT::Math::Cartesian3D< double > > DDTranslation
Definition: DDTranslation.h:7
#define LogDebug(id)
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 54 of file DDTECOptoHybAlgo.cc.

References angles, childName, mps_fire::i, idNameSpace, LogDebug, DDCurrentNamespace::ns(), optoHeight, optoWidth, SpecificationBuilder_cfi::parent(), rpos, startCopyNo, and zpos.

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 }
vector< double > angles
DDName is used to identify DDD entities uniquely.
Definition: DDName.h:17
static std::string & ns()
#define LogDebug(id)

Member Data Documentation

vector<double> DDTECOptoHybAlgo::angles
private

Definition at line 45 of file DDTECOptoHybAlgo.cc.

Referenced by execute(), and initialize().

string DDTECOptoHybAlgo::childName
private

Definition at line 39 of file DDTECOptoHybAlgo.cc.

Referenced by execute(), and initialize().

string DDTECOptoHybAlgo::idNameSpace
private

Definition at line 38 of file DDTECOptoHybAlgo.cc.

Referenced by execute(), and initialize().

double DDTECOptoHybAlgo::optoHeight
private

Definition at line 42 of file DDTECOptoHybAlgo.cc.

Referenced by execute(), and initialize().

double DDTECOptoHybAlgo::optoWidth
private

Definition at line 43 of file DDTECOptoHybAlgo.cc.

Referenced by execute(), and initialize().

double DDTECOptoHybAlgo::rpos
private

Definition at line 40 of file DDTECOptoHybAlgo.cc.

Referenced by execute(), and initialize().

int DDTECOptoHybAlgo::startCopyNo
private

Definition at line 44 of file DDTECOptoHybAlgo.cc.

Referenced by execute(), and initialize().

double DDTECOptoHybAlgo::zpos
private

Definition at line 41 of file DDTECOptoHybAlgo.cc.

Referenced by execute(), and initialize().