CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
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 ( )

Definition at line 49 of file DDTECCoolAlgo.cc.

References LogDebug.

49  : phiPosition(0), coolInsert(0) {
50  LogDebug("TECGeom") << "DDTECCoolAlgo info: Creating an instance";
51 }
vector< string > coolInsert
vector< double > phiPosition
#define LogDebug(id)
DDTECCoolAlgo::~DDTECCoolAlgo ( )
override

Definition at line 53 of file DDTECCoolAlgo.cc.

53 {}

Member Function Documentation

void DDTECCoolAlgo::execute ( DDCompactView cpv)
override

Definition at line 79 of file DDTECCoolAlgo.cc.

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

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 }
void position(const DDLogicalPart &self, const DDLogicalPart &parent, const std::string &copyno, const DDTranslation &trans, const DDRotation &rot, const DDDivision *div=nullptr)
Sin< T >::type sin(const T &t)
Definition: Sin.h:22
DDName is used to identify DDD entities uniquely.
Definition: DDName.h:17
Represents a uniquely identifyable rotation matrix.
Definition: DDTransform.h:57
U second(std::pair< T, U > const &p)
vector< string > coolInsert
Cos< T >::type cos(const T &t)
Definition: Cos.h:22
vector< double > phiPosition
std::pair< std::string, std::string > DDSplit(const std::string &n)
split into (name,namespace), separator = &#39;:&#39;
Definition: DDSplit.cc:3
ROOT::Math::DisplacementVector3D< ROOT::Math::Cartesian3D< double > > DDTranslation
Definition: DDTranslation.h:7
#define LogDebug(id)
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.

References coolInsert, mps_fire::i, idNameSpace, LogDebug, DDCurrentNamespace::ns(), SpecificationBuilder_cfi::parent(), phiPosition, rPosition, and startCopyNo.

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 }
DDName is used to identify DDD entities uniquely.
Definition: DDName.h:17
static std::string & ns()
vector< string > coolInsert
vector< double > phiPosition
string idNameSpace
#define LogDebug(id)

Member Data Documentation

vector<string> DDTECCoolAlgo::coolInsert
private

Definition at line 46 of file DDTECCoolAlgo.cc.

Referenced by execute(), and initialize().

string DDTECCoolAlgo::idNameSpace
private

Definition at line 42 of file DDTECCoolAlgo.cc.

Referenced by initialize().

vector<double> DDTECCoolAlgo::phiPosition
private

Definition at line 45 of file DDTECCoolAlgo.cc.

Referenced by execute(), and initialize().

double DDTECCoolAlgo::rPosition
private

Definition at line 44 of file DDTECCoolAlgo.cc.

Referenced by execute(), and initialize().

int DDTECCoolAlgo::startCopyNo
private

Definition at line 43 of file DDTECCoolAlgo.cc.

Referenced by execute(), and initialize().