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
DDTrackerPhiAltAlgo Class Reference

#include <DDTrackerPhiAltAlgo.h>

Inheritance diagram for DDTrackerPhiAltAlgo:

Public Member Functions

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

Private Attributes

std::string childName
 
std::string idNameSpace
 
int incrCopyNo
 
int number
 
double radiusIn
 
double radiusOut
 
double rangeAngle
 
double startAngle
 
int startCopyNo
 
double tilt
 
double zpos
 

Detailed Description

Definition at line 10 of file DDTrackerPhiAltAlgo.h.

Constructor & Destructor Documentation

DDTrackerPhiAltAlgo::DDTrackerPhiAltAlgo ( )

Definition at line 18 of file DDTrackerPhiAltAlgo.cc.

References LogDebug.

18  {
19  LogDebug("TrackerGeom") << "DDTrackerPhiAltAlgo info: Creating an instance";
20 }
#define LogDebug(id)
DDTrackerPhiAltAlgo::~DDTrackerPhiAltAlgo ( )
virtual

Definition at line 22 of file DDTrackerPhiAltAlgo.cc.

22 {}

Member Function Documentation

void DDTrackerPhiAltAlgo::execute ( DDCompactView cpv)

Definition at line 57 of file DDTrackerPhiAltAlgo.cc.

References childName, funct::cos(), dbl_to_string(), DDrot(), DDSplit(), first, i, idNameSpace, incrCopyNo, LogDebug, number, dbtoconf::parent, phi, DDCompactView::position(), radiusIn, radiusOut, rangeAngle, idealTransformation::rotation, edm::second(), funct::sin(), startAngle, startCopyNo, AlCaHLTBitMon_QueryRunRegistry::string, theta(), tilt, and zpos.

57  {
58 
59  if (number > 0) {
60  double theta = 90.*CLHEP::deg;
61  double dphi;
62  if (number == 1 || fabs(rangeAngle-360.0*CLHEP::deg)<0.001*CLHEP::deg)
63  dphi = rangeAngle/number;
64  else
65  dphi = rangeAngle/(number-1);
66  int copyNo = startCopyNo;
67 
68  DDName mother = parent().name();
70  for (int i=0; i<number; i++) {
71  double phi = startAngle + i*dphi;
72  double phix = phi - tilt + 90.*CLHEP::deg;
73  double phiy = phix + 90.*CLHEP::deg;
74  double phideg = phix/CLHEP::deg;
75 
77  if (phideg != 0) {
78  std::string rotstr =DDSplit(childName).first+dbl_to_string(phideg*10.);
79  rotation = DDRotation(DDName(rotstr, idNameSpace));
80  if (!rotation) {
81  LogDebug("TrackerGeom") << "DDTrackerPhiAltAlgo test: Creating a new"
82  << " rotation " << rotstr << "\t" << "90., "
83  << phix/CLHEP::deg << ", 90.,"
84  << phiy/CLHEP::deg << ", 0, 0";
85  rotation = DDrot(DDName(rotstr, idNameSpace), theta, phix, theta,
86  phiy, 0., 0.);
87  }
88  }
89 
90  double xpos, ypos;
91  if (i%2 == 0) {
92  xpos = radiusIn*cos(phi);
93  ypos = radiusIn*sin(phi);
94  } else {
95  xpos = radiusOut*cos(phi);
96  ypos = radiusOut*sin(phi);
97  }
98  DDTranslation tran(xpos, ypos, zpos);
99 
100  cpv.position(child, mother, copyNo, tran, rotation);
101  LogDebug("TrackerGeom") << "DDTrackerPhiAltAlgo test: " << child
102  << " number " << copyNo << " positioned in "
103  << mother << " at " << tran << " with "
104  << rotation;
105  copyNo += incrCopyNo;
106  }
107  }
108 }
#define LogDebug(id)
int i
Definition: DBlmapReader.cc:9
list parent
Definition: dbtoconf.py:74
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:18
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
bool first
Definition: L1TdeRCT.cc:75
DDRotation DDrot(const DDName &name, DDRotationMatrix *rot)
Definition of a uniquely identifiable rotation matrix named by DDName name.
Definition: DDRotation.cc:90
std::pair< std::string, std::string > DDSplit(const std::string &n)
split into (name,namespace), separator = &#39;:&#39;
Definition: DDSplit.cc:4
Definition: DDAxes.h:10
void DDTrackerPhiAltAlgo::initialize ( const DDNumericArguments nArgs,
const DDVectorArguments vArgs,
const DDMapArguments mArgs,
const DDStringArguments sArgs,
const DDStringVectorArguments vsArgs 
)

