CMS 3D CMS Logo

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) override
 
void initialize (const DDNumericArguments &nArgs, const DDVectorArguments &vArgs, const DDMapArguments &mArgs, const DDStringArguments &sArgs, const DDStringVectorArguments &vsArgs) override
 
 ~DDHCalForwardAlgo () override
 

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 20 of file DDHCalForwardAlgo.cc.

20  : number(0),size(0),type(0) {
21 #ifdef EDM_ML_DEBUG
22  edm::LogVerbatim("HCalGeom") << "DDHCalForwardAlgo: Creating an instance";
23 #endif
24 }
std::vector< int > type
std::vector< int > size
std::vector< int > number
DDHCalForwardAlgo::~DDHCalForwardAlgo ( )
override

Definition at line 26 of file DDHCalForwardAlgo.cc.

26 {}

Member Function Documentation

void DDHCalForwardAlgo::execute ( DDCompactView cpv)
override

Definition at line 66 of file DDHCalForwardAlgo.cc.

References DDSolidFactory::box(), cellDx, cellDy, cellDz, cellMat, class-composition::child, childName, DDBase< N, C >::ddname(), DDSplit(), PVValHelper::dx, plotBeamSpotDB::first, mps_fire::i, idNameSpace, gen::k, DDName::name(), dataset::name, number, class-composition::parent, DDCompactView::position(), diffTwoXMLs::r1, makeMuonMisalignmentScenario::rot, edm::second(), size, startY, and AlCaHLTBitMon_QueryRunRegistry::string.

66  {
67 
68 #ifdef EDM_ML_DEBUG
69  edm::LogVerbatim("HCalGeom") << "==>> Constructing DDHCalForwardAlgo...";
70 #endif
71  DDName parentName = parent().name();
72  double ypos = startY;
73  int box = 0;
74 
75  for (unsigned int i=0; i<number.size(); i++) {
76  double dx = cellDx*size[i];
77  int indx = type[i];
78  for (int j=0; j<number[i]; j++) {
79  box++;
80  std::string name = parentName.name() + std::to_string(box);
82  dx, cellDy, cellDz);
83 #ifdef EDM_ML_DEBUG
84  edm::LogVerbatim("HCalGeom") << "DDHCalForwardAlgo: "
85  << DDName(name, idNameSpace)
86  << " Box made of " << cellMat << " of Size "
87  << dx << ", " << cellDy << ", " << cellDz;
88 #endif
90  DDMaterial matter(matname);
91  DDLogicalPart genlogic(solid.ddname(), matter, solid);
92 
93  DDTranslation r0(0.0, ypos, 0.0);
95  cpv.position(solid.ddname(), parentName, box, r0, rot);
96 #ifdef EDM_ML_DEBUG
97  edm::LogVerbatim("HCalGeom") << "DDHCalForwardAlgo: " << solid.ddname()
98  << " number " << box << " positioned in "
99  << parentName << " at " << r0 << " with "
100  << rot;
101 #endif
102  DDName child(DDSplit(childName[indx]).first,
103  DDSplit(childName[indx]).second);
104  double xpos = -dx + cellDx;
105  ypos += 2*cellDy;
106  indx = 1 - indx;
107 
108  for (int k=0; k<size[i]; k++) {
109  DDTranslation r1(xpos, 0.0, 0.0);
110  cpv.position(child, solid.ddname(), k+1, r1, rot);
111 #ifdef EDM_ML_DEBUG
112  edm::LogVerbatim("HCalGeom") << "DDHCalForwardAlgo: " << child
113  << " number " << k+1 << " positioned in "
114  << solid.ddname() << " at " << r1
115  << " with " << rot;
116 #endif
117  xpos += 2*cellDx;
118  }
119  }
120  }
121 #ifdef EDM_ML_DEBUG
122  edm::LogVerbatim("HCalGeom") << "<<== End of DDHCalForwardAlgo construction";
123 #endif
124 }
type
Definition: HCALResponse.h:21
std::string idNameSpace
DDMaterial is used to define and access material information.
Definition: DDMaterial.h:43
DDName is used to identify DDD entities uniquely.
Definition: DDName.h:15
A DDSolid represents the shape of a part.
Definition: DDSolid.h:39
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)
A DDLogicalPart aggregates information concerning material, solid and sensitveness ...
Definition: DDLogicalPart.h:93
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:704
int k[5][pyjets_maxn]
std::vector< int > size
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< std::string > childName
std::vector< int > number
const std::string & name() const
Returns the name.
Definition: DDName.cc:53
const N & ddname() const
Definition: DDBase.h:76
void DDHCalForwardAlgo::initialize ( const DDNumericArguments nArgs,
const DDVectorArguments vArgs,
const DDMapArguments mArgs,
const DDStringArguments sArgs,
const DDStringVectorArguments vsArgs 
)
override

Definition at line 28 of file DDHCalForwardAlgo.cc.

References cellDx, cellDy, cellDz, cellMat, childName, dbl_to_int(), mps_fire::i, idNameSpace, DDCurrentNamespace::ns(), number, class-composition::parent, size, and startY.

32  {
33 
34  cellMat = sArgs["CellMaterial"];
35  cellDx = nArgs["CellDx"];
36  cellDy = nArgs["CellDy"];
37  cellDz = nArgs["CellDz"];
38  startY = nArgs["StartY"];
39 
40  childName = vsArgs["Child"];
41  number = dbl_to_int(vArgs["Number"]);
42  size = dbl_to_int(vArgs["Size"]);
43  type = dbl_to_int(vArgs["Type"]);
44 
45 #ifdef EDM_ML_DEBUG
46  edm::LogVerbatim("HCalGeom") << "DDHCalForwardAlgo: Cell material "
47  << cellMat << "\tCell Size " << cellDx << ", "
48  << cellDy << ", " << cellDz << "\tStarting Y "
49  << startY << "\tChildren " << childName[0]
50  << ", " << childName[1] << "\n "
51  << " Cell positioning done for "
52  << number.size() << " times";
53  for (unsigned int i = 0; i < number.size(); i++)
54  edm::LogVerbatim("HCalGeom") << "\t" << i << " Number of children "
55  << size[i] << " occurence " << number[i]
56  << " first child index " << type[i];
57 #endif
59 #ifdef EDM_ML_DEBUG
60  edm::LogVerbatim("HCalGeom") << "DDHCalForwardAlgo debug: Parent "
61  << parent().name() << " NameSpace "
62  << idNameSpace;
63 #endif
64 }
type
Definition: HCALResponse.h:21
std::string idNameSpace
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.h:7
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
double DDHCalForwardAlgo::startY
private

Definition at line 28 of file DDHCalForwardAlgo.h.

Referenced by execute(), and initialize().

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