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(), popcon2dropbox::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(), m_hcaltopo, m_hcons, m_limits, makeCell(), CaloTowerGeometry::numberOfCellsForCorners(), CaloTowerGeometry::numberOfParametersPerShape(), CaloTowerGeometry::numberOfShapes(), CaloSubdetectorGeometry::parMgr(), CaloTowerTopology::sizeForDenseIndexing(), theHBHEEtaBounds, and theHFEtaBounds.

Referenced by CaloTowerHardcodeGeometryEP::produce().

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

Definition at line 50 of file CaloTowerHardcodeGeometryLoader.cc.

References funct::abs(), CaloTowerTopology::convertCTtoHcal(), funct::cos(), gather_cfg::cout, CaloTowerTopology::detIdFromDenseIndex(), PVValHelper::eta, CaloTowerTopology::firstHERing(), HcalTopology::firstHFRing(), CaloCellGeometry::getParmPtr(), CaloTowerDetId::ieta(), 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, x, y, and z.

Referenced by load().

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

Referenced by load(), and makeCell().

const HcalDDDRecConstants* CaloTowerHardcodeGeometryLoader::m_hcons
private

Definition at line 22 of file CaloTowerHardcodeGeometryLoader.h.

Referenced by load().

const CaloTowerTopology* CaloTowerHardcodeGeometryLoader::m_limits
private

Definition at line 20 of file CaloTowerHardcodeGeometryLoader.h.

Referenced by load(), and makeCell().

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

Definition at line 23 of file CaloTowerHardcodeGeometryLoader.h.

Referenced by load(), and makeCell().

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

Definition at line 23 of file CaloTowerHardcodeGeometryLoader.h.

Referenced by load(), and makeCell().