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
DDHCalForwardAlgo Class Reference

#include <DDHCalForwardAlgo.h>

Inheritance diagram for DDHCalForwardAlgo:

Public Member Functions

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

Private Attributes

double cellDx
 
double cellDy
 
double cellDz
 
std::string cellMat
 
std::vector< std::string > childName
 
std::string idNameSpace
 
std::vector< int > number
 
std::vector< int > size
 
double startY
 
std::vector< int > type
 

Detailed Description

Definition at line 10 of file DDHCalForwardAlgo.h.

Constructor & Destructor Documentation

DDHCalForwardAlgo::DDHCalForwardAlgo ( )

Definition at line 19 of file DDHCalForwardAlgo.cc.

References LogDebug.

19  : number(0),size(0),type(0) {
20  LogDebug("HCalGeom") << "DDHCalForwardAlgo info: Creating an instance";
21 }
#define LogDebug(id)
std::vector< int > type
std::vector< int > size
std::vector< int > number
DDHCalForwardAlgo::~DDHCalForwardAlgo ( )
virtual

Definition at line 23 of file DDHCalForwardAlgo.cc.

23 {}

Member Function Documentation

void DDHCalForwardAlgo::execute ( DDCompactView cpv)

Definition at line 60 of file DDHCalForwardAlgo.cc.

References DDSolidFactory::box(), cellDx, cellDy, cellDz, cellMat, childName, dbl_to_string(), DDBase< N, C >::ddname(), DDSplit(), first, i, idNameSpace, j, gen::k, LogDebug, DDName::name(), mergeVDriftHistosByStation::name, number, dbtoconf::parent, DDCompactView::position(), diffTwoXMLs::r1, makeMuonMisalignmentScenario::rot, edm::second(), size, and startY.

60  {
61 
62  LogDebug("HCalGeom") << "==>> Constructing DDHCalForwardAlgo...";
63 
64  DDName parentName = parent().name();
65  double ypos = startY;
66  int box = 0;
67 
68  for (unsigned int i=0; i<number.size(); i++) {
69  double dx = cellDx*size[i];
70  int indx = type[i];
71  for (int j=0; j<number[i]; j++) {
72  box++;
73  string name = parentName.name() + dbl_to_string(box);
75  dx, cellDy, cellDz);
76  LogDebug("HCalGeom") << "DDHCalForwardAlgo test: "
77  << DDName(name, idNameSpace) << " Box made of "
78  << cellMat << " of Size " << dx << ", " << cellDy
79  << ", " << cellDz;
80 
82  DDMaterial matter(matname);
83  DDLogicalPart genlogic(solid.ddname(), matter, solid);
84 
85  DDTranslation r0(0.0, ypos, 0.0);
87  cpv.position(solid.ddname(), parentName, box, r0, rot);
88  LogDebug("HCalGeom") << "DDHCalForwardAlgo test: " << solid.ddname()
89  << " number " << box << " positioned in "
90  << parentName << " at " << r0 << " with " << rot;
91 
92  DDName child(DDSplit(childName[indx]).first,
93  DDSplit(childName[indx]).second);
94  double xpos = -dx + cellDx;
95  ypos += 2*cellDy;
96  indx = 1 - indx;
97 
98  for (int k=0; k<size[i]; k++) {
99  DDTranslation r1(xpos, 0.0, 0.0);
100  cpv.position(child, solid.ddname(), k+1, r1, rot);
101  LogDebug("HCalGeom") << "DDHCalForwardAlgo test: " << child
102  << " number " << k+1 << " positioned in "
103  << solid.ddname() << " at " << r1 << " with "
104  << rot;
105  xpos += 2*cellDx;
106  }
107  }
108  }
109  LogDebug("HCalGeom") << "<<== End of DDHCalForwardAlgo construction ...";
110 }
#define LogDebug(id)
type
Definition: HCALResponse.h:22
int i
Definition: DBlmapReader.cc:9
std::string idNameSpace
list parent
Definition: dbtoconf.py:74
DDMaterial is used to define and access material information.
Definition: DDMaterial.h:41
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
std::string dbl_to_string(const double &in)
Converts only the integer part of a double to a string.
Definition: DDutils.cc:12
A DDSolid represents the shape of a part.
Definition: DDSolid.h:35
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)
int j
Definition: DBlmapReader.cc:9
A DDLogicalPart aggregates information concerning material, solid and sensitveness ...
Definition: DDLogicalPart.h:88
bool first
Definition: L1TdeRCT.cc:94
static DDSolid box(const DDName &name, double xHalf, double yHalf, double zHalf)
Creates a box with side length 2*xHalf, 2*yHalf, 2*zHalf.
Definition: DDSolid.cc:519
int k[5][pyjets_maxn]
std::vector< int > size
std::pair< std::string, std::string > DDSplit(const std::string &n)
split into (name,namespace), separator = &#39;:&#39;
Definition: DDSplit.cc:4
std::vector< std::string > childName
std::vector< int > number
const std::string & name() const
Returns the name.
Definition: DDName.cc:87
const N & ddname() const
Definition: DDBase.h:84
void DDHCalForwardAlgo::initialize ( const DDNumericArguments nArgs,
const DDVectorArguments vArgs,
const DDMapArguments mArgs,
const DDStringArguments sArgs,
const DDStringVectorArguments vsArgs 
)

