Skip to content

Commit

Permalink
Merge pull request #30593 from bsunanda/Phase2-hgx252
Browse files Browse the repository at this point in the history
Phase2-hgx252 Make the new algorithm for dd4hep
  • Loading branch information
cmsbuild authored Jul 14, 2020
2 parents 4e90f1d + 995e0f4 commit 551b0a5
Show file tree
Hide file tree
Showing 7 changed files with 1,136 additions and 12 deletions.
86 changes: 86 additions & 0 deletions Geometry/HGCalCommonData/data/dd4hep/testHGCalV14.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,86 @@
<?xml version="1.0"?>
<DDDefinition>
<open_geometry/>
<close_geometry/>

<IncludeSection>
<Include ref="Geometry/CMSCommonData/data/materials.xml"/>
<Include ref="Geometry/CMSCommonData/data/rotations.xml"/>
<Include ref="Geometry/CMSCommonData/data/extend/cmsextent.xml"/>
<Include ref="Geometry/CMSCommonData/data/cms/2026/v4/cms.xml"/>
<Include ref="Geometry/CMSCommonData/data/eta3/etaMax.xml"/>
<Include ref="Geometry/CMSCommonData/data/cmsMother.xml"/>
<Include ref="Geometry/CMSCommonData/data/caloBase/2026/v4/caloBase.xml"/>
<Include ref="Geometry/CMSCommonData/data/cmsCalo.xml"/>
<Include ref="Geometry/CMSCommonData/data/beampipe/2026/v1/beampipe.xml"/>
<Include ref="Geometry/CMSCommonData/data/cmsBeam/2026/v1/cmsBeam.xml"/>
<Include ref="Geometry/CMSCommonData/data/cavernData/2021/v1/cavernData.xml"/>
<Include ref="Geometry/CMSCommonData/data/muonBase/2026/v5/muonBase.xml"/>
<Include ref="Geometry/CMSCommonData/data/cmsMuon.xml"/>
<Include ref="Geometry/CMSCommonData/data/mgnt.xml"/>
<Include ref="Geometry/CMSCommonData/data/muonMB.xml"/>
<Include ref="Geometry/CMSCommonData/data/muonMagnet.xml"/>
<Include ref="Geometry/EcalCommonData/data/eregalgo/2026/v2/eregalgo.xml"/>
<Include ref="Geometry/EcalCommonData/data/ectkcable/2026/v1/ectkcable.xml"/>
<Include ref="Geometry/EcalCommonData/data/ectkcablemat/2026/v1/ectkcablemat.xml"/>
<Include ref="Geometry/EcalCommonData/data/ebalgo.xml"/>
<Include ref="Geometry/EcalCommonData/data/ebcon.xml"/>
<Include ref="Geometry/EcalCommonData/data/ebrot.xml"/>
<Include ref="Geometry/HcalCommonData/data/hcalrotations.xml"/>
<Include ref="Geometry/HcalCommonData/data/hcal/v2/hcalalgo.xml"/>
<Include ref="Geometry/HcalCommonData/data/hcalbarrelalgo.xml"/>
<Include ref="Geometry/HcalCommonData/data/hcalcablealgo/v2/hcalcablealgo.xml"/>
<Include ref="Geometry/HcalCommonData/data/hcalouteralgo.xml"/>
<Include ref="Geometry/HcalCommonData/data/hcalforwardalgo.xml"/>
<Include ref="Geometry/HcalCommonData/data/hcalSimNumbering/NoHE/hcalSimNumbering.xml"/>
<Include ref="Geometry/HcalCommonData/data/hcalRecNumbering/NoHE/hcalRecNumbering.xml"/>
<Include ref="Geometry/HcalCommonData/data/average/hcalforwardmaterial.xml"/>
<Include ref="Geometry/HGCalCommonData/data/hgcalMaterial/v1/hgcalMaterial.xml"/>
<Include ref="Geometry/HGCalCommonData/data/hgcal/v13/hgcal.xml"/>
<Include ref="Geometry/HGCalCommonData/data/hgcalcell/v9/hgcalcell.xml"/>
<Include ref="Geometry/HGCalCommonData/data/hgcalwafer/v9/hgcalwafer.xml"/>
<Include ref="Geometry/HGCalCommonData/data/hgcalEE/v14/hgcalEE.xml"/>
<Include ref="Geometry/HGCalCommonData/data/hgcalHEsil/v14/hgcalHEsil.xml"/>
<Include ref="Geometry/HGCalCommonData/data/hgcalHEmix/v14/hgcalHEmix.xml"/>
<Include ref="Geometry/HGCalCommonData/data/hgcalCons/v13/hgcalCons.xml"/>
<Include ref="Geometry/HGCalCommonData/data/hgcalConsData/v13/hgcalConsData.xml"/>
<Include ref="Geometry/ForwardCommonData/data/forwardshield/2017/v1/forwardshield.xml"/>
<Include ref="Geometry/MuonCommonData/data/mbCommon/2021/v1/mbCommon.xml"/>
<Include ref="Geometry/MuonCommonData/data/mb1/2015/v2/mb1.xml"/>
<Include ref="Geometry/MuonCommonData/data/mb2/2015/v2/mb2.xml"/>
<Include ref="Geometry/MuonCommonData/data/mb3/2015/v2/mb3.xml"/>
<Include ref="Geometry/MuonCommonData/data/mb4/2015/v2/mb4.xml"/>
<Include ref="Geometry/MuonCommonData/data/mb4Shield/2021/v1/mb4Shield.xml"/>
<Include ref="Geometry/MuonCommonData/data/muonYoke/2021/v3/muonYoke.xml"/>
<Include ref="Geometry/MuonCommonData/data/csc/2021/v2/csc.xml"/>
<Include ref="Geometry/MuonCommonData/data/mf/2026/v6/mf.xml"/>
<Include ref="Geometry/MuonCommonData/data/rpcf/2026/v3/rpcf.xml"/>
<Include ref="Geometry/MuonCommonData/data/gemf/TDR_BaseLine/gemf.xml"/>
<Include ref="Geometry/MuonCommonData/data/gem11/TDR_BaseLine/gem11.xml"/>
<Include ref="Geometry/MuonCommonData/data/gem21/TDR_Dev/gem21.xml"/>
<Include ref="Geometry/MuonCommonData/data/mfshield/2026/v3/mfshield.xml"/>
<Include ref="Geometry/MuonCommonData/data/me0/TDR_Dev/v3/me0.xml"/>
<Include ref="Geometry/MuonCommonData/data/muonNumbering/TDR_DeV/v1/muonNumbering.xml"/>
<Include ref="Geometry/EcalSimData/data/PhaseII/ecalsens.xml"/>
<Include ref="Geometry/HcalCommonData/data/hcalsens/NoHE/hcalsenspmf.xml"/>
<Include ref="Geometry/HcalSimData/data/hf.xml"/>
<Include ref="Geometry/HcalSimData/data/hfpmt.xml"/>
<Include ref="Geometry/HcalSimData/data/hffibrebundle.xml"/>
<Include ref="Geometry/HcalSimData/data/CaloUtil.xml"/>
<Include ref="Geometry/HGCalSimData/data/hgcsensv9.xml"/>
<Include ref="Geometry/MuonSimData/data/PhaseII/ME0EtaPart/muonSens.xml"/>
<Include ref="Geometry/DTGeometryBuilder/data/dtSpecsFilter.xml"/>
<Include ref="Geometry/CSCGeometryBuilder/data/cscSpecsFilter.xml"/>
<Include ref="Geometry/CSCGeometryBuilder/data/cscSpecs.xml"/>
<Include ref="Geometry/RPCGeometryBuilder/data/2026/v1/RPCSpecs.xml"/>
<Include ref="Geometry/GEMGeometryBuilder/data/v7/GEMSpecsFilter.xml"/>
<Include ref="Geometry/GEMGeometryBuilder/data/v7/GEMSpecs.xml"/>
<Include ref="Geometry/HcalSimData/data/HcalProdCuts.xml"/>
<Include ref="Geometry/EcalSimData/data/EcalProdCuts.xml"/>
<Include ref="Geometry/HGCalSimData/data/hgcProdCutsv9.xml"/>
<Include ref="Geometry/CMSCommonData/data/FieldParameters.xml"/>
<Include ref="Geometry/MuonSimData/data/PhaseII/muonProdCuts.xml"/>
</IncludeSection>

