CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
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 18 of file DDTECOptoHybAlgo.cc.

References LogDebug.

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

Definition at line 22 of file DDTECOptoHybAlgo.cc.

22 {}

Member Function Documentation

void DDTECOptoHybAlgo::execute ( DDCompactView cpv)

Definition at line 56 of file DDTECOptoHybAlgo.cc.

References angles, childName, funct::cos(), dbl_to_string(), DDrot(), DDSplit(), plotBeamSpotDB::first, i, idNameSpace, LogDebug, DDName::name(), optoHeight, optoWidth, DDCompactView::position(), idealTransformation::rotation, rpos, edm::second(), funct::sin(), startCopyNo, AlCaHLTBitMon_QueryRunRegistry::string, theta(), and zpos.

56  {
57 
58  LogDebug("TECGeom") << "==>> Constructing DDTECOptoHybAlgo...";
59 
60  DDName mother = parent().name();
62 
63  // given r positions are for the lower left corner
64  rpos += optoHeight/2;
65  int copyNo = startCopyNo;
66  for (int i = 0; i < (int)(angles.size()); i++) {
67  double phix = -angles.at(i);
68  // given phi positions are for the lower left corner
69  phix += asin(optoWidth/2/rpos);
70  double xpos = rpos * cos(phix);
71  double ypos = rpos * sin(phix);
72  DDTranslation tran(xpos, ypos, zpos);
73 
75  double phiy = phix + 90.*CLHEP::deg;
76  double phideg = phix/CLHEP::deg;
77  if (phideg != 0) {
78  std::string rotstr= DDSplit(childName).first+dbl_to_string(phideg*1000.);
79  rotation = DDRotation(DDName(rotstr, idNameSpace));
80  if (!rotation) {
81  double theta = 90.*CLHEP::deg;
82  LogDebug("TECGeom") << "DDTECOptoHybAlgo test: Creating a new "
83  << "rotation: " << rotstr << "\t90., "
84  << phix/CLHEP::deg << ", 90.," << phiy/CLHEP::deg
85  << ", 0, 0";
86  rotation = DDrot(DDName(rotstr, idNameSpace), theta, phix, theta, phiy,
87  0., 0.);
88  }
89  }
90 
91  cpv.position(child, mother, copyNo, tran, rotation);
92  LogDebug("TECGeom") << "DDTECOptoHybAlgo test " << child << " number "
93  << copyNo << " positioned in " << mother << " at "
94  << tran << " with " << rotation;
95  copyNo++;
96  }
97 
98  LogDebug("TECGeom") << "<<== End of DDTECOptoHybAlgo construction ...";
99 }
#define LogDebug(id)
int i
Definition: DBlmapReader.cc:9
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:14
std::string idNameSpace
std::string dbl_to_string(const double &in)
Converts only the integer part of a double to a string.
Definition: DDutils.cc:12
ROOT::Math::DisplacementVector3D< ROOT::Math::Cartesian3D< double > > DDTranslation
Definition: DDTranslation.h:7
Represents a uniquely identifyable rotation matrix.
Definition: DDTransform.h:66
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
const std::string & name() const
Returns the name.
Definition: DDName.cc:87
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 24 of file DDTECOptoHybAlgo.cc.

References angles, childName, i, idNameSpace, LogDebug, DDName::name(), DDCurrentNamespace::ns(), optoHeight, optoWidth, rpos, startCopyNo, and zpos.

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