CMS 3D CMS Logo

List of all members | Classes | Public Member Functions | Private Member Functions | Private Attributes | Static Private Attributes
HcalDDDRecConstants Class Reference

#include <HcalDDDRecConstants.h>

Classes

struct  HcalActiveLength
 
struct  HcalEtaBin
 
struct  HcalID
 
struct  HFCellParameters
 

Public Member Functions

const HcalDDDSimConstantsdddConstants () const
 
int findDepth (const int &det, const int &eta, const int &phi, const int &zside, const int &lay) const
 
std::vector< std::pair< double, double > > getConstHBHE (const int &type) const
 
std::vector< int > getDepth (const int &det, const int &phi, const int &zside, const unsigned int &eta) const
 
std::vector< int > getDepth (const unsigned int &eta, const bool &extra) const
 
int getDepthEta16 (const int &det, const int &iphi, const int &zside) const
 
int getDepthEta29 (const int &iphi, const int &zside, const int &type) const
 
std::vector< HcalEtaBingetEtaBins (const int &itype) const
 
std::pair< double, double > getEtaLimit (const int &i) const
 
std::pair< double, double > getEtaPhi (const int &subdet, const int &ieta, const int &iphi) const
 
std::pair< int, int > getEtaRange (const int &i) const
 
const std::vector< double > & getEtaTable () const
 
const std::vector< double > & getEtaTableHF () const
 
HcalID getHCID (int subdet, int ieta, int iphi, int lay, int idepth) const
 
std::vector< HFCellParametersgetHFCellParameters () const
 
double getLayer0Wt (const int &det, const int &phi, const int &zside) const
 
int getLayerBack (const int &det, const int &eta, const int &phi, const int &depth) const
 
void getLayerDepth (const int &ieta, std::map< int, int > &layers) const
 
int getLayerFront (const int &det, const int &eta, const int &phi, const int &depth) const
 
int getMaxDepth (const int &type) const
 
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
 
int getNoff (const int &i) const
 
int getNPhi (const int &type) const
 
double getPhiBin (const int &i) const
 
double getPhiOff (const int &i) const
 
const std::vector< double > & getPhiOffs () const
 
std::vector< std::pair< int, double > > getPhis (const int &subdet, const int &ieta) const
 
const std::vector< double > & getPhiTable () const
 
const std::vector< double > & getPhiTableHF () const
 
int getPhiZOne (std::vector< std::pair< int, int >> &phiz) 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::pair< double, double > getRZ (const HcalDetId &id) const
 
std::vector< HcalActiveLengthgetThickActive (const int &type) const
 
int getTopoMode () const
 
int getTriggerMode () const
 
std::vector< HcalCellTypeHcalCellTypes (HcalSubdetector) const
 
 HcalDDDRecConstants (const HcalParameters *hp, const HcalDDDSimConstants &hc)
 
HcalDetId idBack (const HcalDetId &id) const
 
HcalDetId idFront (const HcalDetId &id) const
 
bool isBH () const
 
bool isHE () const
 
bool isPlan1 (const HcalDetId &id) const
 
bool isPlan1MergedId (const HcalDetId &id) const
 
bool isPlan1ToBeMergedId (const HcalDetId &id) const
 
int maxHFDepth (int ieta, int iphi) const
 
HcalDetId mergedDepthDetId (const HcalDetId &id) const
 
bool mergedDepthList29 (int ieta, int iphi, int depth) const
 
std::vector< int > mergedDepthList29 (int ieta, int iphi) const
 
unsigned int nCells (HcalSubdetector) const
 
unsigned int nCells () const
 
unsigned int numberOfCells (HcalSubdetector) const
 
void specialRBXHBHE (const std::vector< HcalDetId > &, std::vector< HcalDetId > &) const
 
bool specialRBXHBHE (bool flag, std::vector< HcalDetId > &) const
 
void unmergeDepthDetId (const HcalDetId &id, std::vector< HcalDetId > &ids) const
 
bool withSpecialRBXHBHE () const
 
 ~HcalDDDRecConstants ()
 

Private Member Functions

void getOneEtaBin (HcalSubdetector subdet, int ieta, int zside, std::vector< std::pair< int, double >> &phis, std::map< int, int > &layers, bool planOne, std::vector< HcalDDDRecConstants::HcalEtaBin > &bins) const
 
void initialize (void)
 
unsigned int layerGroup (int eta, int i) const
 
unsigned int layerGroupSize (int eta) const
 

Private Attributes

std::pair< int, int > depthMaxDf_
 
std::pair< int, int > depthMaxSp_
 
std::map< HcalDetId, HcalDetIddetIdSp_
 
std::map< HcalDetId, std::vector< HcalDetId > > detIdSpR_
 
std::vector< std::pair< int, int > > etaSimValu
 
std::vector< double > etaTable
 
std::vector< std::pair< double, double > > gconsHB
 
std::vector< std::pair< double, double > > gconsHE
 
const HcalDDDSimConstantshcons
 
const HcalParametershpar
 
std::vector< int > ietaMap
 
std::vector< int > iEtaMax
 
std::vector< int > iEtaMin
 
std::vector< int > maxDepth
 
int nHalves [2]
 
int nModule [2]
 
std::vector< int > nPhiBins
 
std::vector< double > phibin
 
std::vector< int > phiUnitS
 

Static Private Attributes

static const int maxLayer_ = 18
 
static const int maxLayerHB_ = 16
 

Detailed Description

this class reads the constant section of the hcal-sim-numbering xml-file

Author
Sunanda Banerjee, SINP sunan.nosp@m.da.b.nosp@m.anerj.nosp@m.ee@c.nosp@m.ern.c.nosp@m.h

Definition at line 23 of file HcalDDDRecConstants.h.

Constructor & Destructor Documentation

◆ HcalDDDRecConstants()

HcalDDDRecConstants::HcalDDDRecConstants ( const HcalParameters hp,
const HcalDDDSimConstants hc 
)

Definition at line 17 of file HcalDDDRecConstants.cc.

References initialize().

18  : hpar(hp), hcons(hc) {
19 #ifdef EDM_ML_DEBUG
20  edm::LogVerbatim("HCalGeom") << "HcalDDDRecConstants::HcalDDDRecConstants (const HcalParameters* hp) constructor";
21 #endif
22  initialize();
23 }
Log< level::Info, true > LogVerbatim
const HcalParameters * hpar
const HcalDDDSimConstants & hcons

◆ ~HcalDDDRecConstants()

HcalDDDRecConstants::~HcalDDDRecConstants ( )

Definition at line 25 of file HcalDDDRecConstants.cc.

25  {
26 #ifdef EDM_ML_DEBUG
27  edm::LogVerbatim("HCalGeom") << "HcalDDDRecConstants::destructed!!!";
28 #endif
29 }
Log< level::Info, true > LogVerbatim

Member Function Documentation

◆ dddConstants()

const HcalDDDSimConstants* HcalDDDRecConstants::dddConstants ( ) const
inline

Definition at line 128 of file HcalDDDRecConstants.h.

References hcons.

128 { return &hcons; }
const HcalDDDSimConstants & hcons

◆ findDepth()

int HcalDDDRecConstants::findDepth ( const int &  det,
const int &  eta,
const int &  phi,
const int &  zside,
const int &  lay 
) const

Definition at line 31 of file HcalDDDRecConstants.cc.

References ztail::d, hcalRecHitTable_cff::depth, HLT_2024v14_cff::depths, PVValHelper::eta, HcalDDDSimConstants::findDepth(), getDepth(), hcons, phi, and ecaldqm::zside().

32  {
33  int depth = hcons.findDepth(det, eta, phi, zside, lay);
34  if (depth < 0) {
35  std::vector<int> depths = getDepth(eta, false);
36  if ((lay > 0) && (lay <= static_cast<int>(depths.size())))
37  depth = depths[lay - 1];
38 #ifdef EDM_ML_DEBUG
39  std::ostringstream st1;
40  st1 << depths.size() << " depths ";
41  for (const auto& d : depths)
42  st1 << ": " << d;
43  edm::LogVerbatim("HCalGeom") << "HcalDDDRecConstants:: " << st1.str() << " for eta = " << eta << " Depth " << depth;
44 #endif
45  }
46  return depth;
47 }
Log< level::Info, true > LogVerbatim
int zside(DetId const &)
int findDepth(const int &det, const int &eta, const int &phi, const int &zside, const int &lay) const
d
Definition: ztail.py:151
const HcalDDDSimConstants & hcons
std::vector< int > getDepth(const int &det, const int &phi, const int &zside, const unsigned int &eta) const

◆ getConstHBHE()

std::vector<std::pair<double, double> > HcalDDDRecConstants::getConstHBHE ( const int &  type) const
inline

Definition at line 54 of file HcalDDDRecConstants.h.

References gconsHB, and gconsHE.

Referenced by HcalFlexiHardcodeGeometryLoader::makeHBCells(), and HcalFlexiHardcodeGeometryLoader::makeHECells().

54  {
55  if (type == 0)
56  return gconsHB;
57  else if (type == 1)
58  return gconsHE;
59  else {
60  std::vector<std::pair<double, double>> gcons;
61  return gcons;
62  }
63  }
std::vector< std::pair< double, double > > gconsHE
std::vector< std::pair< double, double > > gconsHB

◆ getDepth() [1/2]

std::vector< int > HcalDDDRecConstants::getDepth ( const int &  det,
const int &  phi,
const int &  zside,
const unsigned int &  eta 
) const

Definition at line 72 of file HcalDDDRecConstants.cc.

References HLT_2024v14_cff::depths, PVValHelper::eta, HcalLayerDepthMap::getLayerDepth(), hcons, hgcalTBTopologyTester_cfi::layers, HcalDDDSimConstants::ldMap(), phi, and ecaldqm::zside().

Referenced by findDepth(), and HcalTopology::HcalTopology().

75  {
76  std::map<int, int> layers;
77  hcons.ldMap()->getLayerDepth(det, eta + 1, phi, zside, layers);
78  if (layers.empty()) {
79  return getDepth(eta, false);
80  } else {
81  std::vector<int> depths;
82  for (unsigned int lay = 0; lay < layers.size(); ++lay)
83  depths.emplace_back(layers[lay + 1]);
84  return depths;
85  }
86 }
int zside(DetId const &)
const HcalLayerDepthMap * ldMap() const
const HcalDDDSimConstants & hcons
void getLayerDepth(const int subdet, const int ieta, const int iphi, const int zside, std::map< int, int > &layers) const
std::vector< int > getDepth(const int &det, const int &phi, const int &zside, const unsigned int &eta) const

◆ getDepth() [2/2]

std::vector< int > HcalDDDRecConstants::getDepth ( const unsigned int &  eta,
const bool &  extra 
) const

Definition at line 49 of file HcalDDDRecConstants.cc.

References HLT_2024v14_cff::depths, PVValHelper::eta, HcalLayerDepthMap::getLayerDepth(), hcons, hpar, ALPAKA_ACCELERATOR_NAMESPACE::vertexFinder::it, dqmdumpme::last, HcalParameters::layerGroupEtaRec, hgcalTBTopologyTester_cfi::layers, and HcalDDDSimConstants::ldMap().

49  {
50  if (!extra) {
51  std::vector<HcalParameters::LayerItem>::const_iterator last = hpar->layerGroupEtaRec.begin();
52  for (std::vector<HcalParameters::LayerItem>::const_iterator it = hpar->layerGroupEtaRec.begin();
53  it != hpar->layerGroupEtaRec.end();
54  ++it) {
55  if (it->layer == eta + 1)
56  return it->layerGroup;
57  if (it->layer > eta + 1)
58  return last->layerGroup;
59  last = it;
60  }
61  return last->layerGroup;
62  } else {
63  std::map<int, int> layers;
65  std::vector<int> depths;
66  for (unsigned int lay = 0; lay < layers.size(); ++lay)
67  depths.emplace_back(layers[lay + 1]);
68  return depths;
69  }
70 }
const HcalParameters * hpar
const HcalLayerDepthMap * ldMap() const
std::vector< LayerItem > layerGroupEtaRec
const HcalDDDSimConstants & hcons
void getLayerDepth(const int subdet, const int ieta, const int iphi, const int zside, std::map< int, int > &layers) const

◆ getDepthEta16()

int HcalDDDRecConstants::getDepthEta16 ( const int &  det,
const int &  iphi,
const int &  zside 
) const
inline

Definition at line 67 of file HcalDDDRecConstants.h.

References HcalDDDSimConstants::getDepthEta16(), hcons, hcalRecHitTable_cff::iphi, and ecaldqm::zside().

Referenced by HcalTopology::depthBinInformation(), HcalTopology::incrementDepth(), and HcalTopology::validRaw().

67  {
68  return hcons.getDepthEta16(det, iphi, zside);
69  }
int zside(DetId const &)
const HcalDDDSimConstants & hcons
int getDepthEta16(const int &det, const int &phi, const int &zside) const

◆ getDepthEta29()

int HcalDDDRecConstants::getDepthEta29 ( const int &  iphi,
const int &  zside,
const int &  type 
) const
inline

Definition at line 70 of file HcalDDDRecConstants.h.

References HcalDDDSimConstants::getDepthEta29(), hcons, hcalRecHitTable_cff::iphi, and ecaldqm::zside().

Referenced by HcalTopology::decrementDepth().

70  {
71  return hcons.getDepthEta29(iphi, zside, type);
72  }
int getDepthEta29(const int &phi, const int &zside, const int &i) const
int zside(DetId const &)
const HcalDDDSimConstants & hcons

◆ getEtaBins()

std::vector< HcalDDDRecConstants::HcalEtaBin > HcalDDDRecConstants::getEtaBins ( const int &  itype) const

