CMS 3D CMS Logo

List of all members | Public Types | Public Member Functions | Private Member Functions | Private Attributes
ZdcHardcodeGeometryLoader Class Reference

#include <ZdcHardcodeGeometryLoader.h>

Public Types

typedef CaloSubdetectorGeometryReturnType
 

Public Member Functions

ReturnType load (DetId::Detector det, int subdet)
 
ReturnType load ()
 
void setAddRPD (bool flag)
 
 ZdcHardcodeGeometryLoader (const ZdcTopology &ht)
 
 ~ZdcHardcodeGeometryLoader ()
 

Private Member Functions

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

Private Attributes

const ZdcTopologyextTopology
 
bool m_zdcAddRPD
 
float theEMSectiondX
 
float theEMSectiondY
 
float theEMSectiondZ
 
float theHADSectiondX
 
float theHADSectiondY
 
float theHADSectiondZ
 
float theLUMSectiondX
 
float theLUMSectiondY
 
float theLUMSectiondZ
 
float theRPDSectiondX
 
float theRPDSectiondY
 
float theRPDSectiondZ
 

Detailed Description

Author
E. Garcia - UIC

Definition at line 16 of file ZdcHardcodeGeometryLoader.h.

Member Typedef Documentation

◆ ReturnType

Definition at line 18 of file ZdcHardcodeGeometryLoader.h.

Constructor & Destructor Documentation

◆ ZdcHardcodeGeometryLoader()

ZdcHardcodeGeometryLoader::ZdcHardcodeGeometryLoader ( const ZdcTopology ht)
explicit

Definition at line 10 of file ZdcHardcodeGeometryLoader.cc.

References init().

◆ ~ZdcHardcodeGeometryLoader()

ZdcHardcodeGeometryLoader::~ZdcHardcodeGeometryLoader ( )
inline

Definition at line 21 of file ZdcHardcodeGeometryLoader.h.

21 {}

Member Function Documentation

◆ fill()

void ZdcHardcodeGeometryLoader::fill ( HcalZDCDetId::Section  section,
CaloSubdetectorGeometry cg 
)
private

Definition at line 38 of file ZdcHardcodeGeometryLoader.cc.

References extTopology, ZdcTopology::firstCell(), relativeConstraints::geom, EcalPhiSymFlatTableProducers_cfi::id, ZdcGeometry::k_NumberOfParametersPerShape, ZdcGeometry::k_NumberOfShapes, ZdcTopology::kSizeForDenseIndexing(), ZdcTopology::lastCell(), makeCell(), hgcalPlots::section, and ZdcTopology::valid().

Referenced by load().

38  {
39  // start by making the new HcalDetIds
40  std::vector<HcalZDCDetId> zdcIds;
42  int firstCell = extTopology->firstCell(section);
43  int lastCell = extTopology->lastCell(section);
44  for (int ichannel = firstCell; ichannel <= lastCell; ++ichannel) {
45  id = HcalZDCDetId(section, true, ichannel);
46  if (extTopology->valid(id))
47  zdcIds.emplace_back(id);
48  id = HcalZDCDetId(section, false, ichannel);
49  if (extTopology->valid(id))
50  zdcIds.emplace_back(id);
51  }
52  if (geom->cornersMgr() == nullptr)
53  geom->allocateCorners(extTopology->kSizeForDenseIndexing());
54  if (geom->parMgr() == nullptr)
57 
58  edm::LogVerbatim("ZdcGeometry") << "Number of ZDC DetIds made: " << section << " " << zdcIds.size();
59 
60  // for each new HcalZdcDetId, make a CaloCellGeometry
61 
62  for (std::vector<HcalZDCDetId>::const_iterator zdcIdItr = zdcIds.begin(); zdcIdItr != zdcIds.end(); ++zdcIdItr) {
63  makeCell(*zdcIdItr, geom);
64  }
65 }
Log< level::Info, true > LogVerbatim
uint32_t kSizeForDenseIndexing() const
Definition: ZdcTopology.cc:367
void makeCell(const HcalZDCDetId &detId, CaloSubdetectorGeometry *geom) const
static constexpr int k_NumberOfParametersPerShape
Definition: ZdcGeometry.h:31
static constexpr int k_NumberOfShapes
Definition: ZdcGeometry.h:29
virtual bool valid(const HcalZDCDetId &id) const
Definition: ZdcTopology.cc:30
int firstCell(HcalZDCDetId::Section section) const
Definition: ZdcTopology.cc:323
int lastCell(HcalZDCDetId::Section section) const
Definition: ZdcTopology.cc:345

◆ init()

void ZdcHardcodeGeometryLoader::init ( void  )
private

Definition at line 12 of file ZdcHardcodeGeometryLoader.cc.

