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-hcx113 Bug fix for Plan 1 Geometry #17613

Merged
merged 1 commit into from Feb 23, 2017
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.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
18 changes: 15 additions & 3 deletions Geometry/HcalCommonData/src/HcalDDDRecConstants.cc
Expand Up @@ -839,7 +839,7 @@ void HcalDDDRecConstants::initialize(void) {
#ifdef EDM_ML_DEBUG
std::cout << "Detector type and maximum depth for all RBX "
<< depthMaxDf_.first << ":" << depthMaxDf_.second
<< "and for special RBX " << depthMaxSp_.first << ":"
<< " and for special RBX " << depthMaxSp_.first << ":"
<< depthMaxSp_.second << std::endl;
#endif

Expand Down Expand Up @@ -867,6 +867,14 @@ void HcalDDDRecConstants::initialize(void) {
}
}
if (depth != 0) oldDep[depth] = std::pair<int,int>(lmin,lymax-1);
#ifdef EDM_ML_DEBUG
std::cout << "Eta|Phi|Zside " << eta << ":" << phi << ":" << zside
<< " with " << oldDep.size() << " old Depths" << std::endl;
unsigned int kk(0);
for (std::map<int,std::pair<int,int> >::const_iterator itr=oldDep.begin(); itr != oldDep.end(); ++itr,++kk)
std::cout << "[" << kk << "] " << itr->first << " --> "
<< itr->second.first << ":" << itr->second.second << "\n";
#endif
std::pair<int,int> depths = hcons.ldMap()->getDepths(eta);
for (int ndepth=depths.first; ndepth<=depths.second; ++ndepth) {
bool flag = ((subdet == HcalBarrel && eta == iEtaMax[0] &&
Expand All @@ -875,10 +883,10 @@ void HcalDDDRecConstants::initialize(void) {
ndepth < hcons.getDepthEta16(subdet0,phi,zside)));
if (!flag) {
std::vector<int> count(oldDep.size(),0);
unsigned int l(0);
int layFront = hcons.ldMap()->getLayerFront(subdet0,eta,phi,zside,ndepth);
int layBack = hcons.ldMap()->getLayerBack(subdet0,eta,phi,zside,ndepth);
for (int lay=layFront; lay<=layBack; ++lay) {
unsigned int l(0);
for (std::map<int,std::pair<int,int> >::iterator itr=oldDep.begin();
itr != oldDep.end(); ++itr,++l) {
if (lay >= (itr->second).first && lay <= (itr->second).second) {
Expand All @@ -887,14 +895,18 @@ void HcalDDDRecConstants::initialize(void) {
}
}
int odepth(0), maxlay(0);
l = 0;
unsigned int l(0);
for (std::map<int,std::pair<int,int> >::iterator itr=oldDep.begin();
itr != oldDep.end(); ++itr,++l) {
if (count[l] > maxlay) {
odepth = itr->first;
maxlay = count[l];
}
}
#ifdef EDM_ML_DEBUG
std::cout << "New Depth " << ndepth << " old Depth " << odepth
<< " max " << maxlay << std::endl;
#endif
for (unsigned int k=0; k<phis.size(); ++k) {
zside = (phis[k] > 0) ? 1 : -1;
phi = (phis[k] > 0) ? phis[k] : -phis[k];
Expand Down
2 changes: 1 addition & 1 deletion Geometry/HcalCommonData/src/HcalLayerDepthMap.cc
Expand Up @@ -44,7 +44,7 @@ void HcalLayerDepthMap::initialize(const int subdet, const int ietaMax,
int ietaMin = ieta[k1];
int ietaMax = ietaMax_;
int layMin = layer[k1];
int layMax = (k1+1 < ieta.size()) ? layer[k1+1] : maxLayers_;
int layMax = (k1+1 < ieta.size()) ? (layer[k1+1]-1) : maxLayers_;
for (unsigned int k2=k1+1; k2<ieta.size(); ++k2) {
if (ieta[k2] > ieta[k1]) {
ietaMax = ieta[k2] - 1;
Expand Down
@@ -1,7 +1,7 @@
import FWCore.ParameterSet.Config as cms
process = cms.Process("HcalParametersTest")

process.load('Geometry.HcalCommonData.testPhase1GeometryXML_cfi')
process.load('Geometry.HcalCommonData.testGeometry17bXML_cfi')
process.load('Geometry.HcalCommonData.hcalDDConstants_cff')

process.source = cms.Source("EmptySource")
Expand Down