Definition at line 88 of file HcalDDDRecConstants.cc.

References trigObjTnPSource_cfi::bins, spr::find(), dqmdumpme::first, HcalLayerDepthMap::getLayerDepth(), getLayerDepth(), getOneEtaBin(), getPhis(), hcons, mps_fire::i, hcalRecHitTable_cff::ieta, iEtaMax, iEtaMin, dqmdumpme::k, hgcalTBTopologyTester_cfi::layers, HcalDDDSimConstants::ldMap(), phi, HcalLayerDepthMap::validDet(), and ecaldqm::zside().

Referenced by getThickActive(), HcalCellTypes(), HcalTopology::HcalTopology(), HcalFlexiHardcodeGeometryLoader::makeHBCells(), HcalFlexiHardcodeGeometryLoader::makeHECells(), and nCells().

88  {
89  std::vector<HcalDDDRecConstants::HcalEtaBin> bins;
90  unsigned int type = (itype == 0) ? 0 : 1;
91  HcalSubdetector subdet = HcalSubdetector(type + 1);
92  std::vector<int> phiSp;
93  HcalSubdetector subdetSp = HcalSubdetector(hcons.ldMap()->validDet(phiSp));
94  std::map<int, int> layers;
95  for (int iz = 0; iz < 2; ++iz) {
96  int zside = 2 * iz - 1;
97  for (int ieta = iEtaMin[type]; ieta <= iEtaMax[type]; ++ieta) {
98  std::vector<std::pair<int, double>> phis = getPhis(subdet, ieta);
99  std::vector<std::pair<int, double>> phiUse;
101  if (subdet == subdetSp) {
102  for (auto& phi : phis) {
103  if (std::find(phiSp.begin(), phiSp.end(), (zside * phi.first)) == phiSp.end()) {
104  phiUse.emplace_back(phi);
105  }
106  }
107  } else {
108  phiUse.insert(phiUse.end(), phis.begin(), phis.end());
109  }
110  if (!phiUse.empty())
111  getOneEtaBin(subdet, ieta, zside, phiUse, layers, false, bins);
112  }
113  }
114  if (subdetSp == subdet) {
115  for (int ieta = iEtaMin[type]; ieta <= iEtaMax[type]; ++ieta) {
116  std::vector<std::pair<int, double>> phis = getPhis(subdet, ieta);
117  for (int iz = 0; iz < 2; ++iz) {
118  int zside = 2 * iz - 1;
119  std::vector<std::pair<int, double>> phiUse;
120  for (int i : phiSp) {
121  for (auto& phi : phis) {
122  if (i == zside * phi.first) {
123  phiUse.emplace_back(phi);
124  break;
125  }
126  }
127  }
128  if (!phiUse.empty()) {
129  hcons.ldMap()->getLayerDepth(subdet, ieta, phiUse[0].first, zside, layers);
130  getOneEtaBin(subdet, ieta, zside, phiUse, layers, true, bins);
131  }
132  }
133  }
134  }
135 #ifdef EDM_ML_DEBUG
136  edm::LogVerbatim("HCalGeom") << "Prepares " << bins.size() << " eta bins for type " << type;
137  for (unsigned int i = 0; i < bins.size(); ++i) {
138  edm::LogVerbatim("HCalGeom") << "Bin[" << i << "]: Eta = (" << bins[i].ieta << ":" << bins[i].etaMin << ":"
139  << bins[i].etaMax << "), Zside = " << bins[i].zside << ", phis = ("
140  << bins[i].phis.size() << ":" << bins[i].dphi << ") and " << bins[i].layer.size()
141  << " depths (start) " << bins[i].depthStart;
142  for (unsigned int k = 0; k < bins[i].layer.size(); ++k)
143  edm::LogVerbatim("HCalGeom") << " [" << k << "] " << bins[i].layer[k].first << ":" << bins[i].layer[k].second;
144  edm::LogVerbatim("HCalGeom") << "Phi sets";
145  for (unsigned int k = 0; k < bins[i].phis.size(); ++k)
146  edm::LogVerbatim("HCalGeom") << "[" << k << "] " << bins[i].phis[k].first << ":" << bins[i].phis[k].second;
147  }
148 #endif
149  return bins;
150 }
Log< level::Info, true > LogVerbatim
std::vector< int > iEtaMin
void getOneEtaBin(HcalSubdetector subdet, int ieta, int zside, std::vector< std::pair< int, double >> &phis, std::map< int, int > &layers, bool planOne, std::vector< HcalDDDRecConstants::HcalEtaBin > &bins) const
std::vector< std::pair< int, double > > getPhis(const int &subdet, const int &ieta) const
int zside(DetId const &)
void find(edm::Handle< EcalRecHitCollection > &hits, DetId thisDet, std::vector< EcalRecHitCollection::const_iterator > &hit, bool debug=false)
Definition: FindCaloHit.cc:19
std::vector< int > iEtaMax
HcalSubdetector
Definition: HcalAssistant.h:31
const HcalLayerDepthMap * ldMap() const
void getLayerDepth(const int &ieta, std::map< int, int > &layers) const
const HcalDDDSimConstants & hcons
void getLayerDepth(const int subdet, const int ieta, const int iphi, const int zside, std::map< int, int > &layers) const
int validDet(std::vector< int > &phis) const

◆ getEtaLimit()

std::pair<double, double> HcalDDDRecConstants::getEtaLimit ( const int &  i) const
inline

Definition at line 78 of file HcalDDDRecConstants.h.

References etaTable, and mps_fire::i.

78  {
79  return std::pair<double, double>(etaTable[i], etaTable[i + 1]);
80  }
std::vector< double > etaTable

◆ getEtaPhi()

std::pair< double, double > HcalDDDRecConstants::getEtaPhi ( const int &  subdet,
const int &  ieta,
const int &  iphi 
) const

Definition at line 152 of file HcalDDDRecConstants.cc.

References PVValHelper::eta, etaTable, HcalParameters::etaTableHF, HcalBarrel, HcalEndcap, HcalOuter, hcons, hpar, hcalRecHitTable_cff::ieta, ALPAKA_ACCELERATOR_NAMESPACE::ecal::reconstruction::internal::barrel::ietaAbs(), iEtaMax, iEtaMin, hcalRecHitTable_cff::iphi, M_PI, phi, phibin, HcalParameters::phioff, HcalParameters::phitable, unit(), and HcalDDDSimConstants::unitPhi().

Referenced by HcalGeomCheck::analyze().

152  {
153  int ietaAbs = (ieta > 0) ? ieta : -ieta;
154  double eta(0), phi(0);
155  if ((subdet == static_cast<int>(HcalBarrel)) || (subdet == static_cast<int>(HcalEndcap)) ||
156  (subdet == static_cast<int>(HcalOuter))) { // Use Eta Table
157  int unit = hcons.unitPhi(phibin[ietaAbs - 1]);
158  int kphi = (unit == 2) ? ((iphi - 1) / 2 + 1) : iphi;
159  double foff = (ietaAbs <= iEtaMax[0]) ? hpar->phioff[0] : hpar->phioff[1];
160  eta = 0.5 * (etaTable[ietaAbs - 1] + etaTable[ietaAbs]);
161  phi = foff + (kphi - 0.5) * phibin[ietaAbs - 1];
162  } else {
163  ietaAbs -= iEtaMin[2];
164  int unit = hcons.unitPhi(hpar->phitable[ietaAbs - 1]);
165  int kphi = (unit == 4) ? ((iphi - 3) / 4 + 1) : ((iphi - 1) / 2 + 1);
166  double foff = (unit > 2) ? hpar->phioff[4] : hpar->phioff[2];
167  eta = 0.5 * (hpar->etaTableHF[ietaAbs - 1] + hpar->etaTableHF[ietaAbs]);
168  phi = foff + (kphi - 0.5) * hpar->phitable[ietaAbs - 1];
169  }
170  if (ieta < 0)
171  eta = -eta;
172  if (phi > M_PI)
173  phi -= (2 * M_PI);
174 #ifdef EDM_ML_DEBUG
175  edm::LogVerbatim("HCalGeom") << "getEtaPhi: subdet|ieta|iphi " << subdet << "|" << ieta << "|" << iphi << " eta|phi "
176  << eta << "|" << phi;
177 #endif
178  return std::pair<double, double>(eta, phi);
179 }
Log< level::Info, true > LogVerbatim
std::vector< int > iEtaMin
std::vector< double > etaTableHF
const HcalParameters * hpar
ALPAKA_FN_ACC ALPAKA_FN_INLINE uint32_t ietaAbs(uint32_t id)
std::vector< double > phibin
std::vector< int > iEtaMax
Basic3DVector unit() const
int unitPhi(const int &det, const int &etaR) const
#define M_PI
std::vector< double > phioff
std::vector< double > etaTable
std::vector< double > phitable
const HcalDDDSimConstants & hcons

◆ getEtaRange()

std::pair<int, int> HcalDDDRecConstants::getEtaRange ( const int &  i) const
inline

◆ getEtaTable()

const std::vector<double>& HcalDDDRecConstants::getEtaTable ( ) const
inline

Definition at line 76 of file HcalDDDRecConstants.h.

References etaTable.

Referenced by HcalTopology::HcalTopology(), and CaloTowerHardcodeGeometryLoader::load().

76 { return etaTable; }
std::vector< double > etaTable

◆ getEtaTableHF()

const std::vector<double>& HcalDDDRecConstants::getEtaTableHF ( ) const
inline

Definition at line 77 of file HcalDDDRecConstants.h.

References HcalParameters::etaTableHF, and hpar.

Referenced by HcalTopology::HcalTopology(), and CaloTowerHardcodeGeometryLoader::load().

77 { return hpar->etaTableHF; }
std::vector< double > etaTableHF
const HcalParameters * hpar

◆ getHCID()

HcalDDDRecConstants::HcalID HcalDDDRecConstants::getHCID ( int  subdet,
int  ieta,
int  iphi,
int  lay,
int  idepth 
) const

Definition at line 181 of file HcalDDDRecConstants.cc.

References hcalRecHitTable_cff::depth, PVValHelper::eta, HcalParameters::etaMaxHBHE(), Exception, HcalDDDSimConstants::findDepth(), HcalDDDSimConstants::getDepthEta16(), HcalDDDSimConstants::getDepthEta29(), HcalBarrel, HcalEndcap, HcalOuter, hcons, hpar, hcalRecHitTable_cff::ieta, ietaMap, iEtaMin, createfilelist::int, hcalRecHitTable_cff::iphi, layerGroup(), maxLayerHB_, HcalParameters::noff, phi, phibin, HcalParameters::phigroup, HcalDDDSimConstants::phiNumber(), HcalParameters::phioff, phiUnitS, unit(), HcalDDDSimConstants::unitPhi(), and ecaldqm::zside().

Referenced by CaloSimHitStudy::analyzeHits(), HcalGeometry::getBackPosition(), HcalGeometry::getPosition(), and HcalHitRelabeller::relabel().

181  {
182  uint32_t ieta = (keta > 0) ? keta : -keta;
183  int zside = (keta > 0) ? 1 : -1;
184  if ((ieta > hpar->etaMaxHBHE()) &&
185  ((subdet == static_cast<int>(HcalOuter)) || (subdet == static_cast<int>(HcalBarrel)) ||
186  (subdet == static_cast<int>(HcalEndcap))))
187  throw cms::Exception("HcalDDDRecConstants")
188  << "getHCID: receives an eta value " << ieta << " outside the limit (1:" << hpar->etaMaxHBHE() << ")";
189  int eta(ieta), phi(iphi), depth(idepth);
190  if ((subdet == static_cast<int>(HcalOuter)) ||
191  ((subdet == static_cast<int>(HcalBarrel)) && (lay > maxLayerHB_ + 1))) {
192  subdet = static_cast<int>(HcalOuter);
193  depth = 4;
194  } else if (subdet == static_cast<int>(HcalBarrel) || subdet == static_cast<int>(HcalEndcap)) {
195  eta = ietaMap[ieta - 1];
196  int unit = phiUnitS[ieta - 1];
197  int phi0 = (iphi - 1) / (hpar->phigroup[eta - 1]);
198  if (unit == 2) {
199  phi0 = (iphi + 1) / 2;
200  phi0 = (phi0 - 1) / (hpar->phigroup[eta - 1]);
201  } else if (unit == 4) {
202  phi0 = (iphi + 1) / 4;
203  phi0 = (phi0 - 1) / (hpar->phigroup[eta - 1]);
204  }
205  ++phi0;
206  unit = hcons.unitPhi(phibin[eta - 1]);
207  phi = hcons.phiNumber(phi0, unit);
208  depth = hcons.findDepth(subdet, eta, phi, zside, lay - 1);
209  if (depth <= 0)
210  depth = layerGroup(eta - 1, lay - 1);
211  if (eta == iEtaMin[1]) {
212  if (subdet == static_cast<int>(HcalBarrel)) {
213  if (depth > hcons.getDepthEta16(subdet, phi, zside))
214  depth = hcons.getDepthEta16(subdet, phi, zside);
215  } else {
216  if (depth < hcons.getDepthEta16(subdet, phi, zside))
217  depth = hcons.getDepthEta16(subdet, phi, zside);
218  }
219  } else if (eta == hpar->noff[0] && lay > 1) {
220  int kphi = phi + int((hpar->phioff[3] + 0.1) / phibin[eta - 1]);
221  kphi = (kphi - 1) % 4 + 1;
222  if (kphi == 2 || kphi == 3)
223  depth = layerGroup(eta - 1, lay - 2);
224  } else if (eta == hpar->noff[1] && depth > hcons.getDepthEta29(phi, zside, 0)) {
225  eta -= hcons.getDepthEta29(phi, zside, 1);
226  }
227  }
228 #ifdef EDM_ML_DEBUG
229  edm::LogVerbatim("HCalGeom") << "getHCID: input " << subdet << ":" << ieta << ":" << iphi << ":" << idepth << ":"
230  << lay << " output " << eta << ":" << phi << ":" << depth;
231 #endif
232  return HcalDDDRecConstants::HcalID(subdet, eta, phi, depth);
233 }
Log< level::Info, true > LogVerbatim
std::vector< int > iEtaMin
int getDepthEta29(const int &phi, const int &zside, const int &i) const
uint32_t etaMaxHBHE() const
int zside(DetId const &)
std::vector< int > phiUnitS
int phiNumber(const int &phi, const int &unit) const
const HcalParameters * hpar
std::vector< double > phibin
std::vector< int > ietaMap
int findDepth(const int &det, const int &eta, const int &phi, const int &zside, const int &lay) const
Basic3DVector unit() const
int unitPhi(const int &det, const int &etaR) const
std::vector< double > phioff
const HcalDDDSimConstants & hcons
unsigned int layerGroup(int eta, int i) const
std::vector< int > noff
std::vector< int > phigroup
static const int maxLayerHB_
int getDepthEta16(const int &det, const int &phi, const int &zside) const

