Skip to content

Commit 6a454b3

Browse files
authored
Merge pull request #47519 from bsunanda/Phase2-hgx362
Phase2-hgx362 First attempt to make V19 version of HGCal Geometry
2 parents 116a9c8 + f43f688 commit 6a454b3

File tree

8 files changed

+300
-683
lines changed

8 files changed

+300
-683
lines changed

Fireworks/Geometry/plugins/TGeoMgrFromDdd.cc

Lines changed: 21 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,7 @@
4545

4646
#include <CLHEP/Units/SystemOfUnits.h>
4747
#include <cmath>
48+
#include <sstream>
4849

4950
using CLHEP::cm;
5051
using CLHEP::deg;
@@ -173,7 +174,9 @@ TGeoMgrFromDdd::ReturnType TGeoMgrFromDdd::produce(const DisplayGeomRecord& iRec
173174
auto info = walker.current();
174175

175176
if (m_verbose) {
176-
edm::LogVerbatim("TGeoMgrFromDdd") << "parentStack of size " << parentStack.size();
177+
edm::LogVerbatim("TGeoMgrFromDdd") << "parentStack of size " << parentStack.size() << " info " << &info
178+
<< " first " << &(info.first) << " second " << info.second << " Name "
179+
<< info.first.name();
177180
auto num = (info.second != nullptr) ? info.second->copyno() : 0;
178181
edm::LogVerbatim("TGeoMgrFromDdd") << info.first.name() << " " << num << " "
179182
<< DDSolidShapesName::name(info.first.solid().shape());
@@ -237,8 +240,9 @@ TGeoMgrFromDdd::ReturnType TGeoMgrFromDdd::produce(const DisplayGeomRecord& iRec
237240
//==============================================================================
238241

239242
TGeoShape* TGeoMgrFromDdd::createShape(const std::string& iName, const DDSolid& iSolid) {
240-
edm::LogVerbatim("TGeoMgrFromDdd") << "createShape with name: " << iName
241-
<< " and solid: " << iSolid.name().fullname();
243+
if (m_verbose)
244+
edm::LogVerbatim("TGeoMgrFromDdd") << "createShape with name: " << iName
245+
<< " and solid: " << iSolid.name().fullname();
242246

243247
DDBase<DDName, DDI::Solid*>::def_type defined(iSolid.isDefined());
244248
if (!defined.first)
@@ -249,6 +253,12 @@ TGeoShape* TGeoMgrFromDdd::createShape(const std::string& iName, const DDSolid&
249253
TGeoShape* rSolid = nameToShape_[iName];
250254
if (rSolid == nullptr) {
251255
const std::vector<double>& params = iSolid.parameters();
256+
if (m_verbose) {
257+
std::ostringstream st1;
258+
for (const double& par : params)
259+
st1 << " : " << par;
260+
edm::LogVerbatim("TGeoMgrFromDdd") << params.size() << " Parameters" << st1.str();
261+
}
252262
switch (iSolid.shape()) {
253263
case DDSolidShape::ddbox:
254264
rSolid = new TGeoBBox(iName.c_str(), params[0] / cm, params[1] / cm, params[2] / cm);
@@ -587,15 +597,17 @@ TGeoShape* TGeoMgrFromDdd::createShape(const std::string& iName, const DDSolid&
587597
edm::LogError("TGeoMgrFromDdd") << "COULD NOT MAKE " << iName << " of a shape " << iSolid;
588598
}
589599

590-
edm::LogVerbatim("TGeoMgrFromDdd") << "solid " << iName << " has been created.";
600+
if (m_verbose)
601+
edm::LogVerbatim("TGeoMgrFromDdd") << "solid " << iName << " has been created.";
591602

592603
return rSolid;
593604
}
594605

595606
TGeoVolume* TGeoMgrFromDdd::createVolume(const std::string& iName, const DDSolid& iSolid, const DDMaterial& iMaterial) {
596-
edm::LogVerbatim("TGeoMgrFromDdd") << "createVolume with name: " << iName
597-
<< " and solid: " << iSolid.name().fullname() << " and material "
598-
<< iMaterial.name().fullname();
607+
if (m_verbose)
608+
edm::LogVerbatim("TGeoMgrFromDdd") << "createVolume with name: " << iName
609+
<< " and solid: " << iSolid.name().fullname() << " and material "
610+
<< iMaterial.name().fullname();
599611
TGeoVolume* v = nameToVolume_[iName];
600612
if (v == nullptr) {
601613
TGeoShape* solid =
@@ -617,7 +629,8 @@ TGeoVolume* TGeoMgrFromDdd::createVolume(const std::string& iName, const DDSolid
617629

618630
TGeoMaterial* TGeoMgrFromDdd::createMaterial(const DDMaterial& iMaterial) {
619631
std::string mat_name = m_fullname ? iMaterial.name().fullname() : iMaterial.name().name();
620-
edm::LogVerbatim("TGeoMgrFromDdd") << "createMaterial with name: " << mat_name;
632+
if (m_verbose)
633+
edm::LogVerbatim("TGeoMgrFromDdd") << "createMaterial with name: " << mat_name;
621634
TGeoMaterial* mat = nameToMaterial_[mat_name];
622635

623636
if (mat == nullptr) {

Geometry/HGCalCommonData/data/hgcalEE/v19/hgcalEE.xml

Lines changed: 118 additions & 79 deletions
Large diffs are not rendered by default.

Geometry/HGCalCommonData/data/hgcalHEmix/v19/hgcalHEmix.xml

Lines changed: 3 additions & 255 deletions
Large diffs are not rendered by default.

Geometry/HGCalCommonData/data/hgcalHEsil/v19/hgcalHEsil.xml

Lines changed: 3 additions & 255 deletions
Large diffs are not rendered by default.

Geometry/HGCalCommonData/data/hgcalPassive/v19/hgcalPassive.xml

Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,11 @@
11
<?xml version="1.0"?>
22
<DDDefinition>
33

4+
<ConstantsSection label="hgcalPassive.xml" eval="true">i
5+
<Constant name="WaferSize" value="[hgcal:WaferSize]"/>
6+
<Constant name="SensorSeparation" value="[hgcal:SensorSeparation]"/>
7+
</ConstantsSection>
8+
49
<PosPartSection label="hgcalPassive.xml" eval="true">
510
<Algorithm name="hgcal:DDHGCalPassive">
611
<rParent name="hgcalPassive:HGCalEEPassive"/>
@@ -467,6 +472,44 @@
467472
-94.48*mm, -46.08*mm, -94.48*mm, -46.08*mm, -94.48*mm,
468473
-80.46*mm, 84.40*mm </Vector>
469474
</Algorithm>
475+
<Algorithm name="hgcal:DDHGCalPassiveFull">
476+
<rParent name="hgcalPassive:HGCalHEPassive"/>
477+
<String name="ModuleMaterial" value="materials:StainlessSteel"/>
478+
<Numeric name="ModuleThickness" value="2.50*mm"/>
479+
<Numeric name="WaferSize" value="[WaferSize]"/>
480+
<Numeric name="SensorSeparation" value="[SensorSeparation]"/>
481+
<Vector name="LayerNames" type="string" nEntries="1">
482+
StainlessSteel</Vector>
483+
<Vector name="LayerMaterials" type="string" nEntries="1">
484+
materials:StainlessSteel</Vector>
485+
<Vector name="LayerThickness" type="numeric" nEntries="1">
486+
2.50*mm</Vector>
487+
<Vector name="LayerType" type="numeric" nEntries="0">
488+
</Vector>
489+
</Algorithm>
490+
<Algorithm name="hgcal:DDHGCalPassivePartial">
491+
<rParent name="hgcalPassive:HGCalHEPassive"/>
492+
<String name="ModuleMaterial" value="materials:StainlessSteel"/>
493+
<Numeric name="ModuleThickness" value="2.50*mm"/>
494+
<Numeric name="WaferSize" value="[WaferSize]"/>
495+
<Numeric name="SensorSeparation" value="[SensorSeparation]"/>
496+
<Vector name="Tags" type="string" nEntries="11">
497+
HD1, HD2, HD3, HD4, HD5, LD1, LD2, LD3, LD4, LD5, LD6</Vector>
498+
<Vector name="PartialTypes" type="numeric" nEntries="11">
499+
21, 22, 23, 24, 25, 11, 12, 13, 14, 15, 16</Vector>
500+
<Vector name="PlacementIndex" type="numeric" nEntries="12">
501+
0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11</Vector>
502+
<Vector name="PlacementIndexTags" type="string" nEntries="12">
503+
00, 01, 02, 03, 04, 05, 06, 07, 08, 09, 10, 11</Vector>
504+
<Vector name="LayerNames" type="string" nEntries="1">
505+
StainlessSteel</Vector>
506+
<Vector name="LayerMaterials" type="string" nEntries="1">
507+
materials:StainlessSteel</Vector>
508+
<Vector name="LayerThickness" type="numeric" nEntries="1">
509+
2.50*mm</Vector>
510+
<Vector name="LayerType" type="numeric" nEntries="0">
511+
</Vector>
512+
</Algorithm>
470513
</PosPartSection>
471514

472515
</DDDefinition>

Geometry/HGCalCommonData/plugins/DDHGCalMixRotatedFineCassette.cc

Lines changed: 18 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -216,6 +216,10 @@ void DDHGCalMixRotatedFineCassette::initialize(const DDNumericArguments& nArgs,
216216
#endif
217217
passiveFull_ = vsArgs["PassiveNamesFull"];
218218
passivePart_ = vsArgs["PassiveNamesPartial"];
219+
if (passiveFull_.size() <= 1)
220+
passiveFull_.clear();
221+
if (passivePart_.size() <= 1)
222+
passivePart_.clear();
219223
#ifdef EDM_ML_DEBUG
220224
edm::LogVerbatim("HGCalGeom") << "DDHGCalSiliconRotatedCassette: " << passiveFull_.size() << " full and "
221225
<< passivePart_.size() << " partial passive modules";
@@ -448,7 +452,7 @@ void DDHGCalMixRotatedFineCassette::constructLayers(const DDLogicalPart& module,
448452
DDName matName(DDSplit(materials_[ii]).first, DDSplit(materials_[ii]).second);
449453
DDMaterial matter(matName);
450454
DDLogicalPart glog;
451-
if (layerSense_[ly] == 0) {
455+
if (layerSense_[ly] <= 0) {
452456
std::vector<double> pgonZ, pgonRin, pgonRout;
453457
double rmax =
454458
(std::min(routF, HGCalGeomTools::radius(zz + hthick, zFrontT_, rMaxFront_, slopeT_)) * cosAlpha_) - tol1_;
@@ -480,11 +484,21 @@ void DDHGCalMixRotatedFineCassette::constructLayers(const DDLogicalPart& module,
480484
<< convertRadToDeg(-alpha_ + 2._pi) << " with " << pgonZ.size() << " sections";
481485
for (unsigned int k = 0; k < pgonZ.size(); ++k)
482486
edm::LogVerbatim("HGCalGeom") << "[" << k << "] z " << pgonZ[k] << " R " << pgonRin[k] << ":" << pgonRout[k];
487+
edm::LogVerbatim("HGCalGeom") << "LayeerSense " << layerSense_[ly];
483488
#endif
489+
if (layerSense_[ly] < 0) {
490+
int absType = -layerSense_[ly];
491+
unsigned int num = (absType <= waferTypes_) ? passiveFull_.size() : passivePart_.size();
492+
#ifdef EDM_ML_DEBUG
493+
edm::LogVerbatim("HGCalGeom") << "Abstype " << absType << " num " << num;
494+
#endif
495+
if (num > 1)
496+
positionMix(glog, name, copy, thick_[ii], matter, absType, fine, cpv);
497+
}
484498
} else {
485-
int mode = (layerSense_[ly] > 0) ? sensitiveMode_ : absorbMode_;
486-
double rins = (mode < 1) ? rinB : HGCalGeomTools::radius(zz + hthick, zFrontB_, rMinFront_, slopeB_);
487-
double routs = (mode < 1) ? routF : HGCalGeomTools::radius(zz - hthick, zFrontT_, rMaxFront_, slopeT_);
499+
double rins = (sensitiveMode_ < 1) ? rinB : HGCalGeomTools::radius(zz + hthick, zFrontB_, rMinFront_, slopeB_);
500+
double routs =
501+
(sensitiveMode_ < 1) ? routF : HGCalGeomTools::radius(zz - hthick, zFrontT_, rMaxFront_, slopeT_);
488502
DDSolid solid = DDSolidFactory::tubs(DDName(name, nameSpace_), hthick, rins, routs, 0.0, 2._pi);
489503
glog = DDLogicalPart(solid.ddname(), matter, solid);
490504
#ifdef EDM_ML_DEBUG

0 commit comments

Comments
 (0)