CMS 3D CMS Logo

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)
 
std::unique_ptr< CaloSubdetectorGeometryload ()
 
virtual std::unique_ptr< CaloSubdetectorGeometryload (DetId::Detector det, int subdet)
 
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() [1/2]

CastorHardcodeGeometryLoader::CastorHardcodeGeometryLoader ( )

Definition at line 12 of file CastorHardcodeGeometryLoader.cc.

14  init();
15 }

References init().

◆ CastorHardcodeGeometryLoader() [2/2]

CastorHardcodeGeometryLoader::CastorHardcodeGeometryLoader ( const CastorTopology ht)
explicit

Definition at line 17 of file CastorHardcodeGeometryLoader.cc.

18  : theTopology(nullptr), extTopology(&ht) {
19  init();
20 }

References init().

◆ ~CastorHardcodeGeometryLoader()

virtual CastorHardcodeGeometryLoader::~CastorHardcodeGeometryLoader ( )
inlinevirtual

Definition at line 15 of file CastorHardcodeGeometryLoader.h.

15 { delete theTopology; };

References theTopology.

Member Function Documentation

◆ fill()

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

Definition at line 47 of file CastorHardcodeGeometryLoader.cc.

47  {
48  if (geom->cornersMgr() == nullptr)
50  if (geom->parMgr() == nullptr)
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 }

References extTopology, CastorTopology::firstCell(), relativeConstraints::geom, triggerObjects_cff::id, CastorGeometry::k_NumberOfParametersPerShape, CastorGeometry::k_NumberOfShapes, HcalCastorDetId::kNumberSectorsPerEnd, HcalCastorDetId::kSizeForDenseIndexing, CastorTopology::lastCell(), makeCell(), hgcalPlots::section, and CastorTopology::valid().

Referenced by load().

◆ init()

void CastorHardcodeGeometryLoader::init ( void  )
private

◆ load() [1/2]

std::unique_ptr< CaloSubdetectorGeometry > CastorHardcodeGeometryLoader::load ( )

Definition at line 40 of file CastorHardcodeGeometryLoader.cc.

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 }

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

◆ load() [2/2]

std::unique_ptr< CaloSubdetectorGeometry > CastorHardcodeGeometryLoader::load ( DetId::Detector  det,
int  subdet 
)
virtual

Definition at line 31 of file CastorHardcodeGeometryLoader.cc.

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 }

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

Referenced by CastorHardcodeGeometryEP::produce().

◆ makeCell()

void CastorHardcodeGeometryLoader::makeCell ( const HcalCastorDetId detId,
CaloSubdetectorGeometry geom 
) const
private

Definition at line 79 of file CastorHardcodeGeometryLoader.cc.

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 }

References timingPdfMaker::can, funct::cos(), cuy::dh, HGC3DClusterGenMatchSelector_cfi::dR, PVValHelper::dx, PVValHelper::dy, PVValHelper::dz, HcalCastorDetId::EM, benchmark_cfg::fc, relativeConstraints::geom, CaloCellGeometry::getParmPtr(), CastorGeometry::k_NumberOfParametersPerShape, HcalCastorDetId::kNumberSectorsPerEnd, M_PI, HcalCastorDetId::module(), phi, HcalCastorDetId::section(), hgcalPlots::section, HcalCastorDetId::sector(), Validation_hcalonly_cfi::sign, funct::sin(), mathSSE::sqrt(), HcalCastorDetId::zside(), ecaldqm::zside(), and geometryCSVtoXML::zz.

Referenced by fill().

Member Data Documentation

◆ extTopology

const CastorTopology* CastorHardcodeGeometryLoader::extTopology
private

Definition at line 26 of file CastorHardcodeGeometryLoader.h.

Referenced by fill(), and load().

◆ theEMSectiondX

float CastorHardcodeGeometryLoader::theEMSectiondX
private

Definition at line 28 of file CastorHardcodeGeometryLoader.h.

Referenced by init().

◆ theEMSectiondY

float CastorHardcodeGeometryLoader::theEMSectiondY
private

Definition at line 29 of file CastorHardcodeGeometryLoader.h.

Referenced by init().

◆ theEMSectiondZ

float CastorHardcodeGeometryLoader::theEMSectiondZ
private

Definition at line 30 of file CastorHardcodeGeometryLoader.h.

Referenced by init().

◆ theHADSectiondX

float CastorHardcodeGeometryLoader::theHADSectiondX
private

Definition at line 31 of file CastorHardcodeGeometryLoader.h.

Referenced by init().

◆ theHADSectiondY

float CastorHardcodeGeometryLoader::theHADSectiondY
private

Definition at line 32 of file CastorHardcodeGeometryLoader.h.

Referenced by init().

◆ theHADSectiondZ

float CastorHardcodeGeometryLoader::theHADSectiondZ
private

Definition at line 33 of file CastorHardcodeGeometryLoader.h.

Referenced by init().

◆ theTopology

CastorTopology* CastorHardcodeGeometryLoader::theTopology
private

Definition at line 25 of file CastorHardcodeGeometryLoader.h.

Referenced by ~CastorHardcodeGeometryLoader().