◆ getHFCellParameters()

std::vector< HcalDDDRecConstants::HFCellParameters > HcalDDDRecConstants::getHFCellParameters ( ) const

Definition at line 235 of file HcalDDDRecConstants.cc.

References funct::abs(), hgcalTopologyTester_cfi::cell1, hgcalTopologyTester_cfi::cell2, hgcalTBTopologyTester_cfi::cells, HcalDDDSimConstants::getIdHF2QIE(), HcalDDDSimConstants::getPhiTableHF(), HcalDDDSimConstants::getRTableHF(), hcons, hcalRecHitTable_cff::ieta, iEtaMin, hcalRecHitTable_cff::iphi, dqmdumpme::k, maxDepth, HLT_2024v14_cff::nEta, nphi, photonAnalyzer_cfi::rMax, and photonAnalyzer_cfi::rMin.

Referenced by HcalFlexiHardcodeGeometryLoader::makeHFCells().

235  {
236  std::vector<HcalDDDRecConstants::HFCellParameters> cells;
237  unsigned int nEta = hcons.getPhiTableHF().size();
238  if (maxDepth[2] > 0) {
239  for (unsigned int k = 0; k < nEta; ++k) {
240  int ieta = iEtaMin[2] + k;
241  int dphi = static_cast<int>(0.001 + hcons.getPhiTableHF()[k] / (5._deg));
242  int iphi = (dphi == 4) ? 3 : 1;
243  int nphi = 72 / dphi;
244  double rMin = hcons.getRTableHF()[nEta - k - 1] / CLHEP::cm;
245  double rMax = hcons.getRTableHF()[nEta - k] / CLHEP::cm;
247  cells.emplace_back(cell1);
249  cells.emplace_back(cell2);
250  }
251  }
252  if (maxDepth[2] > 2) {
253  if (!hcons.getIdHF2QIE().empty()) {
254  for (unsigned int k = 0; k < hcons.getIdHF2QIE().size(); ++k) {
255  int ieta = hcons.getIdHF2QIE()[k].ieta();
256  int ind = std::abs(ieta) - iEtaMin[2];
257  int dphi = static_cast<int>(0.001 + hcons.getPhiTableHF()[ind] / (5._deg));
258  int iphi = hcons.getIdHF2QIE()[k].iphi();
259  double rMin = hcons.getRTableHF()[nEta - ind - 1] / CLHEP::cm;
260  double rMax = hcons.getRTableHF()[nEta - ind] / CLHEP::cm;
262  cells.emplace_back(cell1);
263  }
264  } else {
265  for (unsigned int k = 0; k < nEta; ++k) {
266  int ieta = iEtaMin[2] + k;
267  int dphi = static_cast<int>(0.001 + hcons.getPhiTableHF()[k] / (5._deg));
268  int iphi = (dphi == 4) ? 3 : 1;
269  int nphi = 72 / dphi;
270  double rMin = hcons.getRTableHF()[nEta - k - 1] / CLHEP::cm;
271  double rMax = hcons.getRTableHF()[nEta - k] / CLHEP::cm;
273  cells.emplace_back(cell1);
275  cells.emplace_back(cell2);
276  }
277  }
278  }
279 #ifdef EDM_ML_DEBUG
280  edm::LogVerbatim("HCalGeom") << "HcalDDDRecConstants returns " << cells.size() << " HF cell parameters";
281  for (unsigned int k = 0; k < cells.size(); ++k)
282  edm::LogVerbatim("HCalGeom") << "Cell[" << k << "] : (" << cells[k].ieta << ", " << cells[k].depth << ", "
283  << cells[k].firstPhi << ", " << cells[k].stepPhi << ", " << cells[k].nPhi << ", "
284  << cells[k].rMin << ", " << cells[k].rMax << ")";
285 #endif
286  return cells;
287 }
Log< level::Info, true > LogVerbatim
const int nphi
std::vector< int > iEtaMin
std::vector< int > maxDepth
const std::vector< double > & getRTableHF() const
Abs< T >::type abs(const T &t)
Definition: Abs.h:22
const std::vector< double > & getPhiTableHF() const
const std::vector< HcalDetId > & getIdHF2QIE() const
const HcalDDDSimConstants & hcons

◆ getLayer0Wt()

double HcalDDDRecConstants::getLayer0Wt ( const int &  det,
const int &  phi,
const int &  zside 
) const
inline

Definition at line 86 of file HcalDDDRecConstants.h.

References HcalDDDSimConstants::getLayer0Wt(), hcons, phi, and ecaldqm::zside().

Referenced by HcalHitRelabeller::energyWt().

86  {
87  return hcons.getLayer0Wt(det, phi, zside);
88  }
double getLayer0Wt(const int &det, const int &phi, const int &zside) const
int zside(DetId const &)
const HcalDDDSimConstants & hcons

◆ getLayerBack()

int HcalDDDRecConstants::getLayerBack ( const int &  det,
const int &  eta,
const int &  phi,
const int &  depth 
) const

Definition at line 302 of file HcalDDDRecConstants.cc.

References hcalRecHitTable_cff::depth, PVValHelper::eta, ALCARECOTkAlBeamHalo_cff::etaMax, HcalDDDSimConstants::getLastLayer(), HcalLayerDepthMap::getLayerBack(), hcons, hcalRecHitTable_cff::ieta, hcalRecHitTable_cff::iphi, dqmdumpme::k, layerGroup(), layerGroupSize(), HcalDDDSimConstants::ldMap(), and ecaldqm::zside().

Referenced by getRZ().

302  {
303  int subdet = (idet == 1) ? 1 : 2;
304  int zside = (ieta > 0) ? 1 : -1;
305  int eta = zside * ieta;
306  int layBack = hcons.ldMap()->getLayerBack(subdet, eta, iphi, zside, depth);
307  int laymax = hcons.getLastLayer(subdet, ieta);
308  if (layBack < 0 && eta <= hpar->etaMax[1]) {
309  for (unsigned int k = 0; k < layerGroupSize(eta - 1); ++k) {
310  if ((depth + 1) == static_cast<int>(layerGroup(eta - 1, k))) {
311  layBack = k - 1;
312  break;
313  }
314  }
315  }
316  if (layBack < 0 || layBack > laymax)
317  layBack = laymax;
318 #ifdef EDM_ML_DEBUG
319  edm::LogVerbatim("HCalGeom") << "getLayerBack::Input " << idet << ":" << ieta << ":" << iphi << ":" << depth
320  << " Output " << layBack;
321 #endif
322  return layBack;
323 }
Log< level::Info, true > LogVerbatim
int zside(DetId const &)
const HcalLayerDepthMap * ldMap() const
unsigned int layerGroupSize(int eta) const
int getLayerBack(const int subdet, const int ieta, const int iphi, const int zside, const int depth) const
const HcalDDDSimConstants & hcons
unsigned int layerGroup(int eta, int i) const
int getLastLayer(const int &det, const int &eta) const

◆ getLayerDepth()

void HcalDDDRecConstants::getLayerDepth ( const int &  ieta,
std::map< int, int > &  layers 
) const

Definition at line 289 of file HcalDDDRecConstants.cc.

References hcalRecHitTable_cff::ieta, MainPageGenerator::l, layerGroup(), layerGroupSize(), and hgcalTBTopologyTester_cfi::layers.

Referenced by getEtaBins().

289  {
290  layers.clear();
291  for (unsigned int l = 0; l < layerGroupSize(ieta - 1); ++l) {
292  int lay = l + 1;
293  layers[lay] = layerGroup(ieta - 1, l);
294  }
295 #ifdef EDM_ML_DEBUG
296  edm::LogVerbatim("HCalGeom") << "getLayerDepth::Input " << ieta << " Output " << layers.size() << " entries";
297  for (std::map<int, int>::iterator itr = layers.begin(); itr != layers.end(); ++itr)
298  edm::LogVerbatim("HCalGeom") << " [" << itr->first << "] " << itr->second;
299 #endif
300 }
Log< level::Info, true > LogVerbatim
unsigned int layerGroupSize(int eta) const
unsigned int layerGroup(int eta, int i) const

◆ getLayerFront()

int HcalDDDRecConstants::getLayerFront ( const int &  det,
const int &  eta,
const int &  phi,
const int &  depth 
) const

Definition at line 325 of file HcalDDDRecConstants.cc.

References hcalRecHitTable_cff::depth, PVValHelper::eta, ALCARECOTkAlBeamHalo_cff::etaMax, HcalDDDSimConstants::getFrontLayer(), HcalLayerDepthMap::getLayerFront(), HcalEndcap, hcons, hcalRecHitTable_cff::ieta, hcalRecHitTable_cff::iphi, dqmdumpme::k, layerGroup(), layerGroupSize(), HcalDDDSimConstants::ldMap(), and ecaldqm::zside().

Referenced by getRZ(), and getThickActive().

325  {
326  int subdet = (idet == 1) ? 1 : 2;
327  int zside = (ieta > 0) ? 1 : -1;
328  int eta = zside * ieta;
329  int layFront = hcons.ldMap()->getLayerFront(subdet, eta, iphi, zside, depth);
330  int laymin = hcons.getFrontLayer(subdet, ieta);
331  if ((layFront < 0) || ((subdet == static_cast<int>(HcalEndcap)) && (eta == 16))) {
332  if ((subdet == static_cast<int>(HcalEndcap)) && (eta == 16)) {
333  layFront = laymin;
334  } else if (eta <= hpar->etaMax[1]) {
335  for (unsigned int k = 0; k < layerGroupSize(eta - 1); ++k) {
336  if (depth == static_cast<int>(layerGroup(eta - 1, k))) {
337  if (static_cast<int>(k) >= laymin) {
338  layFront = k;
339  break;
340  }
341  }
342  }
343  }
344  } else {
345  if (layFront < laymin)
346  layFront = laymin;
347  }
348 #ifdef EDM_ML_DEBUG
349  edm::LogVerbatim("HCalGeom") << "getLayerFront::Input " << idet << ":" << ieta << ":" << iphi << ":" << depth
350  << " Output " << layFront;
351 #endif
352  return layFront;
353 }
Log< level::Info, true > LogVerbatim
int getFrontLayer(const int &det, const int &eta) const
int getLayerFront(const int subdet, const int ieta, const int iphi, const int zside, const int depth) const
int zside(DetId const &)
const HcalLayerDepthMap * ldMap() const
unsigned int layerGroupSize(int eta) const
const HcalDDDSimConstants & hcons
unsigned int layerGroup(int eta, int i) const

◆ getMaxDepth() [1/2]

int HcalDDDRecConstants::getMaxDepth ( const int &  type) const
inline

◆ getMaxDepth() [2/2]

int HcalDDDRecConstants::getMaxDepth ( const int &  itype,
const int &  ieta,
const int &  iphi,
const int &  zside 
) const

Definition at line 355 of file HcalDDDRecConstants.cc.

References HcalDDDSimConstants::getDepthEta16M(), HcalDDDSimConstants::getDepthEta29M(), HcalDDDSimConstants::getMaxDepth(), hcons, hpar, hcalRecHitTable_cff::ieta, iEtaMax, hcalRecHitTable_cff::iphi, layerGroup(), layerGroupSize(), maxLayer_, maxLayerHB_, HcalParameters::noff, and ecaldqm::zside().

355  {
356  unsigned int type = (itype == 0) ? 0 : 1;
357  int lmax = hcons.getMaxDepth(type + 1, ieta, iphi, zside, true);
358  if (lmax < 0) {
359  unsigned int lymax = (type == 0) ? maxLayerHB_ + 1 : maxLayer_ + 1;
360  lmax = 0;
361  if (layerGroupSize(ieta - 1) > 0) {
362  if (layerGroupSize(ieta - 1) < lymax)
363  lymax = layerGroupSize(ieta - 1);
364  lmax = static_cast<int>(layerGroup(ieta - 1, lymax - 1));
365  if (type == 0 && ieta == iEtaMax[type])
366  lmax = hcons.getDepthEta16M(1);
367  if (type == 1 && ieta >= hpar->noff[1])
368  lmax = hcons.getDepthEta29M(0, false);
369  }
370  }
371 #ifdef EDM_ML_DEBUG
372  edm::LogVerbatim("HCalGeom") << "getMaxDepth::Input " << itype << ":" << ieta << ":" << iphi << ":" << zside
373  << " Output " << lmax;
374 #endif
375  return lmax;
376 }
Log< level::Info, true > LogVerbatim
int getDepthEta29M(const int &i, const bool &planOne) const
static const int maxLayer_
int zside(DetId const &)
int getDepthEta16M(const int &det) const
const HcalParameters * hpar
std::vector< int > iEtaMax
unsigned int layerGroupSize(int eta) const
const HcalDDDSimConstants & hcons
unsigned int layerGroup(int eta, int i) const
std::vector< int > noff
int getMaxDepth(const int &type) const
static const int maxLayerHB_