</DDDefinition>

14 changes: 14 additions & 0 deletions Geometry/HGCalCommonData/interface/HGCalTypes.h
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,20 @@ class HGCalTypes {
enum TileType { TileFine = 0, TileCoarseCast = 1, TileCoarseMould = 2 };

enum TileSiPMType { SiPMUnknown = 0, SiPMSmall = 2, SiPMLarge = 4 };

static int32_t packTypeUV(int type, int u, int v);
static int32_t getUnpackedType(int id);
static int32_t getUnpackedU(int id);
static int32_t getUnpackedV(int id);

private:
static constexpr int32_t facu_ = 1;
static constexpr int32_t facv_ = 100;
static constexpr int32_t factype_ = 1000000;
static constexpr int32_t signu_ = 10000;
static constexpr int32_t signv_ = 100000;
static constexpr int32_t maxuv_ = 100;
static constexpr int32_t maxsign_ = 10;
};

#endif
11 changes: 5 additions & 6 deletions Geometry/HGCalCommonData/plugins/DDHGCalEEFileAlgo.cc
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
#include "FWCore/PluginManager/interface/PluginFactory.h"
#include "Geometry/HGCalCommonData/interface/HGCalGeomTools.h"
#include "Geometry/HGCalCommonData/interface/HGCalParameters.h"
#include "Geometry/HGCalCommonData/interface/HGCalTypes.h"
#include "Geometry/HGCalCommonData/interface/HGCalWaferIndex.h"
#include "Geometry/HGCalCommonData/interface/HGCalWaferType.h"

