From 7b42a2ee8c479cdcb5b9e00c2d47f3f1442edde4 Mon Sep 17 00:00:00 2001 From: Sunanda Date: Thu, 8 Jul 2021 14:57:39 +0200 Subject: [PATCH 1/2] Make V16 ready for the SIM step --- .../python/testHGCV15XML_cfi.py | 24 ++++++ .../python/testHGCV16XML_cfi.py | 28 ++++++- .../python/testHGCalV14XML_cfi.py | 12 +-- .../python/testHGCalV15XML_cfi.py | 2 +- .../python/testHGCalV16XML_cfi.py | 4 +- .../HGCalCommonData/src/HGCalDDDConstants.cc | 19 +++-- .../Calo/interface/HGCalNumberingScheme.h | 2 +- SimG4CMS/Calo/src/HGCalNumberingScheme.cc | 21 ++--- SimG4CMS/Calo/test/python/runHGC1_cfg.py | 55 ++++--------- SimG4CMS/Calo/test/python/runHGC2_cfg.py | 11 ++- SimG4CMS/Calo/test/python/runHGC3_cfg.py | 6 +- SimG4CMS/Calo/test/python/runHGC4_cfg.py | 8 +- SimG4CMS/Calo/test/python/runHGC5_cfg.py | 9 ++- SimG4CMS/Calo/test/python/runHGC6_cfg.py | 81 +++++++++++++++++++ 14 files changed, 199 insertions(+), 83 deletions(-) create mode 100644 SimG4CMS/Calo/test/python/runHGC6_cfg.py diff --git a/Geometry/HGCalCommonData/python/testHGCV15XML_cfi.py b/Geometry/HGCalCommonData/python/testHGCV15XML_cfi.py index 05c0fcc3aa5ac..66b90b7c8f22c 100644 --- a/Geometry/HGCalCommonData/python/testHGCV15XML_cfi.py +++ b/Geometry/HGCalCommonData/python/testHGCV15XML_cfi.py @@ -45,6 +45,22 @@ 'Geometry/ForwardCommonData/data/forwardshield/2026/v4/forwardshield.xml', 'Geometry/ForwardCommonData/data/brmrotations.xml', 'Geometry/ForwardCommonData/data/brm/2026/v1/brm.xml', + 'Geometry/MuonCommonData/data/mbCommon/2021/v1/mbCommon.xml', + 'Geometry/MuonCommonData/data/mb1/2015/v2/mb1.xml', + 'Geometry/MuonCommonData/data/mb2/2015/v2/mb2.xml', + 'Geometry/MuonCommonData/data/mb3/2015/v2/mb3.xml', + 'Geometry/MuonCommonData/data/mb4/2015/v2/mb4.xml', + 'Geometry/MuonCommonData/data/mb4Shield/2021/v1/mb4Shield.xml', + 'Geometry/MuonCommonData/data/muonYoke/2026/v1/muonYoke.xml', + 'Geometry/MuonCommonData/data/mf/2026/v7/mf.xml', + 'Geometry/MuonCommonData/data/csc/2021/v2/csc.xml', + 'Geometry/MuonCommonData/data/rpcf/2026/v3/rpcf.xml', + 'Geometry/MuonCommonData/data/gemf/TDR_BaseLine/gemf.xml', + 'Geometry/MuonCommonData/data/gem11/TDR_BaseLine/gem11.xml', + 'Geometry/MuonCommonData/data/gem21/TDR_Eta16/gem21.xml', + 'Geometry/MuonCommonData/data/mfshield/2026/v5/mfshield.xml', + 'Geometry/MuonCommonData/data/ge0/TDR_Dev/v3/ge0.xml', + 'Geometry/MuonCommonData/data/muonNumbering/TDR_DeV/v5/muonNumbering.xml', 'Geometry/EcalSimData/data/PhaseII/ecalsens.xml', 'Geometry/HcalCommonData/data/hcalsens/NoHE/hcalsenspmf.xml', 'Geometry/HcalSimData/data/hf.xml', @@ -52,9 +68,17 @@ 'Geometry/HcalSimData/data/hffibrebundle.xml', 'Geometry/HcalSimData/data/CaloUtil.xml', 'Geometry/HGCalSimData/data/hgcsensv15.xml', + 'Geometry/MuonSimData/data/PhaseII/v2/muonSens.xml', + 'Geometry/DTGeometryBuilder/data/dtSpecsFilter.xml', + 'Geometry/CSCGeometryBuilder/data/cscSpecsFilter.xml', + 'Geometry/CSCGeometryBuilder/data/cscSpecs.xml', + 'Geometry/RPCGeometryBuilder/data/2026/v1/RPCSpecs.xml', + 'Geometry/GEMGeometryBuilder/data/v12/GEMSpecsFilter.xml', + 'Geometry/GEMGeometryBuilder/data/v12/GEMSpecs.xml', 'Geometry/HcalSimData/data/HcalProdCuts.xml', 'Geometry/EcalSimData/data/EcalProdCuts.xml', 'Geometry/HGCalSimData/data/hgcProdCutsv15.xml', + 'Geometry/MuonSimData/data/PhaseII/muonProdCuts.xml', 'Geometry/CMSCommonData/data/FieldParameters.xml' ), rootNodeName = cms.string('cms:OCMS') diff --git a/Geometry/HGCalCommonData/python/testHGCV16XML_cfi.py b/Geometry/HGCalCommonData/python/testHGCV16XML_cfi.py index 69a7258ec31ca..d1f90da7fa951 100644 --- a/Geometry/HGCalCommonData/python/testHGCV16XML_cfi.py +++ b/Geometry/HGCalCommonData/python/testHGCV16XML_cfi.py @@ -33,19 +33,45 @@ 'Geometry/HcalCommonData/data/hcalSimNumbering/NoHE/hcalSimNumbering.xml', 'Geometry/HcalCommonData/data/hcalRecNumbering/NoHE/hcalRecNumbering.xml', 'Geometry/HcalCommonData/data/average/hcalforwardmaterial.xml', - 'Geometry/HGCalCommonData/data/hgcalMaterial/v1/hgcalMaterial.xml', + 'Geometry/HGCalCommonData/data/hgcalMaterial/v2/hgcalMaterial.xml', 'Geometry/HGCalCommonData/data/hgcal/v16/hgcal.xml', 'Geometry/ForwardCommonData/data/forwardshield/2026/v4/forwardshield.xml', 'Geometry/ForwardCommonData/data/brmrotations.xml', 'Geometry/ForwardCommonData/data/brm/2026/v1/brm.xml', + 'Geometry/MuonCommonData/data/mbCommon/2021/v1/mbCommon.xml', + 'Geometry/MuonCommonData/data/mb1/2015/v2/mb1.xml', + 'Geometry/MuonCommonData/data/mb2/2015/v2/mb2.xml', + 'Geometry/MuonCommonData/data/mb3/2015/v2/mb3.xml', + 'Geometry/MuonCommonData/data/mb4/2015/v2/mb4.xml', + 'Geometry/MuonCommonData/data/mb4Shield/2021/v1/mb4Shield.xml', + 'Geometry/MuonCommonData/data/muonYoke/2026/v1/muonYoke.xml', + 'Geometry/MuonCommonData/data/mf/2026/v7/mf.xml', + 'Geometry/MuonCommonData/data/csc/2021/v2/csc.xml', + 'Geometry/MuonCommonData/data/rpcf/2026/v3/rpcf.xml', + 'Geometry/MuonCommonData/data/gemf/TDR_BaseLine/gemf.xml', + 'Geometry/MuonCommonData/data/gem11/TDR_BaseLine/gem11.xml', + 'Geometry/MuonCommonData/data/gem21/TDR_Eta16/gem21.xml', + 'Geometry/MuonCommonData/data/mfshield/2026/v5/mfshield.xml', + 'Geometry/MuonCommonData/data/ge0/TDR_Dev/v3/ge0.xml', + 'Geometry/MuonCommonData/data/muonNumbering/TDR_DeV/v5/muonNumbering.xml', 'Geometry/EcalSimData/data/PhaseII/ecalsens.xml', 'Geometry/HcalCommonData/data/hcalsens/NoHE/hcalsenspmf.xml', + 'Geometry/EcalSimData/data/PhaseII/ecalsens.xml', + 'Geometry/HcalCommonData/data/hcalsens/NoHE/hcalsenspmf.xml', + 'Geometry/MuonSimData/data/PhaseII/v2/muonSens.xml', + 'Geometry/DTGeometryBuilder/data/dtSpecsFilter.xml', + 'Geometry/CSCGeometryBuilder/data/cscSpecsFilter.xml', + 'Geometry/CSCGeometryBuilder/data/cscSpecs.xml', + 'Geometry/RPCGeometryBuilder/data/2026/v1/RPCSpecs.xml', + 'Geometry/GEMGeometryBuilder/data/v12/GEMSpecsFilter.xml', + 'Geometry/GEMGeometryBuilder/data/v12/GEMSpecs.xml', 'Geometry/HcalSimData/data/hf.xml', 'Geometry/HcalSimData/data/hfpmt.xml', 'Geometry/HcalSimData/data/hffibrebundle.xml', 'Geometry/HcalSimData/data/CaloUtil.xml', 'Geometry/HcalSimData/data/HcalProdCuts.xml', 'Geometry/EcalSimData/data/EcalProdCuts.xml', + 'Geometry/MuonSimData/data/PhaseII/muonProdCuts.xml', 'Geometry/CMSCommonData/data/FieldParameters.xml' ), rootNodeName = cms.string('cms:OCMS') diff --git a/Geometry/HGCalCommonData/python/testHGCalV14XML_cfi.py b/Geometry/HGCalCommonData/python/testHGCalV14XML_cfi.py index 9d441ed2f9f42..047646f5f5488 100644 --- a/Geometry/HGCalCommonData/python/testHGCalV14XML_cfi.py +++ b/Geometry/HGCalCommonData/python/testHGCalV14XML_cfi.py @@ -52,15 +52,15 @@ 'Geometry/MuonCommonData/data/mb4/2015/v2/mb4.xml', 'Geometry/MuonCommonData/data/mb4Shield/2021/v1/mb4Shield.xml', 'Geometry/MuonCommonData/data/muonYoke/2026/v1/muonYoke.xml', + 'Geometry/MuonCommonData/data/mf/2026/v7/mf.xml', 'Geometry/MuonCommonData/data/csc/2021/v2/csc.xml', - 'Geometry/MuonCommonData/data/mf/2026/v6/mf.xml', 'Geometry/MuonCommonData/data/rpcf/2026/v3/rpcf.xml', 'Geometry/MuonCommonData/data/gemf/TDR_BaseLine/gemf.xml', 'Geometry/MuonCommonData/data/gem11/TDR_BaseLine/gem11.xml', - 'Geometry/MuonCommonData/data/gem21/TDR_Dev/gem21.xml', - 'Geometry/MuonCommonData/data/mfshield/2026/v4/mfshield.xml', - 'Geometry/MuonCommonData/data/me0/TDR_Dev/v3/me0.xml', - 'Geometry/MuonCommonData/data/muonNumbering/TDR_DeV/v1/muonNumbering.xml', + 'Geometry/MuonCommonData/data/gem21/TDR_Eta16/gem21.xml', + 'Geometry/MuonCommonData/data/mfshield/2026/v5/mfshield.xml', + 'Geometry/MuonCommonData/data/ge0/TDR_Dev/v3/ge0.xml', + 'Geometry/MuonCommonData/data/muonNumbering/TDR_DeV/v5/muonNumbering.xml', 'Geometry/EcalSimData/data/PhaseII/ecalsens.xml', 'Geometry/HcalCommonData/data/hcalsens/NoHE/hcalsenspmf.xml', 'Geometry/HcalSimData/data/hf.xml', @@ -68,7 +68,7 @@ 'Geometry/HcalSimData/data/hffibrebundle.xml', 'Geometry/HcalSimData/data/CaloUtil.xml', 'Geometry/HGCalSimData/data/hgcsensv9.xml', - 'Geometry/MuonSimData/data/PhaseII/ME0EtaPart/muonSens.xml', + 'Geometry/MuonSimData/data/PhaseII/v2/muonSens.xml', 'Geometry/DTGeometryBuilder/data/dtSpecsFilter.xml', 'Geometry/CSCGeometryBuilder/data/cscSpecsFilter.xml', 'Geometry/CSCGeometryBuilder/data/cscSpecs.xml', diff --git a/Geometry/HGCalCommonData/python/testHGCalV15XML_cfi.py b/Geometry/HGCalCommonData/python/testHGCalV15XML_cfi.py index a09ec61fc48eb..1c747c6fe8072 100644 --- a/Geometry/HGCalCommonData/python/testHGCalV15XML_cfi.py +++ b/Geometry/HGCalCommonData/python/testHGCalV15XML_cfi.py @@ -60,7 +60,7 @@ 'Geometry/MuonCommonData/data/gem21/TDR_Eta16/gem21.xml', 'Geometry/MuonCommonData/data/mfshield/2026/v5/mfshield.xml', 'Geometry/MuonCommonData/data/ge0/TDR_Dev/v3/ge0.xml', - 'Geometry/MuonCommonData/data/muonNumbering/TDR_DeV/v3/muonNumbering.xml', + 'Geometry/MuonCommonData/data/muonNumbering/TDR_DeV/v5/muonNumbering.xml', 'Geometry/EcalSimData/data/PhaseII/ecalsens.xml', 'Geometry/HcalCommonData/data/hcalsens/NoHE/hcalsenspmf.xml', 'Geometry/HcalSimData/data/hf.xml', diff --git a/Geometry/HGCalCommonData/python/testHGCalV16XML_cfi.py b/Geometry/HGCalCommonData/python/testHGCalV16XML_cfi.py index cadfce9532d5c..53d1c40fc665b 100644 --- a/Geometry/HGCalCommonData/python/testHGCalV16XML_cfi.py +++ b/Geometry/HGCalCommonData/python/testHGCalV16XML_cfi.py @@ -61,14 +61,14 @@ 'Geometry/MuonCommonData/data/mfshield/2026/v6/mfshield.xml', 'Geometry/MuonCommonData/data/ge0/TDR_Dev/v4/ge0.xml', 'Geometry/MuonCommonData/data/ge0shield/2026/v1/ge0shield.xml', - 'Geometry/MuonCommonData/data/muonNumbering/TDR_DeV/v3/muonNumbering.xml', + 'Geometry/MuonCommonData/data/muonNumbering/TDR_DeV/v5/muonNumbering.xml', 'Geometry/EcalSimData/data/PhaseII/ecalsens.xml', 'Geometry/HcalCommonData/data/hcalsens/NoHE/hcalsenspmf.xml', + 'Geometry/HGCalSimData/data/hgcsensv15.xml', 'Geometry/HcalSimData/data/hf.xml', 'Geometry/HcalSimData/data/hfpmt.xml', 'Geometry/HcalSimData/data/hffibrebundle.xml', 'Geometry/HcalSimData/data/CaloUtil.xml', - 'Geometry/HGCalSimData/data/hgcsensv15.xml', 'Geometry/MuonSimData/data/PhaseII/v2/muonSens.xml', 'Geometry/ForwardCommonData/data/brmsens.xml', 'Geometry/DTGeometryBuilder/data/dtSpecsFilter.xml', diff --git a/Geometry/HGCalCommonData/src/HGCalDDDConstants.cc b/Geometry/HGCalCommonData/src/HGCalDDDConstants.cc index 3c7247b22749b..ccd6d573a0c65 100644 --- a/Geometry/HGCalCommonData/src/HGCalDDDConstants.cc +++ b/Geometry/HGCalCommonData/src/HGCalDDDConstants.cc @@ -134,8 +134,9 @@ std::pair HGCalDDDConstants::assignCell(float x, float y, int lay, int return std::make_pair(-1, -1); } else { // Now the cell - xx -= hgpar_->waferPosX_[wafer]; - yy -= hgpar_->waferPosY_[wafer]; + std::pair xy = getXY(lay, xx, yy, false); + xx = xy.first - hgpar_->waferPosX_[wafer]; + yy = xy.second - hgpar_->waferPosY_[wafer]; if (hgpar_->waferTypeT_[wafer] == 1) return std::make_pair(wafer, cellHex(xx, @@ -620,7 +621,7 @@ std::pair HGCalDDDConstants::locateCell(int cell, int lay, int typ y *= HGCalParameters::k_ScaleToDDD; } } - return std::make_pair(x, y); + return getXY(lay, x, y, true); } std::pair HGCalDDDConstants::locateCell( @@ -672,7 +673,7 @@ std::pair HGCalDDDConstants::locateCell( edm::LogVerbatim("HGCalGeom") << "With wafer " << x << ":" << y << ":" << xy.first << ":" << xy.second; #endif } - return std::make_pair(x, y); + return getXY(lay, x, y, true); } std::pair HGCalDDDConstants::locateCell(const HGCSiliconDetId& id, bool debug) const { @@ -696,7 +697,8 @@ std::pair HGCalDDDConstants::locateCell(const HGCSiliconDetId& id, edm::LogVerbatim("HGCalGeom") << "LocateCell r1:R1 " << r1 << ":" << R1 << " dx:dy " << ((1.5 * (id.cellV() - ncells) + 1.0) * R1) << ":" << ((id.cellU() - 0.5 * id.cellV() - n2) * 2 * r1) << " Pos " << xpos << ":" << ypos; - return std::make_pair(xpos * id.zside(), ypos); + std::pair xy = getXY(id.layer(), xpos, ypos, true); + return std::make_pair(xy.first * id.zside(), xy.second); } std::pair HGCalDDDConstants::locateCell(const HGCScintillatorDetId& id, bool debug) const { @@ -1088,7 +1090,7 @@ void HGCalDDDConstants::waferFromPosition(const double x, const double y, int& w // Input x, y in Geant4 unit and transformed to CMSSW standard double xx = HGCalParameters::k_ScaleFromDDD * x; double yy = HGCalParameters::k_ScaleFromDDD * y; - int size_ = (int)(hgpar_->waferCopy_.size()); + int size_ = static_cast(hgpar_->waferCopy_.size()); wafer = size_; for (int k = 0; k < size_; ++k) { double dx = std::abs(xx - hgpar_->waferPosX_[k]); @@ -1141,8 +1143,9 @@ void HGCalDDDConstants::waferFromPosition(const double x, if ((hgpar_->xLayerHex_.empty()) || (hgpar_->yLayerHex_.empty())) return; int ll = layer - hgpar_->firstLayer_; - double xx = HGCalParameters::k_ScaleFromDDD * x - hgpar_->xLayerHex_[ll]; - double yy = HGCalParameters::k_ScaleFromDDD * y - hgpar_->yLayerHex_[ll]; + std::pair xy = getXY(layer, HGCalParameters::k_ScaleFromDDD * x, HGCalParameters::k_ScaleFromDDD * y, false); + double xx = xy.first - hgpar_->xLayerHex_[ll]; + double yy = xy.second - hgpar_->yLayerHex_[ll]; for (unsigned int k = 0; k < hgpar_->waferPosX_.size(); ++k) { double dx = std::abs(xx - hgpar_->waferPosX_[k]); double dy = std::abs(yy - hgpar_->waferPosY_[k]); diff --git a/SimG4CMS/Calo/interface/HGCalNumberingScheme.h b/SimG4CMS/Calo/interface/HGCalNumberingScheme.h index 4c89e658cb44d..ac34b232c4287 100644 --- a/SimG4CMS/Calo/interface/HGCalNumberingScheme.h +++ b/SimG4CMS/Calo/interface/HGCalNumberingScheme.h @@ -24,7 +24,7 @@ class HGCalNumberingScheme { uint32_t getUnitID(int layer, int module, int cell, int iz, const G4ThreeVector& pos, double& wt); private: - void checkPosition(uint32_t index, const G4ThreeVector& pos) const; + void checkPosition(uint32_t index, const G4ThreeVector& pos, bool matchOnly, bool debug) const; HGCalNumberingScheme() = delete; const HGCalDDDConstants& hgcons_; diff --git a/SimG4CMS/Calo/src/HGCalNumberingScheme.cc b/SimG4CMS/Calo/src/HGCalNumberingScheme.cc index 12f5efa797906..fc163bb62c66b 100644 --- a/SimG4CMS/Calo/src/HGCalNumberingScheme.cc +++ b/SimG4CMS/Calo/src/HGCalNumberingScheme.cc @@ -17,7 +17,10 @@ HGCalNumberingScheme::HGCalNumberingScheme(const HGCalDDDConstants& hgc, const std::string& name) : hgcons_(hgc), mode_(hgc.geomMode()), det_(det), name_(name) { #ifdef EDM_ML_DEBUG - edm::LogVerbatim("HGCSim") << "Creating HGCalNumberingScheme for " << name_ << " Det " << det_; + edm::LogVerbatim("HGCSim") << "Creating HGCalNumberingScheme for " << name_ << " Det " << det_ << " Mode " << mode_ << ":" + << HGCalGeometryMode::Hexagon8Full << ":" << HGCalGeometryMode::Hexagon8 << ":" + << HGCalGeometryMode::Hexagon8File << ":" << HGCalGeometryMode::Trapezoid << ":" + << HGCalGeometryMode::TrapezoidFile << ":" << HGCalGeometryMode::Hexagon8Module << ":" << HGCalGeometryMode::TrapezoidModule; #endif } @@ -33,10 +36,7 @@ uint32_t HGCalNumberingScheme::getUnitID(int layer, int module, int cell, int iz wt = 1.0; #ifdef EDM_ML_DEBUG edm::LogVerbatim("HGCSim") << "HGCalNumberingScheme:: input Layer " << layer << " Module " << module << " Cell " - << cell << " iz " << iz << " Position " << pos << " Mode " << mode_ << ":" - << HGCalGeometryMode::Hexagon8Full << ":" << HGCalGeometryMode::Hexagon8 << ":" - << HGCalGeometryMode::Hexagon8File << ":" << HGCalGeometryMode::Trapezoid << ":" - << HGCalGeometryMode::TrapezoidFile; + << cell << " iz " << iz << " Position " << pos; #endif if (hgcons_.waferHexagon8()) { int cellU(0), cellV(0), waferType(-1), waferU(0), waferV(0); @@ -51,7 +51,7 @@ uint32_t HGCalNumberingScheme::getUnitID(int layer, int module, int cell, int iz hgcons_.waferFromPosition(xx, pos.y(), layer, waferU, waferV, cellU, cellV, waferType, wt); } if (waferType >= 0) { - if (mode_ == HGCalGeometryMode::Hexagon8File) { + if ((mode_ == HGCalGeometryMode::Hexagon8File) || (mode_ == HGCalGeometryMode::Hexagon8Module)) { int type = hgcons_.waferType(layer, waferU, waferV, true); if (type != waferType) { #ifdef EDM_ML_DEBUG @@ -98,12 +98,14 @@ uint32_t HGCalNumberingScheme::getUnitID(int layer, int module, int cell, int iz edm::LogVerbatim("HGCSim") << "HGCalNumberingScheme::i/p " << det_ << ":" << layer << ":" << module << ":" << cell << ":" << iz << ":" << pos.x() << ":" << pos.y() << ":" << pos.z() << " ID " << std::hex << index << std::dec << " wt " << wt; - checkPosition(index, pos); + bool matchOnly = (mode_ == HGCalGeometryMode::Hexagon8Module) ? true : false; + bool debug = (mode_ == HGCalGeometryMode::Hexagon8Module) ? true : false; + checkPosition(index, pos, matchOnly, debug); #endif return index; } -void HGCalNumberingScheme::checkPosition(uint32_t index, const G4ThreeVector& pos) const { +void HGCalNumberingScheme::checkPosition(uint32_t index, const G4ThreeVector& pos, bool matchOnly, bool debug) const { std::pair xy; bool ok(false); double z1(0), tolR(12.0), tolZ(1.0); @@ -139,7 +141,8 @@ void HGCalNumberingScheme::checkPosition(uint32_t index, const G4ThreeVector& po (z1 > zrange.second + tolZ)) ? "***** ERROR *****" : ""); - if (!(match && inok && outok)) { + if (matchOnly && match) ck = ""; + if (!(match && inok && outok) || debug) { edm::LogVerbatim("HGCSim") << "HGCalNumberingScheme::Detector " << det_ << " Layer " << lay << " R " << r2 << ":" << r1 << ":" << rrange.first << ":" << rrange.second << " Z " << z2 << ":" << z1 << ":" << zrange.first << ":" << zrange.second << " Match " << match << ":" << inok << ":" diff --git a/SimG4CMS/Calo/test/python/runHGC1_cfg.py b/SimG4CMS/Calo/test/python/runHGC1_cfg.py index 21e88d73b1cc4..1a1eb9a06a3f3 100644 --- a/SimG4CMS/Calo/test/python/runHGC1_cfg.py +++ b/SimG4CMS/Calo/test/python/runHGC1_cfg.py @@ -1,54 +1,31 @@ import FWCore.ParameterSet.Config as cms +from Configuration.Eras.Era_Phase2C11_cff import Phase2C11 -process = cms.Process("PROD") +process = cms.Process("PROD",Phase2C11) process.load("SimGeneral.HepPDTESSource.pythiapdt_cfi") process.load('Configuration.StandardSequences.Generator_cff') process.load("IOMC.EventVertexGenerators.VtxSmearedGauss_cfi") process.load('GeneratorInterface.Core.genFilterSummary_cff') process.load('Configuration.StandardSequences.SimIdeal_cff') -process.load("Geometry.HGCalCommonData.testHGCV8XML_cfi") -process.load("Geometry.TrackerNumberingBuilder.trackerNumberingGeometry_cfi") +process.load("Geometry.HGCalCommonData.testHGCV14XML_cfi") +process.load("Geometry.TrackerNumberingBuilder.trackerNumberingGeometry_cff") process.load("Geometry.EcalCommonData.ecalSimulationParameters_cff") -process.load("Geometry.HGCalCommonData.hgcalV6ParametersInitialization_cfi") -process.load("Geometry.HGCalCommonData.hgcalV6NumberingInitialization_cfi") process.load("Geometry.HcalCommonData.hcalDDDSimConstants_cff") +process.load("Geometry.HGCalCommonData.hgcalParametersInitialization_cfi") +process.load("Geometry.HGCalCommonData.hgcalNumberingInitialization_cfi") +process.load("Geometry.MuonNumbering.muonGeometryConstants_cff") +process.load("Geometry.MuonNumbering.muonOffsetESProducer_cff") +process.load("Geometry.MTDNumberingBuilder.mtdNumberingGeometry_cff") process.load("Configuration.StandardSequences.MagneticField_cff") process.load("Configuration.EventContent.EventContent_cff") process.load("Configuration.StandardSequences.FrontierConditions_GlobalTag_cff") -from Configuration.AlCa.autoCond import autoCond -process.GlobalTag.globaltag = autoCond['run2_mc'] +from Configuration.AlCa.GlobalTag import GlobalTag +process.GlobalTag = GlobalTag(process.GlobalTag, 'auto:phase2_realistic_T21', '') -process.MessageLogger = cms.Service("MessageLogger", - cerr = cms.untracked.PSet( - enable = cms.untracked.bool(False) - ), - cout = cms.untracked.PSet( - CaloSim = cms.untracked.PSet( - limit = cms.untracked.int32(0) - ), - DEBUG = cms.untracked.PSet( - limit = cms.untracked.int32(0) - ), - G4cerr = cms.untracked.PSet( - limit = cms.untracked.int32(-1) - ), - G4cout = cms.untracked.PSet( - limit = cms.untracked.int32(-1) - ), - HGCSim = cms.untracked.PSet( - limit = cms.untracked.int32(0) - ), - HGCalGeom = cms.untracked.PSet( - limit = cms.untracked.int32(0) - ), - INFO = cms.untracked.PSet( - limit = cms.untracked.int32(0) - ), - enable = cms.untracked.bool(True), - threshold = cms.untracked.string('DEBUG') - ), - debugModules = cms.untracked.vstring('*') -) +if hasattr(process,'MessageLogger'): + process.MessageLogger.G4cout = dict() + process.MessageLogger.G4cerr = dict() + process.MessageLogger.HGCSim = dict() process.load("IOMC.RandomEngine.IOMC_cff") process.RandomNumberGeneratorService.generator.initialSeed = 456789 @@ -82,7 +59,7 @@ process.output = cms.OutputModule("PoolOutputModule", process.FEVTSIMEventContent, - fileName = cms.untracked.string('simevent.root') + fileName = cms.untracked.string('hgcV14.root') ) process.generation_step = cms.Path(process.pgen) diff --git a/SimG4CMS/Calo/test/python/runHGC2_cfg.py b/SimG4CMS/Calo/test/python/runHGC2_cfg.py index 4ddd814d01dbb..871868955dee8 100644 --- a/SimG4CMS/Calo/test/python/runHGC2_cfg.py +++ b/SimG4CMS/Calo/test/python/runHGC2_cfg.py @@ -1,12 +1,11 @@ import FWCore.ParameterSet.Config as cms -from Configuration.Eras.Era_Phase2C9_cff import Phase2C9 +from Configuration.Eras.Era_Phase2C11_cff import Phase2C11 -process = cms.Process("PROD",Phase2C9) +process = cms.Process("PROD",Phase2C11) process.load("SimGeneral.HepPDTESSource.pythiapdt_cfi") process.load("IOMC.EventVertexGenerators.VtxSmearedGauss_cfi") -process.load("Configuration.Geometry.GeometryExtended2026D49_cff") -process.load("Geometry.TrackerNumberingBuilder.trackerNumberingGeometry_cfi") +process.load("Configuration.Geometry.GeometryExtended2026D83_cff") process.load("Configuration.StandardSequences.MagneticField_cff") process.load("Configuration.EventContent.EventContent_cff") process.load('Configuration.StandardSequences.Generator_cff') @@ -14,7 +13,7 @@ process.load('FWCore.MessageService.MessageLogger_cfi') process.load("Configuration.StandardSequences.FrontierConditions_GlobalTag_cff") from Configuration.AlCa.GlobalTag import GlobalTag -process.GlobalTag = GlobalTag(process.GlobalTag, 'auto:phase2_realistic_T15', '') +process.GlobalTag = GlobalTag(process.GlobalTag, 'auto:phase2_realistic_T21', '') if hasattr(process,'MessageLogger'): process.MessageLogger.HGCalGeom = dict() @@ -52,7 +51,7 @@ process.output = cms.OutputModule("PoolOutputModule", process.FEVTSIMEventContent, - fileName = cms.untracked.string('simevent.root') + fileName = cms.untracked.string('hgcV15.root') ) process.generation_step = cms.Path(process.pgen) diff --git a/SimG4CMS/Calo/test/python/runHGC3_cfg.py b/SimG4CMS/Calo/test/python/runHGC3_cfg.py index a24ca0117ec44..87f78164ad3b0 100644 --- a/SimG4CMS/Calo/test/python/runHGC3_cfg.py +++ b/SimG4CMS/Calo/test/python/runHGC3_cfg.py @@ -5,8 +5,8 @@ process.load("SimGeneral.HepPDTESSource.pythiapdt_cfi") process.load("IOMC.EventVertexGenerators.VtxSmearedGauss_cfi") -process.load('Configuration.Geometry.GeometryExtended2026D71Reco_cff') -process.load('Configuration.Geometry.GeometryExtended2026D71_cff') +process.load('Configuration.Geometry.GeometryExtended2026D77Reco_cff') +process.load('Configuration.Geometry.GeometryExtended2026D77_cff') process.load("Configuration.StandardSequences.MagneticField_cff") process.load("Configuration.EventContent.EventContent_cff") process.load('Configuration.StandardSequences.Generator_cff') @@ -52,7 +52,7 @@ process.output = cms.OutputModule("PoolOutputModule", process.FEVTSIMEventContent, - fileName = cms.untracked.string('simevent.root') + fileName = cms.untracked.string('hgcV14.root') ) process.generation_step = cms.Path(process.pgen) diff --git a/SimG4CMS/Calo/test/python/runHGC4_cfg.py b/SimG4CMS/Calo/test/python/runHGC4_cfg.py index 3fa07935f620c..6cc391f467cc5 100644 --- a/SimG4CMS/Calo/test/python/runHGC4_cfg.py +++ b/SimG4CMS/Calo/test/python/runHGC4_cfg.py @@ -4,7 +4,7 @@ process = cms.Process("PROD",Phase2C11) process.load("SimGeneral.HepPDTESSource.pythiapdt_cfi") process.load("IOMC.EventVertexGenerators.VtxSmearedGauss_cfi") -process.load("Configuration.Geometry.GeometryExtended2026D71Reco_cff") +process.load("Configuration.Geometry.GeometryExtended2026D77Reco_cff") process.load("Configuration.StandardSequences.MagneticField_cff") process.load("Configuration.EventContent.EventContent_cff") process.load('Configuration.StandardSequences.Generator_cff') @@ -12,8 +12,8 @@ process.load('FWCore.MessageService.MessageLogger_cfi') process.load('SimG4CMS.Calo.hgcalHitIdCheck_cff') process.load("Configuration.StandardSequences.FrontierConditions_GlobalTag_cff") -from Configuration.AlCa.autoCond import autoCond -process.GlobalTag.globaltag = autoCond['phase2_realistic'] +from Configuration.AlCa.GlobalTag import GlobalTag +process.GlobalTag = GlobalTag(process.GlobalTag, 'auto:phase2_realistic_T21', '') if hasattr(process,'MessageLogger'): process.MessageLogger.HGCalGeom=dict() @@ -58,7 +58,7 @@ process.output = cms.OutputModule("PoolOutputModule", process.FEVTSIMEventContent, - fileName = cms.untracked.string('simevent.root') + fileName = cms.untracked.string('hgcV14.root') ) process.generation_step = cms.Path(process.pgen) diff --git a/SimG4CMS/Calo/test/python/runHGC5_cfg.py b/SimG4CMS/Calo/test/python/runHGC5_cfg.py index be7b93bd3b88c..62039934998b0 100644 --- a/SimG4CMS/Calo/test/python/runHGC5_cfg.py +++ b/SimG4CMS/Calo/test/python/runHGC5_cfg.py @@ -6,11 +6,14 @@ process.load("SimGeneral.HepPDTESSource.pythiapdt_cfi") process.load("IOMC.EventVertexGenerators.VtxSmearedGauss_cfi") process.load("Geometry.HGCalCommonData.testHGCV15XML_cfi") -process.load("Geometry.TrackerNumberingBuilder.trackerNumberingGeometry_cfi") +process.load("Geometry.TrackerNumberingBuilder.trackerNumberingGeometry_cff") process.load("Geometry.EcalCommonData.ecalSimulationParameters_cff") +process.load("Geometry.HcalCommonData.hcalDDDSimConstants_cff") process.load("Geometry.HGCalCommonData.hgcalV15ParametersInitialization_cfi") process.load("Geometry.HGCalCommonData.hgcalNumberingInitialization_cfi") -process.load("Geometry.HcalCommonData.hcalDDDSimConstants_cff") +process.load("Geometry.MuonNumbering.muonGeometryConstants_cff") +process.load("Geometry.MuonNumbering.muonOffsetESProducer_cff") +process.load("Geometry.MTDNumberingBuilder.mtdNumberingGeometry_cff") process.load("Configuration.StandardSequences.MagneticField_cff") process.load("Configuration.EventContent.EventContent_cff") process.load('Configuration.StandardSequences.Generator_cff') @@ -57,7 +60,7 @@ process.output = cms.OutputModule("PoolOutputModule", process.FEVTSIMEventContent, - fileName = cms.untracked.string('simevent.root') + fileName = cms.untracked.string('hgcV15.root') ) process.generation_step = cms.Path(process.pgen) diff --git a/SimG4CMS/Calo/test/python/runHGC6_cfg.py b/SimG4CMS/Calo/test/python/runHGC6_cfg.py new file mode 100644 index 0000000000000..91484abf64b28 --- /dev/null +++ b/SimG4CMS/Calo/test/python/runHGC6_cfg.py @@ -0,0 +1,81 @@ +import FWCore.ParameterSet.Config as cms +from Configuration.Eras.Era_Phase2C11_cff import Phase2C11 + +process = cms.Process("PROD",Phase2C11) + +process.load("SimGeneral.HepPDTESSource.pythiapdt_cfi") +process.load("IOMC.EventVertexGenerators.VtxSmearedGauss_cfi") +process.load("Geometry.HGCalCommonData.testHGCalV16XML_cfi") +process.load("Geometry.TrackerNumberingBuilder.trackerNumberingGeometry_cff") +process.load("Geometry.EcalCommonData.ecalSimulationParameters_cff") +process.load("Geometry.HcalCommonData.hcalDDDSimConstants_cff") +process.load("Geometry.HGCalCommonData.hgcalV15ParametersInitialization_cfi") +process.load("Geometry.HGCalCommonData.hgcalNumberingInitialization_cfi") +process.load("Geometry.MuonNumbering.muonGeometryConstants_cff") +process.load("Geometry.MuonNumbering.muonOffsetESProducer_cff") +process.load("Geometry.MTDNumberingBuilder.mtdNumberingGeometry_cff") +process.load("Configuration.StandardSequences.MagneticField_cff") +process.load("Configuration.EventContent.EventContent_cff") +process.load('Configuration.StandardSequences.Generator_cff') +process.load('Configuration.StandardSequences.SimIdeal_cff') +process.load('FWCore.MessageService.MessageLogger_cfi') +process.load("Configuration.StandardSequences.FrontierConditions_GlobalTag_cff") +from Configuration.AlCa.GlobalTag import GlobalTag +process.GlobalTag = GlobalTag(process.GlobalTag, 'auto:phase2_realistic_T21', '') + +if hasattr(process,'MessageLogger'): + process.MessageLogger.HGCalGeom = dict() + process.MessageLogger.HGCSim = dict() + process.MessageLogger.CaloSim = dict() + +process.load("IOMC.RandomEngine.IOMC_cff") +process.RandomNumberGeneratorService.generator.initialSeed = 456789 +process.RandomNumberGeneratorService.g4SimHits.initialSeed = 9876 +process.RandomNumberGeneratorService.VtxSmeared.initialSeed = 123456789 + +process.Timing = cms.Service("Timing") + +process.maxEvents = cms.untracked.PSet( + input = cms.untracked.int32(10) +) + +process.source = cms.Source("EmptySource", + firstRun = cms.untracked.uint32(1), + firstEvent = cms.untracked.uint32(1) +) + +process.generator = cms.EDProducer("FlatRandomEGunProducer", + PGunParameters = cms.PSet( + PartID = cms.vint32(13), + MinEta = cms.double(1.75), + MaxEta = cms.double(2.50), + MinPhi = cms.double(-3.1415926), + MaxPhi = cms.double(3.1415926), + MinE = cms.double(100.00), + MaxE = cms.double(100.00) + ), + Verbosity = cms.untracked.int32(0), + AddAntiParticle = cms.bool(True) +) + +process.output = cms.OutputModule("PoolOutputModule", + process.FEVTSIMEventContent, + fileName = cms.untracked.string('hgcv16.root') +) + +process.generation_step = cms.Path(process.pgen) +process.simulation_step = cms.Path(process.psim) +process.out_step = cms.EndPath(process.output) + +process.g4SimHits.Physics.type = 'SimG4Core/Physics/FTFP_BERT_EMN' +process.g4SimHits.Physics.DefaultCutValue = 0.1 + +# Schedule definition +process.schedule = cms.Schedule(process.generation_step, + process.simulation_step, + process.out_step + ) + +# filter all path with the production filter sequence +for path in process.paths: + getattr(process,path)._seq = process.generator * getattr(process,path)._seq From 894c55069a3dd78be451fd33a6d12bf2b0af4a8a Mon Sep 17 00:00:00 2001 From: Sunanda Date: Thu, 8 Jul 2021 15:15:39 +0200 Subject: [PATCH 2/2] Code check --- Geometry/HGCalCommonData/src/HGCalDDDConstants.cc | 3 ++- SimG4CMS/Calo/src/HGCalNumberingScheme.cc | 10 ++++++---- 2 files changed, 8 insertions(+), 5 deletions(-) diff --git a/Geometry/HGCalCommonData/src/HGCalDDDConstants.cc b/Geometry/HGCalCommonData/src/HGCalDDDConstants.cc index ccd6d573a0c65..95dbf06fcb2fe 100644 --- a/Geometry/HGCalCommonData/src/HGCalDDDConstants.cc +++ b/Geometry/HGCalCommonData/src/HGCalDDDConstants.cc @@ -1143,7 +1143,8 @@ void HGCalDDDConstants::waferFromPosition(const double x, if ((hgpar_->xLayerHex_.empty()) || (hgpar_->yLayerHex_.empty())) return; int ll = layer - hgpar_->firstLayer_; - std::pair xy = getXY(layer, HGCalParameters::k_ScaleFromDDD * x, HGCalParameters::k_ScaleFromDDD * y, false); + std::pair xy = + getXY(layer, HGCalParameters::k_ScaleFromDDD * x, HGCalParameters::k_ScaleFromDDD * y, false); double xx = xy.first - hgpar_->xLayerHex_[ll]; double yy = xy.second - hgpar_->yLayerHex_[ll]; for (unsigned int k = 0; k < hgpar_->waferPosX_.size(); ++k) { diff --git a/SimG4CMS/Calo/src/HGCalNumberingScheme.cc b/SimG4CMS/Calo/src/HGCalNumberingScheme.cc index fc163bb62c66b..adf4321f44195 100644 --- a/SimG4CMS/Calo/src/HGCalNumberingScheme.cc +++ b/SimG4CMS/Calo/src/HGCalNumberingScheme.cc @@ -17,10 +17,11 @@ HGCalNumberingScheme::HGCalNumberingScheme(const HGCalDDDConstants& hgc, const std::string& name) : hgcons_(hgc), mode_(hgc.geomMode()), det_(det), name_(name) { #ifdef EDM_ML_DEBUG - edm::LogVerbatim("HGCSim") << "Creating HGCalNumberingScheme for " << name_ << " Det " << det_ << " Mode " << mode_ << ":" - << HGCalGeometryMode::Hexagon8Full << ":" << HGCalGeometryMode::Hexagon8 << ":" + edm::LogVerbatim("HGCSim") << "Creating HGCalNumberingScheme for " << name_ << " Det " << det_ << " Mode " << mode_ + << ":" << HGCalGeometryMode::Hexagon8Full << ":" << HGCalGeometryMode::Hexagon8 << ":" << HGCalGeometryMode::Hexagon8File << ":" << HGCalGeometryMode::Trapezoid << ":" - << HGCalGeometryMode::TrapezoidFile << ":" << HGCalGeometryMode::Hexagon8Module << ":" << HGCalGeometryMode::TrapezoidModule; + << HGCalGeometryMode::TrapezoidFile << ":" << HGCalGeometryMode::Hexagon8Module << ":" + << HGCalGeometryMode::TrapezoidModule; #endif } @@ -141,7 +142,8 @@ void HGCalNumberingScheme::checkPosition(uint32_t index, const G4ThreeVector& po (z1 > zrange.second + tolZ)) ? "***** ERROR *****" : ""); - if (matchOnly && match) ck = ""; + if (matchOnly && match) + ck = ""; if (!(match && inok && outok) || debug) { edm::LogVerbatim("HGCSim") << "HGCalNumberingScheme::Detector " << det_ << " Layer " << lay << " R " << r2 << ":" << r1 << ":" << rrange.first << ":" << rrange.second << " Z " << z2 << ":" << z1 << ":"