CMS 3D CMS Logo

List of all members | Public Member Functions | Private Member Functions | Private Attributes
CaloTowerHardcodeGeometryLoader Class Reference

#include <CaloTowerHardcodeGeometryLoader.h>

Public Member Functions

std::unique_ptr< CaloSubdetectorGeometryload (const CaloTowerTopology *limits, const HcalTopology *hcaltopo, const HcalDDDRecConstants *hcons)
 

Private Member Functions

void makeCell (uint32_t din, CaloSubdetectorGeometry *geom) const
 

Private Attributes

const HcalTopologym_hcaltopo
 
const HcalDDDRecConstantsm_hcons
 
const CaloTowerTopologym_limits
 
std::vector< double > theHBHEEtaBounds
 
std::vector< double > theHFEtaBounds
 

Detailed Description

Author
J. Mans - Minnesota

Definition at line 15 of file CaloTowerHardcodeGeometryLoader.h.

Member Function Documentation

std::unique_ptr< CaloSubdetectorGeometry > CaloTowerHardcodeGeometryLoader::load ( const CaloTowerTopology limits,
const HcalTopology hcaltopo,
const HcalDDDRecConstants hcons 
)

Definition at line 14 of file CaloTowerHardcodeGeometryLoader.cc.

References CaloSubdetectorGeometry::allocateCorners(), CaloSubdetectorGeometry::allocatePar(), filterCSVwithJSON::copy, CaloSubdetectorGeometry::cornersMgr(), gather_cfg::cout, cropTnPTrees::din, HcalTopology::firstHBRing(), HcalTopology::firstHERing(), HcalTopology::firstHFRing(), relativeConstraints::geom, HcalDDDRecConstants::getEtaTable(), HcalDDDRecConstants::getEtaTableHF(), CaloTowerTopology::lastHBRing(), HcalTopology::lastHBRing(), CaloTowerTopology::lastHERing(), HcalTopology::lastHERing(), HcalTopology::lastHFRing(), TH2PolyOfflineMaps::limits, m_hcaltopo, m_hcons, m_limits, makeCell(), CaloTowerGeometry::numberOfCellsForCorners(), CaloTowerGeometry::numberOfParametersPerShape(), CaloTowerGeometry::numberOfShapes(), CaloSubdetectorGeometry::parMgr(), CaloTowerTopology::sizeForDenseIndexing(), theHBHEEtaBounds, and theHFEtaBounds.

Referenced by CaloTowerHardcodeGeometryEP::produce().

16  {
17  m_limits = limits;
18  m_hcaltopo = hcaltopo;
19  m_hcons = hcons;
20 
21  //get eta limits from hcal rec constants
24 
25 #ifdef DebugLog
26  std::cout << "CaloTowerHardcodeGeometryLoader: theHBHEEtaBounds = ";
27  std::copy(theHBHEEtaBounds.begin(), theHBHEEtaBounds.end(), std::ostream_iterator<double>(std::cout, ","));
28  std::cout << std::endl;
29 
30  std::cout << "CaloTowerHardcodeGeometryLoader: lastHBRing = " << m_limits->lastHBRing()
31  << ", lastHERing = " << m_limits->lastHERing() << std::endl;
32  std::cout << "CaloTowerHardcodeGeometryLoader: HcalTopology: firstHBRing = " << hcaltopo->firstHBRing()
33  << ", lastHBRing = " << hcaltopo->lastHBRing() << ", firstHERing = " << hcaltopo->firstHERing()
34  << ", lastHERing = " << hcaltopo->lastHERing() << ", firstHFRing = " << hcaltopo->firstHFRing()
35  << ", lastHFRing = " << hcaltopo->lastHFRing() << std::endl;
36 #endif
37 
39 
40  if (nullptr == geom->cornersMgr())
42  if (nullptr == geom->parMgr())
44 
45  // simple loop
46  for (uint32_t din = 0; din < m_limits->sizeForDenseIndexing(); ++din) {
47  makeCell(din, geom);
48  }
49  edm::LogInfo("Geometry") << "CaloTowersHardcodeGeometry made " << m_limits->sizeForDenseIndexing() << " towers.";
50  return std::unique_ptr<CaloSubdetectorGeometry>(geom);
51 }
int firstHFRing() const
Definition: HcalTopology.h:96
virtual unsigned int numberOfCellsForCorners() const
const std::vector< double > & getEtaTableHF() const
int firstHBRing() const
Definition: HcalTopology.h:91
unsigned int numberOfShapes() const override
int lastHBRing() const
Definition: HcalTopology.h:92
void allocatePar(ParVec::size_type n, unsigned int m)
unsigned int numberOfParametersPerShape() const override
int lastHFRing() const
Definition: HcalTopology.h:97
CaloCellGeometry::CornersMgr * cornersMgr()
int firstHERing() const
Definition: HcalTopology.h:93
const std::vector< double > & getEtaTable() const
int lastHERing() const
void makeCell(uint32_t din, CaloSubdetectorGeometry *geom) const
void allocateCorners(CaloCellGeometry::CornersVec::size_type n)
int lastHBRing() const
uint32_t sizeForDenseIndexing() const
int lastHERing() const
Definition: HcalTopology.h:94
void CaloTowerHardcodeGeometryLoader::makeCell ( uint32_t  din,
CaloSubdetectorGeometry geom 
) const
private

