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

◆ load()

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

Definition at line 14 of file CaloTowerHardcodeGeometryLoader.cc.

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())
41  geom->allocateCorners(geom->numberOfCellsForCorners());
42  if (nullptr == geom->parMgr())
43  geom->allocatePar(geom->numberOfParametersPerShape() * geom->numberOfShapes(), geom->numberOfParametersPerShape());
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 }

References filterCSVwithJSON::copy, 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(), CaloTowerTopology::sizeForDenseIndexing(), theHBHEEtaBounds, and theHFEtaBounds.

Referenced by CaloTowerHardcodeGeometryEP::produce().

◆ makeCell()

void CaloTowerHardcodeGeometryLoader::makeCell ( uint32_t  din,
CaloSubdetectorGeometry geom 
) const
private

Definition at line 53 of file CaloTowerHardcodeGeometryLoader.cc.

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 }

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

Referenced by load().

Member Data Documentation

◆ m_hcaltopo

const HcalTopology* CaloTowerHardcodeGeometryLoader::m_hcaltopo
private

Definition at line 24 of file CaloTowerHardcodeGeometryLoader.h.

Referenced by load(), and makeCell().

◆ m_hcons

const HcalDDDRecConstants* CaloTowerHardcodeGeometryLoader::m_hcons
private

Definition at line 25 of file CaloTowerHardcodeGeometryLoader.h.

Referenced by load().

◆ m_limits

const CaloTowerTopology* CaloTowerHardcodeGeometryLoader::m_limits
private

Definition at line 23 of file CaloTowerHardcodeGeometryLoader.h.

Referenced by load(), and makeCell().

◆ theHBHEEtaBounds

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

Definition at line 26 of file CaloTowerHardcodeGeometryLoader.h.

Referenced by load(), and makeCell().

◆ theHFEtaBounds

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

Definition at line 26 of file CaloTowerHardcodeGeometryLoader.h.

Referenced by load(), and makeCell().

DDAxes::y
filterCSVwithJSON.copy
copy
Definition: filterCSVwithJSON.py:36
gather_cfg.cout
cout
Definition: gather_cfg.py:144
Validation_hcalonly_cfi.sign
sign
Definition: Validation_hcalonly_cfi.py:32
DDAxes::x
edm::LogInfo
Log< level::Info, false > LogInfo
Definition: MessageLogger.h:125
CaloTowerTopology::firstHERing
int firstHERing() const
Definition: CaloTowerTopology.h:38
HcalTopology::firstHERing
int firstHERing() const
Definition: HcalTopology.h:93
funct::sin
Sin< T >::type sin(const T &t)
Definition: Sin.h:22
LEDCalibrationChannels.iphi
iphi
Definition: LEDCalibrationChannels.py:64
HcalTopology::firstHFRing
int firstHFRing() const
Definition: HcalTopology.h:96
HcalDDDRecConstants::getEtaTableHF
const std::vector< double > & getEtaTableHF() const
Definition: HcalDDDRecConstants.h:76
funct::cos
Cos< T >::type cos(const T &t)
Definition: Cos.h:22
Calorimetry_cff.thickness
thickness
Definition: Calorimetry_cff.py:114
PVValHelper::eta
Definition: PVValidationHelpers.h:69
HLT_FULL_cff.eta2
eta2
Definition: HLT_FULL_cff.py:9542
DDAxes::z
relativeConstraints.geom
geom
Definition: relativeConstraints.py:72
Point3DBase< float, GlobalTag >
HLT_FULL_cff.eta1
eta1
Definition: HLT_FULL_cff.py:9541
LEDCalibrationChannels.ieta
ieta
Definition: LEDCalibrationChannels.py:63
CaloTowerTopology::detIdFromDenseIndex
CaloTowerDetId detIdFromDenseIndex(uint32_t din) const
Definition: CaloTowerTopology.cc:247
cropTnPTrees.din
din
Definition: cropTnPTrees.py:30
CaloTowerHardcodeGeometryLoader::m_hcons
const HcalDDDRecConstants * m_hcons
Definition: CaloTowerHardcodeGeometryLoader.h:25
CaloTowerHardcodeGeometryLoader::m_hcaltopo
const HcalTopology * m_hcaltopo
Definition: CaloTowerHardcodeGeometryLoader.h:24
CaloTowerTopology::lastHERing
int lastHERing() const
Definition: CaloTowerTopology.h:39
CaloTowerHardcodeGeometryLoader::theHFEtaBounds
std::vector< double > theHFEtaBounds
Definition: CaloTowerHardcodeGeometryLoader.h:26
CaloTowerHardcodeGeometryLoader::theHBHEEtaBounds
std::vector< double > theHBHEEtaBounds
Definition: CaloTowerHardcodeGeometryLoader.h:26
M_PI
#define M_PI
Definition: BXVectorInputProducer.cc:49
CaloTowerHardcodeGeometryLoader::m_limits
const CaloTowerTopology * m_limits
Definition: CaloTowerHardcodeGeometryLoader.h:23
HcalTopology::firstHBRing
int firstHBRing() const
Definition: HcalTopology.h:91
HcalTopology::lastHERing
int lastHERing() const
Definition: HcalTopology.h:94
CaloTowerGeometry
Definition: CaloTowerGeometry.h:16
alignCSCRings.r
r
Definition: alignCSCRings.py:93
TH2PolyOfflineMaps.limits
limits
Definition: TH2PolyOfflineMaps.py:45
DDAxes::phi
CaloTowerTopology::lastHBRing
int lastHBRing() const
Definition: CaloTowerTopology.h:37
CaloTowerTopology::convertCTtoHcal
int convertCTtoHcal(int ct_ieta) const
Definition: CaloTowerTopology.cc:67
CaloCellGeometry::getParmPtr
static const CCGFloat * getParmPtr(const std::vector< CCGFloat > &vd, ParMgr *mgr, ParVecVec &pvv)
Definition: CaloCellGeometry.cc:117
CaloTowerTopology::sizeForDenseIndexing
uint32_t sizeForDenseIndexing() const
Definition: CaloTowerTopology.h:56
HcalTopology::lastHFRing
int lastHFRing() const
Definition: HcalTopology.h:97
HcalTopology::nPhiBins
int nPhiBins(int etaRing) const
how many phi segments in this ring
Definition: HcalTopology.cc:955
funct::abs
Abs< T >::type abs(const T &t)
Definition: Abs.h:22
CaloTowerHardcodeGeometryLoader::makeCell
void makeCell(uint32_t din, CaloSubdetectorGeometry *geom) const
Definition: CaloTowerHardcodeGeometryLoader.cc:53
point
*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
HcalTopology::lastHBRing
int lastHBRing() const
Definition: HcalTopology.h:92
HcalDDDRecConstants::getEtaTable
const std::vector< double > & getEtaTable() const
Definition: HcalDDDRecConstants.h:75
CaloTowerDetId
Definition: CaloTowerDetId.h:12