CMS 3D CMS Logo

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

#include <CaloTowerHardcodeGeometryLoader.h>

Public Member Functions

std::auto_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::auto_ptr< CaloSubdetectorGeometry > CaloTowerHardcodeGeometryLoader::load ( const CaloTowerTopology limits,
const HcalTopology hcaltopo,
const HcalDDDRecConstants hcons 
)

Definition at line 9 of file CaloTowerHardcodeGeometryLoader.cc.

References CaloSubdetectorGeometry::allocateCorners(), CaloSubdetectorGeometry::allocatePar(), CaloSubdetectorGeometry::cornersMgr(), cropTnPTrees::din, relativeConstraints::geom, HcalDDDRecConstants::getEtaTable(), HcalDDDRecConstants::getEtaTableHF(), m_hcaltopo, m_hcons, m_limits, makeCell(), CaloTowerGeometry::numberOfCellsForCorners(), CaloTowerGeometry::numberOfParametersPerShape(), CaloTowerGeometry::numberOfShapes(), CaloSubdetectorGeometry::parMgr(), CaloTowerTopology::sizeForDenseIndexing(), theHBHEEtaBounds, and theHFEtaBounds.

Referenced by CaloTowerHardcodeGeometryEP::produce().

9  {
10 
11  m_limits = limits;
12  m_hcaltopo = hcaltopo;
13  m_hcons = hcons;
14 
15  //get eta limits from hcal rec constants
18 
20 
21  if( 0 == geom->cornersMgr() ) geom->allocateCorners (
22  geom->numberOfCellsForCorners() ) ;
23  if( 0 == geom->parMgr() ) geom->allocatePar (
25  geom->numberOfParametersPerShape() ) ;
26 
27  // simple loop
28  for (uint32_t din = 0; din < m_limits->sizeForDenseIndexing(); ++din) {
29  makeCell(din, geom);
30  }
31  edm::LogInfo("Geometry") << "CaloTowersHardcodeGeometry made " << m_limits->sizeForDenseIndexing() << " towers.";
32  return std::auto_ptr<CaloSubdetectorGeometry>(geom);
33 }
virtual unsigned int numberOfCellsForCorners() const
const std::vector< double > & getEtaTableHF() const
void allocatePar(ParVec::size_type n, unsigned int m)
virtual unsigned int numberOfParametersPerShape() const
CaloCellGeometry::CornersMgr * cornersMgr()
const std::vector< double > & getEtaTable() const
virtual unsigned int numberOfShapes() const
void makeCell(uint32_t din, CaloSubdetectorGeometry *geom) const
void allocateCorners(CaloCellGeometry::CornersVec::size_type n)
uint32_t sizeForDenseIndexing() const
void CaloTowerHardcodeGeometryLoader::makeCell ( uint32_t  din,
CaloSubdetectorGeometry geom 
) const
private

Definition at line 36 of file CaloTowerHardcodeGeometryLoader.cc.

References funct::abs(), CaloTowerTopology::convertCTtoHcal(), funct::cos(), CaloTowerTopology::detIdFromDenseIndex(), 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, jetcorrextractor::sign(), funct::sin(), theHBHEEtaBounds, theHFEtaBounds, x, y, and z.

Referenced by load().

37  {
38  const double EBradius = 143.0; // cm
39  const double HOradius = 406.0+1.0;
40  const double EEz = 320.0; // rough (cm)
41  const double HEz = 568.0; // back (cm)
42  const double HFz = 1100.0;
43  const double HFthick = 165;
44  // Tower 17 is the last EB tower
45 
46  //use CT topology to get the DetId for this dense index
48  int ieta = id.ieta();
49  int iphi = id.iphi();
50 
51  //use CT topology to get proper ieta for hcal
52  int etaRing=m_limits->convertCTtoHcal(abs(ieta));
53  int sign=(ieta>0)?(1):(-1);
54  double eta1, eta2;
55  if (abs(ieta)>m_limits->lastHERing()) {
56  eta1 = theHFEtaBounds[etaRing-m_hcaltopo->firstHFRing()];
57  eta2 = theHFEtaBounds[etaRing-m_hcaltopo->firstHFRing()+1];
58  } else {
59  eta1 = theHBHEEtaBounds[etaRing-1];
60  eta2 = theHBHEEtaBounds[etaRing];
61  }
62  double eta = 0.5*(eta1+eta2);
63  double deta = (eta2-eta1);
64 
65  // in radians
66  double dphi_nominal = 2.0*M_PI / m_hcaltopo->nPhiBins(1); // always the same
67  double dphi_half = M_PI / m_hcaltopo->nPhiBins(etaRing); // half-width
68 
69  double phi_low = dphi_nominal*(iphi-1); // low-edge boundaries are constant...
70  double phi = phi_low+dphi_half;
71 
72  double x,y,z,thickness;
73  bool alongZ=true;
74  if (abs(ieta)>m_limits->lastHERing()) { // forward
75  z=HFz;
76  double r=z/sinh(eta);
77  x=r * cos(phi);
78  y=r * sin(phi);
79  thickness=HFthick/tanh(eta);
80  } else if (abs(ieta)>m_limits->firstHERing()+1) { // EE-containing
81  z=EEz;
82  double r=z/sinh(eta);
83  x=r * cos(phi);
84  y=r * sin(phi);
85  thickness=(HEz-EEz)/tanh(eta);
86  } else { // EB-containing
87  x=EBradius * cos(phi);
88  y=EBradius * sin(phi);
89  alongZ=false;
90  z=EBradius * sinh(eta);
91  thickness=(HOradius-EBradius) * cosh(eta);
92  }
93 
94  z*=sign;
95  GlobalPoint point(x,y,z);
96 
97  const double mysign ( !alongZ ? 1 : -1 ) ;
98  std::vector<CCGFloat> hh ;
99  hh.reserve(5) ;
100  hh.push_back( deta/2 ) ;
101  hh.push_back( dphi_half ) ;
102  hh.push_back( mysign*thickness/2. ) ;
103 
104  hh.push_back( fabs( eta ) ) ;
105  hh.push_back( fabs( z ) ) ;
106 
107  geom->newCell( point, point, point,
109  geom->parMgr(),
110  geom->parVecVec() ),
111  id ) ;
112 }
int firstHFRing() const
Definition: HcalTopology.h:87
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
*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().