CMS 3D CMS Logo

ZdcHardcodeGeometryLoader.cc
Go to the documentation of this file.
6 #include <algorithm>
7 
9 
10 ZdcHardcodeGeometryLoader::ZdcHardcodeGeometryLoader() : theTopology(new ZdcTopology), extTopology(theTopology) {
11  init();
12 }
13 
14 ZdcHardcodeGeometryLoader::ZdcHardcodeGeometryLoader(const ZdcTopology& ht) : theTopology(nullptr), extTopology(&ht) {
15  init();
16 }
17 
19 
22  if (subdet == HcalZDCDetId::SubdetectorId) {
26  // fill(HcalZDCDetId::RPD ,hg ); // line will be needed in next version of code, but is commented out for now in order to ensure run1 compatability.
27  }
28  return hg;
29 }
30 
36  // fill(HcalZDCDetId::RPD ,hg );
37  return hg;
38 }
39 
41  // start by making the new HcalDetIds
42  std::vector<HcalZDCDetId> zdcIds;
44  int firstCell = extTopology->firstCell(section);
45  int lastCell = extTopology->lastCell(section);
46  for (int ichannel = firstCell; ichannel <= lastCell; ++ichannel) {
47  id = HcalZDCDetId(section, true, ichannel);
48  if (extTopology->valid(id))
49  zdcIds.emplace_back(id);
50  id = HcalZDCDetId(section, false, ichannel);
51  if (extTopology->valid(id))
52  zdcIds.emplace_back(id);
53  }
54  if (geom->cornersMgr() == nullptr)
55  geom->allocateCorners(HcalZDCDetId::kSizeForDenseIndexing);
56  if (geom->parMgr() == nullptr)
59 
60  edm::LogVerbatim("ZdcGeometry") << "Number of ZDC DetIds made: " << section << " " << zdcIds.size();
61 
62  // for each new HcalZdcDetId, make a CaloCellGeometry
63 
64  for (std::vector<HcalZDCDetId>::const_iterator zdcIdItr = zdcIds.begin(); zdcIdItr != zdcIds.end(); ++zdcIdItr) {
65  makeCell(*zdcIdItr, geom);
66  }
67 }
68 
70  double zside(detId.zside());
71 
72  const HcalZDCDetId::Section section(detId.section());
73 
74  const int channel(detId.channel());
75 
76  edm::LogVerbatim("ZdcGeometry") << "ZDCGeometry::Cell: " << detId << " Section " << section << " channel " << channel;
77  //********* Here are all the hardcoded numbers you need to know, in **cm**
78  //********* Most are from the zdc.xml and zdclum.xml files ******
79 
80  static const double x0(0); // these 3 are for the "mother" volume
81  static const double y0(0);
82  static const double z0(14000);
83 
84  static const double angEM(0); // the angles of front face wrt vertical
85  static const double angLUM(0);
86  static const double angRPD(0);
87  static const double angHAD(atan(1.)); // this is 45 deg
88 
89  // these dimensions are **half**-sizes
90 
91  static const double dxHAD(4.8);
92  static const double dxEM(dxHAD / 5.);
93  static const double dxLUM(4.8); // to be updated when known
94  static const double dxRPD(4.8); // to be updated when known
95 
96  static const double dhEM(6.25);
97  static const double dhLUM(6.25); // to be updated when known
98  static const double dhHAD(6.25);
99  static const double dhRPD(6.25); // to be updated when known
100 
101  static const double dzEM(33. * 0.15);
102  static const double dzLUM(23.5); // to be updated when known
103  static const double dzHAD(0.82 * 6. / cos(angHAD));
104  static const double dzRPD(23.5); // to be updated when known
105 
106  // these are not half-dimensions, they are offsets from nominal
107  // for the center-of-front-face points
108 
109  static const double xOffEM(-4. * dxEM);
110  static const double xOffLUM(0);
111  static const double xOffHAD(0);
112  static const double xOffRPD(0);
113 
114  static const double yOffEM(0);
115  static const double yOffLUM(0);
116  static const double yOffHAD(0);
117  static const double yOffRPD(0);
118 
119  static const double zOffEM(-49.85 - 0.15);
120  static const double zOffLUM(-39.555);
121  static const double zOffHAD(-29.00);
122  static const double zOffRPD(-39.555);
123 
124  //++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
125 
126  double dx, dh, dz, x, y, z, an;
127 
128  if (section == HcalZDCDetId::EM) {
129  dx = dxEM;
130  dh = dhEM;
131  dz = dzEM;
132  an = angEM;
133  x = zside * (x0 + xOffEM + (channel - 1.0) * dxEM * 2.);
134  y = y0 + yOffEM;
135  z = zside * (z0 + zOffEM);
136  } else if (section == HcalZDCDetId::LUM) {
137  dx = dxLUM;
138  dh = dhLUM;
139  dz = dzLUM;
140  an = angLUM;
141  x = zside * (x0 + xOffLUM);
142  y = y0 + yOffLUM;
143  z = zside * (z0 + zOffLUM + (channel - 1.0) * dzLUM * 2.);
144  } else if (section == HcalZDCDetId::RPD) {
145  dx = dxRPD;
146  dh = dhRPD;
147  dz = dzRPD;
148  an = angRPD;
149  x = zside * (x0 + xOffRPD);
150  y = y0 + yOffRPD;
151  z = zside * (z0 + zOffRPD + (channel - 1.0) * dzRPD * 2.);
152  } else {
154  dx = dxHAD;
155  dh = dhHAD;
156  dz = dzHAD;
157  an = angHAD;
158  x = zside * (x0 + xOffHAD);
159  y = y0 + yOffHAD;
160  z = zside * (z0 + zOffHAD + (channel - 1.0) * dzHAD * 2.);
161  }
162 
163  const GlobalPoint fc(x, y, z);
164 
165  const double dy(dh * cos(an));
166 
167  std::vector<CCGFloat> zz;
169  zz.emplace_back(an);
170  zz.emplace_back(dx);
171  zz.emplace_back(dy);
172  zz.emplace_back(dz);
173 
174  geom->newCell(fc, fc, fc, CaloCellGeometry::getParmPtr(zz, geom->parMgr(), geom->parVecVec()), detId);
175 }
Log< level::Info, true > LogVerbatim
void makeCell(const HcalZDCDetId &detId, CaloSubdetectorGeometry *geom) const
int zside(DetId const &)
assert(be >=bs)
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:28
int firstCell(HcalZDCDetId::Section section) const
Definition: ZdcTopology.cc:321
Detector
Definition: DetId.h:24
int lastCell(HcalZDCDetId::Section section) const
Definition: ZdcTopology.cc:343
static constexpr int32_t SubdetectorId
Definition: HcalZDCDetId.h:35
dh
Definition: cuy.py:354
CaloCellGeometry::CCGFloat CCGFloat