Expand Down Expand Up @@ -355,9 +356,11 @@ void DDHGCalEEFileAlgo::positionSensitive(
<< (waferSize_ + waferSepar_);
#endif
for (int u = -N; u <= N; ++u) {
int iu = std::abs(u);
for (int v = -N; v <= N; ++v) {
#ifdef EDM_ML_DEBUG
int iu = std::abs(u);
int iv = std::abs(v);
#endif
int nr = 2 * v;
int nc = -2 * u + v;
double xpos = xyoff.first + nc * r;
Expand All @@ -373,11 +376,7 @@ void DDHGCalEEFileAlgo::positionSensitive(
#endif
int type = HGCalWaferType::getType(HGCalWaferIndex::waferIndex(layer, u, v, false), waferIndex_, waferTypes_);
if (corner.first > 0 && type >= 0) {
int copy = type * 1000000 + iv * 100 + iu;
if (u < 0)
copy += 10000;
if (v < 0)
copy += 100000;
int copy = HGCalTypes::packTypeUV(type, u, v);
#ifdef EDM_ML_DEBUG
if (iu > ium)
ium = iu;
Expand Down
11 changes: 5 additions & 6 deletions Geometry/HGCalCommonData/plugins/DDHGCalHEFileAlgo.cc
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
#include "FWCore/PluginManager/interface/PluginFactory.h"
#include "Geometry/HGCalCommonData/interface/HGCalGeomTools.h"
#include "Geometry/HGCalCommonData/interface/HGCalParameters.h"
#include "Geometry/HGCalCommonData/interface/HGCalTypes.h"
#include "Geometry/HGCalCommonData/interface/HGCalWaferIndex.h"
#include "Geometry/HGCalCommonData/interface/HGCalWaferType.h"

Expand Down Expand Up @@ -544,9 +545,11 @@ void DDHGCalHEFileAlgo::positionSensitive(
<< ":" << xyoff.second << " WaferSize " << (waferSize_ + waferSepar_);
#endif
for (int u = -N; u <= N; ++u) {
int iu = std::abs(u);
for (int v = -N; v <= N; ++v) {
#ifdef EDM_ML_DEBUG
int iu = std::abs(u);
int iv = std::abs(v);
#endif
int nr = 2 * v;
int nc = -2 * u + v;
double xpos = xyoff.first + nc * r;
Expand All @@ -557,11 +560,7 @@ void DDHGCalHEFileAlgo::positionSensitive(
#endif
int type = HGCalWaferType::getType(HGCalWaferIndex::waferIndex(layer, u, v, false), waferIndex_, waferTypes_);
if (corner.first > 0 && type >= 0) {
int copy = type * 1000000 + iv * 100 + iu;
if (u < 0)
copy += 10000;
if (v < 0)
copy += 100000;
int copy = HGCalTypes::packTypeUV(type, u, v);
#ifdef EDM_ML_DEBUG
if (iu > ium)
ium = iu;
Expand Down
Loading

0 comments on commit 551b0a5

Please sign in to comment.