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 }
Log< level::Info, true > LogVerbatim

◆ ~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.

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

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 }
Log< level::Info, true > LogVerbatim
void position(const DDLogicalPart &self, const DDLogicalPart &parent, const std::string &copyno, const DDTranslation &trans, const DDRotation &rot, const DDDivision *div=nullptr)
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)
std::vector< std::string > childName
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
std::vector< double > centre

◆ 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.

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

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 }
Log< level::Info, true > LogVerbatim
static std::string & ns()
std::vector< std::string > childName
std::string idNameSpace
std::vector< double > centre

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().