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

#include <DDTrackerPhiAlgo.h>

Inheritance diagram for DDTrackerPhiAlgo:

Public Member Functions

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

Private Attributes

std::string childName
 
std::string idNameSpace
 
int incrcn
 
size_t numcopies
 
std::vector< double > phi
 
double radius
 
size_t startcn
 
double tilt
 
std::vector< double > zpos
 

Detailed Description

Definition at line 10 of file DDTrackerPhiAlgo.h.

Constructor & Destructor Documentation

DDTrackerPhiAlgo::DDTrackerPhiAlgo ( )

Definition at line 18 of file DDTrackerPhiAlgo.cc.

References LogDebug.

18  : startcn(1), incrcn(1) {
19  LogDebug("TrackerGeom") << "DDTrackerPhiAlgo info: Creating an instance";
20 }
#define LogDebug(id)
DDTrackerPhiAlgo::~DDTrackerPhiAlgo ( )
virtual

Definition at line 22 of file DDTrackerPhiAlgo.cc.

22 {}

Member Function Documentation

void DDTrackerPhiAlgo::execute ( DDCompactView cpv)

Definition at line 76 of file DDTrackerPhiAlgo.cc.

References class-composition::child, childName, funct::cos(), dbl_to_string(), DDrot(), DDSplit(), plotBeamSpotDB::first, i, idNameSpace, incrcn, LogDebug, numcopies, dbtoconf::parent, phi, DDCompactView::position(), radius, idealTransformation::rotation, edm::second(), funct::sin(), startcn, AlCaHLTBitMon_QueryRunRegistry::string, theta(), tilt, and zpos.

76  {
77 
78  DDName mother = parent().name();
80  double theta = 90.*CLHEP::deg;
81  size_t i = 0;
82  int ci = startcn;
83  for ( ; i < numcopies; ++i) {
84  double phix = phi[i] + tilt;
85  double phiy = phix + 90.*CLHEP::deg;
86  double phideg = phi[i]/CLHEP::deg;
87 
88  std::string rotstr = DDSplit(childName).first + dbl_to_string(phideg);
90  if (!rotation) {
91  LogDebug("TrackerGeom") << "DDTrackerPhiAlgo test: Creating a new "
92  << "rotation: " << rotstr << "\t" << "90., "
93  << phix/CLHEP::deg << ", 90.,"
94  << phiy/CLHEP::deg << ", 0, 0";
95  rotation = DDrot(DDName(rotstr, idNameSpace), theta, phix, theta, phiy,
96  0., 0.);
97  }
98 
99  double xpos = radius*cos(phi[i]);
100  double ypos = radius*sin(phi[i]);
101  DDTranslation tran(xpos, ypos, zpos[i]);
102 
103  cpv.position(child, mother, ci, tran, rotation);
104  LogDebug("TrackerGeom") << "DDTrackerPhiAlgo test: " << child << " number "
105  << ci << " positioned in " << mother << " at "
106  << tran << " with " << rotation;
107  ci=ci+incrcn;
108  }
109 }
#define LogDebug(id)
std::vector< double > phi
int i
Definition: DBlmapReader.cc:9
std::string childName
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:14
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::vector< double > zpos
std::string idNameSpace
std::pair< std::string, std::string > DDSplit(const std::string &n)
split into (name,namespace), separator = &#39;:&#39;
Definition: DDSplit.cc:4
void DDTrackerPhiAlgo::initialize ( const DDNumericArguments nArgs,
const DDVectorArguments vArgs,
const DDMapArguments mArgs,
const DDStringArguments sArgs,
const DDStringVectorArguments vsArgs 
)

Definition at line 24 of file DDTrackerPhiAlgo.cc.

References childName, i, idNameSpace, incrcn, LogDebug, DDCurrentNamespace::ns(), numcopies, dbtoconf::parent, phi, radius, startcn, tilt, and zpos.

28  {
29 
30  if ( nArgs.find("StartCopyNo") != nArgs.end() ) {
31  startcn = size_t(nArgs["StartCopyNo"]);
32  } else {
33  startcn = 1;
34  }
35  if ( nArgs.find("IncrCopyNo") != nArgs.end() ) {
36  incrcn = int(nArgs["IncrCopyNo"]);
37  } else {
38  incrcn = 1;
39  }
40 
41 
42  radius = nArgs["Radius"];
43  tilt = nArgs["Tilt"];
44  phi = vArgs["Phi"];
45  zpos = vArgs["ZPos"];
46 
47  if ( nArgs.find("NumCopies") != nArgs.end() ) {
48  numcopies = size_t(nArgs["NumCopies"]);
49  if ( numcopies != phi.size() ) {
50  edm::LogError("TrackerGeom") << "DDTrackerPhiAlgo error: Parameter "
51  << "NumCopies does not agree with the size "
52  << "of the Phi vector. It was adjusted to "
53  << "be the size of the Phi vector and may "
54  << "lead to crashes or errors.";
55  }
56  } else {
57  numcopies = phi.size();
58  }
59 
60  LogDebug("TrackerGeom") << "DDTrackerPhiAlgo debug: Parameters for position"
61  << "ing:: " << " Radius " << radius << " Tilt "
62  << tilt/CLHEP::deg << " Copies " << phi.size()
63  << " at";
64  for (int i=0; i<(int)(phi.size()); i++)
65  LogDebug("TrackerGeom") << "\t[" << i << "] phi = " << phi[i]/CLHEP::deg
66  << " z = " << zpos[i];
67 
69  childName = sArgs["ChildName"];
70  DDName parentName = parent().name();
71  LogDebug("TrackerGeom") << "DDTrackerPhiAlgo debug: Parent " << parentName
72  <<"\tChild " << childName << " NameSpace "
73  << idNameSpace;
74 }
#define LogDebug(id)
std::vector< double > phi
int i
Definition: DBlmapReader.cc:9
std::string childName
list parent
Definition: dbtoconf.py:74
DDName is used to identify DDD entities uniquely.
Definition: DDName.h:14
static std::string & ns()
std::vector< double > zpos
std::string idNameSpace

Member Data Documentation

std::string DDTrackerPhiAlgo::childName
private

Definition at line 33 of file DDTrackerPhiAlgo.h.

Referenced by execute(), and initialize().

std::string DDTrackerPhiAlgo::idNameSpace
private

Definition at line 32 of file DDTrackerPhiAlgo.h.

Referenced by execute(), and initialize().

int DDTrackerPhiAlgo::incrcn
private

Definition at line 36 of file DDTrackerPhiAlgo.h.

Referenced by execute(), and initialize().

size_t DDTrackerPhiAlgo::numcopies
private

Definition at line 37 of file DDTrackerPhiAlgo.h.

Referenced by execute(), and initialize().

std::vector<double> DDTrackerPhiAlgo::phi
private

Definition at line 29 of file DDTrackerPhiAlgo.h.

Referenced by Particle.Particle::__str__(), execute(), and initialize().

double DDTrackerPhiAlgo::radius
private

Definition at line 27 of file DDTrackerPhiAlgo.h.

Referenced by execute(), and initialize().

size_t DDTrackerPhiAlgo::startcn
private

Definition at line 35 of file DDTrackerPhiAlgo.h.

Referenced by execute(), and initialize().

double DDTrackerPhiAlgo::tilt
private

Definition at line 28 of file DDTrackerPhiAlgo.h.

Referenced by execute(), and initialize().

std::vector<double> DDTrackerPhiAlgo::zpos
private

Definition at line 30 of file DDTrackerPhiAlgo.h.

Referenced by execute(), and initialize().