CMS 3D CMS Logo

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

#include <DDHCalLinearXY.h>

Inheritance diagram for DDHCalLinearXY:

Public Member Functions

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

Private Attributes

std::vector< double > centre
 
std::vector< std::string > childName
 
double deltaX
 
double deltaY
 
std::string idNameSpace
 
int numberX
 
int numberY
 

Detailed Description

Definition at line 10 of file DDHCalLinearXY.h.

Constructor & Destructor Documentation

DDHCalLinearXY::DDHCalLinearXY ( )

Definition at line 15 of file DDHCalLinearXY.cc.

References LogDebug.

15  {
16  LogDebug("HCalGeom") <<"DDHCalLinearXY info: Creating an instance";
17 }
#define LogDebug(id)
DDHCalLinearXY::~DDHCalLinearXY ( )
override

Definition at line 19 of file DDHCalLinearXY.cc.

19 {}

Member Function Documentation

void DDHCalLinearXY::execute ( DDCompactView cpv)
override

Definition at line 48 of file DDHCalLinearXY.cc.

References centre, class-composition::child, childName, popcon2dropbox::copy(), DDSplit(), deltaX, deltaY, plotBeamSpotDB::first, mps_fire::i, gen::k, LogDebug, numberX, numberY, class-composition::parent, DDCompactView::position(), makeMuonMisalignmentScenario::rot, and edm::second().

48  {
49 
50  DDName mother = parent().name();
51  DDName child;
53  double xoff = centre[0] - (numberX-1)*deltaX/2.;
54  double yoff = centre[1] - (numberY-1)*deltaY/2.;
55  int copy = 0;
56 
57  for (int i=0; i<numberX; i++) {
58  for (int j=0; j<numberY; j++) {
59 
60  DDTranslation tran(xoff+i*deltaX,yoff+j*deltaY,centre[2]);
61  bool place = true;
62  unsigned int k = copy;
63  if (childName.size() == 1) k = 0;
64  if (k < childName.size() && (childName[k] != " " && childName[k] != "Null")) {
66  } else {
67  place = false;
68  }
69  copy++;
70  if (place) {
71  cpv.position(child, mother, copy, tran, rot);
72  LogDebug("HCalGeom") << "DDHCalLinearXY test: " << child
73  << " number " << copy << " positioned in "
74  << mother << " at " << tran << " with " << rot;
75  } else {
76  LogDebug("HCalGeom") << "DDHCalLinearXY test: No child placed for ["
77  << copy << "]";
78  }
79  }
80  }
81 }
#define LogDebug(id)
def copy(args, dbName)
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 > childName
int k[5][pyjets_maxn]
void position(const DDLogicalPart &self, const DDLogicalPart &parent, const std::string &copyno, const DDTranslation &trans, const DDRotation &rot, const DDDivision *div=0)
std::pair< std::string, std::string > DDSplit(const std::string &n)
split into (name,namespace), separator = &#39;:&#39;
Definition: DDSplit.cc:3
std::vector< double > centre
void DDHCalLinearXY::initialize ( const DDNumericArguments nArgs,
const DDVectorArguments vArgs,
const DDMapArguments mArgs,
const DDStringArguments sArgs,
const DDStringVectorArguments vsArgs 
)
override

Definition at line 21 of file DDHCalLinearXY.cc.

References centre, childName, deltaX, deltaY, mps_fire::i, idNameSpace, createfilelist::int, LogDebug, DDCurrentNamespace::ns(), numberX, numberY, and class-composition::parent.

25  {
26 
27  numberX = int(nArgs["NumberX"]);
28  deltaX = nArgs["DeltaX"];
29  numberY = int(nArgs["NumberY"]);
30  deltaY = nArgs["DeltaY"];
31  centre = vArgs["Center"];
32 
34  childName = vsArgs["Child"];
35  DDName parentName = parent().name();
36  LogDebug("HCalGeom") << "DDHCalLinearXY debug: Parent " << parentName
37  << "\twith " << childName.size() << " children";
38  for (unsigned int i=0; i<childName.size(); ++i)
39  LogDebug("HCalGeom") << "DDHCalLinearXY debug: Child[" << i << "] = "
40  << childName[i];
41  LogDebug("HCalGeom") << "DDHCalLinearXY debug: NameSpace "
42  << idNameSpace << "\tNumber along X/Y " << numberX
43  << "/" << numberY << "\tDelta along X/Y " << deltaX
44  << "/" << deltaY << "\tCentre " << centre[0] << ", "
45  << centre[1] << ", " << centre[2];
46 }
#define LogDebug(id)
DDName is used to identify DDD entities uniquely.
Definition: DDName.h:15
static std::string & ns()
std::vector< std::string > childName
std::string idNameSpace
std::vector< double > centre

Member Data Documentation

std::vector<double> DDHCalLinearXY::centre
private

Definition at line 33 of file DDHCalLinearXY.h.

Referenced by execute(), and initialize().

std::vector<std::string> DDHCalLinearXY::childName
private

Definition at line 28 of file DDHCalLinearXY.h.

Referenced by execute(), and initialize().

double DDHCalLinearXY::deltaX
private

Definition at line 30 of file DDHCalLinearXY.h.

Referenced by execute(), and initialize().

double DDHCalLinearXY::deltaY
private

Definition at line 32 of file DDHCalLinearXY.h.

Referenced by execute(), and initialize().

std::string DDHCalLinearXY::idNameSpace
private

Definition at line 27 of file DDHCalLinearXY.h.

Referenced by initialize().

int DDHCalLinearXY::numberX
private

Definition at line 29 of file DDHCalLinearXY.h.

Referenced by execute(), and initialize().

int DDHCalLinearXY::numberY
private

Definition at line 31 of file DDHCalLinearXY.h.

Referenced by execute(), and initialize().