From 9b80a980ab95aae697042332c64fc047293a2c60 Mon Sep 17 00:00:00 2001 From: Sunanda Date: Mon, 28 Aug 2017 19:19:03 +0200 Subject: [PATCH 1/7] Commit after resolving conflicts --- .../plugins/HcalHBHEMuonAnalyzer.cc | 12 +++- .../interface/HcalDDDRecConstants.h | 7 +- .../interface/HcalDDDSimConstants.h | 23 ++++--- .../HcalCommonData/src/HcalDDDRecConstants.cc | 28 +++++++- .../HcalCommonData/src/HcalDDDSimConstants.cc | 65 ++++++++++++++++--- 5 files changed, 107 insertions(+), 28 deletions(-) diff --git a/Calibration/HcalCalibAlgos/plugins/HcalHBHEMuonAnalyzer.cc b/Calibration/HcalCalibAlgos/plugins/HcalHBHEMuonAnalyzer.cc index d5cacd693ff3c..d96679c8b8776 100644 --- a/Calibration/HcalCalibAlgos/plugins/HcalHBHEMuonAnalyzer.cc +++ b/Calibration/HcalCalibAlgos/plugins/HcalHBHEMuonAnalyzer.cc @@ -821,17 +821,25 @@ double HcalHBHEMuonAnalyzer::activeLength(const DetId& id_) { HcalDetId id(id_); int ieta = id.ietaAbs(); int depth= id.depth(); + int zside= id.zside(); + int iphi = id.iphi(); double lx(0); if (id.subdet() == HcalBarrel) { for (unsigned int i=0; i iphis; HcalActiveLength(int ie=0, int d=0, int z=0, int s=0, double et=0, double t=0) : ieta(ie), depth(d), zside(z), stype(s), eta(et), thick(t) {} @@ -78,9 +79,9 @@ class HcalDDDRecConstants { HcalID getHCID(int subdet, int ieta, int iphi, int lay, int idepth) const; std::vector getHFCellParameters() const; - void getLayerDepth(int ieta, std::map& layers) const; - int getLayerFront(int det, int eta, int phi, int depth) const; - double getLayer0Wt(int det, int phi, int zside) const {return hcons.getLayer0Wt(det,phi,zside);} + void getLayerDepth(const int ieta, std::map& layers) const; + int getLayerFront(const int det, const int eta, const int phi, const int depth) const; + double getLayer0Wt(const int det, const int phi, const int zside) const {return hcons.getLayer0Wt(det,phi,zside);} int getMaxDepth(const int type) const {return maxDepth[type];} int getMaxDepth(int itype, int ieta, int iphi, int zside) const; diff --git a/Geometry/HcalCommonData/interface/HcalDDDSimConstants.h b/Geometry/HcalCommonData/interface/HcalDDDSimConstants.h index 8230607fa0d12..3f59f08212a43 100644 --- a/Geometry/HcalCommonData/interface/HcalDDDSimConstants.h +++ b/Geometry/HcalCommonData/interface/HcalDDDSimConstants.h @@ -51,16 +51,17 @@ class HcalDDDSimConstants { const std::vector & getEtaTableHF() const {return hpar->etaTableHF;} const std::vector & getGparHF() const {return hpar->gparHF;} const std::vector & getIdHF2QIE() const {return idHF2QIE;} - double getLayer0Wt(int det, int phi, - int zside) const; - int getFrontLayer(int det, int eta) const; - int getLayerFront(int det, int eta, - int phi, int zside, - int depth) const; - int getLayerBack(int det, int eta, - int phi, int zside, - int depth) const; - int getLayerMax(int eta, int depth) const; + double getLayer0Wt(const int det, const int phi, + const int zside) const; + int getFrontLayer(const int det, const int eta) const; + int getLastLayer(const int det, const int eta) const; + int getLayerFront(const int det, const int eta, + const int phi, const int zside, + const int depth) const; + int getLayerBack(const int det, const int eta, + const int phi, const int zside, + const int depth) const; + int getLayerMax(const int eta, const int depth) const; int getMaxDepth(const int type) const {return maxDepth[type];} int getMaxDepth(int det, int eta, int phi, int zside, @@ -130,6 +131,8 @@ class HcalDDDSimConstants { int depthEta29[2]; // maximum depth index for ieta=29 int layFHB[2]; // first layers in HB (normal, special 16) int layFHE[3]; // first layers in HE (normal, special 16, 18) + int layBHB[3]; // last layers in HB (normal, special 15, 16) + int layBHE[3]; // last layers in HE (normal, special 16, 17|18) bool isBH_; // if HE is BH std::vector idHF2QIE; // DetId's of HF modules with 2 QIE's std::pair depthMaxDf_, depthMaxSp_; // (subdet,maximum depth) default,special diff --git a/Geometry/HcalCommonData/src/HcalDDDRecConstants.cc b/Geometry/HcalCommonData/src/HcalDDDRecConstants.cc index 6045574e73a9c..85ba06e469143 100644 --- a/Geometry/HcalCommonData/src/HcalDDDRecConstants.cc +++ b/Geometry/HcalCommonData/src/HcalDDDRecConstants.cc @@ -295,7 +295,9 @@ int HcalDDDRecConstants::getLayerFront(const int idet, const int ieta, int layFront = hcons.ldMap()->getLayerFront(subdet,eta,iphi,zside,depth); if (layFront < 0) { int laymin = hcons.getFrontLayer(subdet, ieta); - if (eta <= hpar->etaMax[1]) { + if (eta == 16 && subdet == 2) { + layFront = laymin; + } else if (eta <= hpar->etaMax[1]) { for (unsigned int k=0; k= laymin) { @@ -328,6 +330,10 @@ int HcalDDDRecConstants::getMaxDepth (const int itype, const int ieta, if (type == 1 && ieta >= hpar->noff[1]) lmax = hcons.getDepthEta29M(0,false); } } +#ifdef EDM_ML_DEBUG + std::cout << "getMaxDepth::Input " << itype << ":" << ieta << ":" + << iphi << ":" << zside << " Output " << lmax << std::endl; +#endif return lmax; } @@ -446,13 +452,26 @@ HcalDDDRecConstants::getThickActive(const int type) const { int ieta = bin.ieta; int zside = bin.zside; int stype = (bin.phis.size() > 4) ? 0 : 1; + int layf = getLayerFront(type+1,zside*ieta,bin.phis[0].first,bin.depthStart) + 1; + int layl = hcons.getLastLayer(type+1,zside*ieta) + 1; double eta = 0.5*(bin.etaMin+bin.etaMax); double theta = 2*atan(exp(-eta)); double scale = 1.0/((type == 0) ? sin(theta) : cos(theta)); int depth = bin.depthStart; +#ifdef EDM_ML_DEBUG + std::cout << "Eta " << ieta << " zside " << zside << " depth " << depth + << " Layers " << layf << ":" << layl << ":" << bin.layer.size(); + for (auto ll : bin.layer) std::cout << " " << ll.first << ":" << ll.second; + std::cout << " phi "; + for (auto phi : bin.phis) std::cout << " " << phi.first; + std::cout << std::endl; +#endif for (unsigned int i = 0; i < bin.layer.size(); ++i) { double thick(0); - for (int j = bin.layer[i].first; j <= bin.layer[i].second; ++j) { + int lmin = (type == 1 && ieta == iEtaMin[1]) ? layf : + std::max(bin.layer[i].first,layf); + int lmax = std::min(bin.layer[i].second,layl); + for (int j = lmin; j <= lmax; ++j) { if (type == 0 || j > 1) { double t = ((type == 0) ? gconsHB[j-1].second : gconsHE[j-1].second); if (t > 0) thick += t; @@ -460,6 +479,8 @@ HcalDDDRecConstants::getThickActive(const int type) const { } thick *= (2.*scale); HcalDDDRecConstants::HcalActiveLength active(ieta,depth,zside,stype,zside*eta,thick); + for (auto phi : bin.phis) + active.iphis.emplace_back(phi.first); actives.emplace_back(active); ++depth; #ifdef EDM_ML_DEBUG @@ -840,7 +861,8 @@ void HcalDDDRecConstants::initialize(void) { int laymax0 = (imx > 16) ? layerGroup(i,16) : laymax; if (i+1 == iEtaMax[0]) laymax0 = hcons.getDepthEta16M(1); #ifdef EDM_ML_DEBUG - std::cout << "HB " << i << " " << imx << " " << laymax << " " << laymax0 << std::endl; + std::cout << "HB " << i << " " << imx << " " << laymax << " " + << laymax0 << std::endl; #endif if (maxDepth[0] < laymax0) maxDepth[0] = laymax0; } diff --git a/Geometry/HcalCommonData/src/HcalDDDSimConstants.cc b/Geometry/HcalCommonData/src/HcalDDDSimConstants.cc index 59c7694e4cd1e..5f666df829f19 100644 --- a/Geometry/HcalCommonData/src/HcalDDDSimConstants.cc +++ b/Geometry/HcalCommonData/src/HcalDDDSimConstants.cc @@ -339,6 +339,22 @@ int HcalDDDSimConstants::getFrontLayer(const int det, const int eta) const { return lay; } +int HcalDDDSimConstants::getLastLayer(const int det, const int eta) const { + + int lay=0; + if (det == 1) { + if (eta == 15 || eta == -15) lay = layBHB[1]; + else if (eta == 16 || eta == -16) lay = layBHB[2]; + else lay = layBHB[0]; + } else { + if (eta == 16 || eta == -16) lay = layBHE[1]; + else if (eta == 17 || eta == -17 || + eta == 18 || eta == -18) lay = layBHE[2]; + else lay = layBHE[0]; + } + return lay; +} + double HcalDDDSimConstants::getLayer0Wt(const int det, const int phi, const int zside) const { @@ -681,7 +697,9 @@ void HcalDDDSimConstants::printTiles() const { int kphi = (detsp > 0) ? phis[0] : 1; int zside = (kphi > 0) ? 1 : -1; int iphi = (kphi > 0) ? kphi : -kphi; - std::cout << "Tile Information for HB from " << hpar->etaMin[0] << " to " << hpar->etaMax[0] << "\n\n"; + edm::LogVerbatim("HcalGeom") << "Tile Information for HB from " + << hpar->etaMin[0] << " to " << hpar->etaMax[0] + << "\n"; for (int eta=hpar->etaMin[0]; eta<= hpar->etaMax[0]; eta++) { int dmax = getMaxDepth(1,eta,iphi,-zside,false); for (int depth=1; depth<=dmax; depth++) @@ -693,7 +711,9 @@ void HcalDDDSimConstants::printTiles() const { } } - std::cout << "\nTile Information for HE from " << hpar->etaMin[1] << " to " << hpar->etaMax[1] << "\n\n"; + edm::LogVerbatim("HcalGeom") << "\nTile Information for HE from " + << hpar->etaMin[1] << " to " << hpar->etaMax[1] + << "\n"; for (int eta=hpar->etaMin[1]; eta<= hpar->etaMax[1]; eta++) { int dmin = (eta == hpar->etaMin[1]) ? getDepthEta16(2,iphi,-zside) : 1; int dmax = getMaxDepth(2,eta,iphi,-zside,false); @@ -857,8 +877,10 @@ void HcalDDDSimConstants::initialize( void ) { std::cout << " [" << k << "] " << idHF2QIE[k] << std::endl; #endif - layFHB[0] = 0; layFHB[1] = 1; - layFHE[0] = 1; layFHE[1] = 9; layFHE[2] = 0; + layFHB[0] = 0; layFHB[1] = 1; + layBHB[0] = 16; layBHB[1] = 15; layBHB[2] = 8; + layFHE[0] = 1; layFHE[1] = 4; layFHE[2] = 0; + layBHE[0] = 18; layBHE[1] = 9; layBHE[2] = 14; depthMaxSp_ = std::pair(0,0); int noffk(noffsize+5); if ((int)(hpar->noff.size()) > (noffsize+5)) { @@ -906,6 +928,10 @@ void HcalDDDSimConstants::initialize( void ) { for (int i=0; i<2; ++i) layFHB[i] = hpar->noff[noffm+i+1]; for (int i=0; i<3; ++i) layFHE[i] = hpar->noff[noffm+i+3]; } + if (ndnext > 10 && (int)(hpar->noff.size()) >= noffm+ndnext) { + for (int i=0; i<3; ++i) layBHB[i] = hpar->noff[noffm+i+6]; + for (int i=0; i<3; ++i) layBHE[i] = hpar->noff[noffm+i+9]; + } } } } @@ -913,6 +939,9 @@ void HcalDDDSimConstants::initialize( void ) { std::cout << "Front Layer Definition for HB: " << layFHB[0] << ":" << layFHB[1] << " and for HE: " << layFHE[0] << ":" << layFHE[1] << ":" << layFHE[2] << std::endl; + std::cout << "Last Layer Definition for HB: " << layBHB[0] << ":" + << layBHB[1] << ":" << layBHB[2] << " and for HE: " << layBHE[0] + << ":" << layBHE[1] << ":" << layBHE[2] << std::endl; #endif if (depthMaxSp_.first == 0) { depthMaxSp_ = depthMaxDf_ = std::pair(2,maxDepth[1]); @@ -1065,7 +1094,8 @@ double HcalDDDSimConstants::getGain(const HcalSubdetector subdet, void HcalDDDSimConstants::printTileHB(const int eta, const int phi, const int zside, const int depth) const { - std::cout << "HcalDDDSimConstants::printTileHB for eta " << eta << " and depth " << depth << "\n"; + edm::LogVerbatim("HcalGeom") << "HcalDDDSimConstants::printTileHB for eta " + << eta << " and depth " << depth; double etaL = hpar->etaTable.at(eta-1); double thetaL = 2.*atan(exp(-etaL)); @@ -1073,7 +1103,10 @@ void HcalDDDSimConstants::printTileHB(const int eta, const int phi, double thetaH = 2.*atan(exp(-etaH)); int layL = getLayerFront(1,eta,phi,zside,depth); int layH = getLayerBack(1,eta,phi,zside,depth); - std::cout << "\ntileHB:: eta|depth " << zside*eta << "|" << depth << " theta " << thetaH/CLHEP::deg << ":" << thetaL/CLHEP::deg << " Layer " << layL << ":" << layH-1 << "\n"; + edm::LogVerbatim("HcalGeom") << "\ntileHB:: eta|depth " << zside*eta << "|" + << depth << " theta " << thetaH/CLHEP::deg + << ":" << thetaL/CLHEP::deg << " Layer " + << layL << ":" << layH-1; for (int lay=layL; lay area(2,0); int kk=0; @@ -1088,7 +1121,10 @@ void HcalDDDSimConstants::printTileHB(const int eta, const int phi, } } } - if (area[0] > 0) std::cout << std::setw(2) << lay << " Area " << std::setw(8) << area[0] << " " << std::setw(8) << area[1] << "\n"; + if (area[0] > 0) + edm::LogVerbatim("HcalGeom") << std::setw(2) << lay << " Area " + << std::setw(8) << area[0] << " " + << std::setw(8) << area[1]; } } @@ -1104,7 +1140,10 @@ void HcalDDDSimConstants::printTileHE(const int eta, const int phi, double phib = hpar->phibin[eta-1]; int nphi = 2; if (phib > 6*CLHEP::deg) nphi = 1; - std::cout << "\ntileHE:: Eta/depth " << zside*eta << "|" << depth << " theta " << thetaH/CLHEP::deg << ":" << thetaL/CLHEP::deg << " Layer " << layL << ":" << layH-1 << " phi " << nphi << "\n"; + edm::LogVerbatim("HcalGeom") << "\ntileHE:: Eta/depth " << zside*eta << "|" + << depth << " theta " << thetaH/CLHEP::deg + << ":" << thetaL/CLHEP::deg << " Layer " + << layL << ":" << layH-1 << " phi " << nphi; for (int lay=layL; lay area(4,0); int kk=0; @@ -1138,9 +1177,15 @@ void HcalDDDSimConstants::printTileHE(const int eta, const int phi, int lay0 = lay-1; if (eta == 18) lay0++; if (nphi == 1) { - std::cout << std::setw(2) << lay0 << " Area " << std::setw(8) << area[0] << " " << std::setw(8) << area[1] << "\n"; + edm::LogVerbatim("HcalGeom") << std::setw(2) << lay0 << " Area " + << std::setw(8) << area[0] << " " + << std::setw(8) << area[1]; } else { - std::cout << std::setw(2) << lay0 << " Area " << std::setw(8) << area[0] << " " << std::setw(8) << area[1] << ":" << std::setw(8) << area[2] << " " << std::setw(8) << area[3] << "\n"; + edm::LogVerbatim("HcalGeom") << std::setw(2) << lay0 << " Area " + << std::setw(8) << area[0] << " " + << std::setw(8) << area[1] << ":" + << std::setw(8) << area[2] << " " + << std::setw(8) << area[3]; } } } From ddf4f3023c28bf7a49e4d9f25c026e0ee922980a Mon Sep 17 00:00:00 2001 From: Sunanda Date: Tue, 15 Aug 2017 23:29:49 +0200 Subject: [PATCH 2/7] Make a few code style corrections --- .../HcalCalibAlgos/plugins/HcalHBHEMuonAnalyzer.cc | 8 +------- Geometry/HcalCommonData/BuildFile.xml | 1 + 2 files changed, 2 insertions(+), 7 deletions(-) diff --git a/Calibration/HcalCalibAlgos/plugins/HcalHBHEMuonAnalyzer.cc b/Calibration/HcalCalibAlgos/plugins/HcalHBHEMuonAnalyzer.cc index d96679c8b8776..afef29ce2cade 100644 --- a/Calibration/HcalCalibAlgos/plugins/HcalHBHEMuonAnalyzer.cc +++ b/Calibration/HcalCalibAlgos/plugins/HcalHBHEMuonAnalyzer.cc @@ -67,7 +67,6 @@ class HcalHBHEMuonAnalyzer : public edm::one::EDAnalyzer + From 1fa9733387e7df8f3550230e7653f9258bd0babe Mon Sep 17 00:00:00 2001 From: Sunanda Date: Wed, 16 Aug 2017 23:54:43 +0200 Subject: [PATCH 3/7] Correct for last layers of ieta 17:18 --- .../HcalCommonData/interface/HcalDDDSimConstants.h | 2 +- Geometry/HcalCommonData/src/HcalDDDSimConstants.cc | 13 +++++++------ 2 files changed, 8 insertions(+), 7 deletions(-) diff --git a/Geometry/HcalCommonData/interface/HcalDDDSimConstants.h b/Geometry/HcalCommonData/interface/HcalDDDSimConstants.h index 3f59f08212a43..8a1d339125d55 100644 --- a/Geometry/HcalCommonData/interface/HcalDDDSimConstants.h +++ b/Geometry/HcalCommonData/interface/HcalDDDSimConstants.h @@ -132,7 +132,7 @@ class HcalDDDSimConstants { int layFHB[2]; // first layers in HB (normal, special 16) int layFHE[3]; // first layers in HE (normal, special 16, 18) int layBHB[3]; // last layers in HB (normal, special 15, 16) - int layBHE[3]; // last layers in HE (normal, special 16, 17|18) + int layBHE[4]; // last layers in HE (normal, special 16, 17, 18) bool isBH_; // if HE is BH std::vector idHF2QIE; // DetId's of HF modules with 2 QIE's std::pair depthMaxDf_, depthMaxSp_; // (subdet,maximum depth) default,special diff --git a/Geometry/HcalCommonData/src/HcalDDDSimConstants.cc b/Geometry/HcalCommonData/src/HcalDDDSimConstants.cc index 5f666df829f19..28f52d6dc89a8 100644 --- a/Geometry/HcalCommonData/src/HcalDDDSimConstants.cc +++ b/Geometry/HcalCommonData/src/HcalDDDSimConstants.cc @@ -348,8 +348,8 @@ int HcalDDDSimConstants::getLastLayer(const int det, const int eta) const { else lay = layBHB[0]; } else { if (eta == 16 || eta == -16) lay = layBHE[1]; - else if (eta == 17 || eta == -17 || - eta == 18 || eta == -18) lay = layBHE[2]; + else if (eta == 17 || eta == -17) lay = layBHE[2]; + else if (eta == 18 || eta == -18) lay = layBHE[3]; else lay = layBHE[0]; } return lay; @@ -880,7 +880,7 @@ void HcalDDDSimConstants::initialize( void ) { layFHB[0] = 0; layFHB[1] = 1; layBHB[0] = 16; layBHB[1] = 15; layBHB[2] = 8; layFHE[0] = 1; layFHE[1] = 4; layFHE[2] = 0; - layBHE[0] = 18; layBHE[1] = 9; layBHE[2] = 14; + layBHE[0] = 18; layBHE[1] = 9; layBHE[2] = 14; layBHE[3] = 16; depthMaxSp_ = std::pair(0,0); int noffk(noffsize+5); if ((int)(hpar->noff.size()) > (noffsize+5)) { @@ -928,9 +928,9 @@ void HcalDDDSimConstants::initialize( void ) { for (int i=0; i<2; ++i) layFHB[i] = hpar->noff[noffm+i+1]; for (int i=0; i<3; ++i) layFHE[i] = hpar->noff[noffm+i+3]; } - if (ndnext > 10 && (int)(hpar->noff.size()) >= noffm+ndnext) { + if (ndnext > 11 && (int)(hpar->noff.size()) >= noffm+ndnext) { for (int i=0; i<3; ++i) layBHB[i] = hpar->noff[noffm+i+6]; - for (int i=0; i<3; ++i) layBHE[i] = hpar->noff[noffm+i+9]; + for (int i=0; i<4; ++i) layBHE[i] = hpar->noff[noffm+i+9]; } } } @@ -941,7 +941,8 @@ void HcalDDDSimConstants::initialize( void ) { << ":" << layFHE[2] << std::endl; std::cout << "Last Layer Definition for HB: " << layBHB[0] << ":" << layBHB[1] << ":" << layBHB[2] << " and for HE: " << layBHE[0] - << ":" << layBHE[1] << ":" << layBHE[2] << std::endl; + << ":" << layBHE[1] << ":" << layBHE[2] << ":" << layBHE[3] + << std::endl; #endif if (depthMaxSp_.first == 0) { depthMaxSp_ = depthMaxDf_ = std::pair(2,maxDepth[1]); From 447980c7b83d6286d73f2bdb2e22d628db8bd37e Mon Sep 17 00:00:00 2001 From: Sunanda Date: Thu, 17 Aug 2017 22:37:55 +0200 Subject: [PATCH 4/7] Get rid of virtual --- .../HcalCalibAlgos/plugins/HcalHBHEMuonAnalyzer.cc | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/Calibration/HcalCalibAlgos/plugins/HcalHBHEMuonAnalyzer.cc b/Calibration/HcalCalibAlgos/plugins/HcalHBHEMuonAnalyzer.cc index afef29ce2cade..a471582ceb5a9 100644 --- a/Calibration/HcalCalibAlgos/plugins/HcalHBHEMuonAnalyzer.cc +++ b/Calibration/HcalCalibAlgos/plugins/HcalHBHEMuonAnalyzer.cc @@ -71,10 +71,10 @@ class HcalHBHEMuonAnalyzer : public edm::one::EDAnalyzer Date: Tue, 22 Aug 2017 22:35:46 +0200 Subject: [PATCH 5/7] use std::abs --- .../HcalCommonData/src/HcalDDDSimConstants.cc | 24 +++++++++---------- 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/Geometry/HcalCommonData/src/HcalDDDSimConstants.cc b/Geometry/HcalCommonData/src/HcalDDDSimConstants.cc index 28f52d6dc89a8..34d7e337d8dff 100644 --- a/Geometry/HcalCommonData/src/HcalDDDSimConstants.cc +++ b/Geometry/HcalCommonData/src/HcalDDDSimConstants.cc @@ -329,12 +329,12 @@ int HcalDDDSimConstants::getFrontLayer(const int det, const int eta) const { int lay=0; if (det == 1) { - if (eta == 16 || eta == -16) lay = layFHB[1]; - else lay = layFHB[0]; + if (std::abs(eta) == 16) lay = layFHB[1]; + else lay = layFHB[0]; } else { - if (eta == 16 || eta == -16) lay = layFHE[1]; - else if (eta == 18 || eta == -18) lay = layFHE[2]; - else lay = layFHE[0]; + if (std::abs(eta) == 16) lay = layFHE[1]; + else if (std::abs(eta) == 18) lay = layFHE[2]; + else lay = layFHE[0]; } return lay; } @@ -343,14 +343,14 @@ int HcalDDDSimConstants::getLastLayer(const int det, const int eta) const { int lay=0; if (det == 1) { - if (eta == 15 || eta == -15) lay = layBHB[1]; - else if (eta == 16 || eta == -16) lay = layBHB[2]; - else lay = layBHB[0]; + if (std::abs(eta) == 15) lay = layBHB[1]; + else if (std::abs(eta) == 16) lay = layBHB[2]; + else lay = layBHB[0]; } else { - if (eta == 16 || eta == -16) lay = layBHE[1]; - else if (eta == 17 || eta == -17) lay = layBHE[2]; - else if (eta == 18 || eta == -18) lay = layBHE[3]; - else lay = layBHE[0]; + if (std::abs(eta) == 16) lay = layBHE[1]; + else if (std::abs(eta) == 17) lay = layBHE[2]; + else if (std::abs(eta) == 18) lay = layBHE[3]; + else lay = layBHE[0]; } return lay; } From c6f583e1860932c96379204858b43aace32e4ad2 Mon Sep 17 00:00:00 2001 From: Sunanda Date: Mon, 28 Aug 2017 19:22:40 +0200 Subject: [PATCH 6/7] Commit after resolving conflicts DDDRec --- .../interface/HcalDDDRecConstants.h | 14 ++++----- .../HcalCommonData/src/HcalDDDRecConstants.cc | 31 +++++++++---------- 2 files changed, 22 insertions(+), 23 deletions(-) diff --git a/Geometry/HcalCommonData/interface/HcalDDDRecConstants.h b/Geometry/HcalCommonData/interface/HcalDDDRecConstants.h index cb0177887c9d9..e017a491cb71a 100644 --- a/Geometry/HcalCommonData/interface/HcalDDDRecConstants.h +++ b/Geometry/HcalCommonData/interface/HcalDDDRecConstants.h @@ -58,7 +58,7 @@ class HcalDDDRecConstants { nPhi(nfi), rMin(r1), rMax(r2) {} }; - std::vector > getConstHBHE(const int type) const { + std::vector > getConstHBHE(int type) const { if (type == 0) return gconsHB; else if (type == 1) return gconsHE; else {std::vector > gcons; return gcons;} @@ -70,11 +70,11 @@ class HcalDDDRecConstants { const int zside) const {return hcons.getDepthEta16(det,iphi,zside);} std::vector getEtaBins(int itype) const; std::pair getEtaPhi(int subdet, int ieta, int iphi) const; - std::pair getEtaRange(const int i) const + std::pair getEtaRange(int i) const {return std::pair(iEtaMin[i],iEtaMax[i]);} const std::vector & getEtaTable() const {return etaTable;} const std::vector & getEtaTableHF() const {return hpar->etaTableHF;} - std::pair getEtaLimit(const int i) const + std::pair getEtaLimit(int i) const {return std::pair(etaTable[i],etaTable[i+1]);} HcalID getHCID(int subdet, int ieta, int iphi, int lay, int idepth) const; @@ -88,10 +88,10 @@ class HcalDDDRecConstants { int getMinDepth(int itype, int ieta, int iphi, int zside) const; int getNEta() const {return hpar->etagroup.size();} - int getNoff(const int i) const {return hpar->noff[i];} - int getNPhi(const int type) const {return nPhiBins[type];} - double getPhiBin(const int i) const {return phibin[i];} - double getPhiOff(const int i) const {return hpar->phioff[i];} + int getNoff(int i) const {return hpar->noff[i];} + int getNPhi(int type) const {return nPhiBins[type];} + double getPhiBin(int i) const {return phibin[i];} + double getPhiOff(int i) const {return hpar->phioff[i];} const std::vector & getPhiOffs() const {return hpar->phioff;} std::vector > getPhis(int subdet, int ieta) const; const std::vector & getPhiTable() const {return phibin;} diff --git a/Geometry/HcalCommonData/src/HcalDDDRecConstants.cc b/Geometry/HcalCommonData/src/HcalDDDRecConstants.cc index 85ba06e469143..6a828caa993d1 100644 --- a/Geometry/HcalCommonData/src/HcalDDDRecConstants.cc +++ b/Geometry/HcalCommonData/src/HcalDDDRecConstants.cc @@ -26,8 +26,8 @@ HcalDDDRecConstants::~HcalDDDRecConstants() { #endif } -std::vector HcalDDDRecConstants::getDepth(const unsigned int eta, - const bool extra) const { +std::vector HcalDDDRecConstants::getDepth(unsigned int eta, + bool extra) const { if (!extra) { std::vector::const_iterator last = hpar->layerGroupEtaRec.begin(); @@ -47,7 +47,8 @@ std::vector HcalDDDRecConstants::getDepth(const unsigned int eta, } } -std::vector HcalDDDRecConstants::getDepth(const int det, const int phi, const int zside, const unsigned int eta) const { +std::vector HcalDDDRecConstants::getDepth(int det, int phi, int zside, + unsigned int eta) const { std::map layers; hcons.ldMap()->getLayerDepth(det, eta+1, phi, zside, layers); if (layers.empty()) { @@ -61,7 +62,7 @@ std::vector HcalDDDRecConstants::getDepth(const int det, const int phi, con } std::vector -HcalDDDRecConstants::getEtaBins(const int itype) const { +HcalDDDRecConstants::getEtaBins(int itype) const { std::vector bins; unsigned int type = (itype == 0) ? 0 : 1; @@ -270,8 +271,7 @@ HcalDDDRecConstants::getHFCellParameters() const { return cells; } -void HcalDDDRecConstants::getLayerDepth(const int ieta, - std::map& layers) const { +void HcalDDDRecConstants::getLayerDepth(int ieta, std::map& layers) const { layers.clear(); for (unsigned int l=0; l 0) ? 1 : -1; int eta = zside*ieta; @@ -315,8 +315,8 @@ int HcalDDDRecConstants::getLayerFront(const int idet, const int ieta, return layFront; } -int HcalDDDRecConstants::getMaxDepth (const int itype, const int ieta, - const int iphi, const int zside) const { +int HcalDDDRecConstants::getMaxDepth (int itype, int ieta, + int iphi, int zside) const { unsigned int type = (itype == 0) ? 0 : 1; int lmax = hcons.getMaxDepth(type+1, ieta, iphi, zside, true); @@ -337,8 +337,8 @@ int HcalDDDRecConstants::getMaxDepth (const int itype, const int ieta, return lmax; } -int HcalDDDRecConstants::getMinDepth (const int itype, const int ieta, - const int iphi, const int zside) const { +int HcalDDDRecConstants::getMinDepth (int itype, int ieta, + int iphi, int zside) const { int lmin = hcons.getMinDepth(itype+1, ieta, iphi, zside, true); if (lmin < 0) { @@ -441,7 +441,7 @@ double HcalDDDRecConstants::getRZ(int subdet, int layer) const { std::vector -HcalDDDRecConstants::getThickActive(const int type) const { +HcalDDDRecConstants::getThickActive(int type) const { std::vector actives; std::vector bins = getEtaBins(type); @@ -1028,7 +1028,7 @@ void HcalDDDRecConstants::initialize(void) { } -unsigned int HcalDDDRecConstants::layerGroupSize(const int eta) const { +unsigned int HcalDDDRecConstants::layerGroupSize(int eta) const { unsigned int k = 0; for (auto const & it : hpar->layerGroupEtaRec) { if (it.layer == (unsigned int)(eta + 1)) { @@ -1040,8 +1040,7 @@ unsigned int HcalDDDRecConstants::layerGroupSize(const int eta) const { return k; } -unsigned int HcalDDDRecConstants::layerGroup(const int eta, - const int i) const { +unsigned int HcalDDDRecConstants::layerGroup(int eta, int i) const { unsigned int k = 0; for (auto const & it : hpar->layerGroupEtaRec) { if (it.layer == (unsigned int)(eta + 1)) { From 83019dfaf525266cbb7d4013fc4803e292de73ea Mon Sep 17 00:00:00 2001 From: Sunanda Date: Mon, 28 Aug 2017 22:08:30 +0200 Subject: [PATCH 7/7] Fix some const's --- .../interface/HcalDDDRecConstants.h | 60 ++++---- .../interface/HcalDDDSimConstants.h | 126 ++++++++-------- .../HcalCommonData/src/HcalDDDRecConstants.cc | 39 ++--- .../HcalCommonData/src/HcalDDDSimConstants.cc | 140 +++++++++--------- 4 files changed, 182 insertions(+), 183 deletions(-) diff --git a/Geometry/HcalCommonData/interface/HcalDDDRecConstants.h b/Geometry/HcalCommonData/interface/HcalDDDRecConstants.h index e017a491cb71a..502cc2cfd337a 100644 --- a/Geometry/HcalCommonData/interface/HcalDDDRecConstants.h +++ b/Geometry/HcalCommonData/interface/HcalDDDRecConstants.h @@ -58,49 +58,51 @@ class HcalDDDRecConstants { nPhi(nfi), rMin(r1), rMax(r2) {} }; - std::vector > getConstHBHE(int type) const { + std::vector > getConstHBHE(const int& type) const { if (type == 0) return gconsHB; else if (type == 1) return gconsHE; else {std::vector > gcons; return gcons;} } - std::vector getDepth(int det, int phi, - int zside, unsigned int eta) const; - std::vector getDepth(unsigned int eta, bool extra) const; - int getDepthEta16(const int det, const int iphi, - const int zside) const {return hcons.getDepthEta16(det,iphi,zside);} - std::vector getEtaBins(int itype) const; - std::pair getEtaPhi(int subdet, int ieta, int iphi) const; - std::pair getEtaRange(int i) const + std::vector getDepth(const int& det, const int& phi, + const int& zside, const unsigned int& eta) const; + std::vector getDepth(const unsigned int& eta, const bool& extra) const; + int getDepthEta16(const int& det, const int& iphi, + const int& zside) const {return hcons.getDepthEta16(det,iphi,zside);} + std::vector getEtaBins(const int& itype) const; + std::pair getEtaPhi(const int& subdet, const int& ieta, const int& iphi) const; + std::pair getEtaRange(const int& i) const {return std::pair(iEtaMin[i],iEtaMax[i]);} const std::vector & getEtaTable() const {return etaTable;} const std::vector & getEtaTableHF() const {return hpar->etaTableHF;} - std::pair getEtaLimit(int i) const + std::pair getEtaLimit(const int& i) const {return std::pair(etaTable[i],etaTable[i+1]);} - HcalID getHCID(int subdet, int ieta, int iphi, int lay, - int idepth) const; + HcalID getHCID(int subdet, int ieta, int iphi, int lay, int idepth) const; std::vector getHFCellParameters() const; - void getLayerDepth(const int ieta, std::map& layers) const; - int getLayerFront(const int det, const int eta, const int phi, const int depth) const; - double getLayer0Wt(const int det, const int phi, const int zside) const {return hcons.getLayer0Wt(det,phi,zside);} - int getMaxDepth(const int type) const {return maxDepth[type];} - int getMaxDepth(int itype, int ieta, - int iphi, int zside) const; - int getMinDepth(int itype, int ieta, - int iphi, int zside) const; + void getLayerDepth(const int& ieta, std::map& layers) const; + int getLayerFront(const int& det, const int& eta, const int& phi, + const int& depth) const; + double getLayer0Wt(const int& det, const int& phi, + const int& zside) const {return hcons.getLayer0Wt(det,phi,zside);} + int getMaxDepth(const int& type) const {return maxDepth[type];} + int getMaxDepth(const int& itype, const int& ieta, + const int& iphi, const int& zside) const; + int getMinDepth(const int& itype, const int& ieta, + const int& iphi, const int& zside) const; int getNEta() const {return hpar->etagroup.size();} - int getNoff(int i) const {return hpar->noff[i];} - int getNPhi(int type) const {return nPhiBins[type];} - double getPhiBin(int i) const {return phibin[i];} - double getPhiOff(int i) const {return hpar->phioff[i];} + int getNoff(const int& i) const {return hpar->noff[i];} + int getNPhi(const int& type) const {return nPhiBins[type];} + double getPhiBin(const int& i) const {return phibin[i];} + double getPhiOff(const int& i) const {return hpar->phioff[i];} const std::vector & getPhiOffs() const {return hpar->phioff;} - std::vector > getPhis(int subdet, int ieta) const; + std::vector > getPhis(const int& subdet, const int& ieta) const; const std::vector & getPhiTable() const {return phibin;} const std::vector & getPhiTableHF() const {return hpar->phitable;} int getPhiZOne(std::vector >& phiz) const; - double getRZ(int subdet, int ieta, int depth) const; - double getRZ(int subdet, int ieta, int iphi, int depth) const; - double getRZ(int subdet, int layer) const; - std::vector getThickActive(int type) const; + double getRZ(const int& subdet, const int& ieta, const int& depth) const; + double getRZ(const int& subdet, const int& ieta, const int& iphi, + const int& depth) const; + double getRZ(const int& subdet, const int& layer) const; + std::vector getThickActive(const int& type) const; int getTopoMode() const {return ((hpar->topologyMode)&0xFF);} int getTriggerMode() const {return (((hpar->topologyMode)>>8)&0xFF);} std::vector HcalCellTypes(HcalSubdetector) const; diff --git a/Geometry/HcalCommonData/interface/HcalDDDSimConstants.h b/Geometry/HcalCommonData/interface/HcalDDDSimConstants.h index 8a1d339125d55..db8a41bd30273 100644 --- a/Geometry/HcalCommonData/interface/HcalDDDSimConstants.h +++ b/Geometry/HcalCommonData/interface/HcalDDDSimConstants.h @@ -28,80 +28,80 @@ class HcalDDDSimConstants { HcalDDDSimConstants(const HcalParameters* hp); ~HcalDDDSimConstants(); - HcalCellType::HcalCell cell(int det, int zside, - int depth, int etaR, - int iphi) const; - int findDepth(int det, int eta, - int phi, int zside, - int lay) const; - unsigned int findLayer(int layer, const std::vector& layerGroup) const; - std::vector > getConstHBHE(int type) const; - int getDepthEta16(int det, int phi, - int zside) const; - int getDepthEta16M(int det) const; - int getDepthEta29(int phi, int zside, int i) const; - int getDepthEta29M(int i, bool planOne) const; - std::pair getDetEta(double eta, int depth); - int getEta(int det, int lay, double hetaR); - std::pair getEtaDepth(int det, int etaR, int phi, - int zside, int depth, int lay); - double getEtaHO(double& etaR, double& x, double& y, - double& z) const; - std::pair getiEtaRange(const int i) const {return std::pair(hpar->etaMin[i],hpar->etaMax[i]);} + HcalCellType::HcalCell cell(const int& det, const int& zside, const int& depth, + const int& etaR, const int& iphi) const; + int findDepth(const int& det, const int& eta, const int& phi, + const int& zside, const int& lay) const; + unsigned int findLayer(const int& layer, const std::vector& layerGroup) const; + std::vector > getConstHBHE(const int& type) const; + int getDepthEta16(const int& det, const int& phi, + const int& zside) const; + int getDepthEta16M(const int& det) const; + int getDepthEta29(const int& phi, const int& zside, const int& i) const; + int getDepthEta29M(const int& i, const bool& planOne) const; + std::pair getDetEta(const double& eta, const int& depth); + int getEta(const int& det, const int& lay, const double& hetaR); + std::pair getEtaDepth(const int& det, int etaR, const int& phi, + const int& zside, int depth, const int& lay); + double getEtaHO(const double& etaR, const double& x, const double& y, + const double& z) const; + std::pair getiEtaRange(const int& i) const {return std::pair(hpar->etaMin[i],hpar->etaMax[i]);} const std::vector & getEtaTableHF() const {return hpar->etaTableHF;} const std::vector & getGparHF() const {return hpar->gparHF;} const std::vector & getIdHF2QIE() const {return idHF2QIE;} - double getLayer0Wt(const int det, const int phi, - const int zside) const; - int getFrontLayer(const int det, const int eta) const; - int getLastLayer(const int det, const int eta) const; - int getLayerFront(const int det, const int eta, - const int phi, const int zside, - const int depth) const; - int getLayerBack(const int det, const int eta, - const int phi, const int zside, - const int depth) const; - int getLayerMax(const int eta, const int depth) const; - int getMaxDepth(const int type) const {return maxDepth[type];} - int getMaxDepth(int det, int eta, - int phi, int zside, - bool partialOnly) const; - std::pair getMaxDepthDet(const int i) const {return ((i==1) ? depthMaxDf_ : depthMaxSp_);} - int getMinDepth(int det, int eta, - int phi, int zside, - bool partialOnly) const; - std::pair getModHalfHBHE(int type) const; - std::pair getPhiCons(int det, int ieta) const; - std::vector > getPhis(int subdet, int ieta) const; + double getLayer0Wt(const int& det, const int& phi, + const int& zside) const; + int getFrontLayer(const int& det, const int& eta) const; + int getLastLayer(const int& det, const int& eta) const; + int getLayerFront(const int& det, const int& eta, + const int& phi, const int& zside, + const int& depth) const; + int getLayerBack(const int& det, const int& eta, + const int& phi, const int& zside, + const int& depth) const; + int getLayerMax(const int& eta, const int& depth) const; + int getMaxDepth(const int& type) const {return maxDepth[type];} + int getMaxDepth(const int& det, const int& eta, + const int& phi, const int& zside, + const bool& partialOnly) const; + std::pair getMaxDepthDet(const int& i) const {return ((i==1) ? depthMaxDf_ : depthMaxSp_);} + int getMinDepth(const int& det, const int& eta, + const int& phi, const int& zside, + const bool& partialOnly) const; + std::pair getModHalfHBHE(const int& type) const; + std::pair getPhiCons(const int& det, const int& ieta) const; + std::vector > getPhis(const int& subdet, const int& ieta) const; const std::vector & getPhiTableHF() const {return hpar->phitable;} const std::vector & getRTableHF() const {return hpar->rTable;} std::vector HcalCellTypes() const; - std::vector HcalCellTypes(HcalSubdetector, int ieta=-1, + std::vector HcalCellTypes(const HcalSubdetector&, int ieta=-1, int depth=-1) const; bool isBH() const {return isBH_;} const HcalLayerDepthMap* ldMap() const {return &ldmap_;} - int maxHFDepth(int ieta, int iphi) const; - unsigned int numberOfCells(HcalSubdetector) const; - int phiNumber(int phi, int unit) const; + int maxHFDepth(const int& ieta, const int& iphi) const; + unsigned int numberOfCells(const HcalSubdetector&) const; + int phiNumber(const int& phi, const int& unit) const; void printTiles() const; - int unitPhi(int det, int etaR) const; - int unitPhi(double dphi) const; + int unitPhi(const int& det, const int& etaR) const; + int unitPhi(const double& dphi) const; private: + + static const int nDepthMax=9; + static const int maxLayer_=18; + static const int maxLayerHB_=16; + void initialize(); - double deltaEta(int det, int eta, - int depth) const; - double getEta(int det, int etaR, - int zside, int depth=1) const; - double getEta(double r, double z) const; - int getShift(HcalSubdetector subdet, - int depth) const; - double getGain (HcalSubdetector subdet, - int depth) const; - void printTileHB(int eta, int phi, - int zside, int depth) const; - void printTileHE(int eta, int phi, - int zside, int depth) const; + double deltaEta(const int& det, const int& eta, const int& depth) const; + double getEta(const int& det, const int& etaR, + const int& zside, int depth=1) const; + double getEta(const double& r, const double& z) const; + int getShift(const HcalSubdetector& subdet, const int& depth) const; + double getGain (const HcalSubdetector& subdet, const int& depth) const; + void printTileHB(const int& eta, const int& phi, + const int& zside, const int& depth) const; + void printTileHE(const int& eta, const int& phi, + const int& zside, const int& depth) const; unsigned int layerGroupSize(int eta) const; unsigned int layerGroup(int eta, int i) const; unsigned int layerGroup(int det, int eta, @@ -111,10 +111,6 @@ class HcalDDDSimConstants { const HcalParameters* hpar; HcalLayerDepthMap ldmap_; - static const int nDepthMax=9; - static const int maxLayer_=18; - static const int maxLayerHB_=16; - std::vector maxDepth; // Maximum depths in HB/HE/HF/HO int nEta; // Number of bins in eta for HB and HE int nR; // Number of bins in r diff --git a/Geometry/HcalCommonData/src/HcalDDDRecConstants.cc b/Geometry/HcalCommonData/src/HcalDDDRecConstants.cc index 6a828caa993d1..c6ddd1787209e 100644 --- a/Geometry/HcalCommonData/src/HcalDDDRecConstants.cc +++ b/Geometry/HcalCommonData/src/HcalDDDRecConstants.cc @@ -26,8 +26,8 @@ HcalDDDRecConstants::~HcalDDDRecConstants() { #endif } -std::vector HcalDDDRecConstants::getDepth(unsigned int eta, - bool extra) const { +std::vector HcalDDDRecConstants::getDepth(const unsigned int& eta, + const bool& extra) const { if (!extra) { std::vector::const_iterator last = hpar->layerGroupEtaRec.begin(); @@ -47,8 +47,8 @@ std::vector HcalDDDRecConstants::getDepth(unsigned int eta, } } -std::vector HcalDDDRecConstants::getDepth(int det, int phi, int zside, - unsigned int eta) const { +std::vector HcalDDDRecConstants::getDepth(const int& det, const int& phi, const int& zside, + const unsigned int& eta) const { std::map layers; hcons.ldMap()->getLayerDepth(det, eta+1, phi, zside, layers); if (layers.empty()) { @@ -62,7 +62,7 @@ std::vector HcalDDDRecConstants::getDepth(int det, int phi, int zside, } std::vector -HcalDDDRecConstants::getEtaBins(int itype) const { +HcalDDDRecConstants::getEtaBins(const int& itype) const { std::vector bins; unsigned int type = (itype == 0) ? 0 : 1; @@ -132,7 +132,7 @@ HcalDDDRecConstants::getEtaBins(int itype) const { } std::pair -HcalDDDRecConstants::getEtaPhi(int subdet, int ieta, int iphi) const { +HcalDDDRecConstants::getEtaPhi(const int& subdet, const int& ieta, const int& iphi) const { int ietaAbs = (ieta > 0) ? ieta : -ieta; double eta(0), phi(0); if ((subdet == static_cast(HcalBarrel)) || @@ -271,7 +271,7 @@ HcalDDDRecConstants::getHFCellParameters() const { return cells; } -void HcalDDDRecConstants::getLayerDepth(int ieta, std::map& layers) const { +void HcalDDDRecConstants::getLayerDepth(const int& ieta, std::map& layers) const { layers.clear(); for (unsigned int l=0; l& layers) con #endif } -int HcalDDDRecConstants::getLayerFront(int idet, int ieta, - int iphi, int depth) const { +int HcalDDDRecConstants::getLayerFront(const int& idet, const int& ieta, + const int& iphi, const int& depth) const { int subdet = (idet == 1) ? 1 : 2; int zside = (ieta > 0) ? 1 : -1; int eta = zside*ieta; @@ -315,8 +315,8 @@ int HcalDDDRecConstants::getLayerFront(int idet, int ieta, return layFront; } -int HcalDDDRecConstants::getMaxDepth (int itype, int ieta, - int iphi, int zside) const { +int HcalDDDRecConstants::getMaxDepth (const int& itype, const int& ieta, + const int& iphi, const int& zside) const { unsigned int type = (itype == 0) ? 0 : 1; int lmax = hcons.getMaxDepth(type+1, ieta, iphi, zside, true); @@ -337,8 +337,8 @@ int HcalDDDRecConstants::getMaxDepth (int itype, int ieta, return lmax; } -int HcalDDDRecConstants::getMinDepth (int itype, int ieta, - int iphi, int zside) const { +int HcalDDDRecConstants::getMinDepth (const int& itype, const int& ieta, + const int& iphi, const int& zside) const { int lmin = hcons.getMinDepth(itype+1, ieta, iphi, zside, true); if (lmin < 0) { @@ -360,7 +360,7 @@ int HcalDDDRecConstants::getMinDepth (int itype, int ieta, } std::vector > -HcalDDDRecConstants::getPhis(int subdet, int ieta) const { +HcalDDDRecConstants::getPhis(const int& subdet, const int& ieta) const { std::vector > phis; int ietaAbs = (ieta > 0) ? ieta : -ieta; @@ -407,13 +407,14 @@ int HcalDDDRecConstants::getPhiZOne(std::vector>& phiz) const return subdet; } -double HcalDDDRecConstants::getRZ(int subdet, int ieta, int depth) const { +double HcalDDDRecConstants::getRZ(const int& subdet, const int& ieta, + const int& depth) const { return getRZ(subdet, ieta, 1, depth); } -double HcalDDDRecConstants::getRZ(int subdet, int ieta, int iphi, - int depth) const { +double HcalDDDRecConstants::getRZ(const int& subdet, const int& ieta, const int& iphi, + const int& depth) const { int layf = getLayerFront(subdet,ieta,iphi,depth); double rz = (layf < 0) ? 0.0 : ((subdet == static_cast(HcalBarrel)) ? (gconsHB[layf].first) : @@ -426,7 +427,7 @@ double HcalDDDRecConstants::getRZ(int subdet, int ieta, int iphi, return rz; } -double HcalDDDRecConstants::getRZ(int subdet, int layer) const { +double HcalDDDRecConstants::getRZ(const int& subdet, const int& layer) const { double rz(0); if (layer > 0 && layer <= (int)(layerGroupSize(0))) @@ -441,7 +442,7 @@ double HcalDDDRecConstants::getRZ(int subdet, int layer) const { std::vector -HcalDDDRecConstants::getThickActive(int type) const { +HcalDDDRecConstants::getThickActive(const int& type) const { std::vector actives; std::vector bins = getEtaBins(type); diff --git a/Geometry/HcalCommonData/src/HcalDDDSimConstants.cc b/Geometry/HcalCommonData/src/HcalDDDSimConstants.cc index 34d7e337d8dff..85a726acfca4e 100644 --- a/Geometry/HcalCommonData/src/HcalDDDSimConstants.cc +++ b/Geometry/HcalCommonData/src/HcalDDDSimConstants.cc @@ -28,9 +28,9 @@ HcalDDDSimConstants::~HcalDDDSimConstants() { #endif } -HcalCellType::HcalCell HcalDDDSimConstants::cell(const int idet, const int zside, - const int depth, const int etaR, - const int iphi) const { +HcalCellType::HcalCell HcalDDDSimConstants::cell(const int& idet, const int& zside, + const int& depth, const int& etaR, + const int& iphi) const { double etaMn = hpar->etaMin[0]; double etaMx = hpar->etaMax[0]; @@ -120,15 +120,15 @@ HcalCellType::HcalCell HcalDDDSimConstants::cell(const int idet, const int zside return tmp; } -int HcalDDDSimConstants::findDepth(const int det, const int eta, - const int phi, const int zside, - const int lay) const { +int HcalDDDSimConstants::findDepth(const int& det, const int& eta, + const int& phi, const int& zside, + const int& lay) const { int depth = (ldmap_.isValid(det,phi,zside)) ? ldmap_.getDepth(det,eta,phi,zside,lay) : -1; return depth; } -unsigned int HcalDDDSimConstants::findLayer(const int layer, const std::vector& layerGroup) const { +unsigned int HcalDDDSimConstants::findLayer(const int& layer, const std::vector& layerGroup) const { unsigned int id = layerGroup.size(); for (unsigned int i = 0; i < layerGroup.size(); i++) { @@ -140,7 +140,7 @@ unsigned int HcalDDDSimConstants::findLayer(const int layer, const std::vector > HcalDDDSimConstants::getConstHBHE(const int type) const { +std::vector > HcalDDDSimConstants::getConstHBHE(const int& type) const { std::vector > gcons; if (type == 0) { @@ -155,8 +155,8 @@ std::vector > HcalDDDSimConstants::getConstHBHE(const i return gcons; } -int HcalDDDSimConstants::getDepthEta16(const int det, const int phi, - const int zside) const { +int HcalDDDSimConstants::getDepthEta16(const int& det, const int& phi, + const int& zside) const { int depth = ldmap_.getDepth16(det,phi,zside); if (depth < 0) depth = (det == 2) ? depthEta16[1] : depthEta16[0]; @@ -166,7 +166,7 @@ int HcalDDDSimConstants::getDepthEta16(const int det, const int phi, return depth; } -int HcalDDDSimConstants::getDepthEta16M(const int det) const { +int HcalDDDSimConstants::getDepthEta16M(const int& det) const { int depth = (det == 2) ? depthEta16[1] : depthEta16[0]; std::vector phis; int detsp = ldmap_.validDet(phis); @@ -180,16 +180,16 @@ int HcalDDDSimConstants::getDepthEta16M(const int det) const { return depth; } -int HcalDDDSimConstants::getDepthEta29(const int phi, const int zside, - const int i) const { +int HcalDDDSimConstants::getDepthEta29(const int& phi, const int& zside, + const int& i) const { int depth = (i == 0) ? ldmap_.getMaxDepthLastHE(2,phi,zside) : -1; if (depth < 0) depth = (i == 1) ? depthEta29[1] : depthEta29[0]; return depth; } -int HcalDDDSimConstants::getDepthEta29M(const int i, - const bool planOne) const { +int HcalDDDSimConstants::getDepthEta29M(const int& i, + const bool& planOne) const { int depth = (i == 1) ? depthEta29[1] : depthEta29[0]; if (i == 0 && planOne) { std::vector phis; @@ -204,8 +204,8 @@ int HcalDDDSimConstants::getDepthEta29M(const int i, return depth; } -std::pair HcalDDDSimConstants::getDetEta(const double eta, - const int depth) { +std::pair HcalDDDSimConstants::getDetEta(const double& eta, + const int& depth) { int hsubdet(0), ieta(0); double etaR(0); @@ -229,8 +229,8 @@ std::pair HcalDDDSimConstants::getDetEta(const double eta, return std::pair(hsubdet,etaR); } -int HcalDDDSimConstants::getEta(const int det, const int lay, - const double hetaR) { +int HcalDDDSimConstants::getEta(const int& det, const int& lay, + const double& hetaR) { int ieta(0); if (det == static_cast(HcalForward)) { // Forward HCal @@ -253,9 +253,9 @@ int HcalDDDSimConstants::getEta(const int det, const int lay, return ieta; } -std::pair HcalDDDSimConstants::getEtaDepth(const int det, int etaR, - int phi, int zside, - int depth, int lay) { +std::pair HcalDDDSimConstants::getEtaDepth(const int& det, int etaR, + const int& phi, const int& zside, + int depth, const int& lay) { #ifdef EDM_ML_DEBUG std::cout << "HcalDDDEsimConstants:getEtaDepth: I/P " << det << ":" << etaR @@ -299,8 +299,8 @@ std::pair HcalDDDSimConstants::getEtaDepth(const int det, int etaR, return std::pair(etaR,depth); } -double HcalDDDSimConstants::getEtaHO(double& etaR, double& x, double& y, - double& z) const { +double HcalDDDSimConstants::getEtaHO(const double& etaR, const double& x, const double& y, + const double& z) const { if (hpar->zHO.size() > 4) { double eta = fabs(etaR); @@ -325,7 +325,7 @@ double HcalDDDSimConstants::getEtaHO(double& etaR, double& x, double& y, } } -int HcalDDDSimConstants::getFrontLayer(const int det, const int eta) const { +int HcalDDDSimConstants::getFrontLayer(const int& det, const int& eta) const { int lay=0; if (det == 1) { @@ -339,7 +339,7 @@ int HcalDDDSimConstants::getFrontLayer(const int det, const int eta) const { return lay; } -int HcalDDDSimConstants::getLastLayer(const int det, const int eta) const { +int HcalDDDSimConstants::getLastLayer(const int& det, const int& eta) const { int lay=0; if (det == 1) { @@ -355,17 +355,17 @@ int HcalDDDSimConstants::getLastLayer(const int det, const int eta) const { return lay; } -double HcalDDDSimConstants::getLayer0Wt(const int det, const int phi, - const int zside) const { +double HcalDDDSimConstants::getLayer0Wt(const int& det, const int& phi, + const int& zside) const { double wt = ldmap_.getLayer0Wt(det, phi, zside); if (wt < 0) wt = (det == 2) ? hpar->Layer0Wt[1] : hpar->Layer0Wt[0]; return wt; } -int HcalDDDSimConstants::getLayerFront(const int det, const int eta, - const int phi, const int zside, - const int depth) const { +int HcalDDDSimConstants::getLayerFront(const int& det, const int& eta, + const int& phi, const int& zside, + const int& depth) const { int layer = ldmap_.getLayerFront(det, eta, phi, zside, depth); if (layer < 0) { @@ -383,9 +383,9 @@ int HcalDDDSimConstants::getLayerFront(const int det, const int eta, return layer; } -int HcalDDDSimConstants::getLayerBack(const int det, const int eta, - const int phi, const int zside, - const int depth) const { +int HcalDDDSimConstants::getLayerBack(const int& det, const int& eta, + const int& phi, const int& zside, + const int& depth) const { int layer = ldmap_.getLayerBack(det, eta, phi, zside, depth); if (layer < 0) { @@ -398,15 +398,15 @@ int HcalDDDSimConstants::getLayerBack(const int det, const int eta, return layer; } -int HcalDDDSimConstants::getLayerMax(const int eta, const int depth) const { +int HcalDDDSimConstants::getLayerMax(const int& eta, const int& depth) const { int layermx = ((eta < hpar->etaMin[1]) && depth-1 < maxDepth[0]) ? maxLayerHB_+1 : (int)layerGroupSize(eta-1); return layermx; } -int HcalDDDSimConstants::getMaxDepth(const int det, const int eta, - const int phi, const int zside, - const bool partialDetOnly) const { +int HcalDDDSimConstants::getMaxDepth(const int& det, const int& eta, + const int& phi, const int& zside, + const bool& partialDetOnly) const { int dmax(-1); if (partialDetOnly) { @@ -432,9 +432,9 @@ int HcalDDDSimConstants::getMaxDepth(const int det, const int eta, return dmax; } -int HcalDDDSimConstants::getMinDepth(const int det, const int eta, - const int phi, const int zside, - const bool partialDetOnly) const { +int HcalDDDSimConstants::getMinDepth(const int& det, const int& eta, + const int& phi, const int& zside, + const bool& partialDetOnly) const { int lmin(-1); if (partialDetOnly) { @@ -460,7 +460,7 @@ int HcalDDDSimConstants::getMinDepth(const int det, const int eta, return lmin; } -std::pair HcalDDDSimConstants::getModHalfHBHE(const int type) const { +std::pair HcalDDDSimConstants::getModHalfHBHE(const int& type) const { if (type == 0) { return std::pair(nmodHB,nzHB); @@ -469,8 +469,8 @@ std::pair HcalDDDSimConstants::getModHalfHBHE(const int type) const { } } -std::pair HcalDDDSimConstants::getPhiCons(const int det, - const int ieta) const { +std::pair HcalDDDSimConstants::getPhiCons(const int& det, + const int& ieta) const { double fioff(0), fibin(0); if (det == static_cast(HcalForward)) { // Forward HCal @@ -491,7 +491,7 @@ std::pair HcalDDDSimConstants::getPhiCons(const int det, } std::vector > -HcalDDDSimConstants::getPhis(const int subdet, const int ieta) const { +HcalDDDSimConstants::getPhis(const int& subdet, const int& ieta) const { std::vector > phis; int ietaAbs = (ieta > 0) ? ieta : -ieta; @@ -553,7 +553,8 @@ std::vector HcalDDDSimConstants::HcalCellTypes() const{ return cellTypes; } -std::vector HcalDDDSimConstants::HcalCellTypes(const HcalSubdetector subdet, const int ieta, const int depthl) const { +std::vector HcalDDDSimConstants::HcalCellTypes(const HcalSubdetector& subdet, + int ieta, int depthl) const { std::vector cellTypes; if (subdet == HcalForward) { @@ -652,7 +653,7 @@ std::vector HcalDDDSimConstants::HcalCellTypes(const HcalSubdetect return cellTypes; } -int HcalDDDSimConstants::maxHFDepth(const int eta, const int iphi) const { +int HcalDDDSimConstants::maxHFDepth(const int& eta, const int& iphi) const { int mxdepth = maxDepth[2]; if (!idHF2QIE.empty()) { bool ok(false); @@ -666,7 +667,7 @@ int HcalDDDSimConstants::maxHFDepth(const int eta, const int iphi) const { return mxdepth; } -unsigned int HcalDDDSimConstants::numberOfCells(const HcalSubdetector subdet) const{ +unsigned int HcalDDDSimConstants::numberOfCells(const HcalSubdetector& subdet) const{ unsigned int num = 0; std::vector cellTypes = HcalCellTypes(subdet); @@ -681,7 +682,7 @@ unsigned int HcalDDDSimConstants::numberOfCells(const HcalSubdetector subdet) co return num; } -int HcalDDDSimConstants::phiNumber(const int phi, const int units) const { +int HcalDDDSimConstants::phiNumber(const int& phi, const int& units) const { int iphi_skip = phi; if (units==2) iphi_skip = (phi-1)*2+1; @@ -727,13 +728,13 @@ void HcalDDDSimConstants::printTiles() const { } } -int HcalDDDSimConstants::unitPhi(const int det, const int etaR) const { +int HcalDDDSimConstants::unitPhi(const int& det, const int& etaR) const { double dphi = (det == static_cast(HcalForward)) ? hpar->phitable[etaR-hpar->etaMin[2]] : hpar->phibin[etaR-1]; return unitPhi(dphi); } -int HcalDDDSimConstants::unitPhi(const double dphi) const { +int HcalDDDSimConstants::unitPhi(const double& dphi) const { const double fiveDegInRad = 2*M_PI/72; int units = int(dphi/fiveDegInRad+0.5); @@ -961,8 +962,8 @@ void HcalDDDSimConstants::initialize( void ) { #endif } -double HcalDDDSimConstants::deltaEta(const int det, const int etaR, - const int depth) const { +double HcalDDDSimConstants::deltaEta(const int& det, const int& etaR, + const int& depth) const { double tmp = 0; if (det == static_cast(HcalForward)) { @@ -1000,8 +1001,8 @@ double HcalDDDSimConstants::deltaEta(const int det, const int etaR, return tmp; } -double HcalDDDSimConstants::getEta(const int det, const int etaR, - const int zside, const int depth) const { +double HcalDDDSimConstants::getEta(const int& det, const int& etaR, + const int& zside, int depth) const { double tmp = 0; if (det == static_cast(HcalForward)) { @@ -1040,7 +1041,7 @@ double HcalDDDSimConstants::getEta(const int det, const int etaR, return tmp; } -double HcalDDDSimConstants::getEta(const double r, const double z) const { +double HcalDDDSimConstants::getEta(const double& r, const double& z) const { double tmp = 0; if (z != 0) tmp = -log(tan(0.5*atan(r/z))); @@ -1051,8 +1052,8 @@ double HcalDDDSimConstants::getEta(const double r, const double z) const { return tmp; } -int HcalDDDSimConstants::getShift(const HcalSubdetector subdet, - const int depth) const { +int HcalDDDSimConstants::getShift(const HcalSubdetector& subdet, + const int& depth) const { int shift; switch(subdet) { @@ -1072,8 +1073,8 @@ int HcalDDDSimConstants::getShift(const HcalSubdetector subdet, return shift; } -double HcalDDDSimConstants::getGain(const HcalSubdetector subdet, - const int depth) const { +double HcalDDDSimConstants::getGain(const HcalSubdetector& subdet, + const int& depth) const { double gain; switch(subdet) { @@ -1093,8 +1094,8 @@ double HcalDDDSimConstants::getGain(const HcalSubdetector subdet, return gain; } -void HcalDDDSimConstants::printTileHB(const int eta, const int phi, - const int zside, const int depth) const { +void HcalDDDSimConstants::printTileHB(const int& eta, const int& phi, + const int& zside, const int& depth) const { edm::LogVerbatim("HcalGeom") << "HcalDDDSimConstants::printTileHB for eta " << eta << " and depth " << depth; @@ -1129,8 +1130,8 @@ void HcalDDDSimConstants::printTileHB(const int eta, const int phi, } } -void HcalDDDSimConstants::printTileHE(const int eta, const int phi, - const int zside, const int depth) const { +void HcalDDDSimConstants::printTileHE(const int& eta, const int& phi, + const int& zside, const int& depth) const { double etaL = hpar->etaTable[eta-1]; double thetaL = 2.*atan(exp(-etaL)); @@ -1192,7 +1193,7 @@ void HcalDDDSimConstants::printTileHE(const int eta, const int phi, } } -unsigned int HcalDDDSimConstants::layerGroupSize(const int eta) const { +unsigned int HcalDDDSimConstants::layerGroupSize(int eta) const { unsigned int k = 0; for (auto const & it : hpar->layerGroupEtaSim) { if (it.layer == (unsigned int)(eta + 1)) { @@ -1204,8 +1205,7 @@ unsigned int HcalDDDSimConstants::layerGroupSize(const int eta) const { return k; } -unsigned int HcalDDDSimConstants::layerGroup(const int eta, - const int i) const { +unsigned int HcalDDDSimConstants::layerGroup(int eta, int i) const { unsigned int k = 0; for (auto const & it : hpar->layerGroupEtaSim) { if (it.layer == (unsigned int)(eta + 1)) { @@ -1217,9 +1217,9 @@ unsigned int HcalDDDSimConstants::layerGroup(const int eta, return k; } -unsigned int HcalDDDSimConstants::layerGroup(const int det, const int eta, - const int phi, const int zside, - const int lay) const { +unsigned int HcalDDDSimConstants::layerGroup(int det, int eta, + int phi, int zside, + int lay) const { int depth0 = findDepth(det,eta,phi,zside,lay); unsigned int depth = (depth0 > 0) ? (unsigned int)(depth0) : layerGroup(eta-1,lay);