Referenced by ZdcHardcodeGeometryLoader().

12 {}

◆ load() [1/2]

ZdcHardcodeGeometryLoader::ReturnType ZdcHardcodeGeometryLoader::load ( DetId::Detector  det,
int  subdet 
)

Definition at line 14 of file ZdcHardcodeGeometryLoader.cc.

References HcalZDCDetId::EM, extTopology, fill(), HcalZDCDetId::HAD, HcalZDCDetId::LUM, m_zdcAddRPD, HcalZDCDetId::RPD, and HcalZDCDetId::SubdetectorId.

14  {
16  if (subdet == HcalZDCDetId::SubdetectorId) {
20  if (m_zdcAddRPD)
21  fill(
23  hg); // line will be needed in next version of code, but is commented out for now in order to ensure run1 compatability.
24  }
25  return hg;
26 }
void fill(HcalZDCDetId::Section section, CaloSubdetectorGeometry *cg)
CaloSubdetectorGeometry * ReturnType
static constexpr int32_t SubdetectorId
Definition: HcalZDCDetId.h:35

◆ load() [2/2]

ZdcHardcodeGeometryLoader::ReturnType ZdcHardcodeGeometryLoader::load ( )

◆ makeCell()

void ZdcHardcodeGeometryLoader::makeCell ( const HcalZDCDetId detId,
CaloSubdetectorGeometry geom 
) const
private

Definition at line 67 of file ZdcHardcodeGeometryLoader.cc.

References cms::cuda::assert(), funct::cos(), hcalRecHitTable_cff::detId, cuy::dh, PVValHelper::dx, PVValHelper::dy, PVValHelper::dz, HcalZDCDetId::EM, relativeConstraints::geom, CaloCellGeometry::getParmPtr(), HcalZDCDetId::HAD, ZdcGeometry::k_NumberOfParametersPerShape, HcalZDCDetId::LUM, HcalZDCDetId::RPD, hgcalPlots::section, x, y, z, ppsFastLocalSimulation_cfi::z0, ecaldqm::zside(), and geometryCSVtoXML::zz.

Referenced by fill().

67  {
68  double zside(detId.zside());
69 
70  const HcalZDCDetId::Section section(detId.section());
71 
72  const int channel(detId.channel());
73 
74  edm::LogVerbatim("ZdcGeometry") << "ZDCGeometry::Cell: " << detId << " Section " << section << " channel " << channel;
75  //********* Here are all the hardcoded numbers you need to know, in **cm**
76  //********* Most are from the zdc.xml and zdclum.xml files ******
77 
78  static const double x0(0); // these 3 are for the "mother" volume
79  static const double y0(0);
80  static const double z0(14000);
81 
82  static const double angEM(0); // the angles of front face wrt vertical
83  static const double angLUM(0);
84  static const double angRPD(0);
85  static const double angHAD(atan(1.)); // this is 45 deg
86 
87  // these dimensions are **half**-sizes
88 
89  static const double dxHAD(4.8);
90  static const double dxEM(dxHAD / 5.);
91  static const double dxLUM(4.8); // to be updated when known
92  static const double dxRPD(4.8); // to be updated when known
93 
94  static const double dhEM(6.25);
95  static const double dhLUM(6.25); // to be updated when known
96  static const double dhHAD(6.25);
97  static const double dhRPD(6.25); // to be updated when known
98 
99  static const double dzEM(33. * 0.15);
100  static const double dzLUM(23.5); // to be updated when known
101  static const double dzHAD(0.82 * 6. / cos(angHAD));
102  static const double dzRPD(23.5); // to be updated when known
103 
104  // these are not half-dimensions, they are offsets from nominal
105  // for the center-of-front-face points
106 
107  static const double xOffEM(-4. * dxEM);
108  static const double xOffLUM(0);
109  static const double xOffHAD(0);
110  static const double xOffRPD(0);
111 
112  static const double yOffEM(0);
113  static const double yOffLUM(0);
114  static const double yOffHAD(0);
115  static const double yOffRPD(0);
116 
117  static const double zOffEM(-49.85 - 0.15);
118  static const double zOffLUM(-39.555);
119  static const double zOffHAD(-29.00);
120  static const double zOffRPD(-39.555);
121 
122  //++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
123 
124  double dx, dh, dz, x, y, z, an;
125 
126  if (section == HcalZDCDetId::EM) {
127  dx = dxEM;
128  dh = dhEM;
129  dz = dzEM;
130  an = angEM;
131  x = zside * (x0 + xOffEM + (channel - 1.0) * dxEM * 2.);
132  y = y0 + yOffEM;
133  z = zside * (z0 + zOffEM);
134  } else if (section == HcalZDCDetId::LUM) {
135  dx = dxLUM;
136  dh = dhLUM;
137  dz = dzLUM;
138  an = angLUM;
139  x = zside * (x0 + xOffLUM);
140  y = y0 + yOffLUM;
141  z = zside * (z0 + zOffLUM + (channel - 1.0) * dzLUM * 2.);
142  } else if (section == HcalZDCDetId::RPD) {
143  dx = dxRPD;
144  dh = dhRPD;
145  dz = dzRPD;
146  an = angRPD;
147  x = zside * (x0 + xOffRPD);
148  y = y0 + yOffRPD;
149  z = zside * (z0 + zOffRPD + (channel - 1.0) * dzRPD * 2.);
150  } else {
152  dx = dxHAD;
153  dh = dhHAD;
154  dz = dzHAD;
155  an = angHAD;
156  x = zside * (x0 + xOffHAD);
157  y = y0 + yOffHAD;
158  z = zside * (z0 + zOffHAD + (channel - 1.0) * dzHAD * 2.);
159  }
160 
161  const GlobalPoint fc(x, y, z);
162 
163  const double dy(dh * cos(an));
164 
165  std::vector<CCGFloat> zz;
167  zz.emplace_back(an);
168  zz.emplace_back(dx);
169  zz.emplace_back(dy);
170  zz.emplace_back(dz);
171 
172  geom->newCell(fc, fc, fc, CaloCellGeometry::getParmPtr(zz, geom->parMgr(), geom->parVecVec()), detId);
173 }
Log< level::Info, true > LogVerbatim
static constexpr int k_NumberOfParametersPerShape
Definition: ZdcGeometry.h:31
int zside(DetId const &)
assert(be >=bs)
Cos< T >::type cos(const T &t)
Definition: Cos.h:22
static const CCGFloat * getParmPtr(const std::vector< CCGFloat > &vd, ParMgr *mgr, ParVecVec &pvv)
dh
Definition: cuy.py:354

