CMS 3D CMS Logo

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

Constructor & Destructor Documentation

◆ DDHCalForwardAlgo()

DDHCalForwardAlgo::DDHCalForwardAlgo ( )

Definition at line 52 of file DDHCalForwardAlgo.cc.

52  : number(0), size(0), type(0) {
53 #ifdef EDM_ML_DEBUG
54  edm::LogVerbatim("HCalGeom") << "DDHCalForwardAlgo: Creating an instance";
55 #endif
56 }
Log< level::Info, true > LogVerbatim
std::vector< int > type
std::vector< int > size
std::vector< int > number

◆ ~DDHCalForwardAlgo()

DDHCalForwardAlgo::~DDHCalForwardAlgo ( )
override

Definition at line 58 of file DDHCalForwardAlgo.cc.

58 {}

Member Function Documentation

◆ execute()

void DDHCalForwardAlgo::execute ( DDCompactView cpv)
override

Definition at line 91 of file DDHCalForwardAlgo.cc.

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

91  {
92 #ifdef EDM_ML_DEBUG
93  edm::LogVerbatim("HCalGeom") << "==>> Constructing DDHCalForwardAlgo...";
94 #endif
95  DDName parentName = parent().name();
96  double ypos = startY;
97  int box = 0;
98 
99  for (unsigned int i = 0; i < number.size(); i++) {
100  double dx = cellDx * size[i];
101  int indx = type[i];
102  for (int j = 0; j < number[i]; j++) {
103  box++;
104  std::string name = parentName.name() + std::to_string(box);
106 #ifdef EDM_ML_DEBUG
107  edm::LogVerbatim("HCalGeom") << "DDHCalForwardAlgo: " << DDName(name, idNameSpace) << " Box made of " << cellMat
108  << " of Size " << dx << ", " << cellDy << ", " << cellDz;
109 #endif
111  DDMaterial matter(matname);
112  DDLogicalPart genlogic(solid.ddname(), matter, solid);
113 
114  DDTranslation r0(0.0, ypos, 0.0);
115  DDRotation rot;
116  cpv.position(solid.ddname(), parentName, box, r0, rot);
117 #ifdef EDM_ML_DEBUG
118  edm::LogVerbatim("HCalGeom") << "DDHCalForwardAlgo: " << solid.ddname() << " number " << box << " positioned in "
119  << parentName << " at " << r0 << " with " << rot;
120 #endif
122  double xpos = -dx + cellDx;
123  ypos += 2 * cellDy;
124  indx = 1 - indx;
125 
126  for (int k = 0; k < size[i]; k++) {
127  DDTranslation r1(xpos, 0.0, 0.0);
128  cpv.position(child, solid.ddname(), k + 1, r1, rot);
129 #ifdef EDM_ML_DEBUG
130  edm::LogVerbatim("HCalGeom") << "DDHCalForwardAlgo: " << child << " number " << k + 1 << " positioned in "
131  << solid.ddname() << " at " << r1 << " with " << rot;
132 #endif
133  xpos += 2 * cellDx;
134  }
135  }
136  }
137 #ifdef EDM_ML_DEBUG
138  edm::LogVerbatim("HCalGeom") << "<<== End of DDHCalForwardAlgo construction";
139 #endif
140 }
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)
DDMaterial is used to define and access material information.
Definition: DDMaterial.h:45
DDName is used to identify DDD entities uniquely.
Definition: DDName.h:17
std::string to_string(const V &value)
Definition: OMSAccess.h:71
A DDSolid represents the shape of a part.
Definition: DDSolid.h:39
Represents a uniquely identifyable rotation matrix.
Definition: DDTransform.h:57
U second(std::pair< T, U > const &p)
const std::string & name() const
Returns the name.
Definition: DDName.cc:41
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:547
std::vector< int > size
const N & ddname() const
Definition: DDBase.h:61
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
std::vector< int > number
ROOT::Math::DisplacementVector3D< ROOT::Math::Cartesian3D< double > > DDTranslation
Definition: DDTranslation.h:7

◆ initialize()

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

Definition at line 60 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.

64  {
65  cellMat = sArgs["CellMaterial"];
66  cellDx = nArgs["CellDx"];
67  cellDy = nArgs["CellDy"];
68  cellDz = nArgs["CellDz"];
69  startY = nArgs["StartY"];
70 
71  childName = vsArgs["Child"];
72  number = dbl_to_int(vArgs["Number"]);
73  size = dbl_to_int(vArgs["Size"]);
74  type = dbl_to_int(vArgs["Type"]);
75 
76 #ifdef EDM_ML_DEBUG
77  edm::LogVerbatim("HCalGeom") << "DDHCalForwardAlgo: Cell material " << cellMat << "\tCell Size " << cellDx << ", "
78  << cellDy << ", " << cellDz << "\tStarting Y " << startY << "\tChildren " << childName[0]
79  << ", " << childName[1] << "\n "
80  << " Cell positioning done for " << number.size() << " times";
81  for (unsigned int i = 0; i < number.size(); i++)
82  edm::LogVerbatim("HCalGeom") << "\t" << i << " Number of children " << size[i] << " occurence " << number[i]
83  << " first child index " << type[i];
84 #endif
86 #ifdef EDM_ML_DEBUG
87  edm::LogVerbatim("HCalGeom") << "DDHCalForwardAlgo debug: Parent " << parent().name() << " NameSpace " << idNameSpace;
88 #endif
89 }
Log< level::Info, true > LogVerbatim
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

◆ cellDx

double DDHCalForwardAlgo::cellDx
private

Definition at line 42 of file DDHCalForwardAlgo.cc.

Referenced by execute(), and initialize().

◆ cellDy

double DDHCalForwardAlgo::cellDy
private

Definition at line 42 of file DDHCalForwardAlgo.cc.

Referenced by execute(), and initialize().

◆ cellDz

double DDHCalForwardAlgo::cellDz
private

Definition at line 42 of file DDHCalForwardAlgo.cc.

Referenced by execute(), and initialize().

◆ cellMat

std::string DDHCalForwardAlgo::cellMat
private

Definition at line 41 of file DDHCalForwardAlgo.cc.

Referenced by execute(), and initialize().

◆ childName

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

Definition at line 44 of file DDHCalForwardAlgo.cc.

Referenced by execute(), and initialize().

◆ idNameSpace

std::string DDHCalForwardAlgo::idNameSpace
private

Definition at line 49 of file DDHCalForwardAlgo.cc.

Referenced by execute(), and initialize().

◆ number

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

Definition at line 45 of file DDHCalForwardAlgo.cc.

Referenced by execute(), and initialize().

◆ size

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

◆ startY

double DDHCalForwardAlgo::startY
private

Definition at line 43 of file DDHCalForwardAlgo.cc.

Referenced by execute(), and initialize().

◆ type

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