Definition at line 26 of file DDHCalForwardAlgo.cc.

References cellDx, cellDy, cellDz, cellMat, childName, dbl_to_int(), i, idNameSpace, LogDebug, DDCurrentNamespace::ns(), number, dbtoconf::parent, size, and startY.

30  {
31 
32  cellMat = sArgs["CellMaterial"];
33  cellDx = nArgs["CellDx"];
34  cellDy = nArgs["CellDy"];
35  cellDz = nArgs["CellDz"];
36  startY = nArgs["StartY"];
37 
38  childName = vsArgs["Child"];
39  number = dbl_to_int(vArgs["Number"]);
40  size = dbl_to_int(vArgs["Size"]);
41  type = dbl_to_int(vArgs["Type"]);
42 
43  LogDebug("HCalGeom") << "DDHCalForwardAlgo debug: Cell material " << cellMat
44  << "\tCell Size " << cellDx << ", " << cellDy << ", "
45  << cellDz << "\tStarting Y " << startY << "\tChildren "
46  << childName[0] << ", " << childName[1] << "\n"
47  << " Cell positioning done for "
48  << number.size() << " times";
49  for (unsigned int i = 0; i < number.size(); i++)
50  LogDebug("HCalGeom") << "\t" << i << " Number of children " << size[i]
51  << " occurence " << number[i] << " first child index "
52  << type[i];
53 
55  DDName parentName = parent().name();
56  LogDebug("HCalGeom") << "DDHCalForwardAlgo debug: Parent " << parentName
57  << " NameSpace " << idNameSpace;
58 }
#define LogDebug(id)
type
Definition: HCALResponse.h:22
int i
Definition: DBlmapReader.cc:9
std::string idNameSpace
list parent
Definition: dbtoconf.py:74
DDName is used to identify DDD entities uniquely.
Definition: DDName.h:18
static std::string & ns()
std::vector< int > dbl_to_int(const std::vector< double > &vecdbl)
Converts a std::vector of doubles to a std::vector of int.
Definition: DDutils.cc:4
std::vector< int > size
std::vector< std::string > childName
std::vector< int > number

Member Data Documentation

double DDHCalForwardAlgo::cellDx
private

Definition at line 27 of file DDHCalForwardAlgo.h.

Referenced by execute(), and initialize().

double DDHCalForwardAlgo::cellDy
private

Definition at line 27 of file DDHCalForwardAlgo.h.

Referenced by execute(), and initialize().

double DDHCalForwardAlgo::cellDz
private

Definition at line 27 of file DDHCalForwardAlgo.h.

Referenced by execute(), and initialize().

std::string DDHCalForwardAlgo::cellMat
private

Definition at line 26 of file DDHCalForwardAlgo.h.

Referenced by execute(), and initialize().

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

Definition at line 29 of file DDHCalForwardAlgo.h.

Referenced by execute(), and initialize().

std::string DDHCalForwardAlgo::idNameSpace
private

Definition at line 34 of file DDHCalForwardAlgo.h.

Referenced by execute(), and initialize().

std::vector<int> DDHCalForwardAlgo::number
private

Definition at line 30 of file DDHCalForwardAlgo.h.

Referenced by execute(), and initialize().

std::vector<int> DDHCalForwardAlgo::size
private

Definition at line 31 of file DDHCalForwardAlgo.h.

Referenced by execute(), and initialize().

double DDHCalForwardAlgo::startY
private

Definition at line 28 of file DDHCalForwardAlgo.h.

Referenced by execute(), and initialize().

std::vector<int> DDHCalForwardAlgo::type
private