CMS 3D CMS Logo

List of all members | Public Member Functions | Private Attributes
DDTECCoolAlgo Class Reference
Inheritance diagram for DDTECCoolAlgo:

Public Member Functions

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

Private Attributes

vector< string > coolInsert
 
string idNameSpace
 
vector< double > phiPosition
 
double rPosition
 
int startCopyNo
 

Detailed Description

Definition at line 27 of file DDTECCoolAlgo.cc.

Constructor & Destructor Documentation

◆ DDTECCoolAlgo()

DDTECCoolAlgo::DDTECCoolAlgo ( )

Definition at line 49 of file DDTECCoolAlgo.cc.

49  : phiPosition(0), coolInsert(0) {
50  LogDebug("TECGeom") << "DDTECCoolAlgo info: Creating an instance";
51 }

References LogDebug.

◆ ~DDTECCoolAlgo()

DDTECCoolAlgo::~DDTECCoolAlgo ( )
override

Definition at line 53 of file DDTECCoolAlgo.cc.

53 {}

Member Function Documentation

◆ execute()

void DDTECCoolAlgo::execute ( DDCompactView cpv)
override

Definition at line 79 of file DDTECCoolAlgo.cc.

79  {
80  LogDebug("TECGeom") << "==>> Constructing DDTECCoolAlgo...";
81  int copyNo = startCopyNo;
82  // loop over the inserts to be placed
83  for (int i = 0; i < (int)(coolInsert.size()); i++) {
84  // get objects
86  DDName mother = parent().name();
87  // get positions
88  double xpos = rPosition * cos(phiPosition.at(i));
89  double ypos = -rPosition * sin(phiPosition.at(i));
90  // place inserts
91  DDTranslation tran(xpos, ypos, 0.0);
93  cpv.position(child, mother, copyNo, tran, rotation);
94  LogDebug("TECGeom") << "DDTECCoolAlgo test " << child << "[" << copyNo << "] positioned in " << mother << " at "
95  << tran << " with " << rotation << " phi " << phiPosition.at(i) / CLHEP::deg << " r "
96  << rPosition;
97  copyNo++;
98  }
99  LogDebug("TECGeom") << "<<== End of DDTECCoolAlgo construction ...";
100 }

References coolInsert, funct::cos(), DDSplit(), first, mps_fire::i, createfilelist::int, LogDebug, class-composition::parent, phiPosition, DDCompactView::position(), idealTransformation::rotation, rPosition, edm::second(), funct::sin(), and startCopyNo.

◆ initialize()

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

Definition at line 55 of file DDTECCoolAlgo.cc.

59  {
61  startCopyNo = int(nArgs["StartCopyNo"]);
62 
63  DDName parentName = parent().name();
64  rPosition = nArgs["RPosition"];
65  LogDebug("TECGeom") << "DDTECCoolAlgo debug: Parent " << parentName << " NameSpace " << idNameSpace
66  << " at radial Position " << rPosition;
67  phiPosition = vArgs["PhiPosition"];
68  coolInsert = vsArgs["CoolInsert"];
69  if (phiPosition.size() == coolInsert.size()) {
70  for (int i = 0; i < (int)(phiPosition.size()); i++)
71  LogDebug("TECGeom") << "DDTECCoolAlgo debug: Insert[" << i << "]: " << coolInsert.at(i) << " at Phi "
72  << phiPosition.at(i) / CLHEP::deg;
73  } else {
74  LogDebug("TECGeom") << "ERROR: Number of inserts does not match the numer of PhiPositions!";
75  }
76  LogDebug("TECGeom") << " Done creating instance of DDTECCoolAlgo ";
77 }

References coolInsert, mps_fire::i, idNameSpace, createfilelist::int, LogDebug, DDCurrentNamespace::ns(), class-composition::parent, phiPosition, rPosition, and startCopyNo.

Member Data Documentation

◆ coolInsert

vector<string> DDTECCoolAlgo::coolInsert
private

Definition at line 46 of file DDTECCoolAlgo.cc.

Referenced by execute(), and initialize().

◆ idNameSpace

string DDTECCoolAlgo::idNameSpace
private

Definition at line 42 of file DDTECCoolAlgo.cc.

Referenced by initialize().

◆ phiPosition

vector<double> DDTECCoolAlgo::phiPosition
private

Definition at line 45 of file DDTECCoolAlgo.cc.

Referenced by execute(), and initialize().

◆ rPosition

double DDTECCoolAlgo::rPosition
private

Definition at line 44 of file DDTECCoolAlgo.cc.

Referenced by execute(), and initialize().

◆ startCopyNo

int DDTECCoolAlgo::startCopyNo
private

Definition at line 43 of file DDTECCoolAlgo.cc.

Referenced by execute(), and initialize().

mps_fire.i
i
Definition: mps_fire.py:428
DDName
DDName is used to identify DDD entities uniquely.
Definition: DDName.h:15
DDTECCoolAlgo::idNameSpace
string idNameSpace
Definition: DDTECCoolAlgo.cc:42
DDTECCoolAlgo::rPosition
double rPosition
Definition: DDTECCoolAlgo.cc:44
DDTECCoolAlgo::coolInsert
vector< string > coolInsert
Definition: DDTECCoolAlgo.cc:46
DDTECCoolAlgo::startCopyNo
int startCopyNo
Definition: DDTECCoolAlgo.cc:43
edm::second
U second(std::pair< T, U > const &p)
Definition: ParameterSet.cc:222
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
first
auto first
Definition: CAHitNtupletGeneratorKernelsImpl.h:112
LogDebug
#define LogDebug(id)
Definition: MessageLogger.h:233
idealTransformation.rotation
dictionary rotation
Definition: idealTransformation.py:1
DDTECCoolAlgo::phiPosition
vector< double > phiPosition
Definition: DDTECCoolAlgo.cc:45
createfilelist.int
int
Definition: createfilelist.py:10
DDCurrentNamespace::ns
static std::string & ns()
Definition: DDCurrentNamespace.cc:3
DDRotation
Represents a uniquely identifyable rotation matrix.
Definition: DDTransform.h:57
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