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

bsunanda:Run2-hcx101 Make geometry change to accommodate Plan 1 operation of HCAL #17330

Merged
merged 2 commits into from Feb 7, 2017
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
32 changes: 32 additions & 0 deletions Configuration/Geometry/python/GeometryExtended2017devReco_cff.py
@@ -0,0 +1,32 @@
import FWCore.ParameterSet.Config as cms

# Ideal geometry, needed for transient ECAL alignement
from Configuration.Geometry.GeometryExtended2017dev_cff import *


# Reconstruction geometry services
# Tracking Geometry
#bah - well, this is not a cfi!
from Geometry.CommonDetUnit.globalTrackingGeometry_cfi import *

#Tracker
from RecoTracker.GeometryESProducer.TrackerRecoGeometryESProducer_cfi import *
from Geometry.TrackerNumberingBuilder.trackerTopology_cfi import *

#Muon
from Geometry.MuonNumbering.muonNumberingInitialization_cfi import *
from RecoMuon.DetLayers.muonDetLayerGeometry_cfi import *

# Alignment
from Geometry.TrackerGeometryBuilder.idealForDigiTrackerGeometry_cff import *
from Geometry.CSCGeometryBuilder.idealForDigiCscGeometry_cff import *
from Geometry.DTGeometryBuilder.idealForDigiDtGeometry_cff import *

# Calorimeters
from Geometry.CaloEventSetup.CaloTopology_cfi import *
from Geometry.CaloEventSetup.CaloGeometry_cff import *
from Geometry.CaloEventSetup.EcalTrigTowerConstituents_cfi import *
from Geometry.EcalMapping.EcalMapping_cfi import *
from Geometry.EcalMapping.EcalMappingRecord_cfi import *
from Geometry.HcalCommonData.hcalDDDRecConstants_cfi import *
from Geometry.HcalEventSetup.hcalTopologyIdeal_cfi import *
11 changes: 11 additions & 0 deletions Configuration/Geometry/python/GeometryExtended2017dev_cff.py
@@ -0,0 +1,11 @@
import FWCore.ParameterSet.Config as cms

#
# Geometry master configuration
#
# Ideal geometry, needed for simulation
from Geometry.CMSCommonData.cmsExtendedGeometry2017aXML_cfi import *
from Geometry.TrackerNumberingBuilder.trackerNumberingGeometry_cfi import *
from Geometry.HcalCommonData.hcalParameters_cfi import *
from Geometry.HcalCommonData.hcalDDDSimConstants_cfi import *

287 changes: 287 additions & 0 deletions Geometry/CMSCommonData/python/cmsExtendedGeometry2017aXML_cfi.py

Large diffs are not rendered by default.

7 changes: 4 additions & 3 deletions Geometry/CaloTopology/interface/HcalTopology.h
Expand Up @@ -98,7 +98,8 @@ class HcalTopology : public CaloSubdetectorTopology {

/// finds the number of depth bins and which is the number to start with
void depthBinInformation(HcalSubdetector subdet, int etaRing,
int & nDepthBins, int & startingBin) const;
int iphi, int zside, int & nDepthBins,
int & startingBin) const;