◆ setAddRPD()

void ZdcHardcodeGeometryLoader::setAddRPD ( bool  flag)
inline

Member Data Documentation

◆ extTopology

const ZdcTopology* ZdcHardcodeGeometryLoader::extTopology
private

Definition at line 33 of file ZdcHardcodeGeometryLoader.h.

Referenced by fill(), and load().

◆ m_zdcAddRPD

bool ZdcHardcodeGeometryLoader::m_zdcAddRPD
private

Definition at line 34 of file ZdcHardcodeGeometryLoader.h.

Referenced by load(), and setAddRPD().

◆ theEMSectiondX

float ZdcHardcodeGeometryLoader::theEMSectiondX
private

Definition at line 35 of file ZdcHardcodeGeometryLoader.h.

◆ theEMSectiondY

float ZdcHardcodeGeometryLoader::theEMSectiondY
private

Definition at line 36 of file ZdcHardcodeGeometryLoader.h.

◆ theEMSectiondZ

float ZdcHardcodeGeometryLoader::theEMSectiondZ
private

Definition at line 37 of file ZdcHardcodeGeometryLoader.h.

◆ theHADSectiondX

float ZdcHardcodeGeometryLoader::theHADSectiondX
private

Definition at line 41 of file ZdcHardcodeGeometryLoader.h.

◆ theHADSectiondY

float ZdcHardcodeGeometryLoader::theHADSectiondY
private

Definition at line 42 of file ZdcHardcodeGeometryLoader.h.

◆ theHADSectiondZ

float ZdcHardcodeGeometryLoader::theHADSectiondZ
private

Definition at line 43 of file ZdcHardcodeGeometryLoader.h.

◆ theLUMSectiondX

float ZdcHardcodeGeometryLoader::theLUMSectiondX
private

Definition at line 38 of file ZdcHardcodeGeometryLoader.h.

◆ theLUMSectiondY

float ZdcHardcodeGeometryLoader::theLUMSectiondY
private

Definition at line 39 of file ZdcHardcodeGeometryLoader.h.

◆ theLUMSectiondZ

float ZdcHardcodeGeometryLoader::theLUMSectiondZ
private

Definition at line 40 of file ZdcHardcodeGeometryLoader.h.

◆ theRPDSectiondX

float ZdcHardcodeGeometryLoader::theRPDSectiondX
private

Definition at line 44 of file ZdcHardcodeGeometryLoader.h.

◆ theRPDSectiondY

float ZdcHardcodeGeometryLoader::theRPDSectiondY
private

Definition at line 45 of file ZdcHardcodeGeometryLoader.h.

◆ theRPDSectiondZ

float ZdcHardcodeGeometryLoader::theRPDSectiondZ
private

Definition at line 46 of file ZdcHardcodeGeometryLoader.h.