CastorHardcodeGeometryLoader::fill
void fill(HcalCastorDetId::Section section, CaloSubdetectorGeometry *cg)
Definition: CastorHardcodeGeometryLoader.cc:47
geometryCSVtoXML.zz
zz
Definition: geometryCSVtoXML.py:19
HcalCastorDetId::kNumberSectorsPerEnd
Definition: HcalCastorDetId.h:69
CastorHardcodeGeometryLoader::theTopology
CastorTopology * theTopology
Definition: CastorHardcodeGeometryLoader.h:25
CastorTopology::lastCell
int lastCell(HcalCastorDetId::Section section) const
Definition: CastorTopology.cc:273
ecaldqm::zside
int zside(DetId const &)
Definition: EcalDQMCommonUtils.cc:189
CastorHardcodeGeometryLoader::makeCell
void makeCell(const HcalCastorDetId &detId, CaloSubdetectorGeometry *geom) const
Definition: CastorHardcodeGeometryLoader.cc:79
CastorHardcodeGeometryLoader::theHADSectiondZ
float theHADSectiondZ
Definition: CastorHardcodeGeometryLoader.h:33
Validation_hcalonly_cfi.sign
sign
Definition: Validation_hcalonly_cfi.py:32
HcalCastorDetId::SubdetectorId
static const int SubdetectorId
Definition: HcalCastorDetId.h:28
HcalCastorDetId::Section
Section
Definition: HcalCastorDetId.h:25
CastorHardcodeGeometryLoader::theEMSectiondX
float theEMSectiondX
Definition: CastorHardcodeGeometryLoader.h:28
CastorHardcodeGeometryLoader::theHADSectiondX
float theHADSectiondX
Definition: CastorHardcodeGeometryLoader.h:31
funct::sin
Sin< T >::type sin(const T &t)
Definition: Sin.h:22
funct::cos
Cos< T >::type cos(const T &t)
Definition: Cos.h:22
mathSSE::sqrt
T sqrt(T t)
Definition: SSEVec.h:19
HcalCastorDetId::section
Section section() const
get the section
Definition: HcalCastorDetId.cc:49
CastorHardcodeGeometryLoader::init
void init()
Definition: CastorHardcodeGeometryLoader.cc:22
benchmark_cfg.fc
fc
Definition: benchmark_cfg.py:15
relativeConstraints.geom
geom
Definition: relativeConstraints.py:72
CastorGeometry::k_NumberOfShapes
Definition: CastorGeometry.h:30
CastorHardcodeGeometryLoader::theHADSectiondY
float theHADSectiondY
Definition: CastorHardcodeGeometryLoader.h:32
dYHADPlate
static const double dYHADPlate
Definition: CastorGeometryData.h:35
Point3DBase< float, GlobalTag >
HcalCastorDetId
Definition: HcalCastorDetId.h:23
HcalCastorDetId::module
int module() const
get the module (1-2 for EM, 1-12 for HAD)
Definition: HcalCastorDetId.h:58
CastorTopology::valid
virtual bool valid(const HcalCastorDetId &id) const
Definition: CastorTopology.cc:19
CastorTopology
Definition: CastorTopology.h:13
HcalCastorDetId::zside
int zside() const
get the z-side of the cell (1/-1)
Definition: HcalCastorDetId.h:50
HcalCastorDetId::sector
int sector() const
get the sector (1-16)
Definition: HcalCastorDetId.h:62
M_PI
#define M_PI
Definition: BXVectorInputProducer.cc:49
PVValHelper::dy
Definition: PVValidationHelpers.h:49
dXHADPlate
static const double dXHADPlate
Definition: CastorGeometryData.h:37
DDAxes::phi
CastorHardcodeGeometryLoader::extTopology
const CastorTopology * extTopology
Definition: CastorHardcodeGeometryLoader.h:26
timingPdfMaker.can
can
Definition: timingPdfMaker.py:311
dXEMPlate
static const double dXEMPlate
Definition: CastorGeometryData.h:36
HcalCastorDetId::kSizeForDenseIndexing
Definition: HcalCastorDetId.h:71
PVValHelper::dz
Definition: PVValidationHelpers.h:50
triggerObjects_cff.id
id
Definition: triggerObjects_cff.py:31
hgcalPlots.section
section
Definition: hgcalPlots.py:2049
dYEMPlate
static const double dYEMPlate
Definition: CastorGeometryData.h:34
HcalCastorDetId::HAD
Definition: HcalCastorDetId.h:25
CaloCellGeometry::getParmPtr
static const CCGFloat * getParmPtr(const std::vector< CCGFloat > &vd, ParMgr *mgr, ParVecVec &pvv)
Definition: CaloCellGeometry.cc:117
CastorGeometry::k_NumberOfParametersPerShape
Definition: CastorGeometry.h:32
CastorHardcodeGeometryLoader::theEMSectiondZ
float theEMSectiondZ
Definition: CastorHardcodeGeometryLoader.h:30
CastorGeometry
Definition: CastorGeometry.h:14
HGC3DClusterGenMatchSelector_cfi.dR
dR
Definition: HGC3DClusterGenMatchSelector_cfi.py:7
PVValHelper::dx
Definition: PVValidationHelpers.h:48
CastorTopology::firstCell
int firstCell(HcalCastorDetId::Section section) const
Definition: CastorTopology.cc:257
cuy.dh
dh
Definition: cuy.py:355
HcalCastorDetId::EM
Definition: HcalCastorDetId.h:25
CastorHardcodeGeometryLoader::theEMSectiondY
float theEMSectiondY
Definition: CastorHardcodeGeometryLoader.h:29