CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
List of all members | Public Member Functions | Private Member Functions | Private Attributes
CaloTowerHardcodeGeometryLoader Class Reference

#include <CaloTowerHardcodeGeometryLoader.h>

Public Member Functions

std::unique_ptr
< CaloSubdetectorGeometry
load (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 15 of file CaloTowerHardcodeGeometryLoader.cc.

References CaloSubdetectorGeometry::allocateCorners(), CaloSubdetectorGeometry::allocatePar(), filterCSVwithJSON::copy, CaloSubdetectorGeometry::cornersMgr(), 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().

17  {
18  m_limits = limits;
19  m_hcaltopo = hcaltopo;
20  m_hcons = hcons;
21 
22  //get eta limits from hcal rec constants
25 
26 #ifdef EDM_ML_DEUG
27  std::ostringstream st1;
28  st1 << "CaloTowerHardcodeGeometryLoader: theHBHEEtaBounds = ";
29  std::copy(theHBHEEtaBounds.begin(), theHBHEEtaBounds.end(), std::ostream_iterator<double>(st1, ","));
30  edm::LogVerbatim("HCalGeom") << st1.str();
31 
32  edm::LogVerbatim("HCalGeom") << "CaloTowerHardcodeGeometryLoader: lastHBRing = " << m_limits->lastHBRing()
33  << ", lastHERing = " << m_limits->lastHERing();
34  edm::LogVerbatim("HCalGeom") << "CaloTowerHardcodeGeometryLoader: HcalTopology: firstHBRing = "
35  << hcaltopo->firstHBRing() << ", lastHBRing = " << hcaltopo->lastHBRing()
36  << ", firstHERing = " << hcaltopo->firstHERing()
37  << ", lastHERing = " << hcaltopo->lastHERing()
38  << ", firstHFRing = " << hcaltopo->firstHFRing()
39  << ", lastHFRing = " << hcaltopo->lastHFRing();
40 #endif
41 
43 
44  if (nullptr == geom->cornersMgr())
46  if (nullptr == geom->parMgr())
48 
49  // simple loop
50  for (uint32_t din = 0; din < m_limits->sizeForDenseIndexing(); ++din) {
51  makeCell(din, geom);
52  }
53  edm::LogInfo("Geometry") << "CaloTowersHardcodeGeometry made " << m_limits->sizeForDenseIndexing() << " towers.";
54  return std::unique_ptr<CaloSubdetectorGeometry>(geom);
55 }
int firstHFRing() const
Definition: HcalTopology.h:96
Log< level::Info, true > LogVerbatim
unsigned int numberOfShapes() const override
virtual unsigned int numberOfCellsForCorners() const
const std::vector< double > & getEtaTableHF() const
int firstHBRing() const
Definition: HcalTopology.h:91
unsigned int numberOfParametersPerShape() const override
int lastHBRing() const
Definition: HcalTopology.h:92
void allocatePar(ParVec::size_type n, unsigned int m)
int lastHFRing() const
Definition: HcalTopology.h:97
Log< level::Info, false > LogInfo
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 57 of file CaloTowerHardcodeGeometryLoader.cc.

References funct::abs(), CaloTowerTopology::convertCTtoHcal(), funct::cos(), CaloTowerTopology::detIdFromDenseIndex(), PVValHelper::eta, HLT_FULL_cff::eta1, HLT_FULL_cff::eta2, CaloTowerTopology::firstHERing(), HcalTopology::firstHFRing(), CaloCellGeometry::getParmPtr(), hh, CaloTowerDetId::ieta(), CaloTowerTopology::lastHERing(), m_hcaltopo, m_limits, M_PI, CaloSubdetectorGeometry::newCell(), HcalTopology::nPhiBins(), CaloSubdetectorGeometry::parMgr(), CaloSubdetectorGeometry::parVecVec(), phi, point, alignCSCRings::r, jetcorrextractor::sign(), funct::sin(), theHBHEEtaBounds, theHFEtaBounds, TrackerMaterial_cfi::thickness, x, y, and z.

Referenced by load().

57  {
58  const double EBradius = 143.0; // cm
59  const double HOradius = 406.0 + 1.0;
60  const double EEz = 320.0; // rough (cm)
61  const double HEz = 568.0; // back (cm)
62  const double HFz = 1100.0;
63  const double HFthick = 165;
64  // Tower 17 is the last EB tower
65 
66  //use CT topology to get the DetId for this dense index
68  int ieta = id.ieta();
69  int iphi = id.iphi();
70 
71  //use CT topology to get proper ieta for hcal
72  int etaRing = m_limits->convertCTtoHcal(abs(ieta));
73  int sign = (ieta > 0) ? (1) : (-1);
74  double eta1, eta2;
75 
76 #ifdef EDM_ML_DEUG
77  edm::LogVerbatim("HCalGeom") << "CaloTowerHardcodeGeometryLoader: ieta = " << ieta << ", iphi = " << iphi
78  << ", etaRing = " << etaRing;
79 #endif
80 
81  if (abs(ieta) > m_limits->lastHERing()) {
82  eta1 = theHFEtaBounds.at(etaRing - m_hcaltopo->firstHFRing());
83  eta2 = theHFEtaBounds.at(etaRing - m_hcaltopo->firstHFRing() + 1);
84  } else {
85  eta1 = theHBHEEtaBounds.at(etaRing - 1);
86  eta2 = theHBHEEtaBounds.at(etaRing);
87  }
88  double eta = 0.5 * (eta1 + eta2);
89  double deta = (eta2 - eta1);
90 
91  // in radians
92  double dphi_nominal = 2.0 * M_PI / m_hcaltopo->nPhiBins(1); // always the same
93  double dphi_half = M_PI / m_hcaltopo->nPhiBins(etaRing); // half-width
94 
95  double phi_low = dphi_nominal * (iphi - 1); // low-edge boundaries are constant...
96  double phi = phi_low + dphi_half;
97 
98 #ifdef EDM_ML_DEUG
99  edm::LogVerbatim("HCalGeom") << "CaloTowerHardcodeGeometryLoader: eta1 = " << eta1 << ", eta2 = " << eta2
100  << ", eta = " << eta << ", phi = " << phi;
101 #endif
102 
103  double x, y, z, thickness;
104  bool alongZ = true;
105  if (abs(ieta) > m_limits->lastHERing()) { // forward
106  z = HFz;
107  double r = z / sinh(eta);
108  x = r * cos(phi);
109  y = r * sin(phi);
110  thickness = HFthick / tanh(eta);
111  } else if (abs(ieta) > m_limits->firstHERing() + 1) { // EE-containing
112  z = EEz;
113  double r = z / sinh(eta);
114  x = r * cos(phi);
115  y = r * sin(phi);
116  thickness = (HEz - EEz) / tanh(eta);
117  } else { // EB-containing
118  x = EBradius * cos(phi);
119  y = EBradius * sin(phi);
120  alongZ = false;
121  z = EBradius * sinh(eta);
122  thickness = (HOradius - EBradius) * cosh(eta);
123  }
124 
125  z *= sign;
126  GlobalPoint point(x, y, z);
127 
128  const double mysign(!alongZ ? 1 : -1);
129  std::vector<CCGFloat> hh;
130  hh.reserve(5);
131  hh.emplace_back(deta / 2);
132  hh.emplace_back(dphi_half);
133  hh.emplace_back(mysign * thickness / 2.);
134 
135  hh.emplace_back(fabs(eta));
136  hh.emplace_back(fabs(z));
137 
138 #ifdef EDM_ML_DEUG
139  edm::LogVerbatim("HCalGeom") << "CaloTowerHardcodeGeometryLoader: x = " << x << ", y = " << y << ", z = " << z
140  << ", thickness = " << thickness;
141 #endif
142 
143  geom->newCell(point, point, point, CaloCellGeometry::getParmPtr(hh, geom->parMgr(), geom->parVecVec()), id);
144 }
int firstHFRing() const
Definition: HcalTopology.h:96
Log< level::Info, true > LogVerbatim
virtual void newCell(const GlobalPoint &f1, const GlobalPoint &f2, const GlobalPoint &f3, const CCGFloat *parm, const DetId &detId)=0
double sign(double x)
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
int ieta() const
get the tower ieta
auto const & hh
*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().