◆ getMinDepth()

int HcalDDDRecConstants::getMinDepth ( const int &  itype,
const int &  ieta,
const int &  iphi,
const int &  zside 
) const

Definition at line 378 of file HcalDDDRecConstants.cc.

References HcalDDDSimConstants::getDepthEta16M(), HcalDDDSimConstants::getMinDepth(), hcons, hcalRecHitTable_cff::ieta, iEtaMin, hcalRecHitTable_cff::iphi, layerGroup(), layerGroupSize(), maxDepth, and ecaldqm::zside().

Referenced by HcalRaddamMuon::analyze(), HcalHBHEMuonAnalyzer::depth16HE(), HcalHBHEMuonHighEtaAnalyzer::depth16HE(), AlCaHcalHBHEMuonProducer::depth16HE(), HcalTopology::depthBinInformation(), HcalGeometry::getClosestCell(), and HcalTopology::validRaw().

378  {
379  int lmin = hcons.getMinDepth(itype + 1, ieta, iphi, zside, true);
380  if (lmin < 0) {
381  if (itype == 2) { // HFn
382  lmin = 1;
383  } else if (itype == 3) { //HO
384  lmin = maxDepth[3];
385  } else {
386  unsigned int type = (itype == 0) ? 0 : 1;
387  if (layerGroupSize(ieta - 1) > 0) {
388  if (type == 1 && ieta == iEtaMin[type])
389  lmin = hcons.getDepthEta16M(2);
390  else
391  lmin = static_cast<int>(layerGroup(ieta - 1, 0));
392  }
393  }
394  }
395  return lmin;
396 }
std::vector< int > iEtaMin
std::vector< int > maxDepth
int zside(DetId const &)
int getDepthEta16M(const int &det) const
unsigned int layerGroupSize(int eta) const
int getMinDepth(const int &det, const int &eta, const int &phi, const int &zside, const bool &partialOnly) const
const HcalDDDSimConstants & hcons
unsigned int layerGroup(int eta, int i) const

◆ getNEta()

int HcalDDDRecConstants::getNEta ( ) const
inline

Definition at line 92 of file HcalDDDRecConstants.h.

References HcalParameters::etagroup, and hpar.

Referenced by HcalTopology::HcalTopology().

92 { return hpar->etagroup.size(); }
std::vector< int > etagroup
const HcalParameters * hpar

◆ getNoff()

int HcalDDDRecConstants::getNoff ( const int &  i) const
inline

Definition at line 93 of file HcalDDDRecConstants.h.

References hpar, mps_fire::i, and HcalParameters::noff.

Referenced by HcalTopology::validRaw().

93 { return hpar->noff[i]; }
const HcalParameters * hpar
std::vector< int > noff

◆ getNPhi()

int HcalDDDRecConstants::getNPhi ( const int &  type) const
inline

◆ getOneEtaBin()

void HcalDDDRecConstants::getOneEtaBin ( HcalSubdetector  subdet,
int  ieta,
int  zside,
std::vector< std::pair< int, double >> &  phis,
std::map< int, int > &  layers,
bool  planOne,
std::vector< HcalDDDRecConstants::HcalEtaBin > &  bins 
) const
private

Definition at line 732 of file HcalDDDRecConstants.cc.

References trigObjTnPSource_cfi::bins, angle_units::operators::convertRadToDeg(), HcalDDDRecConstants::HcalEtaBin::depthStart, etaTable, dqmdumpme::first, HcalDDDSimConstants::getDepthEta16(), HcalDDDSimConstants::getDepthEta16M(), HcalDDDSimConstants::getDepthEta29(), HcalDDDSimConstants::getDepthEta29M(), HcalBarrel, HcalEndcap, hcons, hpar, hcalRecHitTable_cff::ieta, iEtaMax, iEtaMin, dqmdumpme::k, MainPageGenerator::l, HcalDDDRecConstants::HcalEtaBin::layer, hgcalTBTopologyTester_cfi::layers, maxLayer_, maxLayerHB_, dqmiodumpmetadata::n, HcalParameters::noff, phibin, HcalDDDRecConstants::HcalEtaBin::phis, edm::second(), and ecaldqm::zside().

Referenced by getEtaBins().

738  {
739  unsigned int lymax = (subdet == HcalBarrel) ? maxLayerHB_ + 1 : maxLayer_ + 1;
740  int type = (subdet == HcalBarrel) ? 0 : 1;
741  double dphi = phibin[ieta - 1];
744  etabin.phis.insert(etabin.phis.end(), phis.begin(), phis.end());
745  int n = (ieta == iEtaMax[type]) ? 0 : 1;
748  etabin0.depthStart = hcons.getDepthEta29(phis[0].first, zside, 0) + 1;
749  int dstart = -1;
750  int lmin(0), lmax(0);
751 
752  std::map<int, int>::iterator itr = layers.begin();
753  if (!layers.empty()) {
754  int dep = itr->second;
755  if (subdet == HcalEndcap && ieta == iEtaMin[type])
756  dep = hcons.getDepthEta16(subdet, phis[0].first, zside);
757  unsigned lymx0 = (layers.size() > lymax) ? lymax : layers.size();
758 #ifdef EDM_ML_DEBUG
759  edm::LogVerbatim("HCalGeom") << "Eta " << ieta << ":" << hpar->noff[1] << " zside " << zside << " lymax " << lymx0
760  << ":" << lymax << " Depth " << dep << ":" << itr->second;
761  unsigned int l(0);
762  for (itr = layers.begin(); itr != layers.end(); ++itr, ++l)
763  edm::LogVerbatim("HCalGeom") << "Layer [" << l << "] " << itr->first << ":" << itr->second;
764  edm::LogVerbatim("HCalGeom") << "With " << phis.size() << " phis";
765  for (unsigned int l = 0; l < phis.size(); ++l)
766  edm::LogVerbatim("HCalGeom") << "[" << l << "] " << phis[l].first << ":" << convertRadToDeg(phis[l].second);
767 #endif
768  for (itr = layers.begin(); itr != layers.end(); ++itr) {
769  if (itr->first <= static_cast<int>(lymx0)) {
770  if (itr->second == dep) {
771  if (lmin == 0)
772  lmin = itr->first;
773  lmax = itr->first;
774  } else if (itr->second > dep) {
775  if (dstart < 0)
776  dstart = dep;
777  int lmax0 = (lmax >= lmin) ? lmax : lmin;
778  if (subdet == HcalEndcap && ieta + 1 == hpar->noff[1] && dep > hcons.getDepthEta29(phis[0].first, zside, 0)) {
779  etabin0.layer.emplace_back(std::pair<int, int>(lmin, lmax0));
780  } else {
781  etabin.layer.emplace_back(std::pair<int, int>(lmin, lmax0));
782  }
783  lmin = itr->first;
784  lmax = lmin - 1;
785  dep = itr->second;
786  }
787  if (subdet == HcalBarrel && ieta == iEtaMax[type] && dep > hcons.getDepthEta16M(1))
788  break;
789  if (subdet == HcalEndcap && ieta == hpar->noff[1] && dep > hcons.getDepthEta29M(0, planOne)) {
790  lmax = lymx0;
791  break;
792  }
793  if (itr->first == static_cast<int>(lymx0))
794  lmax = lymx0;
795  }
796  }
797  if (lmax >= lmin) {
798  if (ieta + 1 == hpar->noff[1]) {
799  etabin0.layer.emplace_back(std::pair<int, int>(lmin, lmax));
800  etabin0.phis.insert(etabin0.phis.end(), phis.begin(), phis.end());
801  bins.emplace_back(etabin0);
802 #ifdef EDM_ML_DEBUG
803  edm::LogVerbatim("HCalGeom") << "etabin0: dStatrt " << etabin0.depthStart << " layers " << etabin0.layer.size()
804  << ":" << lmin << ":" << lmax << " phis " << phis.size();
805  for (unsigned int k = 0; k < etabin0.layer.size(); ++k)
806  edm::LogVerbatim("HCalGeom") << " [" << k << "] " << etabin0.layer[k].first << ":" << etabin0.layer[k].second;
807 #endif
808  } else if (ieta == hpar->noff[1]) {
809  } else {
810  etabin.layer.emplace_back(std::pair<int, int>(lmin, lmax));
811  if (dstart < 0)
812  dstart = dep;
813  }
814  }
815  }
816  etabin.depthStart = dstart;
817  bins.emplace_back(etabin);
818 #ifdef EDM_ML_DEBUG
819  edm::LogVerbatim("HCalGeom") << "etabin: dStatrt " << etabin.depthStart << " layers " << etabin.layer.size() << ":"
820  << lmin << ":" << lmax << " phis " << etabin.phis.size();
821  for (unsigned int k = 0; k < etabin.layer.size(); ++k)
822  edm::LogVerbatim("HCalGeom") << "[" << k << "] " << etabin.layer[k].first << ":" << etabin.layer[k].second;
823 #endif
824 }
Log< level::Info, true > LogVerbatim
std::vector< int > iEtaMin
int getDepthEta29M(const int &i, const bool &planOne) const
constexpr NumType convertRadToDeg(NumType radians)
Definition: angle_units.h:21
int getDepthEta29(const int &phi, const int &zside, const int &i) const
static const int maxLayer_
int zside(DetId const &)
int getDepthEta16M(const int &det) const
U second(std::pair< T, U > const &p)
const HcalParameters * hpar
std::vector< double > phibin
std::vector< int > iEtaMax
std::vector< std::pair< int, int > > layer
std::vector< double > etaTable
const HcalDDDSimConstants & hcons
std::vector< int > noff
std::vector< std::pair< int, double > > phis
static const int maxLayerHB_
int getDepthEta16(const int &det, const int &phi, const int &zside) const

◆ getPhiBin()

double HcalDDDRecConstants::getPhiBin ( const int &  i) const
inline

Definition at line 95 of file HcalDDDRecConstants.h.

References mps_fire::i, and phibin.

95 { return phibin[i]; }
std::vector< double > phibin

◆ getPhiOff()

double HcalDDDRecConstants::getPhiOff ( const int &  i) const
inline

Definition at line 96 of file HcalDDDRecConstants.h.

References hpar, mps_fire::i, and HcalParameters::phioff.

96 { return hpar->phioff[i]; }
const HcalParameters * hpar
std::vector< double > phioff

◆ getPhiOffs()

const std::vector<double>& HcalDDDRecConstants::getPhiOffs ( ) const
inline

Definition at line 97 of file HcalDDDRecConstants.h.

References hpar, and HcalParameters::phioff.

Referenced by HcalTopology::HcalTopology().

97 { return hpar->phioff; }
const HcalParameters * hpar
std::vector< double > phioff

◆ getPhis()

std::vector< std::pair< int, double > > HcalDDDRecConstants::getPhis ( const int &  subdet,
const int &  ieta 
) const

Definition at line 398 of file HcalDDDRecConstants.cc.

References angle_units::operators::convertRadToDeg(), etaSimValu, dqmdumpme::first, HcalDDDSimConstants::getPhiCons(), HcalForward, hcons, hcalRecHitTable_cff::ieta, ALPAKA_ACCELERATOR_NAMESPACE::ecal::reconstruction::internal::barrel::ietaAbs(), hcalRecHitTable_cff::iphi, dqmdumpme::k, nphi, phi, phibin, HcalDDDSimConstants::phiNumber(), edm::second(), HcalDDDSimConstants::unitPhi(), and units().

Referenced by HcalTestNumberingTester::analyze(), and getEtaBins().

398  {
399  std::vector<std::pair<int, double>> phis;
400  int ietaAbs = (ieta > 0) ? ieta : -ieta;
401  int keta = (subdet != HcalForward) ? etaSimValu[ietaAbs - 1].first : ietaAbs;
402  std::pair<double, double> ficons = hcons.getPhiCons(subdet, keta);
403  double fioff = ficons.first;
404  double dphi = (subdet != HcalForward) ? phibin[ietaAbs - 1] : ficons.second;
405  int nphi = int((2._pi + 0.1 * dphi) / dphi);
406  int units = hcons.unitPhi(subdet, keta);
407  for (int ifi = 0; ifi < nphi; ++ifi) {
408  double phi = -fioff + (ifi + 0.5) * dphi;
409  int iphi = hcons.phiNumber(ifi + 1, units);
410  phis.emplace_back(std::pair<int, double>(iphi, phi));
411  }
412 #ifdef EDM_ML_DEBUG
413  edm::LogVerbatim("HCalGeom") << "getEtaPhi: subdet|ieta|iphi " << subdet << "|" << ieta << " with " << phis.size()
414  << " phi bins";
415  for (unsigned int k = 0; k < phis.size(); ++k)
416  edm::LogVerbatim("HCalGeom") << "[" << k << "] iphi " << phis[k].first << " phi "
417  << convertRadToDeg(phis[k].second);
418 #endif
419  return phis;
420 }
Log< level::Info, true > LogVerbatim
const int nphi
constexpr NumType convertRadToDeg(NumType radians)
Definition: angle_units.h:21
std::pair< double, double > getPhiCons(const int &det, const int &ieta) const
int phiNumber(const int &phi, const int &unit) const
U second(std::pair< T, U > const &p)
ALPAKA_FN_ACC ALPAKA_FN_INLINE uint32_t ietaAbs(uint32_t id)
std::vector< double > phibin
std::vector< std::pair< int, int > > etaSimValu
int unitPhi(const int &det, const int &etaR) const
TString units(TString variable, Char_t axis)
const HcalDDDSimConstants & hcons

