CMS 3D CMS Logo

ZdcHardcodeGeometryLoader.cc
Go to the documentation of this file.
6 #include <algorithm>
7 
9 
11 
13 
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 }
27 
33  if (m_zdcAddRPD)
35  return hg;
36 }
37 
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 }
66 
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
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
int zside(DetId const &)
assert(be >=bs)
static constexpr int k_NumberOfShapes
Definition: ZdcGeometry.h:29
Cos< T >::type cos(const T &t)
Definition: Cos.h:22
void fill(HcalZDCDetId::Section section, CaloSubdetectorGeometry *cg)
static const CCGFloat * getParmPtr(const std::vector< CCGFloat > &vd, ParMgr *mgr, ParVecVec &pvv)
virtual bool valid(const HcalZDCDetId &id) const
Definition: ZdcTopology.cc:30
int firstCell(HcalZDCDetId::Section section) const
Definition: ZdcTopology.cc:323
Detector
Definition: DetId.h:24
int lastCell(HcalZDCDetId::Section section) const
Definition: ZdcTopology.cc:345
static constexpr int32_t SubdetectorId
Definition: HcalZDCDetId.h:35
ZdcHardcodeGeometryLoader(const ZdcTopology &ht)
dh
Definition: cuy.py:354
CaloCellGeometry::CCGFloat CCGFloat