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

virtual ReturnType load (DetId::Detector det, int subdet)
 
ReturnType load ()
 
void setAddRPD (bool flag)
 
 ZdcHardcodeGeometryLoader ()
 
 ZdcHardcodeGeometryLoader (const ZdcTopology &ht)
 
virtual ~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
 
ZdcTopologytheTopology
 

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() [1/2]

ZdcHardcodeGeometryLoader::ZdcHardcodeGeometryLoader ( )

◆ ZdcHardcodeGeometryLoader() [2/2]

ZdcHardcodeGeometryLoader::ZdcHardcodeGeometryLoader ( const ZdcTopology ht)
explicit

Definition at line 14 of file ZdcHardcodeGeometryLoader.cc.

References init().

◆ ~ZdcHardcodeGeometryLoader()

virtual ZdcHardcodeGeometryLoader::~ZdcHardcodeGeometryLoader ( )
inlinevirtual

Definition at line 22 of file ZdcHardcodeGeometryLoader.h.

References theTopology.

22 { delete theTopology; }

Member Function Documentation

◆ fill()

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

Definition at line 44 of file ZdcHardcodeGeometryLoader.cc.

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

Referenced by load().

44  {
45  // start by making the new HcalDetIds
46  std::vector<HcalZDCDetId> zdcIds;
48  int firstCell = extTopology->firstCell(section);
49  int lastCell = extTopology->lastCell(section);
50  for (int ichannel = firstCell; ichannel <= lastCell; ++ichannel) {
51  id = HcalZDCDetId(section, true, ichannel);
52  if (extTopology->valid(id))
53  zdcIds.emplace_back(id);
54  id = HcalZDCDetId(section, false, ichannel);
55  if (extTopology->valid(id))
56  zdcIds.emplace_back(id);
57  }
58  if (geom->cornersMgr() == nullptr)
59  geom->allocateCorners(HcalZDCDetId::kSizeForDenseIndexing);
60  if (geom->parMgr() == nullptr)
63 
64  edm::LogVerbatim("ZdcGeometry") << "Number of ZDC DetIds made: " << section << " " << zdcIds.size();
65 
66  // for each new HcalZdcDetId, make a CaloCellGeometry
67 
68  for (std::vector<HcalZDCDetId>::const_iterator zdcIdItr = zdcIds.begin(); zdcIdItr != zdcIds.end(); ++zdcIdItr) {
69  makeCell(*zdcIdItr, geom);
70  }
71 }
Log< level::Info, true > LogVerbatim
void makeCell(const HcalZDCDetId &detId, CaloSubdetectorGeometry *geom) const
virtual bool valid(const HcalZDCDetId &id) const
Definition: ZdcTopology.cc:24
int firstCell(HcalZDCDetId::Section section) const
Definition: ZdcTopology.cc:316
int lastCell(HcalZDCDetId::Section section) const
Definition: ZdcTopology.cc:338

◆ init()

void ZdcHardcodeGeometryLoader::init ( void  )
private

Definition at line 18 of file ZdcHardcodeGeometryLoader.cc.

Referenced by ZdcHardcodeGeometryLoader().

18 {}

◆ load() [1/2]

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

Definition at line 20 of file ZdcHardcodeGeometryLoader.cc.

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

20  {
22  if (subdet == HcalZDCDetId::SubdetectorId) {
26  if (m_zdcAddRPD)
27  fill(
29  hg); // line will be needed in next version of code, but is commented out for now in order to ensure run1 compatability.
30  }
31  return hg;
32 }
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 73 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, HLTMuonOfflineAnalyzer_cfi::z0, ecaldqm::zside(), and geometryCSVtoXML::zz.

Referenced by fill().

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

Referenced by fill(), and load().

◆ m_zdcAddRPD

bool ZdcHardcodeGeometryLoader::m_zdcAddRPD
private

Definition at line 35 of file ZdcHardcodeGeometryLoader.h.

Referenced by load(), and setAddRPD().

◆ theEMSectiondX

float ZdcHardcodeGeometryLoader::theEMSectiondX
private

Definition at line 36 of file ZdcHardcodeGeometryLoader.h.

◆ theEMSectiondY

float ZdcHardcodeGeometryLoader::theEMSectiondY
private

Definition at line 37 of file ZdcHardcodeGeometryLoader.h.

◆ theEMSectiondZ

float ZdcHardcodeGeometryLoader::theEMSectiondZ
private

Definition at line 38 of file ZdcHardcodeGeometryLoader.h.

◆ theHADSectiondX

float ZdcHardcodeGeometryLoader::theHADSectiondX
private

Definition at line 42 of file ZdcHardcodeGeometryLoader.h.

◆ theHADSectiondY

float ZdcHardcodeGeometryLoader::theHADSectiondY
private

Definition at line 43 of file ZdcHardcodeGeometryLoader.h.

◆ theHADSectiondZ

float ZdcHardcodeGeometryLoader::theHADSectiondZ
private

Definition at line 44 of file ZdcHardcodeGeometryLoader.h.

◆ theLUMSectiondX

float ZdcHardcodeGeometryLoader::theLUMSectiondX
private

Definition at line 39 of file ZdcHardcodeGeometryLoader.h.

◆ theLUMSectiondY

float ZdcHardcodeGeometryLoader::theLUMSectiondY
private

Definition at line 40 of file ZdcHardcodeGeometryLoader.h.

◆ theLUMSectiondZ

float ZdcHardcodeGeometryLoader::theLUMSectiondZ
private

Definition at line 41 of file ZdcHardcodeGeometryLoader.h.

◆ theRPDSectiondX

float ZdcHardcodeGeometryLoader::theRPDSectiondX
private

Definition at line 45 of file ZdcHardcodeGeometryLoader.h.

◆ theRPDSectiondY

float ZdcHardcodeGeometryLoader::theRPDSectiondY
private

Definition at line 46 of file ZdcHardcodeGeometryLoader.h.

◆ theRPDSectiondZ

float ZdcHardcodeGeometryLoader::theRPDSectiondZ
private

Definition at line 47 of file ZdcHardcodeGeometryLoader.h.

◆ theTopology

ZdcTopology* ZdcHardcodeGeometryLoader::theTopology
private

Definition at line 33 of file ZdcHardcodeGeometryLoader.h.

Referenced by ~ZdcHardcodeGeometryLoader().