CMS 3D CMS Logo

List of all members | Public Member Functions | Private Attributes
DDTrackerPhiAlgo Class Reference
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

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

Detailed Description

Definition at line 20 of file DDTrackerPhiAlgo.cc.

Constructor & Destructor Documentation

◆ DDTrackerPhiAlgo()

DDTrackerPhiAlgo::DDTrackerPhiAlgo ( )

Definition at line 48 of file DDTrackerPhiAlgo.cc.

48  : startcn(1), incrcn(1) {
49  LogDebug("TrackerGeom") << "DDTrackerPhiAlgo info: Creating an instance";
50 }

References LogDebug.

◆ ~DDTrackerPhiAlgo()

DDTrackerPhiAlgo::~DDTrackerPhiAlgo ( )
override

Definition at line 52 of file DDTrackerPhiAlgo.cc.

52 {}

Member Function Documentation

◆ execute()

void DDTrackerPhiAlgo::execute ( DDCompactView cpv)
override

Definition at line 101 of file DDTrackerPhiAlgo.cc.

101  {
102  DDName mother = parent().name();
104  double theta = 90. * CLHEP::deg;
105  size_t i = 0;
106  int ci = startcn;
107  for (; i < numcopies; ++i) {
108  double phix = phi[i] + tilt;
109  double phiy = phix + 90. * CLHEP::deg;
110  double phideg = phi[i] / CLHEP::deg;
111 
112  string rotstr = DDSplit(childName).first + to_string(phideg);
114  if (!rotation) {
115  LogDebug("TrackerGeom") << "DDTrackerPhiAlgo test: Creating a new "
116  << "rotation: " << rotstr << "\t"
117  << "90., " << phix / CLHEP::deg << ", 90.," << phiy / CLHEP::deg << ", 0, 0";
118  rotation = DDrot(DDName(rotstr, idNameSpace), theta, phix, theta, phiy, 0., 0.);
119  }
120 
121  double xpos = radius * cos(phi[i]);
122  double ypos = radius * sin(phi[i]);
123  DDTranslation tran(xpos, ypos, zpos[i]);
124 
125  cpv.position(child, mother, ci, tran, rotation);
126  LogDebug("TrackerGeom") << "DDTrackerPhiAlgo test: " << child << " number " << ci << " positioned in " << mother
127  << " at " << tran << " with " << rotation;
128  ci = ci + incrcn;
129  }
130 }

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

◆ initialize()

void DDTrackerPhiAlgo::initialize ( const DDNumericArguments nArgs,
const DDVectorArguments vArgs,
const DDMapArguments mArgs,
const DDStringArguments sArgs,
const DDStringVectorArguments vsArgs 
)
override

Definition at line 54 of file DDTrackerPhiAlgo.cc.

58  {
59  if (nArgs.find("StartCopyNo") != nArgs.end()) {
60  startcn = size_t(nArgs["StartCopyNo"]);
61  } else {
62  startcn = 1;
63  }
64  if (nArgs.find("IncrCopyNo") != nArgs.end()) {
65  incrcn = int(nArgs["IncrCopyNo"]);
66  } else {
67  incrcn = 1;
68  }
69 
70  radius = nArgs["Radius"];
71  tilt = nArgs["Tilt"];
72  phi = vArgs["Phi"];
73  zpos = vArgs["ZPos"];
74 
75  if (nArgs.find("NumCopies") != nArgs.end()) {
76  numcopies = size_t(nArgs["NumCopies"]);
77  if (numcopies != phi.size()) {
78  edm::LogError("TrackerGeom") << "DDTrackerPhiAlgo error: Parameter "
79  << "NumCopies does not agree with the size "
80  << "of the Phi vector. It was adjusted to "
81  << "be the size of the Phi vector and may "
82  << "lead to crashes or errors.";
83  }
84  } else {
85  numcopies = phi.size();
86  }
87 
88  LogDebug("TrackerGeom") << "DDTrackerPhiAlgo debug: Parameters for position"
89  << "ing:: "
90  << " Radius " << radius << " Tilt " << tilt / CLHEP::deg << " Copies " << phi.size() << " at";
91  for (int i = 0; i < (int)(phi.size()); i++)
92  LogDebug("TrackerGeom") << "\t[" << i << "] phi = " << phi[i] / CLHEP::deg << " z = " << zpos[i];
93 
95  childName = sArgs["ChildName"];
96  DDName parentName = parent().name();
97  LogDebug("TrackerGeom") << "DDTrackerPhiAlgo debug: Parent " << parentName << "\tChild " << childName << " NameSpace "
98  << idNameSpace;
99 }

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

Member Data Documentation

◆ childName

string DDTrackerPhiAlgo::childName
private

