CMS 3D CMS Logo

List of all members | Public Member Functions | Private Attributes
DDHCalLinearXY Class Reference
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 22 of file DDHCalLinearXY.cc.

Constructor & Destructor Documentation

◆ DDHCalLinearXY()

DDHCalLinearXY::DDHCalLinearXY ( )

Definition at line 46 of file DDHCalLinearXY.cc.

46  {
47 #ifdef EDM_ML_DEBUG
48  edm::LogVerbatim("HCalGeom") << "DDHCalLinearXY: Creating an instance";
49 #endif
50 }

◆ ~DDHCalLinearXY()

DDHCalLinearXY::~DDHCalLinearXY ( )
override

Definition at line 52 of file DDHCalLinearXY.cc.

52 {}

Member Function Documentation

◆ execute()

void DDHCalLinearXY::execute ( DDCompactView cpv)
override

Definition at line 78 of file DDHCalLinearXY.cc.

78  {
79  DDName mother = parent().name();
80  DDName child;
82  double xoff = centre[0] - (numberX - 1) * deltaX / 2.;
83  double yoff = centre[1] - (numberY - 1) * deltaY / 2.;
84  int copy = 0;
85 
86  for (int i = 0; i < numberX; i++) {
87  for (int j = 0; j < numberY; j++) {
88  DDTranslation tran(xoff + i * deltaX, yoff + j * deltaY, centre[2]);
89  bool place = true;
90  unsigned int k = copy;
91  if (childName.size() == 1)
92  k = 0;
93  if (k < childName.size() && (childName[k] != " " && childName[k] != "Null")) {
95  } else {
96  place = false;
97  }
98  copy++;
99  if (place) {
100  cpv.position(child, mother, copy, tran, rot);
101 #ifdef EDM_ML_DEBUG
102  edm::LogVerbatim("HCalGeom") << "DDHCalLinearXY: " << child << " number " << copy << " positioned in " << mother
103  << " at " << tran << " with " << rot;
104 #endif
105  } else {
106 #ifdef EDM_ML_DEBUG
107  edm::LogVerbatim("HCalGeom") << "DDHCalLinearXY: No child placed for [" << copy << "]";
108 #endif
109  }
110  }
111  }
112 }

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

◆ initialize()

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

Definition at line 54 of file DDHCalLinearXY.cc.

58  {
59  numberX = int(nArgs["NumberX"]);
60  deltaX = nArgs["DeltaX"];
61  numberY = int(nArgs["NumberY"]);
62  deltaY = nArgs["DeltaY"];
63  centre = vArgs["Center"];
64 
66  childName = vsArgs["Child"];
67 #ifdef EDM_ML_DEBUG
68  edm::LogVerbatim("HCalGeom") << "DDHCalLinearXY: Parent " << parent().name() << "\twith " << childName.size()
69  << " children";
70  for (unsigned int i = 0; i < childName.size(); ++i)
71  edm::LogVerbatim("HCalGeom") << "DDHCalLinearXY: Child[" << i << "] = " << childName[i];
72  edm::LogVerbatim("HCalGeom") << "DDHCalLinearXY: NameSpace " << idNameSpace << "\tNumber along X/Y " << numberX << "/"
73  << numberY << "\tDelta along X/Y " << deltaX << "/" << deltaY << "\tCentre " << centre[0]
74  << ", " << centre[1] << ", " << centre[2];
75 #endif
76 }

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

Member Data Documentation

◆ centre

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

Definition at line 43 of file DDHCalLinearXY.cc.

Referenced by execute(), and initialize().

◆ childName

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

Definition at line 38 of file DDHCalLinearXY.cc.

Referenced by execute(), and initialize().

◆ deltaX

double DDHCalLinearXY::deltaX
private

Definition at line 40 of file DDHCalLinearXY.cc.

Referenced by execute(), and initialize().

◆ deltaY

double DDHCalLinearXY::deltaY
private

Definition at line 42 of file DDHCalLinearXY.cc.

Referenced by execute(), and initialize().

◆ idNameSpace

std::string DDHCalLinearXY::idNameSpace
private

Definition at line 37 of file DDHCalLinearXY.cc.

Referenced by initialize().

◆ numberX

int DDHCalLinearXY::numberX
private

Definition at line 39 of file DDHCalLinearXY.cc.

Referenced by execute(), and initialize().

◆ numberY

int DDHCalLinearXY::numberY
private

Definition at line 41 of file DDHCalLinearXY.cc.

Referenced by execute(), and initialize().

mps_fire.i
i
Definition: mps_fire.py:355
filterCSVwithJSON.copy
copy
Definition: filterCSVwithJSON.py:36
DDName
DDName is used to identify DDD entities uniquely.
Definition: DDName.h:15
DDHCalLinearXY::deltaX
double deltaX
Definition: DDHCalLinearXY.cc:40
edm::second
U second(std::pair< T, U > const &p)
Definition: ParameterSet.cc:215
DDHCalLinearXY::childName
std::vector< std::string > childName
Definition: DDHCalLinearXY.cc:38
DDHCalLinearXY::centre
std::vector< double > centre
Definition: DDHCalLinearXY.cc:43
dqmdumpme.first
first
Definition: dqmdumpme.py:55
DDHCalLinearXY::numberY
int numberY
Definition: DDHCalLinearXY.cc:41
DDTranslation
ROOT::Math::DisplacementVector3D< ROOT::Math::Cartesian3D< double > > DDTranslation
Definition: DDTranslation.h:7
DDHCalLinearXY::idNameSpace
std::string idNameSpace
Definition: DDHCalLinearXY.cc:37
dqmdumpme.k
k
Definition: dqmdumpme.py:60
createfilelist.int
int
Definition: createfilelist.py:10
edm::LogVerbatim
Definition: MessageLogger.h:297
DDHCalLinearXY::numberX
int numberX
Definition: DDHCalLinearXY.cc:39
DDCurrentNamespace::ns
static std::string & ns()
Definition: DDCurrentNamespace.cc:3
makeMuonMisalignmentScenario.rot
rot
Definition: makeMuonMisalignmentScenario.py:322
DDRotation
Represents a uniquely identifyable rotation matrix.
Definition: DDTransform.h:57
class-composition.child
child
Definition: class-composition.py:91
DDHCalLinearXY::deltaY
double deltaY
Definition: DDHCalLinearXY.cc:42
dqmiolumiharvest.j
j
Definition: dqmiolumiharvest.py:66
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:66