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
CastorHardcodeGeometryLoader Class Reference

#include <CastorHardcodeGeometryLoader.h>

Public Member Functions

 CastorHardcodeGeometryLoader ()
 
 CastorHardcodeGeometryLoader (const CastorTopology &ht)
 
virtual std::unique_ptr
< CaloSubdetectorGeometry
load (DetId::Detector det, int subdet)
 
std::unique_ptr
< CaloSubdetectorGeometry
load ()
 
virtual ~CastorHardcodeGeometryLoader ()
 

Private Member Functions

void fill (HcalCastorDetId::Section section, CaloSubdetectorGeometry *cg)
 
void init ()
 
void makeCell (const HcalCastorDetId &detId, CaloSubdetectorGeometry *geom) const
 

Private Attributes

const CastorTopologyextTopology
 
float theEMSectiondX
 
float theEMSectiondY
 
float theEMSectiondZ
 
float theHADSectiondX
 
float theHADSectiondY
 
float theHADSectiondZ
 
CastorTopologytheTopology
 

Detailed Description

Definition at line 11 of file CastorHardcodeGeometryLoader.h.

Constructor & Destructor Documentation

CastorHardcodeGeometryLoader::CastorHardcodeGeometryLoader ( )
CastorHardcodeGeometryLoader::CastorHardcodeGeometryLoader ( const CastorTopology ht)
explicit

Definition at line 17 of file CastorHardcodeGeometryLoader.cc.

References init().

virtual CastorHardcodeGeometryLoader::~CastorHardcodeGeometryLoader ( )
inlinevirtual

Definition at line 15 of file CastorHardcodeGeometryLoader.h.

References theTopology.

15 { delete theTopology; };

Member Function Documentation

void CastorHardcodeGeometryLoader::fill ( HcalCastorDetId::Section  section,
CaloSubdetectorGeometry cg 
)
private

Definition at line 47 of file CastorHardcodeGeometryLoader.cc.

References CaloSubdetectorGeometry::allocateCorners(), CaloSubdetectorGeometry::allocatePar(), CaloSubdetectorGeometry::cornersMgr(), extTopology, CastorTopology::firstCell(), gpuClustering::id, CastorGeometry::k_NumberOfParametersPerShape, CastorGeometry::k_NumberOfShapes, HcalCastorDetId::kNumberSectorsPerEnd, HcalCastorDetId::kSizeForDenseIndexing, CastorTopology::lastCell(), makeCell(), CaloSubdetectorGeometry::parMgr(), and CastorTopology::valid().

Referenced by load().

47  {
48  if (geom->cornersMgr() == nullptr)
50  if (geom->parMgr() == nullptr)
52  CastorGeometry::k_NumberOfParametersPerShape);
53 
54  // start by making the new HcalDetIds
55  std::vector<HcalCastorDetId> castorIds;
56 
57  const int firstCell(extTopology->firstCell(section));
58  const int lastCell(extTopology->lastCell(section));
59 
60  for (int imodule(firstCell); imodule <= lastCell; ++imodule) {
61  for (int isector(1); isector <= HcalCastorDetId::kNumberSectorsPerEnd; ++isector) {
62  const HcalCastorDetId id(section, false, isector, imodule);
63  if (extTopology->valid(id))
64  castorIds.emplace_back(id);
65  }
66  }
67  // edm::LogInfo("CastorHardcodeGeometry")
68  // << "Number of Castor DetIds made: " << section
69  // << " " << castorIds.size();
70 
71  // for each new HcalCastorDetId, make a CaloCellGeometry
72 
73  for (std::vector<HcalCastorDetId>::const_iterator castorIdItr(castorIds.begin()); castorIdItr != castorIds.end();
74  ++castorIdItr) {
75  makeCell(*castorIdItr, geom);
76  }
77 }
uint16_t *__restrict__ id
void makeCell(const HcalCastorDetId &detId, CaloSubdetectorGeometry *geom) const
virtual bool valid(const HcalCastorDetId &id) const
string section
Definition: vertexPlots.py:496
int firstCell(HcalCastorDetId::Section section) const
int lastCell(HcalCastorDetId::Section section) const
void CastorHardcodeGeometryLoader::init ( void  )
private
std::unique_ptr< CaloSubdetectorGeometry > CastorHardcodeGeometryLoader::load ( DetId::Detector  det,
int  subdet 
)
virtual

