CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
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)
 
void initialize (const DDNumericArguments &nArgs, const DDVectorArguments &vArgs, const DDMapArguments &mArgs, const DDStringArguments &sArgs, const DDStringVectorArguments &vsArgs)
 
virtual ~DDHCalLinearXY ()
 

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

Definition at line 19 of file DDHCalLinearXY.cc.

19 {}

Member Function Documentation

void DDHCalLinearXY::execute ( DDCompactView cpv)

Definition at line 48 of file DDHCalLinearXY.cc.

References centre, childName, filterCSVwithJSON::copy, DDSplit(), deltaX, deltaY, first, i, j, gen::k, LogDebug, numberX, numberY, dbtoconf::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)
int i
Definition: DBlmapReader.cc:9
list parent
Definition: dbtoconf.py:74
void position(const DDLogicalPart &self, const DDLogicalPart &parent, std::string copyno, const DDTranslation &trans, const DDRotation &rot, const DDDivision *div=NULL)
DDName is used to identify DDD entities uniquely.
Definition: DDName.h:18
ROOT::Math::DisplacementVector3D< ROOT::Math::Cartesian3D< double > > DDTranslation
Definition: DDTranslation.h:7
Represents a uniquely identifyable rotation matrix.
Definition: DDTransform.h:66
U second(std::pair< T, U > const &p)
std::vector< std::string > childName
int j
Definition: DBlmapReader.cc:9
bool first
Definition: L1TdeRCT.cc:94
int k[5][pyjets_maxn]
std::pair< std::string, std::string > DDSplit(const std::string &n)
split into (name,namespace), separator = &#39;:&#39;
Definition: DDSplit.cc:4
std::vector< double > centre
void DDHCalLinearXY::initialize ( const DDNumericArguments nArgs,
const DDVectorArguments vArgs,
const DDMapArguments mArgs,
const DDStringArguments sArgs,
const DDStringVectorArguments vsArgs 
)

Definition at line 21 of file DDHCalLinearXY.cc.

References centre, childName, deltaX, deltaY, i, idNameSpace, LogDebug, DDCurrentNamespace::ns(), numberX, numberY, and dbtoconf::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)
int i
Definition: DBlmapReader.cc:9
list parent
Definition: dbtoconf.py:74
DDName is used to identify DDD entities uniquely.
Definition: DDName.h:18
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().