Skip to content

Commit

Permalink
Code check
Browse files Browse the repository at this point in the history
  • Loading branch information
Sunanda committed Jun 29, 2023
1 parent 911b266 commit 4591480
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 11 deletions.
18 changes: 10 additions & 8 deletions Geometry/HcalCommonData/src/HcalDDDSimConstants.cc
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,8 @@ HcalCellType::HcalCell HcalDDDSimConstants::cell(
} else if (etaR <= nEta) {
int laymin(depth), laymax(depth);
if (idet == static_cast<int>(HcalOuter)) {
laymin = (etaR > hpar->noff[2]) ? (static_cast<int>(hpar->zHE.size())) : (static_cast<int>(hpar->zHE.size())) - 1;
laymin =
(etaR > hpar->noff[2]) ? (static_cast<int>(hpar->zHE.size())) : (static_cast<int>(hpar->zHE.size())) - 1;
laymax = (static_cast<int>(hpar->zHE.size()));
}
double d1 = 0, d2 = 0;
Expand Down Expand Up @@ -265,12 +266,12 @@ std::pair<int, int> HcalDDDSimConstants::getEtaDepth(
if (lay >= 0) {
depth = layerGroup(det, etaR, phi, zside, lay - 1);
if (((det == 2) && (etaR == 18)) || ((det == 1) && (etaR == 15)))
if (etaR == hpar->noff[0] && lay > 1) {
int kphi = phi + static_cast<int>((hpar->phioff[3] + 0.1) / hpar->phibin[etaR - 1]);
kphi = (kphi - 1) % 4 + 1;
if (kphi == 2 || kphi == 3)
depth = layerGroup(det, etaR, phi, zside, lay - 2);
}
if (etaR == hpar->noff[0] && lay > 1) {
int kphi = phi + static_cast<int>((hpar->phioff[3] + 0.1) / hpar->phibin[etaR - 1]);
kphi = (kphi - 1) % 4 + 1;
if (kphi == 2 || kphi == 3)
depth = layerGroup(det, etaR, phi, zside, lay - 2);
}
} else if (det == static_cast<int>(HcalBarrel)) {
if (depth > getMaxDepth(det, etaR, phi, zside, false))
depth = getMaxDepth(det, etaR, phi, zside, false);
Expand Down Expand Up @@ -398,7 +399,8 @@ int HcalDDDSimConstants::getLayerBack(
}

int HcalDDDSimConstants::getLayerMax(const int& eta, const int& depth) const {
int layermx = ((eta < hpar->etaMin[1]) && depth - 1 < maxDepth[0]) ? maxLayerHB_ + 1 : static_cast<int>(layerGroupSize(eta - 1));
int layermx = ((eta < hpar->etaMin[1]) && depth - 1 < maxDepth[0]) ? maxLayerHB_ + 1
: static_cast<int>(layerGroupSize(eta - 1));
return layermx;
}

Expand Down
17 changes: 14 additions & 3 deletions Geometry/HcalCommonData/src/HcalHitRelabeller.cc
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ void HcalHitRelabeller::process(std::vector<PCaloHit>& hcalHits) {
int det, z, depth, eta, phi, layer;
HcalTestNumbering::unpackHcalIndex(hcalHit.id(), det, z, depth, eta, phi, layer);
if ((det == 2) && (layer == 2) && (eta == 18))
depth = 2;
depth = 2;
hid = HcalTestNumbering::packHcalIndex(det, z, depth, eta, phi, layer);
double wt = (neutralDensity_) ? (energyWt(hid)) : 1.0;
double energy = wt * (hcalHit.energy());
Expand All @@ -39,7 +39,10 @@ void HcalHitRelabeller::process(std::vector<PCaloHit>& hcalHits) {
#endif
hcalHit.setID(newid);
#ifdef EDM_ML_DEBUG
edm::LogVerbatim("HcalSim") << "Final Setting::subdet: " << HcalDetId(newid).subdet() << " z: " << HcalDetId(newid).zside() << " depth: " << HcalDetId(newid).depth() << " ieta: " << HcalDetId(newid).ietaAbs() << " iphi: " << HcalDetId(newid).iphi() << " wt " << wt;
edm::LogVerbatim("HcalSim") << "Final Setting::subdet: " << HcalDetId(newid).subdet()
<< " z: " << HcalDetId(newid).zside() << " depth: " << HcalDetId(newid).depth()
<< " ieta: " << HcalDetId(newid).ietaAbs() << " iphi: " << HcalDetId(newid).iphi()
<< " wt " << wt;
++ii;
#endif
}
Expand Down Expand Up @@ -76,7 +79,15 @@ DetId HcalHitRelabeller::relabel(const uint32_t testId, const HcalDDDRecConstant
hid = HcalDetId(HcalForward, sign * id.eta, id.phi, depth0);
}
#ifdef EDM_ML_DEBUG
edm::LogVerbatim("HcalSim") << "Initial indices:" << "subdet: " << det << " " << "z: " << z << " " << "depth: " << depth << " " << "ieta: " << eta << " " << "iphi: " << phi << " " << "layer: " << layer << " new HcalDetId -> hex.RawID = " << std::hex << hid.rawId() << std::dec << " subdet, z, depth, eta, phi = " << det << " " << z << " " << id.depth << " " << id.eta << " " << id.phi << " ---> " << hid;
edm::LogVerbatim("HcalSim") << "Initial indices:"
<< "subdet: " << det << " "
<< "z: " << z << " "
<< "depth: " << depth << " "
<< "ieta: " << eta << " "
<< "iphi: " << phi << " "
<< "layer: " << layer << " new HcalDetId -> hex.RawID = " << std::hex << hid.rawId()
<< std::dec << " subdet, z, depth, eta, phi = " << det << " " << z << " " << id.depth
<< " " << id.eta << " " << id.phi << " ---> " << hid;
#endif
return hid;
}
Expand Down

0 comments on commit 4591480

Please sign in to comment.