Definition at line 53 of file CaloTowerHardcodeGeometryLoader.cc.

References funct::abs(), CaloTowerTopology::convertCTtoHcal(), funct::cos(), gather_cfg::cout, CaloTowerTopology::detIdFromDenseIndex(), PVValHelper::eta, HLT_2018_cff::eta1, HLT_2018_cff::eta2, CaloTowerTopology::firstHERing(), HcalTopology::firstHFRing(), CaloCellGeometry::getParmPtr(), LEDCalibrationChannels::ieta, LEDCalibrationChannels::iphi, CaloTowerTopology::lastHERing(), m_hcaltopo, m_limits, M_PI, CaloSubdetectorGeometry::newCell(), HcalTopology::nPhiBins(), CaloSubdetectorGeometry::parMgr(), CaloSubdetectorGeometry::parVecVec(), phi, point, alignCSCRings::r, Validation_hcalonly_cfi::sign, funct::sin(), theHBHEEtaBounds, theHFEtaBounds, Calorimetry_cff::thickness, x, y, and z.

Referenced by load().

53  {
54  const double EBradius = 143.0; // cm
55  const double HOradius = 406.0 + 1.0;
56  const double EEz = 320.0; // rough (cm)
57  const double HEz = 568.0; // back (cm)
58  const double HFz = 1100.0;
59  const double HFthick = 165;
60  // Tower 17 is the last EB tower
61 
62  //use CT topology to get the DetId for this dense index
64  int ieta = id.ieta();
65  int iphi = id.iphi();
66 
67  //use CT topology to get proper ieta for hcal
68  int etaRing = m_limits->convertCTtoHcal(abs(ieta));
69  int sign = (ieta > 0) ? (1) : (-1);
70  double eta1, eta2;
71 
72 #ifdef DebugLog
73  std::cout << "CaloTowerHardcodeGeometryLoader: ieta = " << ieta << ", iphi = " << iphi << ", etaRing = " << etaRing
74  << std::endl;
75 #endif
76 
77  if (abs(ieta) > m_limits->lastHERing()) {
78  eta1 = theHFEtaBounds.at(etaRing - m_hcaltopo->firstHFRing());
79  eta2 = theHFEtaBounds.at(etaRing - m_hcaltopo->firstHFRing() + 1);
80  } else {
81  eta1 = theHBHEEtaBounds.at(etaRing - 1);
82  eta2 = theHBHEEtaBounds.at(etaRing);
83  }
84  double eta = 0.5 * (eta1 + eta2);
85  double deta = (eta2 - eta1);
86 
87  // in radians
88  double dphi_nominal = 2.0 * M_PI / m_hcaltopo->nPhiBins(1); // always the same
89  double dphi_half = M_PI / m_hcaltopo->nPhiBins(etaRing); // half-width
90 
91  double phi_low = dphi_nominal * (iphi - 1); // low-edge boundaries are constant...
92  double phi = phi_low + dphi_half;
93 
94 #ifdef DebugLog
95  std::cout << "CaloTowerHardcodeGeometryLoader: eta1 = " << eta1 << ", eta2 = " << eta2 << ", eta = " << eta
96  << ", phi = " << phi << std::endl;
97 #endif
98 
99  double x, y, z, thickness;
100  bool alongZ = true;
101  if (abs(ieta) > m_limits->lastHERing()) { // forward
102  z = HFz;
103  double r = z / sinh(eta);
104  x = r * cos(phi);
105  y = r * sin(phi);
106  thickness = HFthick / tanh(eta);
107  } else if (abs(ieta) > m_limits->firstHERing() + 1) { // EE-containing
108  z = EEz;
109  double r = z / sinh(eta);
110  x = r * cos(phi);
111  y = r * sin(phi);
112  thickness = (HEz - EEz) / tanh(eta);
113  } else { // EB-containing
114  x = EBradius * cos(phi);
115  y = EBradius * sin(phi);
116  alongZ = false;
117  z = EBradius * sinh(eta);
118  thickness = (HOradius - EBradius) * cosh(eta);
119  }
120 
121  z *= sign;
122  GlobalPoint point(x, y, z);
123 
124  const double mysign(!alongZ ? 1 : -1);
125  std::vector<CCGFloat> hh;
126  hh.reserve(5);
127  hh.emplace_back(deta / 2);
128  hh.emplace_back(dphi_half);
129  hh.emplace_back(mysign * thickness / 2.);
130 
131  hh.emplace_back(fabs(eta));
132  hh.emplace_back(fabs(z));
133 
134 #ifdef DebugLog
135  std::cout << "CaloTowerHardcodeGeometryLoader: x = " << x << ", y = " << y << ", z = " << z
136  << ", thickness = " << thickness << std::endl;
137 #endif
138 
139  geom->newCell(point, point, point, CaloCellGeometry::getParmPtr(hh, geom->parMgr(), geom->parVecVec()), id);
140 }
int firstHFRing() const
Definition: HcalTopology.h:96
virtual void newCell(const GlobalPoint &f1, const GlobalPoint &f2, const GlobalPoint &f3, const CCGFloat *parm, const DetId &detId)=0
Sin< T >::type sin(const T &t)
Definition: Sin.h:22
int nPhiBins(int etaRing) const
how many phi segments in this ring
int firstHERing() const
CaloTowerDetId detIdFromDenseIndex(uint32_t din) const
Cos< T >::type cos(const T &t)
Definition: Cos.h:22
Abs< T >::type abs(const T &t)
Definition: Abs.h:22
static const CCGFloat * getParmPtr(const std::vector< CCGFloat > &vd, ParMgr *mgr, ParVecVec &pvv)
#define M_PI
int lastHERing() const
int convertCTtoHcal(int ct_ieta) const
*vegas h *****************************************************used in the default bin number in original ***version of VEGAS is ***a higher bin number might help to derive a more precise ***grade subtle point
Definition: invegas.h:5

Member Data Documentation

const HcalTopology* CaloTowerHardcodeGeometryLoader::m_hcaltopo
private

Definition at line 24 of file CaloTowerHardcodeGeometryLoader.h.

Referenced by load(), and makeCell().

const HcalDDDRecConstants* CaloTowerHardcodeGeometryLoader::m_hcons
private

Definition at line 25 of file CaloTowerHardcodeGeometryLoader.h.

Referenced by load().

const CaloTowerTopology* CaloTowerHardcodeGeometryLoader::m_limits
private

Definition at line 23 of file CaloTowerHardcodeGeometryLoader.h.

Referenced by load(), and makeCell().

std::vector<double> CaloTowerHardcodeGeometryLoader::theHBHEEtaBounds
private

Definition at line 26 of file CaloTowerHardcodeGeometryLoader.h.

Referenced by load(), and makeCell().

std::vector<double> CaloTowerHardcodeGeometryLoader::theHFEtaBounds
private

Definition at line 26 of file CaloTowerHardcodeGeometryLoader.h.

Referenced by load(), and makeCell().