Definition at line 24 of file DDTrackerPhiAltAlgo.cc.

References childName, idNameSpace, incrCopyNo, LogDebug, DDCurrentNamespace::ns(), number, dbtoconf::parent, radiusIn, radiusOut, rangeAngle, startAngle, startCopyNo, tilt, and zpos.

28  {
29 
30  tilt = nArgs["Tilt"];
31  startAngle = nArgs["StartAngle"];
32  rangeAngle = nArgs["RangeAngle"];
33  radiusIn = nArgs["RadiusIn"];
34  radiusOut = nArgs["RadiusOut"];
35  zpos = nArgs["ZPosition"];
36  number = int (nArgs["Number"]);
37  startCopyNo= int (nArgs["StartCopyNo"]);
38  incrCopyNo = int (nArgs["IncrCopyNo"]);
39 
40  LogDebug("TrackerGeom") << "DDTrackerPhiAltAlgo debug: Parameters for "
41  << "positioning--" << " Tilt " << tilt
42  << "\tStartAngle " << startAngle/CLHEP::deg
43  << "\tRangeAngle " << rangeAngle/CLHEP::deg
44  << "\tRin " << radiusIn << "\tRout " << radiusOut
45  << "\t ZPos " << zpos << "\tCopy Numbers " << number
46  << " Start/Increment " << startCopyNo << ", "
47  << incrCopyNo;
48 
50  childName = sArgs["ChildName"];
51  DDName parentName = parent().name();
52  LogDebug("TrackerGeom") << "DDTrackerPhiAltAlgo debug: Parent " << parentName
53  << "\tChild " << childName << " NameSpace "
54  << idNameSpace;
55 }
#define LogDebug(id)
list parent
Definition: dbtoconf.py:74
DDName is used to identify DDD entities uniquely.
Definition: DDName.h:18
static std::string & ns()

Member Data Documentation

std::string DDTrackerPhiAltAlgo::childName
private

Definition at line 38 of file DDTrackerPhiAltAlgo.h.

Referenced by execute(), and initialize().

std::string DDTrackerPhiAltAlgo::idNameSpace
private

Definition at line 37 of file DDTrackerPhiAltAlgo.h.

Referenced by execute(), and initialize().

int DDTrackerPhiAltAlgo::incrCopyNo
private

Definition at line 35 of file DDTrackerPhiAltAlgo.h.

Referenced by execute(), and initialize().

int DDTrackerPhiAltAlgo::number
private

Definition at line 33 of file DDTrackerPhiAltAlgo.h.

Referenced by execute(), and initialize().

double DDTrackerPhiAltAlgo::radiusIn
private

Definition at line 30 of file DDTrackerPhiAltAlgo.h.

Referenced by execute(), and initialize().

double DDTrackerPhiAltAlgo::radiusOut
private

Definition at line 31 of file DDTrackerPhiAltAlgo.h.

Referenced by execute(), and initialize().

double DDTrackerPhiAltAlgo::rangeAngle
private

Definition at line 29 of file DDTrackerPhiAltAlgo.h.

Referenced by execute(), and initialize().

double DDTrackerPhiAltAlgo::startAngle
private

Definition at line 28 of file DDTrackerPhiAltAlgo.h.

Referenced by execute(), and initialize().

int DDTrackerPhiAltAlgo::startCopyNo
private

Definition at line 34 of file DDTrackerPhiAltAlgo.h.

Referenced by execute(), and initialize().

double DDTrackerPhiAltAlgo::tilt
private

Definition at line 27 of file DDTrackerPhiAltAlgo.h.

Referenced by execute(), and initialize().

double DDTrackerPhiAltAlgo::zpos
private

Definition at line 32 of file DDTrackerPhiAltAlgo.h.

Referenced by execute(), and initialize().