Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Phase2-hgx288 Read all parameters needed for V16 geometry of HGCal #34340

Merged
merged 2 commits into from
Jul 7, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
91 changes: 91 additions & 0 deletions Geometry/HGCalCommonData/data/dd4hep/testHGCalV16.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,91 @@
<?xml version="1.0"?>
<DDDefinition>
<open_geometry/>
<close_geometry/>

<IncludeSection>
<Include ref="Geometry/CMSCommonData/data/materials/2021/v1/materials.xml"/>
<Include ref="Geometry/CMSCommonData/data/rotations.xml"/>
<Include ref="Geometry/CMSCommonData/data/extend/v2/cmsextent.xml"/>
<Include ref="Geometry/CMSCommonData/data/cavernData/2021/v1/cavernData.xml"/>
<Include ref="Geometry/CMSCommonData/data/cms/2026/v5/cms.xml"/>
<Include ref="Geometry/CMSCommonData/data/cmsMother.xml"/>
<Include ref="Geometry/CMSCommonData/data/eta3/etaMax.xml"/>
<Include ref="Geometry/CMSCommonData/data/caloBase/2026/v6/caloBase.xml"/>
<Include ref="Geometry/CMSCommonData/data/cmsCalo.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/beampipe/2026/v3/beampipe.xml"/>
<Include ref="Geometry/CMSCommonData/data/cmsBeam/2026/v1/cmsBeam.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/2021/v1/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/v2/hgcalMaterial.xml"/>
<Include ref="Geometry/HGCalCommonData/data/hgcal/v16/hgcal.xml"/>
<Include ref="Geometry/HGCalCommonData/data/hgcalcell/v16/hgcalcell.xml"/>
<Include ref="Geometry/HGCalCommonData/data/hgcalwafer/v16/hgcalwafer.xml"/>
<Include ref="Geometry/HGCalCommonData/data/hgcalEE/v16/hgcalEE.xml"/>
<Include ref="Geometry/HGCalCommonData/data/hgcalHEsil/v16/hgcalHEsil.xml"/>
<Include ref="Geometry/HGCalCommonData/data/hgcalHEmix/v16/hgcalHEmix.xml"/>
<Include ref="Geometry/HGCalCommonData/data/hgcalCons/v16/hgcalCons.xml"/>
<Include ref="Geometry/HGCalCommonData/data/hgcalConsData/v16/hgcalConsData.xml"/>
<Include ref="Geometry/ForwardCommonData/data/forwardshield/2026/v4/forwardshield.xml"/>
<Include ref="Geometry/ForwardCommonData/data/brmrotations.xml"/>
<Include ref="Geometry/ForwardCommonData/data/brm/2026/v1/brm.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/2026/v1/muonYoke.xml"/>
<Include ref="Geometry/MuonCommonData/data/mf/2026/v8/mf.xml"/>
<Include ref="Geometry/MuonCommonData/data/csc/2021/v2/csc.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_Eta16/gem21.xml"/>
<Include ref="Geometry/MuonCommonData/data/mfshield/2026/v6/mfshield.xml"/>
<Include ref="Geometry/MuonCommonData/data/ge0/TDR_Dev/v4/ge0.xml"/>
<Include ref="Geometry/MuonCommonData/data/ge0shield/2026/v1/ge0shield.xml"/>
<Include ref="Geometry/MuonCommonData/data/muonNumbering/TDR_DeV/v3/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/hgcsensv15.xml"/>
<Include ref="Geometry/MuonSimData/data/PhaseII/v2/muonSens.xml"/>
<Include ref="Geometry/ForwardCommonData/data/brmsens.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/v12/GEMSpecsFilter.xml"/>
<Include ref="Geometry/GEMGeometryBuilder/data/v12/GEMSpecs.xml"/>
<Include ref="Geometry/HcalSimData/data/HcalProdCuts.xml"/>
<Include ref="Geometry/EcalSimData/data/EcalProdCuts.xml"/>
<Include ref="Geometry/HGCalSimData/data/hgcProdCutsv15.xml"/>
<Include ref="Geometry/MuonSimData/data/PhaseII/muonProdCuts.xml"/>
<Include ref="Geometry/ForwardSimData/data/ForwardShieldProdCuts.xml"/>
<Include ref="Geometry/CMSCommonData/data/FieldParameters.xml"/>
</IncludeSection>

</DDDefinition>