◆ getPhiTable()

const std::vector<double>& HcalDDDRecConstants::getPhiTable ( ) const
inline

Definition at line 99 of file HcalDDDRecConstants.h.

References phibin.

Referenced by HcalTopology::HcalTopology().

99 { return phibin; }
std::vector< double > phibin

◆ getPhiTableHF()

const std::vector<double>& HcalDDDRecConstants::getPhiTableHF ( ) const
inline

Definition at line 100 of file HcalDDDRecConstants.h.

References hpar, and HcalParameters::phitable.

Referenced by HcalTopology::HcalTopology().

100 { return hpar->phitable; }
const HcalParameters * hpar
std::vector< double > phitable

◆ getPhiZOne()

int HcalDDDRecConstants::getPhiZOne ( std::vector< std::pair< int, int >> &  phiz) const

Definition at line 422 of file HcalDDDRecConstants.cc.

References HcalLayerDepthMap::getPhis(), HcalLayerDepthMap::getSubdet(), hcons, dqmdumpme::k, HcalDDDSimConstants::ldMap(), phi, and ecaldqm::zside().

Referenced by HcalTopology::getPhiZOne().

422  {
423  phiz.clear();
424  int subdet = hcons.ldMap()->getSubdet();
425  if (subdet > 0) {
426  std::vector<int> phis = hcons.ldMap()->getPhis();
427  for (int k : phis) {
428  int zside = (k > 0) ? 1 : -1;
429  int phi = (k > 0) ? k : -k;
430  phiz.emplace_back(std::pair<int, int>(phi, zside));
431  }
432  }
433 #ifdef EDM_ML_DEBUG
434  edm::LogVerbatim("HCalGeom") << "Special RBX for detector " << subdet << " with " << phiz.size() << " phi/z bins";
435  for (unsigned int k = 0; k < phiz.size(); ++k)
436  edm::LogVerbatim("HCalGeom") << " [" << k << "] " << phiz[k].first << ":" << phiz[k].second;
437 #endif
438  return subdet;
439 }
Log< level::Info, true > LogVerbatim
int zside(DetId const &)
const std::vector< int > & getPhis() const
const HcalLayerDepthMap * ldMap() const
const HcalDDDSimConstants & hcons

◆ getRZ() [1/4]

double HcalDDDRecConstants::getRZ ( const int &  subdet,
const int &  ieta,
const int &  depth 
) const

◆ getRZ() [2/4]

double HcalDDDRecConstants::getRZ ( const int &  subdet,
const int &  ieta,
const int &  iphi,
const int &  depth 
) const

Definition at line 445 of file HcalDDDRecConstants.cc.

References hcalRecHitTable_cff::depth, dqmdumpme::first, gconsHB, gconsHE, getLayerFront(), HcalBarrel, hcalRecHitTable_cff::ieta, and hcalRecHitTable_cff::iphi.

445  {
446  int layf = getLayerFront(subdet, ieta, iphi, depth);
447  double rz =
448  (layf < 0) ? 0.0 : ((subdet == static_cast<int>(HcalBarrel)) ? (gconsHB[layf].first) : (gconsHE[layf].first));
449 #ifdef EDM_ML_DEBUG
450  edm::LogVerbatim("HCalGeom") << "getRZ: subdet|ieta|ipho|depth " << subdet << "|" << ieta << "|" << iphi << "|"
451  << depth << " lay|rz " << layf << "|" << rz;
452 #endif
453  return rz;
454 }
Log< level::Info, true > LogVerbatim
std::vector< std::pair< double, double > > gconsHE
std::vector< std::pair< double, double > > gconsHB
int getLayerFront(const int &det, const int &eta, const int &phi, const int &depth) const

◆ getRZ() [3/4]

double HcalDDDRecConstants::getRZ ( const int &  subdet,
const int &  layer 
) const

Definition at line 456 of file HcalDDDRecConstants.cc.

References dqmdumpme::first, gconsHB, gconsHE, HcalBarrel, nano_mu_digi_cff::layer, and layerGroupSize().

456  {
457  double rz(0);
458  if (layer > 0 && layer <= static_cast<int>(layerGroupSize(0)))
459  rz = ((subdet == static_cast<int>(HcalBarrel)) ? (gconsHB[layer - 1].first) : (gconsHE[layer - 1].first));
460 #ifdef EDM_ML_DEBUG
461  edm::LogVerbatim("HCalGeom") << "getRZ: subdet|layer " << subdet << "|" << layer << " rz " << rz;
462 #endif
463  return rz;
464 }
Log< level::Info, true > LogVerbatim
std::vector< std::pair< double, double > > gconsHE
unsigned int layerGroupSize(int eta) const
std::vector< std::pair< double, double > > gconsHB

◆ getRZ() [4/4]

std::pair< double, double > HcalDDDRecConstants::getRZ ( const HcalDetId id) const

Definition at line 466 of file HcalDDDRecConstants.cc.

References hcalRecHitTable_cff::depth, dqmdumpme::first, gconsHB, gconsHE, getLayerBack(), getLayerFront(), HcalBarrel, hcalRecHitTable_cff::ieta, hcalRecHitTable_cff::iphi, edm::second(), and ecaldqm::zside().

466  {
467  int subdet = id.subdetId();
468  int ieta = id.ieta();
469  int iphi = id.iphi();
470  int depth = id.depth();
471  int zside = (subdet == static_cast<int>(HcalBarrel)) ? 1 : id.zside();
472  int layf = getLayerFront(subdet, ieta, iphi, depth);
473  double rzf = (layf < 0)
474  ? 0.0
475  : ((subdet == static_cast<int>(HcalBarrel)) ? zside * (gconsHB[layf].first - gconsHB[layf].second)
476  : zside * (gconsHE[layf].first - gconsHE[layf].second));
477  int layb = getLayerBack(subdet, ieta, iphi, depth);
478  double rzb = (layb < 0)
479  ? 0.0
480  : ((subdet == static_cast<int>(HcalBarrel)) ? zside * (gconsHB[layb].first + gconsHB[layb].second)
481  : zside * (gconsHE[layb].first + gconsHE[layb].second));
482 #ifdef EDM_ML_DEBUG
483  edm::LogVerbatim("HCalGeom") << "getRZ: subdet|ieta|ipho|depth " << subdet << "|" << ieta << "|" << iphi << "|"
484  << depth << " lay|rz (front) " << layf << "|" << rzf << " lay|rz (back) " << layb << "|"
485  << rzb;
486 #endif
487  return std::pair<double, double>(rzf, rzb);
488 }
Log< level::Info, true > LogVerbatim
int zside(DetId const &)
U second(std::pair< T, U > const &p)
std::vector< std::pair< double, double > > gconsHE
std::vector< std::pair< double, double > > gconsHB
int getLayerFront(const int &det, const int &eta, const int &phi, const int &depth) const
int getLayerBack(const int &det, const int &eta, const int &phi, const int &depth) const

◆ getThickActive()

std::vector< HcalDDDRecConstants::HcalActiveLength > HcalDDDRecConstants::getThickActive ( const int &  type) const

Definition at line 490 of file HcalDDDRecConstants.cc.

References newFWLiteAna::bin, trigObjTnPSource_cfi::bins, angle_units::operators::convertRadToDeg(), funct::cos(), hcalRecHitTable_cff::depth, HcalDDDRecConstants::HcalActiveLength::depth, HcalDDDRecConstants::HcalActiveLength::eta, PVValHelper::eta, JetChargeProducer_cfi::exp, gconsHB, gconsHE, getEtaBins(), HcalDDDSimConstants::getLastLayer(), getLayerFront(), hcons, mps_fire::i, hcalRecHitTable_cff::ieta, HcalDDDRecConstants::HcalActiveLength::ieta, iEtaMin, HcalDDDRecConstants::HcalActiveLength::iphis, dqmiolumiharvest::j, SiStripPI::max, SiStripPI::min, phi, l1tEGammaCrystalsEmulatorProducer_cfi::scale, edm::second(), funct::sin(), HcalDDDRecConstants::HcalActiveLength::stype, submitPVValidationJobs::t, theta(), HcalDDDRecConstants::HcalActiveLength::thick, HcalDDDRecConstants::HcalActiveLength::zside, and ecaldqm::zside().

Referenced by HcalRaddamMuon::beginRun(), HcalHBHEMuonAnalyzer::beginRun(), HcalHBHEMuonHighEtaAnalyzer::beginRun(), and AlCaHcalHBHEMuonProducer::beginRun().

490  {
491  std::vector<HcalDDDRecConstants::HcalActiveLength> actives;
492  std::vector<HcalDDDRecConstants::HcalEtaBin> bins = getEtaBins(type);
493 #ifdef EDM_ML_DEBUG
494  unsigned int kount(0);
495 #endif
496  for (auto& bin : bins) {
497  int ieta = bin.ieta;
498  int zside = bin.zside;
499  int stype = (bin.phis.size() > 4) ? 0 : 1;
500  int layf = getLayerFront(type + 1, zside * ieta, bin.phis[0].first, bin.depthStart) + 1;
501  int layl = hcons.getLastLayer(type + 1, zside * ieta) + 1;
502  double eta = 0.5 * (bin.etaMin + bin.etaMax);
503  double theta = 2 * atan(exp(-eta));
504  double scale = 1.0 / ((type == 0) ? sin(theta) : cos(theta));
505  int depth = bin.depthStart;
506 #ifdef EDM_ML_DEBUG
507  edm::LogVerbatim("HCalGeom") << "Eta " << ieta << " zside " << zside << " depth " << depth << " Layers " << layf
508  << ":" << layl << ":" << bin.layer.size();
509  for (auto ll : bin.layer)
510  edm::LogVerbatim("HCalGeom") << "Layer " << ll.first << ":" << ll.second;
511  for (auto phi : bin.phis)
512  edm::LogVerbatim("HCalGeom") << "Phi " << phi.first << ":" << convertRadToDeg(phi.second);
513 #endif
514  for (unsigned int i = 0; i < bin.layer.size(); ++i) {
515  double thick(0);
516  int lmin = (type == 1 && ieta == iEtaMin[1]) ? layf : std::max(bin.layer[i].first, layf);
517  int lmax = std::min(bin.layer[i].second, layl);
518  for (int j = lmin; j <= lmax; ++j) {
519  double t = ((type == 0) ? gconsHB[j - 1].second : gconsHE[j - 1].second);
520  if ((type == 1) && (ieta <= 18))
521  t = gconsHE[j].second;
522  if (t > 0)
523  thick += t;
524  }
525 #ifdef EDM_ML_DEBUG
526  edm::LogVerbatim("HCalGeom") << "Type " << type << " L " << lmin << ":" << lmax << " T " << thick;
527 #endif
528  thick *= (2. * scale);
529  HcalDDDRecConstants::HcalActiveLength active(ieta, depth, zside, stype, zside * eta, thick);
530  for (auto phi : bin.phis)
531  active.iphis.emplace_back(phi.first);
532  actives.emplace_back(active);
533  ++depth;
534 #ifdef EDM_ML_DEBUG
535  kount++;
536  edm::LogVerbatim("HCalGeom") << "getThickActive: [" << kount << "] eta:" << active.ieta << ":" << active.eta
537  << " zside " << active.zside << " depth " << active.depth << " type " << active.stype
538  << " thick " << active.thick;
539 #endif
540  }
541  }
542  return actives;
543 }
Log< level::Info, true > LogVerbatim
std::vector< int > iEtaMin
constexpr NumType convertRadToDeg(NumType radians)
Definition: angle_units.h:21
Sin< T >::type sin(const T &t)
Definition: Sin.h:22
int zside(DetId const &)
std::vector< HcalEtaBin > getEtaBins(const int &itype) const
U second(std::pair< T, U > const &p)
std::vector< std::pair< double, double > > gconsHE
Cos< T >::type cos(const T &t)
Definition: Cos.h:22
std::vector< std::pair< double, double > > gconsHB
int getLayerFront(const int &det, const int &eta, const int &phi, const int &depth) const
const HcalDDDSimConstants & hcons
int getLastLayer(const int &det, const int &eta) const
Geom::Theta< T > theta() const

◆ getTopoMode()

int HcalDDDRecConstants::getTopoMode ( ) const
inline

◆ getTriggerMode()

int HcalDDDRecConstants::getTriggerMode ( ) const
inline

Definition at line 108 of file HcalDDDRecConstants.h.

References hpar, and HcalParameters::topologyMode.

Referenced by HcalTopology::HcalTopology().

108 { return (((hpar->topologyMode) >> 8) & 0xFF); }
const HcalParameters * hpar

◆ HcalCellTypes()

std::vector< HcalCellType > HcalDDDRecConstants::HcalCellTypes ( HcalSubdetector  subdet) const

Definition at line 545 of file HcalDDDRecConstants.cc.

References hgcalTBTopologyTester_cfi::cells, submitPVResolutionJobs::count, hcalRecHitTable_cff::depth, defaults_cfi::etabins, etaSimValu, dqmdumpme::first, getEtaBins(), HcalBarrel, HcalDDDSimConstants::HcalCellTypes(), HcalEndcap, hcons, hpar, hcalRecHitTable_cff::ieta, iEtaMax, HcalParameters::phioff, groupFilesInBlocks::temp, unit(), and HcalDDDSimConstants::unitPhi().