/// how many phi segments in this ring
int nPhiBins(int etaRing) const;
Expand Down Expand Up @@ -148,8 +149,8 @@ class HcalTopology : public CaloSubdetectorTopology {
bool isBH() const { return ((hcons_ == 0) ? false : hcons_->isBH()); }

const HcalDDDRecConstants* dddConstants () const {return hcons_;}
bool withSpecialRBXHBHE() const {return false;}
HcalDetId mergedDepthDetId(HcalDetId& id) const { return id; }
bool withSpecialRBXHBHE() const {return hcons_->withSpecialRBXHBHE();}
HcalDetId mergedDepthDetId(HcalDetId& id) const {return hcons_->mergedDepthDetId(id); }

private:
/** Get the neighbors of the given cell with higher absolute ieta */
Expand Down
10 changes: 5 additions & 5 deletions Geometry/CaloTopology/src/CaloTowerConstituentsMap.cc
Expand Up @@ -93,34 +93,34 @@ std::vector<DetId> CaloTowerConstituentsMap::constituentsOf(const CaloTowerDetId

if (standardHB_) {
if (id.ietaAbs()<=m_cttopo->lastHBRing()) {
m_hcaltopo->depthBinInformation(HcalBarrel,hcal_ieta,nd,sd);
m_hcaltopo->depthBinInformation(HcalBarrel,hcal_ieta,id.iphi(),id.zside(),nd,sd);
for (int i=0; i<nd; i++)
items.push_back(HcalDetId(HcalBarrel,hcal_ieta*id.zside(),id.iphi(),i+sd));
}
}
if (standardHO_) {
if (id.ietaAbs()<=m_cttopo->lastHORing()) {
m_hcaltopo->depthBinInformation(HcalOuter,hcal_ieta,nd,sd);
m_hcaltopo->depthBinInformation(HcalOuter,hcal_ieta,id.iphi(),id.zside(),nd,sd);
for (int i=0; i<nd; i++)
items.push_back(HcalDetId(HcalOuter,hcal_ieta*id.zside(),id.iphi(),i+sd));
}
}
if (standardHE_) {
if (id.ietaAbs()>=m_cttopo->firstHERing() && id.ietaAbs()<=m_cttopo->lastHERing()) {
m_hcaltopo->depthBinInformation(HcalEndcap,hcal_ieta,nd,sd);
m_hcaltopo->depthBinInformation(HcalEndcap,hcal_ieta,id.iphi(),id.zside(),nd,sd);
for (int i=0; i<nd; i++)
items.push_back(HcalDetId(HcalEndcap,hcal_ieta*id.zside(),id.iphi(),i+sd));
}
}
if (standardHF_) {
if (id.ietaAbs()>=m_cttopo->firstHFRing() && id.ietaAbs()<=m_cttopo->lastHFRing()) {
m_hcaltopo->depthBinInformation(HcalForward,hcal_ieta,nd,sd);
m_hcaltopo->depthBinInformation(HcalForward,hcal_ieta,id.iphi(),id.zside(),nd,sd);
for (int i=0; i<nd; i++)
items.push_back(HcalDetId(HcalForward,hcal_ieta*id.zside(),id.iphi(),i+sd));
// special handling for first HF tower
if (id.ietaAbs() == m_cttopo->firstHFRing()) {
int hcal_ieta2 = hcal_ieta-1;
m_hcaltopo->depthBinInformation(HcalForward,hcal_ieta2,nd,sd);
m_hcaltopo->depthBinInformation(HcalForward,hcal_ieta2,id.iphi(),id.zside(),nd,sd);
for (int i=0; i<nd; i++)
items.push_back(HcalDetId(HcalForward,hcal_ieta2*id.zside(),id.iphi(),i+sd));
}
Expand Down
50 changes: 27 additions & 23 deletions Geometry/CaloTopology/src/HcalTopology.cc
Expand Up @@ -12,7 +12,7 @@

static const int IPHI_MAX=72;

//#define DebugLog
//#define EDM_ML_DEBUG

HcalTopology::HcalTopology(const HcalDDDRecConstants* hcons) :
hcons_(hcons),
Expand All @@ -32,7 +32,7 @@ HcalTopology::HcalTopology(const HcalDDDRecConstants* hcons) :
maxDepthHF_ = hcons_->getMaxDepth(2);
etaBinsHB_ = hcons_->getEtaBins(0);
etaBinsHE_ = hcons_->getEtaBins(1);
nEtaHB_ = (int)(etaBinsHB_.size());
nEtaHB_ = (hcons_->getEtaRange(0)).second-(hcons_->getEtaRange(0)).first+1;
lastHBRing_ = firstHBRing_+nEtaHB_-1;
if (hcons_->getNPhi(1) > maxPhiHE_) maxPhiHE_ = hcons_->getNPhi(1);
for (int i = 0; i < (int)(etaBinsHE_.size()); ++i) {
Expand Down Expand Up @@ -69,7 +69,7 @@ HcalTopology::HcalTopology(const HcalDDDRecConstants* hcons) :
HTSize_ = kHTSizePhase1;
}

#ifdef DebugLog
#ifdef EDM_ML_DEBUG
std::cout << "Topo sizes " << HBSize_ << ":" << HESize_ << ":" << HOSize_
<< ":" << HFSize_ << ":" << HTSize_ << " for mode " << mode_
<< ":" << triggerMode_ << std::endl;
Expand Down Expand Up @@ -111,7 +111,7 @@ HcalTopology::HcalTopology(const HcalDDDRecConstants* hcons) :
for (int ring=1; ring<=nEta; ++ring) {
std::vector<int> segmentation = hcons_->getDepth(ring-1);
setDepthSegmentation(ring,segmentation);
#ifdef DebugLog
#ifdef EDM_ML_DEBUG
std::cout << "Set segmentation for ring " << ring << " with "
<< segmentation.size() << " elements:";
for (unsigned int k=0; k<segmentation.size(); ++k)
Expand All @@ -120,7 +120,7 @@ HcalTopology::HcalTopology(const HcalDDDRecConstants* hcons) :
#endif
}

#ifdef DebugLog
#ifdef EDM_ML_DEBUG
std::cout << "Constants in HcalTopology " << firstHBRing_ << ":"
<< lastHBRing_ << " " << firstHERing_ << ":" << lastHERing_ << ":"
<< firstHEDoublePhiRing_ << ":" << firstHEQuadPhiRing_ << ":"
Expand Down Expand Up @@ -423,23 +423,25 @@ bool HcalTopology::validRaw(const HcalDetId& id) const {
int aieta=id.ietaAbs();
int depth=id.depth();
int iphi=id.iphi();
int zside=id.zside();
HcalSubdetector subdet=id.subdet();
int maxPhi = (subdet==HcalEndcap) ? maxPhiHE_ : IPHI_MAX;
if ((ieta==0 || iphi<=0 || iphi>maxPhi) || aieta>maxEta_) ok = false; // outer limits

if (ok) {
if (subdet==HcalBarrel) {
if (mode_==HcalTopologyMode::SLHC || mode_==HcalTopologyMode::H2HE) {
if ((aieta>lastHBRing()) || (depth>hcons_->getMaxDepth(0,aieta)) ||
(depth<hcons_->getMinDepth(0,aieta))) ok=false;
if ((aieta>lastHBRing()) ||
(depth>hcons_->getMaxDepth(0,aieta,iphi,zside)) ||
(depth<hcons_->getMinDepth(0,aieta,iphi,zside))) ok=false;
} else {
if (aieta>lastHBRing() || depth>2 || (aieta<=14 && depth>1)) ok=false;
}
} else if (subdet==HcalEndcap) {
if (mode_==HcalTopologyMode::SLHC || mode_==HcalTopologyMode::H2HE) {
if ((depth>hcons_->getMaxDepth(1,aieta)) ||
(aieta<firstHERing()) || (aieta>lastHERing()) ||
(depth<hcons_->getMinDepth(1,aieta))) {
if ((depth>hcons_->getMaxDepth(1,aieta,iphi,zside)) ||
(depth<hcons_->getMinDepth(1,aieta,iphi,zside)) ||
(aieta<firstHERing()) || (aieta>lastHERing())) {
ok = false;
} else {
for (unsigned int i=0; i<etaBinsHE_.size(); ++i) {
Expand All @@ -456,8 +458,9 @@ bool HcalTopology::validRaw(const HcalDetId& id) const {
}
}
} else {
if (depth>hcons_->getMaxDepth(1,aieta) || aieta<firstHERing() || aieta>lastHERing() ||
(aieta==firstHERing() && depth!=hcons_->getDepthEta16(1)) ||
if (depth>hcons_->getMaxDepth(1,aieta,iphi,zside) ||
aieta<firstHERing() || aieta>lastHERing() ||
(aieta==firstHERing() && depth!=hcons_->getDepthEta16(2,iphi,zside)) ||
(aieta==17 && depth!=1 && mode_!=HcalTopologyMode::H2) || // special case at H2
(((aieta>=17 && aieta<firstHETripleDepthRing()) ||
aieta==lastHERing()) && depth>2) ||
Expand Down Expand Up @@ -628,15 +631,16 @@ int HcalTopology::decAIEta(const HcalDetId& id, HcalDetId neighbors[2]) const {


void HcalTopology::depthBinInformation(HcalSubdetector subdet, int etaRing,
int & nDepthBins, int & startingBin) const {
int iphi, int zside, int & nDepthBins,
int & startingBin) const {

if(subdet == HcalBarrel) {
if (mode_==HcalTopologyMode::SLHC || mode_==HcalTopologyMode::H2HE) {
startingBin = hcons_->getMinDepth(0,etaRing);
startingBin = hcons_->getMinDepth(0,etaRing,iphi,zside);
if (etaRing==lastHBRing()) {
nDepthBins = hcons_->getDepthEta16(0) - startingBin + 1;
nDepthBins = hcons_->getDepthEta16(1,iphi,zside)-startingBin+1;
} else {
nDepthBins = hcons_->getMaxDepth(0,etaRing) - startingBin + 1;
nDepthBins = hcons_->getMaxDepth(0,etaRing,iphi,zside)-startingBin+1;
}
} else {
if (etaRing<=14) {
Expand All @@ -650,11 +654,11 @@ void HcalTopology::depthBinInformation(HcalSubdetector subdet, int etaRing,
} else if(subdet == HcalEndcap) {
if (mode_==HcalTopologyMode::SLHC || mode_==HcalTopologyMode::H2HE) {
if (etaRing==firstHERing()) {
startingBin = hcons_->getDepthEta16(1);
startingBin = hcons_->getDepthEta16(2,iphi,zside);
} else {
startingBin = hcons_->getMinDepth(1,etaRing);
startingBin = hcons_->getMinDepth(1,etaRing,iphi,zside);
}
nDepthBins = hcons_->getMaxDepth(1,etaRing) - startingBin + 1;
nDepthBins = hcons_->getMaxDepth(1,etaRing,iphi,zside)-startingBin+1;
} else {
if (etaRing==firstHERing()) {
nDepthBins = 1;
Expand Down Expand Up @@ -688,7 +692,7 @@ bool HcalTopology::incrementDepth(HcalDetId & detId) const {
int etaRing = detId.ietaAbs();
int depth = detId.depth();
int nDepthBins, startingBin;
depthBinInformation(subdet, etaRing, nDepthBins, startingBin);
depthBinInformation(subdet, etaRing, detId.iphi(), detId.zside(), nDepthBins, startingBin);

// see if the new depth bin exists
++depth;
Expand Down Expand Up @@ -727,7 +731,7 @@ bool HcalTopology::decrementDepth(HcalDetId & detId) const {
int etaRing = detId.ietaAbs();
int depth = detId.depth();
int nDepthBins, startingBin;
depthBinInformation(subdet, etaRing, nDepthBins, startingBin);
depthBinInformation(subdet, etaRing, detId.iphi(), detId.zside(), nDepthBins, startingBin);

// see if the new depth bin exists
--depth;
Expand Down Expand Up @@ -1123,7 +1127,7 @@ unsigned int HcalTopology::detId2denseId(const DetId& id) const {
return 0xFFFFFFFu;
}
}
#ifdef DebugLog
#ifdef EDM_ML_DEBUG
std::cout << "DetId2Dense " << topoVersion_ << " ID " << std::hex
<< id.rawId() << std::dec << " | " << HcalDetId(id) << " : "
<< std::hex << retval << std::dec << std::endl;
Expand Down Expand Up @@ -1232,7 +1236,7 @@ DetId HcalTopology::denseId2detId(unsigned int denseid) const {
}
}
HcalDetId hid(sd, iz*int(ie), ip, dp);
#ifdef DebugLog
#ifdef EDM_ML_DEBUG
std::cout << "Dens2Det " << topoVersion_ << " i/p " << std::hex << denseid
<< " : " << hid.rawId() << std::dec << " | " << hid << std::endl;
#endif
Expand Down
109 changes: 109 additions & 0 deletions Geometry/HcalCommonData/data/Run2/hcalSimNumbering17b.xml
@@ -0,0 +1,109 @@
<?xml version="1.0"?>
<DDDefinition xmlns="http://www.cern.ch/cms/DDL" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.cern.ch/cms/DDL ../../../DetectorDescription/Schema/DDLSchema.xsd">

<ConstantsSection label="hcalSimNumbering.xml" eval="true">
<Vector name="phioff" type="numeric" nEntries="5">
0.0*deg, 0.0*deg, 0.0*deg, 10.0*deg, 10.0*deg
</Vector>
<Vector name="etaTable" type="numeric" nEntries="30">
0.000, 0.087, 0.174, 0.261, 0.348, 0.435, 0.522, 0.609, 0.696,
0.783, 0.870, 0.957, 1.044, 1.131, 1.218, 1.305, 1.392, 1.479,
1.566, 1.653, 1.740, 1.830, 1.930, 2.043, 2.172, 2.322, 2.500,
2.650, 2.868, 3.000
</Vector>
<Vector name="rTable" type="numeric" nEntries="14">
12.50*cm, 16.90*cm, 20.10*cm, 24.00*cm, 28.60*cm, 34.00*cm,
40.60*cm, 48.30*cm, 57.60*cm, 68.60*cm, 81.80*cm, 97.50*cm,
116.20*cm, 130.00*cm
</Vector>
<Vector name="phibin" type="numeric" nEntries="29">
5.0*deg, 5.0*deg, 5.0*deg, 5.0*deg, 5.0*deg, 5.0*deg, 5.0*deg,
5.0*deg, 5.0*deg, 5.0*deg, 5.0*deg, 5.0*deg, 5.0*deg, 5.0*deg,
5.0*deg, 5.0*deg, 5.0*deg, 5.0*deg, 5.0*deg, 5.0*deg, 10.0*deg,
10.0*deg, 10.0*deg, 10.0*deg, 10.0*deg, 10.0*deg, 10.0*deg,
10.0*deg, 10.0*deg
</Vector>
<Vector name="phitable" type="numeric" nEntries="13">
10.0*deg, 10.0*deg, 10.0*deg, 10.0*deg, 10.0*deg, 10.0*deg,
10.0*deg, 10.0*deg, 10.0*deg, 10.0*deg, 10.0*deg, 20.0*deg,
20.0*deg
</Vector>
<Vector name="layerGroupSimEta1" type="numeric" nEntries="19">
1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 4, 4
</Vector>
<Vector name="layerGroupSimEta15" type="numeric" nEntries="19">
1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 2, 2, 2, 4, 4
</Vector>
<Vector name="layerGroupSimEta16" type="numeric" nEntries="19">
1, 1, 2, 2, 2, 2, 2, 2, 2, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3
</Vector>
<Vector name="layerGroupSimEta17" type="numeric" nEntries="19">
1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1
</Vector>
<Vector name="layerGroupSimEta18" type="numeric" nEntries="19">
1, 1, 1, 1, 1, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2
</Vector>
<Vector name="layerGroupSimEta19" type="numeric" nEntries="19">
1, 1, 1, 1, 1, 1, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2
</Vector>
<Vector name="layerGroupSimEta27" type="numeric" nEntries="19">
1, 1, 1, 1, 2, 2, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3
</Vector>
<Vector name="etaMin" type="numeric" nEntries="4">
1, 16, 29, 1
</Vector>
<Vector name="etaMax" type="numeric" nEntries="4">
16, 29, 41, 15
</Vector>
<Vector name="MaxDepth" type="numeric" nEntries="4">
2, 3, 4, 4
</Vector>
<Vector name="etaRange" type="numeric" nEntries="4">
1.392, 3.000, 5.500, 1.305
</Vector>
<Vector name="gparHF" type="numeric" nEntries="7">
22.0*cm, 165.0*cm, 30.0*cm, 0.0*cm, 1115.0*cm, 0.375*cm,
1137.0*cm
</Vector>
<Vector name="noff" type="numeric" nEntries="95">
15, 29, 4, 10, 5, 2, 4, 18, 19, 11, 12, 13, 14, 2, 3, 2, 1, 0,
0, 2, 4, 22, 4, 3, 12, 63, 64, 65, 66, 16, 0, 1, 16, 2, 2,
16, 9, 4, 17, 0, 2, 17, 8, 3, 18, 0, 1, 18, 1, 2, 18, 4, 3,
18, 8, 4, 18, 11, 5, 19, 0, 1, 19, 2, 2, 19, 5, 3, 19, 8, 4,
19, 11, 5, 26, 0, 1, 26, 2, 2, 26, 4, 3, 26, 6, 4, 26, 8, 5,
26, 11, 6, 26, 15, 7
</Vector>
<Vector name="Layer0Wt" type="numeric" nEntries="2">
0.5, 0.5
</Vector>
<Vector name="HBGains" type="numeric" nEntries="4">
117.0, 117.0, 117.0, 217.0
</Vector>
<Vector name="HBShift" type="numeric" nEntries="4">
0, 0, 0, 0
</Vector>
<Vector name="HEGains" type="numeric" nEntries="4">
178.0, 178.0, 178.0, 0.000
</Vector>
<Vector name="HEShift" type="numeric" nEntries="4">
0, 0, 0, 0
</Vector>
<Vector name="HFGains" type="numeric" nEntries="4">
2.840, 2.090, 2.840, 2.090
</Vector>
<Vector name="HFShift" type="numeric" nEntries="4">
0, 0, 0, 0
</Vector>
</ConstantsSection>

<SpecParSection label="hcalSimNumbering.xml" eval="true">
<SpecPar name="hcal">
<PartSelector path="//HBS.*"/>
<PartSelector path="//HTS.*"/>
<PartSelector path="//.*HES.*"/>
<PartSelector path="//HVQF"/>
<Parameter name="OnlyForHcalSimNumbering" value="HCAL" eval="false"/>
</SpecPar>
</SpecParSection>

</DDDefinition>