CMS 3D CMS Logo

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

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 17 of file DDTrackerPhiAlgo.cc.

References LogDebug.

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

Definition at line 21 of file DDTrackerPhiAlgo.cc.

21 {}

Member Function Documentation

void DDTrackerPhiAlgo::execute ( DDCompactView cpv)
override

Definition at line 75 of file DDTrackerPhiAlgo.cc.

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

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

Definition at line 23 of file DDTrackerPhiAlgo.cc.

References childName, mps_fire::i, idNameSpace, incrcn, createfilelist::int, LogDebug, DDCurrentNamespace::ns(), numcopies, class-composition::parent, phi, radius, startcn, tilt, and zpos.

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