Referenced by HcalDDDGeometryLoader::fill(), and numberOfCells().

545  {
546  if (subdet == HcalBarrel || subdet == HcalEndcap) {
547  std::vector<HcalCellType> cells;
548  int isub = (subdet == HcalBarrel) ? 0 : 1;
549  std::vector<HcalDDDRecConstants::HcalEtaBin> etabins = getEtaBins(isub);
550  std::vector<int> missPhi;
551  for (const auto& etabin : etabins) {
552  std::vector<HcalCellType> temp;
553  std::vector<int> count;
554  std::vector<double> dmin, dmax;
555  for (unsigned int il = 0; il < etabin.layer.size(); ++il) {
556  HcalCellType cell(subdet, etabin.ieta, etabin.zside, 0, HcalCellType::HcalCell());
557  temp.emplace_back(cell);
558  count.emplace_back(0);
559  dmin.emplace_back(0);
560  dmax.emplace_back(0);
561  }
562  int ieta = etabin.ieta;
563  for (int keta = etaSimValu[ieta - 1].first; keta <= etaSimValu[ieta - 1].second; ++keta) {
564  std::vector<HcalCellType> cellsm = hcons.HcalCellTypes(subdet, keta, -1);
565  for (unsigned int il = 0; il < etabin.layer.size(); ++il) {
566  for (auto& ic : cellsm) {
567  if (ic.depthSegment() >= etabin.layer[il].first && ic.depthSegment() <= etabin.layer[il].second &&
568  ic.etaBin() == temp[il].etaBin() && ic.zside() == temp[il].zside()) {
569  if (count[il] == 0) {
570  temp[il] = ic;
571  dmin[il] = ic.depthMin();
572  dmax[il] = ic.depthMax();
573  }
574  ++count[il];
575  if (ic.depthMin() < dmin[il])
576  dmin[il] = ic.depthMin();
577  if (ic.depthMax() > dmax[il])
578  dmax[il] = ic.depthMax();
579  }
580  }
581  }
582  }
583  for (unsigned int il = 0; il < etabin.layer.size(); ++il) {
584  int depth = etabin.depthStart + static_cast<int>(il);
585  temp[il].setEta(ieta, etabin.etaMin, etabin.etaMax);
586  temp[il].setDepth(depth, dmin[il], dmax[il]);
587  double foff = (etabin.ieta <= iEtaMax[0]) ? hpar->phioff[0] : hpar->phioff[1];
588  int unit = hcons.unitPhi(etabin.dphi);
589  temp[il].setPhi(etabin.phis, missPhi, foff, etabin.dphi, unit);
590  cells.emplace_back(temp[il]);
591  }
592  }
593 #ifdef EDM_ML_DEBUG
594  edm::LogVerbatim("HCalGeom") << "HcalDDDRecConstants: found " << cells.size() << " cells for sub-detector type "
595  << isub;
596  for (unsigned int ic = 0; ic < cells.size(); ++ic)
597  edm::LogVerbatim("HCalGeom") << "Cell[" << ic << "] " << cells[ic];
598 #endif
599  return cells;
600  } else {
601  return hcons.HcalCellTypes(subdet, -1, -1);
602  }
603 }
Log< level::Info, true > LogVerbatim
std::vector< HcalEtaBin > getEtaBins(const int &itype) const
const HcalParameters * hpar
std::vector< int > iEtaMax
std::vector< HcalCellType > HcalCellTypes() const
std::vector< std::pair< int, int > > etaSimValu
Basic3DVector unit() const
int unitPhi(const int &det, const int &etaR) const
std::vector< double > phioff
const HcalDDDSimConstants & hcons

◆ idBack()

HcalDetId HcalDDDRecConstants::idBack ( const HcalDetId id) const

Definition at line 688 of file HcalDDDRecConstants.cc.

References detIdSpR_.

Referenced by HcalTopology::idBack().

688  {
689  HcalDetId hid(id);
690  std::map<HcalDetId, std::vector<HcalDetId>>::const_iterator itr = detIdSpR_.find(id);
691  if (itr != detIdSpR_.end())
692  hid = HcalDetId(id.subdet(), id.ieta(), id.iphi(), (itr->second).back().depth());
693  return hid;
694 }
std::map< HcalDetId, std::vector< HcalDetId > > detIdSpR_

◆ idFront()

HcalDetId HcalDDDRecConstants::idFront ( const HcalDetId id) const

Definition at line 680 of file HcalDDDRecConstants.cc.

References hcalRecHitTable_cff::depth, and detIdSpR_.

Referenced by HcalTopology::idFront().

680  {
681  HcalDetId hid(id);
682  std::map<HcalDetId, std::vector<HcalDetId>>::const_iterator itr = detIdSpR_.find(id);
683  if (itr != detIdSpR_.end())
684  hid = HcalDetId(id.subdet(), id.ieta(), id.iphi(), (itr->second)[0].depth());
685  return hid;
686 }
std::map< HcalDetId, std::vector< HcalDetId > > detIdSpR_

◆ initialize()

void HcalDDDRecConstants::initialize ( void  )
private

Definition at line 826 of file HcalDDDRecConstants.cc.

References angle_units::operators::convertRadToDeg(), submitPVResolutionJobs::count, hcalRecHitTable_cff::depth, depthMaxDf_, depthMaxSp_, HLT_2024v14_cff::depths, detIdSp_, detIdSpR_, HcalParameters::drHB, HcalParameters::dzHE, PVValHelper::eta, HcalParameters::etagroup, ALCARECOTkAlBeamHalo_cff::etaMax, HcalParameters::etaMax, ALCARECOTkAlBeamHalo_cff::etaMin, HcalParameters::etaMin, EnergyCorrector::etas, etaSimValu, HcalParameters::etaTable, etaTable, HcalParameters::etaTableHF, Exception, RemoveAddSevLevel::flag, gconsHB, gconsHE, HcalDDDSimConstants::getDepthEta16(), HcalDDDSimConstants::getDepthEta16M(), HcalDDDSimConstants::getDepthEta29M(), HcalLayerDepthMap::getDepths(), HcalLayerDepthMap::getLayerBack(), HcalLayerDepthMap::getLayerFront(), HcalDDDSimConstants::getMaxDepthDet(), HcalBarrel, HcalEndcap, hcons, hpar, mps_fire::i, hcalRecHitTable_cff::ieta, ietaMap, iEtaMax, iEtaMin, dqmdumpme::k, GetRecoTauVFromDQM_MC_cff::kk, MainPageGenerator::l, layerGroup(), layerGroupSize(), HcalDDDSimConstants::ldMap(), genParticles_cff::map, HcalParameters::maxDepth, maxDepth, maxLayer_, maxLayerHB_, HcalParameters::modHB, HcalParameters::modHE, ndepth, HLT_2024v14_cff::nEta, nHalves, nModule, HcalParameters::noff, nphi, nPhiBins, phi, HcalParameters::phibin, phibin, HcalParameters::phigroup, HcalParameters::phitable, phiUnitS, HcalParameters::rHB, edm::second(), unit(), HcalDDDSimConstants::unitPhi(), HcalLayerDepthMap::validDet(), HcalLayerDepthMap::validEta(), HcalParameters::zHE, and ecaldqm::zside().

Referenced by HcalDDDRecConstants().