Definition at line 31 of file CastorHardcodeGeometryLoader.cc.

References HcalCastorDetId::EM, extTopology, fill(), HcalCastorDetId::HAD, and HcalCastorDetId::SubdetectorId.

Referenced by CastorHardcodeGeometryEP::produce().

31  {
32  std::unique_ptr<CaloSubdetectorGeometry> hg(new CastorGeometry(extTopology));
33  if (subdet == HcalCastorDetId::SubdetectorId) {
34  fill(HcalCastorDetId::EM, hg.get());
35  fill(HcalCastorDetId::HAD, hg.get());
36  }
37  return hg;
38 }
void fill(HcalCastorDetId::Section section, CaloSubdetectorGeometry *cg)
static const int SubdetectorId
std::unique_ptr< CaloSubdetectorGeometry > CastorHardcodeGeometryLoader::load ( )

Definition at line 40 of file CastorHardcodeGeometryLoader.cc.

References HcalCastorDetId::EM, extTopology, fill(), and HcalCastorDetId::HAD.

40  {
41  std::unique_ptr<CaloSubdetectorGeometry> hg(new CastorGeometry(extTopology));
42  fill(HcalCastorDetId::EM, hg.get());
43  fill(HcalCastorDetId::HAD, hg.get());
44  return hg;
45 }
void fill(HcalCastorDetId::Section section, CaloSubdetectorGeometry *cg)
void CastorHardcodeGeometryLoader::makeCell ( const HcalCastorDetId detId,
CaloSubdetectorGeometry geom 
) const
private

Definition at line 79 of file CastorHardcodeGeometryLoader.cc.

References timingPdfMaker::can, funct::cos(), cuy::dh, PVValHelper::dx, PVValHelper::dy, PVValHelper::dz, HcalCastorDetId::EM, CaloCellGeometry::getParmPtr(), CastorGeometry::k_NumberOfParametersPerShape, HcalCastorDetId::kNumberSectorsPerEnd, M_PI, HcalCastorDetId::module(), callgraph::module, CaloSubdetectorGeometry::newCell(), CaloSubdetectorGeometry::parMgr(), CaloSubdetectorGeometry::parVecVec(), phi, HcalCastorDetId::section(), vertexPlots::section, HcalCastorDetId::sector(), jetcorrextractor::sign(), funct::sin(), mathSSE::sqrt(), HcalCastorDetId::zside(), and ecaldqm::zside().

Referenced by fill().

