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 }

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

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 }

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, and AlCaHLTBitMon_QueryRunRegistry::string.

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

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 }

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

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
DDHCalForwardAlgo::idNameSpace
std::string idNameSpace
Definition: DDHCalForwardAlgo.cc:49
mps_fire.i
i
Definition: mps_fire.py:428
DDName
DDName is used to identify DDD entities uniquely.
Definition: DDName.h:15
edm::second
U second(std::pair< T, U > const &p)
Definition: ParameterSet.cc:222
DDMaterial
DDMaterial is used to define and access material information.
Definition: DDMaterial.h:45
DDTranslation
ROOT::Math::DisplacementVector3D< ROOT::Math::Cartesian3D< double > > DDTranslation
Definition: DDTranslation.h:7
DDHCalForwardAlgo::cellDz
double cellDz
Definition: DDHCalForwardAlgo.cc:42
DDHCalForwardAlgo::cellMat
std::string cellMat
Definition: DDHCalForwardAlgo.cc:41
dqmdumpme.k
k
Definition: dqmdumpme.py:60
first
auto first
Definition: CAHitNtupletGeneratorKernelsImpl.h:112
DDHCalForwardAlgo::type
std::vector< int > type
Definition: DDHCalForwardAlgo.cc:47
AlCaHLTBitMon_QueryRunRegistry.string
string
Definition: AlCaHLTBitMon_QueryRunRegistry.py:256
DDHCalForwardAlgo::cellDy
double cellDy
Definition: DDHCalForwardAlgo.cc:42
DDBase::ddname
const N & ddname() const
Definition: DDBase.h:61
type
type
Definition: SiPixelVCal_PayloadInspector.cc:37
DDLogicalPart
A DDLogicalPart aggregates information concerning material, solid and sensitveness ....
Definition: DDLogicalPart.h:93
DDName::name
const std::string & name() const
Returns the name.
Definition: DDName.cc:41
submitPVValidationJobs.child
child
Definition: submitPVValidationJobs.py:119
diffTwoXMLs.r1
r1
Definition: diffTwoXMLs.py:53
edm::LogVerbatim
Log< level::Info, true > LogVerbatim
Definition: MessageLogger.h:128
DDHCalForwardAlgo::size
std::vector< int > size
Definition: DDHCalForwardAlgo.cc:46
DDCurrentNamespace::ns
static std::string & ns()
Definition: DDCurrentNamespace.cc:3
DDHCalForwardAlgo::childName
std::vector< std::string > childName
Definition: DDHCalForwardAlgo.cc:44
makeMuonMisalignmentScenario.rot
rot
Definition: makeMuonMisalignmentScenario.py:322
Skims_PA_cff.name
name
Definition: Skims_PA_cff.py:17
DDSolid
A DDSolid represents the shape of a part.
Definition: DDSolid.h:39
DDRotation
Represents a uniquely identifyable rotation matrix.
Definition: DDTransform.h:57
DDHCalForwardAlgo::cellDx
double cellDx
Definition: DDHCalForwardAlgo.cc:42
dbl_to_int
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
dqmiolumiharvest.j
j
Definition: dqmiolumiharvest.py:66
DDSolidFactory::box
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:533
child
Definition: simpleInheritance.h:11
edm::Log
Definition: MessageLogger.h:70
class-composition.parent
parent
Definition: class-composition.py:88
PVValHelper::dx
Definition: PVValidationHelpers.h:49
DDHCalForwardAlgo::startY
double startY
Definition: DDHCalForwardAlgo.cc:43
DDSplit
std::pair< std::string, std::string > DDSplit(const std::string &n)
split into (name,namespace), separator = ':'
Definition: DDSplit.cc:3
DDHCalForwardAlgo::number
std::vector< int > number
Definition: DDHCalForwardAlgo.cc:45
DDCompactView::position
void position(const DDLogicalPart &self, const DDLogicalPart &parent, const std::string &copyno, const DDTranslation &trans, const DDRotation &rot, const DDDivision *div=nullptr)
Definition: DDCompactView.cc:76