826  {
827  //Eta grouping
828  int nEta = static_cast<int>(hpar->etagroup.size());
829  if (nEta != static_cast<int>(hpar->phigroup.size())) {
830  edm::LogError("HCalGeom") << "HcalDDDRecConstants: sizes of the vectors "
831  << " etaGroup (" << nEta << ") and phiGroup (" << hpar->phigroup.size()
832  << ") do not match";
833  throw cms::Exception("DDException") << "HcalDDDRecConstants: inconsistent array sizes" << nEta << ":"
834  << hpar->phigroup.size();
835  }
836 
837  // First eta table
838  iEtaMin = hpar->etaMin;
839  iEtaMax = hpar->etaMax;
840  etaTable.clear();
841  ietaMap.clear();
842  etaSimValu.clear();
843  int ieta(0), ietaHB(0), ietaHE(0), ietaHEM(0);
844  etaTable.emplace_back(hpar->etaTable[ieta]);
845  for (int i = 0; i < nEta; ++i) {
846  int ef = ieta + 1;
847  ieta += (hpar->etagroup[i]);
848  if (ieta >= static_cast<int>(hpar->etaTable.size())) {
849  edm::LogError("HCalGeom") << "HcalDDDRecConstants: Going beyond the array boundary " << hpar->etaTable.size()
850  << " at index " << i << " of etaTable from SimConstant";
851  throw cms::Exception("DDException")
852  << "HcalDDDRecConstants: Going beyond the array boundary " << hpar->etaTable.size() << " at index " << i
853  << " of etaTable from SimConstant";
854  } else {
855  etaTable.emplace_back(hpar->etaTable[ieta]);
856  etaSimValu.emplace_back(std::pair<int, int>(ef, ieta));
857  }
858  for (int k = 0; k < (hpar->etagroup[i]); ++k)
859  ietaMap.emplace_back(i + 1);
860  if (ieta <= hpar->etaMax[0])
861  ietaHB = i + 1;
862  if (ieta <= hpar->etaMin[1])
863  ietaHE = i + 1;
864  if (ieta <= hpar->etaMax[1])
865  ietaHEM = i + 1;
866  }
867  iEtaMin[1] = ietaHE;
868  iEtaMax[0] = ietaHB;
869  iEtaMax[1] = ietaHEM;
870 
871  // Then Phi bins
872  nPhiBins.clear();
873  for (unsigned int k = 0; k < 4; ++k)
874  nPhiBins.emplace_back(0);
875  ieta = 0;
876  phibin.clear();
877  phiUnitS.clear();
878  for (int i = 0; i < nEta; ++i) {
879  double dphi = (hpar->phigroup[i]) * (hpar->phibin[ieta]);
880  phibin.emplace_back(dphi);
881  int nphi = static_cast<int>((2._pi + 0.001) / dphi);
882  if (ieta <= iEtaMax[0]) {
883  if (nphi > nPhiBins[0])
884  nPhiBins[3] = nPhiBins[0] = nphi;
885  }
886  if (ieta >= iEtaMin[1]) {
887  if (nphi > nPhiBins[1])
888  nPhiBins[1] = nphi;
889  }
890  ieta += (hpar->etagroup[i]);
891  }
892  for (unsigned int i = 1; i < hpar->etaTable.size(); ++i) {
893  int unit = hcons.unitPhi(hpar->phibin[i - 1]);
894  phiUnitS.emplace_back(unit);
895  }
896  for (double i : hpar->phitable) {
897  int nphi = static_cast<int>((2._pi + 0.001) / i);
898  if (nphi > nPhiBins[2])
899  nPhiBins[2] = nphi;
900  }
901 #ifdef EDM_ML_DEBUG
902  edm::LogVerbatim("HCalGeom") << "HcalDDDRecConstants: Modified eta/deltaphi table for " << nEta << " bins";
903  for (int i = 0; i < nEta; ++i)
904  edm::LogVerbatim("HCalGeom") << "Eta[" << i << "] = " << etaTable[i] << ":" << etaTable[i + 1] << ":"
905  << etaSimValu[i].first << ":" << etaSimValu[i].second << " PhiBin[" << i
906  << "] = " << convertRadToDeg(phibin[i]);
907  for (unsigned int i = 0; i < phiUnitS.size(); ++i)
908  edm::LogVerbatim("HCalGeom") << " PhiUnitS[" << i << "] = " << phiUnitS[i];
909  for (unsigned int i = 0; i < nPhiBins.size(); ++i)
910  edm::LogVerbatim("HCalGeom") << " nPhiBins[" << i << "] = " << nPhiBins[i];
911  for (unsigned int i = 0; i < hpar->etaTableHF.size(); ++i)
912  edm::LogVerbatim("HCalGeom") << " EtaTableHF[" << i << "] = " << hpar->etaTableHF[i];
913  for (unsigned int i = 0; i < hpar->phitable.size(); ++i)
914  edm::LogVerbatim("HCalGeom") << " PhiBinHF[" << i << "] = " << hpar->phitable[i];
915 #endif
916 
917  //Now the depths
919  maxDepth[0] = maxDepth[1] = 0;
920  for (int i = 0; i < nEta; ++i) {
921  unsigned int imx = layerGroupSize(i);
922  int laymax = (imx > 0) ? layerGroup(i, imx - 1) : 0;
923  if (i < iEtaMax[0]) {
924  int laymax0 = (imx > 16) ? layerGroup(i, 16) : laymax;
925  if (i + 1 == iEtaMax[0])
926  laymax0 = hcons.getDepthEta16M(1);
927 #ifdef EDM_ML_DEBUG
928  edm::LogVerbatim("HCalGeom") << "HcalDDDRecConstants:HB " << i << " " << imx << " " << laymax << " " << laymax0;
929 #endif
930  if (maxDepth[0] < laymax0)
931  maxDepth[0] = laymax0;
932  }
933  if (i >= iEtaMin[1] - 1 && i < iEtaMax[1]) {
934 #ifdef EDM_ML_DEBUG
935  edm::LogVerbatim("HCalGeom") << "HcalDDDRecConstants:HE " << i << " " << imx << " " << laymax;
936 #endif
937  if (maxDepth[1] < laymax)
938  maxDepth[1] = laymax;
939  }
940  }
941 #ifdef EDM_ML_DEBUG
942  for (int i = 0; i < 4; ++i)
943  edm::LogVerbatim("HCalGeom") << "HcalDDDRecConstants:Detector Type[" << i << "] iEta " << iEtaMin[i] << ":"
944  << iEtaMax[i] << " MaxDepth " << maxDepth[i];
945 #endif
946 
947  //Now the geometry constants
948  nModule[0] = hpar->modHB[0];
949  nHalves[0] = hpar->modHB[1];
950  for (unsigned int i = 0; i < hpar->rHB.size(); ++i) {
951  gconsHB.emplace_back(std::pair<double, double>(hpar->rHB[i] / CLHEP::cm, hpar->drHB[i] / CLHEP::cm));
952  }
953 #ifdef EDM_ML_DEBUG
954  edm::LogVerbatim("HCalGeom") << "HcalDDDRecConstants:HB with " << nModule[0] << " modules and " << nHalves[0]
955  << " halves and " << gconsHB.size() << " layers";
956  for (unsigned int i = 0; i < gconsHB.size(); ++i)
957  edm::LogVerbatim("HCalGeom") << "rHB[" << i << "] = " << gconsHB[i].first << " +- " << gconsHB[i].second;
958 #endif
959  nModule[1] = hpar->modHE[0];
960  nHalves[1] = hpar->modHE[1];
961  for (unsigned int i = 0; i < hpar->zHE.size(); ++i) {
962  gconsHE.emplace_back(std::pair<double, double>(hpar->zHE[i] / CLHEP::cm, hpar->dzHE[i] / CLHEP::cm));
963  }
964 #ifdef EDM_ML_DEBUG
965  edm::LogVerbatim("HCalGeom") << "HcalDDDRecConstants:HE with " << nModule[1] << " modules and " << nHalves[1]
966  << " halves and " << gconsHE.size() << " layers";
967  for (unsigned int i = 0; i < gconsHE.size(); ++i)
968  edm::LogVerbatim("HCalGeom") << "zHE[" << i << "] = " << gconsHE[i].first << " +- " << gconsHE[i].second;
969 #endif
970 
971  //Special RBX
973  if (depthMaxSp_.first == 0) {
974  depthMaxSp_ = depthMaxDf_ = std::pair<int, int>(2, maxDepth[1]);
975  } else if (depthMaxSp_.first == 1) {
976  depthMaxDf_ = std::pair<int, int>(1, maxDepth[0]);
977  if (depthMaxSp_.second > maxDepth[0])
978  maxDepth[0] = depthMaxSp_.second;
979  } else {
980  depthMaxDf_ = std::pair<int, int>(2, maxDepth[1]);
981  if (depthMaxSp_.second > maxDepth[1])
982  maxDepth[1] = depthMaxSp_.second;
983  }
984 #ifdef EDM_ML_DEBUG
985  edm::LogVerbatim("HCalGeom") << "HcalDDDRecConstants:Detector type and maximum depth for all RBX "
986  << depthMaxDf_.first << ":" << depthMaxDf_.second << " and for special RBX "
987  << depthMaxSp_.first << ":" << depthMaxSp_.second;
988 #endif
989 
990  //Map of special DetId's
991  std::vector<int> phis;
993  detIdSp_.clear();
994  detIdSpR_.clear();
995  if ((subdet == HcalBarrel) || (subdet == HcalEndcap)) {
996  int phi = (phis[0] > 0) ? phis[0] : -phis[0];
997  int zside = (phis[0] > 0) ? 1 : -1;
998  int lymax = (subdet == HcalBarrel) ? maxLayerHB_ + 1 : maxLayer_ + 1;
999  std::pair<int, int> etas = hcons.ldMap()->validEta();
1000  for (int eta = etas.first; eta <= etas.second; ++eta) {
1001  std::map<int, std::pair<int, int>> oldDep;
1002  int depth(0);
1003  int lmin = layerGroup(eta - 1, 0);
1004  for (int lay = 0; lay < lymax; ++lay) {
1005  int depc = layerGroup(eta - 1, lay);
1006  if (depth != depc) {
1007  if (depth != 0)
1008  oldDep[depth] = std::pair<int, int>(lmin, lay - 1);
1009  depth = depc;
1010  lmin = lay;
1011  }
1012  }
1013  if (depth != 0)
1014  oldDep[depth] = std::pair<int, int>(lmin, lymax - 1);
1015 #ifdef EDM_ML_DEBUG
1016  edm::LogVerbatim("HCalGeom") << "HcalDDDRecConstants:Eta|Phi|Zside " << eta << ":" << phi << ":" << zside
1017  << " with " << oldDep.size() << " old Depths";
1018  unsigned int kk(0);
1019  for (std::map<int, std::pair<int, int>>::const_iterator itr = oldDep.begin(); itr != oldDep.end(); ++itr, ++kk)
1020  edm::LogVerbatim("HCalGeom") << "[" << kk << "] " << itr->first << " --> " << itr->second.first << ":"
1021  << itr->second.second;
1022 #endif
1023  std::pair<int, int> depths = hcons.ldMap()->getDepths(eta);
1024  for (int ndepth = depths.first; ndepth <= depths.second; ++ndepth) {
1025  bool flag = ((subdet == HcalBarrel && eta == iEtaMax[0] && ndepth > hcons.getDepthEta16(subdet, phi, zside)) ||
1026  (subdet == HcalEndcap && eta == iEtaMin[1] && ndepth < hcons.getDepthEta16(subdet, phi, zside)));
1027  if (!flag) {
1028  std::vector<int> count(oldDep.size(), 0);
1029  int layFront = hcons.ldMap()->getLayerFront(subdet, eta, phi, zside, ndepth);
1030  int layBack = hcons.ldMap()->getLayerBack(subdet, eta, phi, zside, ndepth);
1031  for (int lay = layFront; lay <= layBack; ++lay) {
1032  unsigned int l(0);
1033  for (std::map<int, std::pair<int, int>>::iterator itr = oldDep.begin(); itr != oldDep.end(); ++itr, ++l) {
1034  if (lay >= (itr->second).first && lay <= (itr->second).second) {
1035  ++count[l];
1036  break;
1037  }
1038  }
1039  }
1040  int odepth(0), maxlay(0);
1041  unsigned int l(0);
1042  for (std::map<int, std::pair<int, int>>::iterator itr = oldDep.begin(); itr != oldDep.end(); ++itr, ++l) {
1043  if (count[l] > maxlay) {
1044  odepth = itr->first;
1045  maxlay = count[l];
1046  }
1047  }
1048 #ifdef EDM_ML_DEBUG
1049  edm::LogVerbatim("HCalGeom") << "HcalDDDRecConstants:New Depth " << ndepth << " old Depth " << odepth
1050  << " max " << maxlay;
1051 #endif
1052  for (int k : phis) {
1053  zside = (k > 0) ? 1 : -1;
1054  phi = (k > 0) ? k : -k;
1055  if (subdet == HcalEndcap && eta == hpar->noff[1] && ndepth > hcons.getDepthEta29M(0, true))
1056  break;
1057  HcalDetId newId(subdet, zside * eta, phi, ndepth);
1058  HcalDetId oldId(subdet, zside * eta, phi, odepth);
1059  detIdSp_[newId] = oldId;
1060  std::vector<HcalDetId> ids;
1061  std::map<HcalDetId, std::vector<HcalDetId>>::iterator itr = detIdSpR_.find(oldId);
1062  if (itr != detIdSpR_.end())
1063  ids = itr->second;
1064  ids.emplace_back(newId);
1065  detIdSpR_[oldId] = ids;
1066  }
1067  }
1068  }
1069  }
1070 #ifdef EDM_ML_DEBUG
1071  edm::LogVerbatim("HCalGeom") << "HcalDDDRecConstants:Map for merging new channels to old channel"
1072  << " IDs with " << detIdSp_.size() << " entries";
1073  int l(0);
1074  for (auto itr : detIdSp_) {
1075  edm::LogVerbatim("HCalGeom") << "[" << l << "] Special " << itr.first << " Standard " << itr.second;
1076  ++l;
1077  }
1078  edm::LogVerbatim("HCalGeom") << "HcalDDDRecConstants:Reverse Map for mapping old to new IDs with "
1079  << detIdSpR_.size() << " entries";
1080  l = 0;
1081  for (auto itr : detIdSpR_) {
1082  edm::LogVerbatim("HCalGeom") << "[" << l << "] Standard " << itr.first << " Special";
1083  for (auto itr1 : itr.second)
1084  edm::LogVerbatim("HCalGeom") << "ID " << (itr1);
1085  ++l;
1086  }
1087 #endif
1088  }
1089 }
Log< level::Info, true > LogVerbatim
const int nphi
std::map< HcalDetId, HcalDetId > detIdSp_
std::vector< double > etaTable
std::vector< int > iEtaMin
std::vector< int > etagroup
std::pair< int, int > depthMaxSp_
std::vector< double > rHB
int getDepthEta29M(const int &i, const bool &planOne) const
constexpr NumType convertRadToDeg(NumType radians)
Definition: angle_units.h:21
int getLayerFront(const int subdet, const int ieta, const int iphi, const int zside, const int depth) const
static const int maxLayer_
std::vector< int > maxDepth
int zside(DetId const &)
Log< level::Error, false > LogError
std::vector< double > etaTableHF
int getDepthEta16M(const int &det) const
std::vector< int > etaMax
std::vector< int > phiUnitS
std::vector< int > modHB
U second(std::pair< T, U > const &p)
std::vector< std::pair< double, double > > gconsHE
const HcalParameters * hpar
std::pair< int, int > getMaxDepthDet(const int &i) const
std::pair< int, int > depthMaxDf_
std::vector< double > zHE
std::vector< double > phibin
std::pair< int, int > getDepths(const int eta) const
std::vector< double > dzHE
std::vector< int > iEtaMax
HcalSubdetector
Definition: HcalAssistant.h:31
std::vector< int > ietaMap
std::vector< int > nPhiBins
const HcalLayerDepthMap * ldMap() const
std::vector< int > modHE
std::vector< std::pair< int, int > > etaSimValu
unsigned int layerGroupSize(int eta) const
Basic3DVector unit() const
int unitPhi(const int &det, const int &etaR) const
std::vector< std::pair< double, double > > gconsHB
int getLayerBack(const int subdet, const int ieta, const int iphi, const int zside, const int depth) const
std::vector< double > etaTable
std::vector< double > phitable
std::vector< double > phibin
std::vector< double > drHB
const HcalDDDSimConstants & hcons
unsigned int layerGroup(int eta, int i) const
std::vector< int > noff
const int ndepth
std::vector< int > maxDepth
std::vector< int > phigroup
std::pair< int, int > validEta() const
static const int maxLayerHB_
int validDet(std::vector< int > &phis) const
int getDepthEta16(const int &det, const int &phi, const int &zside) const
std::map< HcalDetId, std::vector< HcalDetId > > detIdSpR_
std::vector< int > etaMin

◆ isBH()

bool HcalDDDRecConstants::isBH ( ) const
inline

◆ isHE()

bool HcalDDDRecConstants::isHE ( ) const
inline

Definition at line 111 of file HcalDDDRecConstants.h.

References hcons, and HcalDDDSimConstants::isHE().

111 { return hcons.isHE(); }
const HcalDDDSimConstants & hcons

◆ isPlan1()

bool HcalDDDRecConstants::isPlan1 ( const HcalDetId id) const
inline

Definition at line 112 of file HcalDDDRecConstants.h.

References detIdSp_.

Referenced by CaloTPGTranscoderULUT::setup(), and HcaluLUTTPGCoder::update().

112 { return detIdSp_.find(id) != detIdSp_.end(); };
std::map< HcalDetId, HcalDetId > detIdSp_

◆ isPlan1MergedId()

bool HcalDDDRecConstants::isPlan1MergedId ( const HcalDetId id) const
inline

Definition at line 127 of file HcalDDDRecConstants.h.

References detIdSpR_.

Referenced by HcalTopology::validHcal().

127 { return detIdSpR_.find(id) != detIdSpR_.end(); };
std::map< HcalDetId, std::vector< HcalDetId > > detIdSpR_

◆ isPlan1ToBeMergedId()

bool HcalDDDRecConstants::isPlan1ToBeMergedId ( const HcalDetId id) const
inline

Definition at line 126 of file HcalDDDRecConstants.h.

References detIdSp_.

Referenced by HcalTopology::validHcal().

126 { return detIdSp_.find(id) != detIdSp_.end(); };
std::map< HcalDetId, HcalDetId > detIdSp_

◆ layerGroup()

unsigned int HcalDDDRecConstants::layerGroup ( int  eta,
int  i 
) const
private

Definition at line 1104 of file HcalDDDRecConstants.cc.

References PVValHelper::eta, hpar, mps_fire::i, ALPAKA_ACCELERATOR_NAMESPACE::vertexFinder::it, dqmdumpme::k, and HcalParameters::layerGroupEtaRec.

Referenced by getHCID(), getLayerBack(), getLayerDepth(), getLayerFront(), getMaxDepth(), getMinDepth(), and initialize().

1104  {
1105  unsigned int k = 0;
1106  for (auto const& it : hpar->layerGroupEtaRec) {
1107  if (it.layer == (unsigned int)(eta + 1)) {
1108  return it.layerGroup.at(i);
1109  }
1110  if (it.layer > (unsigned int)(eta + 1))
1111  break;
1112  k = it.layerGroup.at(i);
1113  }
1114  return k;
1115 }
const HcalParameters * hpar
std::vector< LayerItem > layerGroupEtaRec

◆ layerGroupSize()

unsigned int HcalDDDRecConstants::layerGroupSize ( int  eta) const
private

Definition at line 1091 of file HcalDDDRecConstants.cc.

References PVValHelper::eta, hpar, ALPAKA_ACCELERATOR_NAMESPACE::vertexFinder::it, dqmdumpme::k, and HcalParameters::layerGroupEtaRec.