79  {
80  const double zside(1.0 * detId.zside());
82  const int module(detId.module());
83  const int isect(detId.sector());
84  const double sector(1.0 * isect);
85 
86  // length units are cm
87 
88  const double sign(0 == isect % 2 ? -1 : 1);
89 
90  //********* HERE ARE HARDWIRED GEOMETRY NUMBERS ACTUALLY USED *****
91 
92  static const double an(atan(1.)); //angle of cant w.r.t. beam
93  static const double can(cos(an));
94  static const double san(sin(an));
95  static const double dxlEM(1.55 / 2.); //halflength of side near beam
96  static const double dxhEM(5.73 / 2.); //halflength of side away from beam
97  static const double dhEM(14.26 / 2.); //halflength of 2nd longest side
98  static const double dR(0.1 + 2. * dhEM * san * dxlEM / (dxhEM - dxlEM));
99  static const double dhHAD(19.88 / 2.); //halflength of 2nd longest side
100 
101  static const double dxhHAD(dxhEM * (2. * dhHAD * san + dR) /
102  (2. * dhEM * san + dR)); //halflength of side away from beam
103  static const double zm(1439.0); //z of start of EM
104  static const double dzEM(5.45 / 2); // halflength in z of EM
105  static const double dzHAD(10.075 / 2); // halflength in z of HAD
106 
107  //*****************************************************************
108 
109  const double dxl(sign * dxlEM); // same for EM and HAD
110 
111  const double dxh(sign * (section == HcalCastorDetId::EM ? dxhEM : dxhHAD));
112  const double dh(section == HcalCastorDetId::EM ? dhEM : dhHAD);
113  const double dz(section == HcalCastorDetId::EM ? dzEM : dzHAD);
114 
115  const double delz(dh * can);
116  const double dy(dh * san);
117  const double dx((dxl + dxh) / 2.);
118  const double leg(dR + dy);
119  const double len(sqrt(leg * leg + dx * dx));
120 
121  static const double dphi(2. * M_PI / (1.0 * HcalCastorDetId::kNumberSectorsPerEnd));
122 
123  const double fphi(atan(dx / (dR + dy)));
124 
125  const double phi(0 == isect % 2 ? (sector - 1.) * dphi - fphi : sector * dphi - fphi);
126 
127  const double sphi(sin(phi));
128  const double cphi(cos(phi));
129 
130  const double xc(len * cphi);
131  const double yc(len * sphi);
132  const double zc(
133  zside *
134  (zm + delz + (module < 3 ? (1. * module - 1.0) * 2. * dzEM : 4. * dzEM + (1. * (module - 2) - 1) * 2. * dzHAD)));
135 
136  const GlobalPoint fc(xc, yc, zc);
137 
138  std::vector<CCGFloat> zz;
140  zz.emplace_back(dxl);
141  zz.emplace_back(dxh);
142  zz.emplace_back(dh);
143  zz.emplace_back(dz);
144  zz.emplace_back(an);
145  zz.emplace_back(dR);
146 
147  geom->newCell(fc, fc, fc, CaloCellGeometry::getParmPtr(zz, geom->parMgr(), geom->parVecVec()), detId);
148 }
int sector() const
get the sector (1-16)
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 module() const
get the module (1-2 for EM, 1-12 for HAD)
int zside(DetId const &)
Section section() const
get the section
T sqrt(T t)
Definition: SSEVec.h:19
Cos< T >::type cos(const T &t)
Definition: Cos.h:22
int zside() const
get the z-side of the cell (1/-1)
static const CCGFloat * getParmPtr(const std::vector< CCGFloat > &vd, ParMgr *mgr, ParVecVec &pvv)
#define M_PI
string section
Definition: vertexPlots.py:496
tuple module
Definition: callgraph.py:69
tuple dh
Definition: cuy.py:354

Member Data Documentation

const CastorTopology* CastorHardcodeGeometryLoader::extTopology
private

Definition at line 26 of file CastorHardcodeGeometryLoader.h.

Referenced by fill(), and load().

float CastorHardcodeGeometryLoader::theEMSectiondX
private

Definition at line 28 of file CastorHardcodeGeometryLoader.h.

Referenced by init().

float CastorHardcodeGeometryLoader::theEMSectiondY
private

Definition at line 29 of file CastorHardcodeGeometryLoader.h.

Referenced by init().

float CastorHardcodeGeometryLoader::theEMSectiondZ
private

Definition at line 30 of file CastorHardcodeGeometryLoader.h.

Referenced by init().

float CastorHardcodeGeometryLoader::theHADSectiondX
private

Definition at line 31 of file CastorHardcodeGeometryLoader.h.

Referenced by init().

float CastorHardcodeGeometryLoader::theHADSectiondY
private

Definition at line 32 of file CastorHardcodeGeometryLoader.h.

Referenced by init().

float CastorHardcodeGeometryLoader::theHADSectiondZ
private

Definition at line 33 of file CastorHardcodeGeometryLoader.h.

Referenced by init().

CastorTopology* CastorHardcodeGeometryLoader::theTopology
private

Definition at line 25 of file CastorHardcodeGeometryLoader.h.

Referenced by ~CastorHardcodeGeometryLoader().