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 16 of file DDHCalLinearXY.cc.

16  {
17 #ifdef EDM_ML_DEBUG
18  edm::LogVerbatim("HCalGeom") << "DDHCalLinearXY: Creating an instance";
19 #endif
20 }
DDHCalLinearXY::~DDHCalLinearXY ( )
override

Definition at line 22 of file DDHCalLinearXY.cc.

22 {}

Member Function Documentation

void DDHCalLinearXY::execute ( DDCompactView cpv)
override

Definition at line 52 of file DDHCalLinearXY.cc.

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

52  {
53 
54  DDName mother = parent().name();
55  DDName child;
57  double xoff = centre[0] - (numberX-1)*deltaX/2.;
58  double yoff = centre[1] - (numberY-1)*deltaY/2.;
59  int copy = 0;
60 
61  for (int i=0; i<numberX; i++) {
62  for (int j=0; j<numberY; j++) {
63 
64  DDTranslation tran(xoff+i*deltaX,yoff+j*deltaY,centre[2]);
65  bool place = true;
66  unsigned int k = copy;
67  if (childName.size() == 1) k = 0;
68  if (k < childName.size() && (childName[k] != " " &&
69  childName[k] != "Null")) {
71  } else {
72  place = false;
73  }
74  copy++;
75  if (place) {
76  cpv.position(child, mother, copy, tran, rot);
77 #ifdef EDM_ML_DEBUG
78  edm::LogVerbatim("HCalGeom") << "DDHCalLinearXY: " << child
79  << " number " << copy << " positioned in "
80  << mother << " at " << tran << " with "
81  << rot;
82 #endif
83  } else {
84 #ifdef EDM_ML_DEBUG
85  edm::LogVerbatim("HCalGeom") << "DDHCalLinearXY: No child placed for ["
86  << copy << "]";
87 #endif
88  }
89  }
90  }
91 }
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:68
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 24 of file DDHCalLinearXY.cc.

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

28  {
29 
30  numberX = int(nArgs["NumberX"]);
31  deltaX = nArgs["DeltaX"];
32  numberY = int(nArgs["NumberY"]);
33  deltaY = nArgs["DeltaY"];
34  centre = vArgs["Center"];
35 
37  childName = vsArgs["Child"];
38 #ifdef EDM_ML_DEBUG
39  edm::LogVerbatim("HCalGeom") << "DDHCalLinearXY: Parent " << parent().name()
40  << "\twith " << childName.size() << " children";
41  for (unsigned int i=0; i<childName.size(); ++i)
42  edm::LogVerbatim("HCalGeom") << "DDHCalLinearXY: Child[" << i << "] = "
43  << childName[i];
44  edm::LogVerbatim("HCalGeom") << "DDHCalLinearXY: NameSpace " << idNameSpace
45  << "\tNumber along X/Y " << numberX << "/"
46  << numberY << "\tDelta along X/Y " << deltaX
47  << "/" << deltaY << "\tCentre " << centre[0]
48  << ", " << centre[1] << ", " << centre[2];
49 #endif
50 }
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().