CMS 3D CMS Logo

List of all members | Public Member Functions | Private Attributes
DDTECCoolAlgo Class Reference

#include <DDTECCoolAlgo.h>

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

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

Detailed Description

Definition at line 10 of file DDTECCoolAlgo.h.

Constructor & Destructor Documentation

DDTECCoolAlgo::DDTECCoolAlgo ( )

Definition at line 21 of file DDTECCoolAlgo.cc.

References LogDebug.

21  : phiPosition(0),coolInsert(0) {
22  LogDebug("TECGeom") << "DDTECCoolAlgo info: Creating an instance";
23 }
#define LogDebug(id)
std::vector< std::string > coolInsert
Definition: DDTECCoolAlgo.h:29
std::vector< double > phiPosition
Definition: DDTECCoolAlgo.h:28
DDTECCoolAlgo::~DDTECCoolAlgo ( )
override

Definition at line 25 of file DDTECCoolAlgo.cc.

25 {}

Member Function Documentation

void DDTECCoolAlgo::execute ( DDCompactView cpv)
override

Definition at line 54 of file DDTECCoolAlgo.cc.

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

54  {
55  LogDebug("TECGeom") << "==>> Constructing DDTECCoolAlgo...";
56  int copyNo = startCopyNo;
57  // loop over the inserts to be placed
58  for (int i = 0; i < (int)(coolInsert.size()); i++) {
59  // get objects
61  DDSplit(coolInsert.at(i)).second);
62  DDName mother = parent().name();
63  // get positions
64  double xpos = rPosition*cos(phiPosition.at(i));
65  double ypos = -rPosition*sin(phiPosition.at(i));
66  // place inserts
67  DDTranslation tran(xpos, ypos, 0.0);
69  cpv.position(child, mother, copyNo, tran, rotation);
70  LogDebug("TECGeom") << "DDTECCoolAlgo test " << child << "["
71  << copyNo << "] positioned in " << mother
72  << " at " << tran << " with " << rotation
73  << " phi " << phiPosition.at(i)/CLHEP::deg << " r "
74  << rPosition;
75  copyNo++;
76  }
77  LogDebug("TECGeom") << "<<== End of DDTECCoolAlgo construction ...";
78 }
#define LogDebug(id)
Sin< T >::type sin(const T &t)
Definition: Sin.h:22
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:67
U second(std::pair< T, U > const &p)
std::vector< std::string > coolInsert
Definition: DDTECCoolAlgo.h:29
Cos< T >::type cos(const T &t)
Definition: Cos.h:22
void position(const DDLogicalPart &self, const DDLogicalPart &parent, const std::string &copyno, const DDTranslation &trans, const DDRotation &rot, const DDDivision *div=0)
double rPosition
Definition: DDTECCoolAlgo.h:27
std::vector< double > phiPosition
Definition: DDTECCoolAlgo.h:28
std::pair< std::string, std::string > DDSplit(const std::string &n)
split into (name,namespace), separator = &#39;:&#39;
Definition: DDSplit.cc:3
void DDTECCoolAlgo::initialize ( const DDNumericArguments nArgs,
const DDVectorArguments vArgs,
const DDMapArguments mArgs,
const DDStringArguments sArgs,
const DDStringVectorArguments vsArgs 
)
override

Definition at line 27 of file DDTECCoolAlgo.cc.

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

31  {
32 
34  startCopyNo = int(nArgs["StartCopyNo"]);
35 
36  DDName parentName = parent().name();
37  rPosition = nArgs["RPosition"];
38  LogDebug("TECGeom") << "DDTECCoolAlgo debug: Parent " << parentName
39  <<" NameSpace " << idNameSpace << " at radial Position "
40  << rPosition ;
41  phiPosition = vArgs["PhiPosition"];
42  coolInsert = vsArgs["CoolInsert"];
43  if (phiPosition.size() == coolInsert.size()) {
44  for (int i=0; i<(int)(phiPosition.size()); i++)
45  LogDebug("TECGeom") << "DDTECCoolAlgo debug: Insert[" << i << "]: "
46  << coolInsert.at(i) << " at Phi "
47  << phiPosition.at(i)/CLHEP::deg;
48  } else {
49  LogDebug("TECGeom") << "ERROR: Number of inserts does not match the numer of PhiPositions!";
50  }
51  LogDebug("TECGeom") << " Done creating instance of DDTECCoolAlgo ";
52 }
#define LogDebug(id)
DDName is used to identify DDD entities uniquely.
Definition: DDName.h:15
static std::string & ns()
std::vector< std::string > coolInsert
Definition: DDTECCoolAlgo.h:29
std::string idNameSpace
Definition: DDTECCoolAlgo.h:25
double rPosition
Definition: DDTECCoolAlgo.h:27
std::vector< double > phiPosition
Definition: DDTECCoolAlgo.h:28

Member Data Documentation

std::vector<std::string> DDTECCoolAlgo::coolInsert
private

Definition at line 29 of file DDTECCoolAlgo.h.

Referenced by execute(), and initialize().

std::string DDTECCoolAlgo::idNameSpace
private

Definition at line 25 of file DDTECCoolAlgo.h.

Referenced by initialize().

std::vector<double> DDTECCoolAlgo::phiPosition
private

Definition at line 28 of file DDTECCoolAlgo.h.

Referenced by execute(), and initialize().

double DDTECCoolAlgo::rPosition
private

Definition at line 27 of file DDTECCoolAlgo.h.

Referenced by execute(), and initialize().

int DDTECCoolAlgo::startCopyNo
private

Definition at line 26 of file DDTECCoolAlgo.h.

Referenced by execute(), and initialize().