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)
 
void initialize (const DDNumericArguments &nArgs, const DDVectorArguments &vArgs, const DDMapArguments &mArgs, const DDStringArguments &sArgs, const DDStringVectorArguments &vsArgs)
 
virtual ~DDTECOptoHybAlgo ()
 

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

Definition at line 21 of file DDTECOptoHybAlgo.cc.

21 {}

Member Function Documentation

void DDTECOptoHybAlgo::execute ( DDCompactView cpv)

Definition at line 55 of file DDTECOptoHybAlgo.cc.

References angles, childName, funct::cos(), DDrot(), DDSplit(), plotBeamSpotDB::first, mps_fire::i, idNameSpace, createfilelist::int, 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 (int i = 0; i < (int)(angles.size()); i++) {
66  double phix = -angles.at(i);
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
void position(const DDLogicalPart &self, const DDLogicalPart &parent, std::string copyno, const DDTranslation &trans, const DDRotation &rot, const DDDivision *div=NULL)
DDName is used to identify DDD entities uniquely.
Definition: DDName.h:16
std::string idNameSpace
ROOT::Math::DisplacementVector3D< ROOT::Math::Cartesian3D< double > > DDTranslation
Definition: DDTranslation.h:7
Represents a uniquely identifyable rotation matrix.
Definition: DDTransform.h:64
U second(std::pair< T, U > const &p)
Cos< T >::type cos(const T &t)
Definition: Cos.h:22
DDRotation DDrot(const DDName &name, DDRotationMatrix *rot)
Definition of a uniquely identifiable rotation matrix named by DDName name.
Definition: DDRotation.cc:90
std::string childName
std::pair< std::string, std::string > DDSplit(const std::string &n)
split into (name,namespace), separator = &#39;:&#39;
Definition: DDSplit.cc:4
std::vector< double > angles
void DDTECOptoHybAlgo::initialize ( const DDNumericArguments nArgs,
const DDVectorArguments vArgs,
const DDMapArguments mArgs,
const DDStringArguments sArgs,
const DDStringVectorArguments vsArgs 
)

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:16
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().