Referenced by getLayerBack(), getLayerDepth(), getLayerFront(), getMaxDepth(), getMinDepth(), getRZ(), and initialize().

1091  {
1092  unsigned int k = 0;
1093  for (auto const& it : hpar->layerGroupEtaRec) {
1094  if (it.layer == (unsigned int)(eta + 1)) {
1095  return it.layerGroup.size();
1096  }
1097  if (it.layer > (unsigned int)(eta + 1))
1098  break;
1099  k = it.layerGroup.size();
1100  }
1101  return k;
1102 }
const HcalParameters * hpar
std::vector< LayerItem > layerGroupEtaRec

◆ maxHFDepth()

int HcalDDDRecConstants::maxHFDepth ( int  ieta,
int  iphi 
) const
inline

◆ mergedDepthDetId()

HcalDetId HcalDDDRecConstants::mergedDepthDetId ( const HcalDetId id) const

◆ mergedDepthList29() [1/2]

bool HcalDDDRecConstants::mergedDepthList29 ( int  ieta,
int  iphi,
int  depth 
) const

Definition at line 605 of file HcalDDDRecConstants.cc.

References funct::abs(), hcalRecHitTable_cff::depth, PVValHelper::eta, TrackingDataMCValidation_Standalone_cff::etamin, HcalDDDSimConstants::getDepthEta29(), getMaxDepth(), hcons, hcalRecHitTable_cff::ieta, iEtaMax, hcalRecHitTable_cff::iphi, and ecaldqm::zside().

Referenced by HcalTopology::mergedDepth29(), and HcalTopology::mergedDepthList29().

605  {
606  int eta = std::abs(ieta);
607  int zside = (ieta > 0) ? 1 : -1;
608  int etamin = iEtaMax[1] - hcons.getDepthEta29(iphi, zside, 1);
609  if ((eta >= etamin) && (eta <= iEtaMax[1])) {
610  int depthMax = getMaxDepth(1, etamin, iphi, zside);
611  int depthMin = hcons.getDepthEta29(iphi, zside, 0) + 1;
612  if (depth >= depthMin && depth <= depthMax)
613  return true;
614  }
615  return false;
616 }
int getDepthEta29(const int &phi, const int &zside, const int &i) const
int zside(DetId const &)
std::vector< int > iEtaMax
Abs< T >::type abs(const T &t)
Definition: Abs.h:22
int getMaxDepth(const int &type) const
const HcalDDDSimConstants & hcons

◆ mergedDepthList29() [2/2]

std::vector< int > HcalDDDRecConstants::mergedDepthList29 ( int  ieta,
int  iphi 
) const

Definition at line 618 of file HcalDDDRecConstants.cc.

References funct::abs(), hcalRecHitTable_cff::depth, HLT_2024v14_cff::depths, PVValHelper::eta, TrackingDataMCValidation_Standalone_cff::etamin, HcalDDDSimConstants::getDepthEta29(), getMaxDepth(), hcons, hcalRecHitTable_cff::ieta, iEtaMax, hcalRecHitTable_cff::iphi, and ecaldqm::zside().

618  {
619  std::vector<int> depths;
620  int eta = std::abs(ieta);
621  int zside = (ieta > 0) ? 1 : -1;
622  int etamin = iEtaMax[1] - hcons.getDepthEta29(iphi, zside, 1);
623  if ((eta >= etamin) && (eta <= iEtaMax[1])) {
624  int depthMax = getMaxDepth(1, etamin, iphi, zside);
625  int depthMin = hcons.getDepthEta29(iphi, zside, 0) + 1;
626  depths.reserve(depthMax - depthMin + 1);
627  for (int depth = depthMin; depth <= depthMax; ++depth)
628  depths.emplace_back(depth);
629  }
630  return depths;
631 }
int getDepthEta29(const int &phi, const int &zside, const int &i) const
int zside(DetId const &)
std::vector< int > iEtaMax
Abs< T >::type abs(const T &t)
Definition: Abs.h:22
int getMaxDepth(const int &type) const
const HcalDDDSimConstants & hcons

◆ nCells() [1/2]

unsigned int HcalDDDRecConstants::nCells ( HcalSubdetector  subdet) const

Definition at line 650 of file HcalDDDRecConstants.cc.

References defaults_cfi::etabins, getEtaBins(), HcalBarrel, HcalEndcap, HcalForward, HcalOuter, hcons, kHOSizePreLS1, and HcalDDDSimConstants::numberOfCells().

650  {
651  if (subdet == HcalBarrel || subdet == HcalEndcap) {
652  int isub = (subdet == HcalBarrel) ? 0 : 1;
653  std::vector<HcalDDDRecConstants::HcalEtaBin> etabins = getEtaBins(isub);
654  unsigned int ncell(0);
655  for (auto& etabin : etabins) {
656  ncell += ((etabin.phis.size()) * (etabin.layer.size()));
657  }
658  return ncell;
659  } else if (subdet == HcalOuter) {
660  return kHOSizePreLS1;
661  } else if (subdet == HcalForward) {
662  return (unsigned int)(hcons.numberOfCells(subdet));
663  } else {
664  return 0;
665  }
666 }
std::vector< HcalEtaBin > getEtaBins(const int &itype) const
unsigned int numberOfCells(const HcalSubdetector &) const
const HcalDDDSimConstants & hcons

◆ nCells() [2/2]

unsigned int HcalDDDRecConstants::nCells ( ) const

◆ numberOfCells()

unsigned int HcalDDDRecConstants::numberOfCells ( HcalSubdetector  subdet) const

Definition at line 633 of file HcalDDDRecConstants.cc.

References HcalBarrel, HcalCellTypes(), HcalEndcap, hcons, createfilelist::int, EgammaValidation_cff::num, and HcalDDDSimConstants::numberOfCells().

Referenced by HcalDDDGeometryLoader::load().

633  {
634  if (subdet == HcalBarrel || subdet == HcalEndcap) {
635  unsigned int num = 0;
636  std::vector<HcalCellType> cellTypes = HcalCellTypes(subdet);
637  for (auto& cellType : cellTypes) {
638  num += (unsigned int)(cellType.nPhiBins());
639  }
640 #ifdef EDM_ML_DEBUG
641  edm::LogInfo("HCalGeom") << "HcalDDDRecConstants:numberOfCells " << cellTypes.size() << " " << num
642  << " for subdetector " << subdet;
643 #endif
644  return num;
645  } else {
646  return hcons.numberOfCells(subdet);
647  }
648 }
unsigned int numberOfCells(const HcalSubdetector &) const
std::vector< HcalCellType > HcalCellTypes(HcalSubdetector) const
Log< level::Info, false > LogInfo
const HcalDDDSimConstants & hcons

◆ specialRBXHBHE() [1/2]

void HcalDDDRecConstants::specialRBXHBHE ( const std::vector< HcalDetId > &  idsOld,
std::vector< HcalDetId > &  idsNew 
) const

Definition at line 709 of file HcalDDDRecConstants.cc.

References detIdSp_, and dqmdumpme::k.

709  {
710  for (auto k : idsOld) {
711  std::map<HcalDetId, HcalDetId>::const_iterator itr = detIdSp_.find(k);
712  if (itr == detIdSp_.end())
713  idsNew.emplace_back(k);
714  else
715  idsNew.emplace_back(itr->second);
716  }
717 }
std::map< HcalDetId, HcalDetId > detIdSp_

◆ specialRBXHBHE() [2/2]

bool HcalDDDRecConstants::specialRBXHBHE ( bool  flag,
std::vector< HcalDetId > &  ids 
) const

Definition at line 719 of file HcalDDDRecConstants.cc.

References detIdSp_, and detIdSpR_.

719  {
720  if (tobemerged) {
721  std::map<HcalDetId, HcalDetId>::const_iterator itr;
722  for (itr = detIdSp_.begin(); itr != detIdSp_.end(); ++itr)
723  ids.emplace_back(itr->first);
724  } else {
725  std::map<HcalDetId, std::vector<HcalDetId>>::const_iterator itr;
726  for (itr = detIdSpR_.begin(); itr != detIdSpR_.end(); ++itr)
727  ids.emplace_back(itr->first);
728  }
729  return (!ids.empty());
730 }
std::map< HcalDetId, HcalDetId > detIdSp_
std::map< HcalDetId, std::vector< HcalDetId > > detIdSpR_

◆ unmergeDepthDetId()

void HcalDDDRecConstants::unmergeDepthDetId ( const HcalDetId id,
std::vector< HcalDetId > &  ids 
) const

Definition at line 696 of file HcalDDDRecConstants.cc.

References detIdSpR_, hcalRecHitTable_cff::ieta, hcalRecHitTable_cff::iphi, and dqmdumpme::k.

Referenced by HcalHBHEMuonAnalyzer::activeLength(), HcalHBHEMuonHighEtaAnalyzer::activeLength(), AlCaHcalHBHEMuonProducer::activeLength(), and HcalTopology::unmergeDepthDetId().

696  {
697  ids.clear();
698  std::map<HcalDetId, std::vector<HcalDetId>>::const_iterator itr = detIdSpR_.find(id);
699  if (itr == detIdSpR_.end()) {
700  ids.emplace_back(id);
701  } else {
702  for (auto k : itr->second) {
703  HcalDetId hid(id.subdet(), id.ieta(), id.iphi(), k.depth());
704  ids.emplace_back(hid);
705  }
706  }
707 }
std::map< HcalDetId, std::vector< HcalDetId > > detIdSpR_

◆ withSpecialRBXHBHE()

bool HcalDDDRecConstants::withSpecialRBXHBHE ( ) const
inline

Definition at line 125 of file HcalDDDRecConstants.h.

References HcalLayerDepthMap::getSubdet(), hcons, and HcalDDDSimConstants::ldMap().

Referenced by HcalTopology::withSpecialRBXHBHE().

125 { return (hcons.ldMap()->getSubdet() != 0); }
const HcalLayerDepthMap * ldMap() const
const HcalDDDSimConstants & hcons

Member Data Documentation

◆ depthMaxDf_

std::pair<int, int> HcalDDDRecConstants::depthMaxDf_
private

Definition at line 157 of file HcalDDDRecConstants.h.

Referenced by initialize().

◆ depthMaxSp_

std::pair<int, int> HcalDDDRecConstants::depthMaxSp_
private

Definition at line 157 of file HcalDDDRecConstants.h.

Referenced by initialize().

◆ detIdSp_

std::map<HcalDetId, HcalDetId> HcalDDDRecConstants::detIdSp_
private

◆ detIdSpR_

std::map<HcalDetId, std::vector<HcalDetId> > HcalDDDRecConstants::detIdSpR_
private

◆ etaSimValu

std::vector<std::pair<int, int> > HcalDDDRecConstants::etaSimValu
private

Definition at line 146 of file HcalDDDRecConstants.h.

Referenced by getPhis(), HcalCellTypes(), and initialize().

◆ etaTable

std::vector<double> HcalDDDRecConstants::etaTable
private

Definition at line 147 of file HcalDDDRecConstants.h.

Referenced by getEtaLimit(), getEtaPhi(), getEtaTable(), getOneEtaBin(), and initialize().

◆ gconsHB

std::vector<std::pair<double, double> > HcalDDDRecConstants::gconsHB
private

Definition at line 154 of file HcalDDDRecConstants.h.

Referenced by getConstHBHE(), getRZ(), getThickActive(), and initialize().

◆ gconsHE

std::vector<std::pair<double, double> > HcalDDDRecConstants::gconsHE
private

Definition at line 155 of file HcalDDDRecConstants.h.

Referenced by getConstHBHE(), getRZ(), getThickActive(), and initialize().

◆ hcons

const HcalDDDSimConstants& HcalDDDRecConstants::hcons
private

◆ hpar

const HcalParameters* HcalDDDRecConstants::hpar
private

◆ ietaMap

std::vector<int> HcalDDDRecConstants::ietaMap
private

Definition at line 148 of file HcalDDDRecConstants.h.

Referenced by getHCID(), and initialize().

◆ iEtaMax

std::vector<int> HcalDDDRecConstants::iEtaMax
private

◆ iEtaMin

std::vector<int> HcalDDDRecConstants::iEtaMin
private

◆ maxDepth

std::vector<int> HcalDDDRecConstants::maxDepth
private

Definition at line 150 of file HcalDDDRecConstants.h.

Referenced by getHFCellParameters(), getMaxDepth(), getMinDepth(), and initialize().

◆ maxLayer_

const int HcalDDDRecConstants::maxLayer_ = 18
staticprivate

Definition at line 142 of file HcalDDDRecConstants.h.

Referenced by getMaxDepth(), getOneEtaBin(), and initialize().

◆ maxLayerHB_

const int HcalDDDRecConstants::maxLayerHB_ = 16
staticprivate

Definition at line 143 of file HcalDDDRecConstants.h.

Referenced by getHCID(), getMaxDepth(), getOneEtaBin(), and initialize().

◆ nHalves

int HcalDDDRecConstants::nHalves[2]
private

Definition at line 156 of file HcalDDDRecConstants.h.

Referenced by initialize().

◆ nModule

int HcalDDDRecConstants::nModule[2]
private

Definition at line 156 of file HcalDDDRecConstants.h.

Referenced by initialize().

◆ nPhiBins

std::vector<int> HcalDDDRecConstants::nPhiBins
private

Definition at line 151 of file HcalDDDRecConstants.h.

Referenced by getNPhi(), and initialize().

◆ phibin

std::vector<double> HcalDDDRecConstants::phibin
private

◆ phiUnitS

std::vector<int> HcalDDDRecConstants::phiUnitS
private

Definition at line 153 of file HcalDDDRecConstants.h.

Referenced by getHCID(), and initialize().