Definition at line 41 of file DDTrackerPhiAlgo.cc.

Referenced by execute(), and initialize().

◆ idNameSpace

string DDTrackerPhiAlgo::idNameSpace
private

Definition at line 40 of file DDTrackerPhiAlgo.cc.

Referenced by execute(), and initialize().

◆ incrcn

int DDTrackerPhiAlgo::incrcn
private

Definition at line 44 of file DDTrackerPhiAlgo.cc.

Referenced by execute(), and initialize().

◆ numcopies

size_t DDTrackerPhiAlgo::numcopies
private

Definition at line 45 of file DDTrackerPhiAlgo.cc.

Referenced by execute(), and initialize().

◆ phi

vector<double> DDTrackerPhiAlgo::phi
private

◆ radius

double DDTrackerPhiAlgo::radius
private

Definition at line 35 of file DDTrackerPhiAlgo.cc.

Referenced by execute(), and initialize().

◆ startcn

size_t DDTrackerPhiAlgo::startcn
private

Definition at line 43 of file DDTrackerPhiAlgo.cc.

Referenced by execute(), and initialize().

◆ tilt

double DDTrackerPhiAlgo::tilt
private

Definition at line 36 of file DDTrackerPhiAlgo.cc.

Referenced by execute(), and initialize().

◆ zpos

vector<double> DDTrackerPhiAlgo::zpos
private

Definition at line 38 of file DDTrackerPhiAlgo.cc.

Referenced by execute(), and initialize().

DDTrackerPhiAlgo::startcn
size_t startcn
Definition: DDTrackerPhiAlgo.cc:43
mps_fire.i
i
Definition: mps_fire.py:428
DDrot
DDRotation DDrot(const DDName &name, std::unique_ptr< DDRotationMatrix > rot)
Definition of a uniquely identifiable rotation matrix named by DDName name.
Definition: DDRotation.cc:67
DDTrackerPhiAlgo::childName
string childName
Definition: DDTrackerPhiAlgo.cc:41
DDName
DDName is used to identify DDD entities uniquely.
Definition: DDName.h:15
DDTrackerPhiAlgo::zpos
vector< double > zpos
Definition: DDTrackerPhiAlgo.cc:38
edm::second
U second(std::pair< T, U > const &p)
Definition: ParameterSet.cc:222
DDTrackerPhiAlgo::radius
double radius
Definition: DDTrackerPhiAlgo.cc:35
dqmdumpme.first
first
Definition: dqmdumpme.py:55
funct::sin
Sin< T >::type sin(const T &t)
Definition: Sin.h:22
funct::cos
Cos< T >::type cos(const T &t)
Definition: Cos.h:22
DDTranslation
ROOT::Math::DisplacementVector3D< ROOT::Math::Cartesian3D< double > > DDTranslation
Definition: DDTranslation.h:7
theta
Geom::Theta< T > theta() const
Definition: Basic3DVectorLD.h:150
LogDebug
#define LogDebug(id)
Definition: MessageLogger.h:223
idealTransformation.rotation
dictionary rotation
Definition: idealTransformation.py:1
DDTrackerPhiAlgo::idNameSpace
string idNameSpace
Definition: DDTrackerPhiAlgo.cc:40
DDTrackerPhiAlgo::tilt
double tilt
Definition: DDTrackerPhiAlgo.cc:36
createfilelist.int
int
Definition: createfilelist.py:10
edm::LogError
Log< level::Error, false > LogError
Definition: MessageLogger.h:123
submitPVValidationJobs.child
child
Definition: submitPVValidationJobs.py:119
DDTrackerPhiAlgo::phi
vector< double > phi
Definition: DDTrackerPhiAlgo.cc:37
DDCurrentNamespace::ns
static std::string & ns()
Definition: DDCurrentNamespace.cc:3
DDRotation
Represents a uniquely identifyable rotation matrix.
Definition: DDTransform.h:57
DDTrackerPhiAlgo::incrcn
int incrcn
Definition: DDTrackerPhiAlgo.cc:44
child
Definition: simpleInheritance.h:11
class-composition.parent
parent
Definition: class-composition.py:88
DDSplit
std::pair< std::string, std::string > DDSplit(const std::string &n)
split into (name,namespace), separator = ':'
Definition: DDSplit.cc:3
DDCompactView::position
void position(const DDLogicalPart &self, const DDLogicalPart &parent, const std::string &copyno, const DDTranslation &trans, const DDRotation &rot, const DDDivision *div=nullptr)
Definition: DDCompactView.cc:76
DDRotation
ROOT::Math::Rotation3D DDRotation
Definition: DDEcalEndcapAlgo.cc:18
DDTrackerPhiAlgo::numcopies
size_t numcopies
Definition: DDTrackerPhiAlgo.cc:45