7 changes: 4 additions & 3 deletions Geometry/HGCalCommonData/data/hgcalCons/v16/hgcalCons.xml
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,10 @@
[hgcal:zHGCalEE1], [hgcal:zHGCalHEsil1], [hgcal:zHGCalHEmix1],
[hgcal:zHGCalHEmix6]</Vector>
<Vector name="LayerCenter" type="numeric" nEntries="47">
0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1,
0, 1, 0, 1, 0, 1, 0, 4, 0, 4, 0, 4, 0, 2, 3, 2, 3, 2, 3, 2,
3, 2, 3, 2, 3, 2, 3
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0,
0, 6, 0, 6, 0, 6, 0,
2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1
</Vector>
</ConstantsSection>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@
<Vector name="Layers" type="numeric" nEntries="7">
6, 5, 5, 5, 5, 5, 5</Vector>
<Vector name="LayerThick" type="numeric" nEntries="7">
67.80*mm, 63.05*mm, 63.05*mm, 63.05*mm, 63.05*mm, 63.05*mm, 63.05*mm,
67.80*mm, 63.05*mm, 63.05*mm, 63.05*mm, 63.05*mm, 63.05*mm, 63.05*mm
</Vector>
<Vector name="LayerType" type="numeric" nEntries="36">
0, 2, 3, 4, 6, 5,
Expand Down
1 change: 1 addition & 0 deletions Geometry/HGCalCommonData/interface/HGCalDDDConstants.h
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,7 @@ class HGCalDDDConstants {
std::vector<HGCalParameters::hgtrform> getTrForms() const;
int getTypeTrap(int layer) const;
int getTypeHex(int layer, int waferU, int waferV) const;
std::pair<double, double> getXY(int layer, double x, double y, bool forwd) const;
int getUVMax(int type) const { return ((type == 0) ? hgpar_->nCellsFine_ : hgpar_->nCellsCoarse_); }
bool isHalfCell(int waferType, int cell) const;
bool isValidHex(int lay, int mod, int cell, bool reco) const;
Expand Down
3 changes: 1 addition & 2 deletions Geometry/HGCalCommonData/interface/HGCalParameters.h
Original file line number Diff line number Diff line change
Expand Up @@ -182,8 +182,7 @@ class HGCalParameters {
int waferMaskMode_;
int waferZSide_;
waferInfo_map waferInfoMap_;
std::vector<std::pair<double, double> > layerRotF_;
std::vector<std::pair<double, double> > layerRotB_;
std::vector<std::pair<double, double> > layerRotV_;
tileInfo_map tileInfoMap_;
std::vector<std::pair<double, double> > tileRingR_;
std::vector<std::pair<int, int> > tileRingRange_;
Expand Down
12 changes: 9 additions & 3 deletions Geometry/HGCalCommonData/interface/HGCalTypes.h
Original file line number Diff line number Diff line change
Expand Up @@ -46,9 +46,15 @@ class HGCalTypes {
WaferCenterR = 6
};

enum WaferType { WaferFineThin = 0, WaferCoarseThin = 1, WaferCoarseThick = 2, WaferFineThick = 3 };
enum WaferType {
WaferTypeUndefined = -1,
WaferFineThin = 0,
WaferCoarseThin = 1,
WaferCoarseThick = 2,
WaferFineThick = 3
};

enum WaferSizeType {
enum WaferPartialType {
WaferFull = 0,
WaferFive = 1,
WaferChopTwo = 2,
Expand Down Expand Up @@ -78,7 +84,7 @@ class HGCalTypes {
WaferCenteredBack = 1,
CornerCenteredY = 2,
CornerCenteredLambda = 3,
WaferCenteredRotated = 0
WaferCenteredRotated = 4
};

static constexpr int32_t WaferCornerMin = 3;
Expand Down
15 changes: 15 additions & 0 deletions Geometry/HGCalCommonData/src/HGCalDDDConstants.cc
Original file line number Diff line number Diff line change
Expand Up @@ -435,6 +435,21 @@ int HGCalDDDConstants::getTypeHex(int layer, int waferU, int waferV) const {
}
}

std::pair<double, double> HGCalDDDConstants::getXY(int layer, double x, double y, bool forwd) const {
int ll = layer - hgpar_->firstLayer_;
double x0(x), y0(y);
if (ll < static_cast<int>(hgpar_->layerRotV_.size())) {
if (forwd) {
x0 = x * hgpar_->layerRotV_[ll].first + y * hgpar_->layerRotV_[ll].second;
y0 = y * hgpar_->layerRotV_[ll].first - x * hgpar_->layerRotV_[ll].second;
} else {
x0 = x * hgpar_->layerRotV_[ll].first - y * hgpar_->layerRotV_[ll].second;
y0 = y * hgpar_->layerRotV_[ll].first + x * hgpar_->layerRotV_[ll].second;
}
}
return std::make_pair(x0, y0);
}

bool HGCalDDDConstants::isHalfCell(int waferType, int cell) const {
if (waferType < 1 || cell < 0)
return false;
Expand Down
17 changes: 13 additions & 4 deletions Geometry/HGCalCommonData/src/HGCalGeomParameters.cc
Original file line number Diff line number Diff line change
Expand Up @@ -1302,9 +1302,9 @@ void HGCalGeomParameters::loadSpecParsHexagon8(const DDFilteredView& fv, HGCalPa
}
if (php.mode_ == HGCalGeometryMode::Hexagon8Module) {
if (php.waferMaskMode_ == siliconFileEE) {
layerType = dbl_to_int(fv.vector("LayerTypeEE"));
layerType = dbl_to_int(fv.vector("LayerTypesEE"));
} else if (php.waferMaskMode_ == siliconFileHE) {
layerType = dbl_to_int(fv.vector("LayerTypeHE"));
layerType = dbl_to_int(fv.vector("LayerTypesHE"));
}
}

Expand Down Expand Up @@ -1403,14 +1403,14 @@ void HGCalGeomParameters::loadSpecParsHexagon8(const cms::DDFilteredView& fv,
if (php.mode_ == HGCalGeometryMode::Hexagon8Module) {
if (php.waferMaskMode_ == siliconFileEE) {
for (auto const& it : vmap) {
if (dd4hep::dd::compareEqual(dd4hep::dd::noNamespace(it.first), "LayerTypeEE")) {
if (dd4hep::dd::compareEqual(dd4hep::dd::noNamespace(it.first), "LayerTypesEE")) {
for (const auto& i : it.second)
layerType.emplace_back(std::round(i));
}
}
} else if (php.waferMaskMode_ == siliconFileHE) {
for (auto const& it : vmap) {
if (dd4hep::dd::compareEqual(dd4hep::dd::noNamespace(it.first), "LayerTypeHE")) {
if (dd4hep::dd::compareEqual(dd4hep::dd::noNamespace(it.first), "LayerTypesHE")) {
for (const auto& i : it.second)
layerType.emplace_back(std::round(i));
}
Expand Down Expand Up @@ -1472,6 +1472,15 @@ void HGCalGeomParameters::loadSpecParsHexagon8(HGCalParameters& php,
php.layerType_.emplace_back(types[layerType[k]]);
#ifdef EDM_ML_DEBUG
edm::LogVerbatim("HGCalGeom") << "Layer[" << k << "] Type " << layerType[k] << ":" << php.layerType_[k];
#endif
}
for (unsigned int k = 0; k < php.layerType_.size(); ++k) {
double cth = (php.layerType_[k] == HGCalTypes::WaferCenterR) ? cos(php.layerRotation_) : 1.0;
double sth = (php.layerType_[k] == HGCalTypes::WaferCenterR) ? sin(php.layerRotation_) : 0.0;
php.layerRotV_.emplace_back(std::make_pair(cth, sth));
#ifdef EDM_ML_DEBUG
edm::LogVerbatim("HGCalGeom") << "Layer[" << k << "] Type " << php.layerType_[k] << " cos|sin(Theta) "
<< php.layerRotV_[k].first << ":" << php.layerRotV_[k].second;
#endif
}
for (unsigned int k = 0; k < waferIndex.size(); ++k) {
Expand Down
4 changes: 4 additions & 0 deletions Geometry/HGCalCommonData/test/HGCalParameterTester.cc
Original file line number Diff line number Diff line change
Expand Up @@ -130,6 +130,7 @@ void HGCalParameterTester::analyze(const edm::Event& iEvent, const edm::EventSet
std::cout << "DetectorType: " << phgp->detectorType_ << "\n";
std::cout << "Wafer Parameters: " << phgp->waferSize_ << ":" << phgp->waferR_ << ":" << phgp->waferThick_ << ":"
<< phgp->sensorSeparation_ << ":" << phgp->mouseBite_ << "\n";
myPrint("waferThickness", phgp->waferThickness_, 10);
std::cout << "nCells_: " << phgp->nCellsFine_ << ":" << phgp->nCellsCoarse_ << "\n";
std::cout << "nSectors_: " << phgp->nSectors_ << "\n";
std::cout << "FirstLayer: " << phgp->firstLayer_ << "\n";
Expand All @@ -147,6 +148,9 @@ void HGCalParameterTester::analyze(const edm::Event& iEvent, const edm::EventSet
myPrint("CellSize", phgp->cellSize_, 10);
myPrint("radiusMixBoundary", phgp->radiusMixBoundary_, 10);
myPrint("LayerCenter", phgp->layerCenter_, 20);
std::cout << "Layer Rotation " << phgp->layerRotation_ << " with " << phgp->layerRotV_.size() << " parameters\n";
for (unsigned int k = 0; k < phgp->layerRotV_.size(); ++k)
std::cout << "Element[" << k << "] " << phgp->layerRotV_[k].first << ":" << phgp->layerRotV_[k].second << "\n";
myPrint("slopeMin", phgp->slopeMin_, 10);
myPrint("zFrontMin", phgp->zFrontMin_, 10);
myPrint("rMinFront", phgp->rMinFront_, 10);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
process.MessageLogger.HGCalGeom=dict()

process.DDDetectorESProducer = cms.ESSource("DDDetectorESProducer",
confGeomXMLFiles = cms.FileInPath('Geometry/HGCalCommonData/data/dd4hep/testHGCalV15.xml'),
confGeomXMLFiles = cms.FileInPath('Geometry/HGCalCommonData/data/dd4hep/testHGCalV16.xml'),
appendToDataLabel = cms.string('')
)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

process = cms.Process("HGCalParametersTest",Phase2C11)
process.load("SimGeneral.HepPDTESSource.pdt_cfi")
process.load("Geometry.HGCalCommonData.testHGCalV15XML_cfi")
process.load("Geometry.HGCalCommonData.testHGCalV16XML_cfi")
process.load("Geometry.HGCalCommonData.hgcalV15ParametersInitialization_cfi")
process.load('FWCore.MessageService.MessageLogger_cfi')

Expand Down