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::LogInfo("ZdcHardcodeGeometry") << "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  //********* Here are all the hardcoded numbers you need to know, in **cm**
77  //********* Most are from the zdc.xml and zdclum.xml files ******
78 
79  static const double x0(0); // these 3 are for the "mother" volume
80  static const double y0(0);
81  static const double z0(14000);
82 
83  static const double angEM(0); // the angles of front face wrt vertical
84  static const double angLUM(0);
85  static const double angRPD(0);
86  static const double angHAD(atan(1.)); // this is 45 deg
87 
88  // these dimensions are **half**-sizes
89 
90  static const double dxHAD(4.8);
91  static const double dxEM(dxHAD / 5.);
92  static const double dxLUM(4.8); // to be updated when known
93  static const double dxRPD(4.8); // to be updated when known
94 
95  static const double dhEM(6.25);
96  static const double dhLUM(6.25); // to be updated when known
97  static const double dhHAD(6.25);
98  static const double dhRPD(6.25); // to be updated when known
99 
100  static const double dzEM(33. * 0.15);
101  static const double dzLUM(23.5); // to be updated when known
102  static const double dzHAD(0.82 * 6. / cos(angHAD));
103  static const double dzRPD(23.5); // to be updated when known
104 
105  // these are not half-dimensions, they are offsets from nominal
106  // for the center-of-front-face points
107 
108  static const double xOffEM(-4. * dxEM);
109  static const double xOffLUM(0);
110  static const double xOffHAD(0);
111  static const double xOffRPD(0);
112 
113  static const double yOffEM(0);
114  static const double yOffLUM(0);
115  static const double yOffHAD(0);
116  static const double yOffRPD(0);
117 
118  static const double zOffEM(-49.85 - 0.15);
119  static const double zOffLUM(-39.555);
120  static const double zOffHAD(-29.00);
121  static const double zOffRPD(-39.555);
122 
123  //++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
124 
125  double dx, dh, dz, x, y, z, an;
126 
127  if (section == HcalZDCDetId::EM) {
128  dx = dxEM;
129  dh = dhEM;
130  dz = dzEM;
131  an = angEM;
132  x = zside * (x0 + xOffEM + (channel - 1.0) * dxEM * 2.);
133  y = y0 + yOffEM;
134  z = zside * (z0 + zOffEM);
135  } else if (section == HcalZDCDetId::LUM) {
136  dx = dxLUM;
137  dh = dhLUM;
138  dz = dzLUM;
139  an = angLUM;
140  x = zside * (x0 + xOffLUM);
141  y = y0 + yOffLUM;
142  z = zside * (z0 + zOffLUM + (channel - 1.0) * dzLUM * 2.);
143  } else if (section == HcalZDCDetId::RPD) {
144  dx = dxRPD;
145  dh = dhRPD;
146  dz = dzRPD;
147  an = angRPD;
148  x = zside * (x0 + xOffRPD);
149  y = y0 + yOffRPD;
150  z = zside * (z0 + zOffRPD + (channel - 1.0) * dzRPD * 2.);
151  } else {
153  dx = dxHAD;
154  dh = dhHAD;
155  dz = dzHAD;
156  an = angHAD;
157  x = zside * (x0 + xOffHAD);
158  y = y0 + yOffHAD;
159  z = zside * (z0 + zOffHAD + (channel - 1.0) * dzHAD * 2.);
160  }
161 
162  const GlobalPoint fc(x, y, z);
163 
164  const double dy(dh * cos(an));
165 
166  std::vector<CCGFloat> zz;
168  zz.emplace_back(an);
169  zz.emplace_back(dx);
170  zz.emplace_back(dy);
171  zz.emplace_back(dz);
172 
173  geom->newCell(fc, fc, fc, CaloCellGeometry::getParmPtr(zz, geom->parMgr(), geom->parVecVec()), detId);
174 }
DDAxes::y
geometryCSVtoXML.zz
zz
Definition: geometryCSVtoXML.py:19
CaloCellGeometry::CCGFloat
float CCGFloat
Definition: CaloCellGeometry.h:52
MessageLogger.h
HcalZDCDetId::HAD
Definition: HcalZDCDetId.h:23
HcalZDCDetId::Section
Section
Definition: HcalZDCDetId.h:23
ecaldqm::zside
int zside(DetId const &)
Definition: EcalDQMCommonUtils.cc:189
ZdcHardcodeGeometryLoader::load
ReturnType load()
Definition: ZdcHardcodeGeometryLoader.cc:31
ZdcGeometry
Definition: ZdcGeometry.h:12
HcalZDCDetId::channel
int channel() const
get the channel
Definition: HcalZDCDetId.cc:63
ZdcTopology::firstCell
int firstCell(HcalZDCDetId::Section section) const
Definition: ZdcTopology.cc:320
cms::cuda::assert
assert(be >=bs)
DDAxes::x
IdealZDCTrapezoid.h
edm::LogInfo
Log< level::Info, false > LogInfo
Definition: MessageLogger.h:125
ZdcGeometry.h
ZdcTopology::valid
virtual bool valid(const HcalZDCDetId &id) const
Definition: ZdcTopology.cc:27
HcalZDCDetId
Definition: HcalZDCDetId.h:16
funct::cos
Cos< T >::type cos(const T &t)
Definition: Cos.h:22
DDAxes::z
benchmark_cfg.fc
fc
Definition: benchmark_cfg.py:15
relativeConstraints.geom
geom
Definition: relativeConstraints.py:72
ZdcHardcodeGeometryLoader::init
void init()
Definition: ZdcHardcodeGeometryLoader.cc:18
HLTMuonOfflineAnalyzer_cfi.z0
z0
Definition: HLTMuonOfflineAnalyzer_cfi.py:98
HcalZDCDetId::SubdetectorId
static const int SubdetectorId
Definition: HcalZDCDetId.h:25
Point3DBase< float, GlobalTag >
HcalZDCDetId::zside
int zside() const
get the z-side of the cell (1/-1)
Definition: HcalZDCDetId.h:39
ZdcGeometry::k_NumberOfShapes
Definition: ZdcGeometry.h:28
HcalZDCDetId::RPD
Definition: HcalZDCDetId.h:23
CCGFloat
CaloCellGeometry::CCGFloat CCGFloat
Definition: ZdcHardcodeGeometryLoader.cc:8
ZdcGeometry::k_NumberOfParametersPerShape
Definition: ZdcGeometry.h:30
HcalZDCDetId::kSizeForDenseIndexing
Definition: HcalZDCDetId.h:66
ZdcHardcodeGeometryLoader::fill
void fill(HcalZDCDetId::Section section, CaloSubdetectorGeometry *cg)
Definition: ZdcHardcodeGeometryLoader.cc:40
ZdcHardcodeGeometryLoader::ZdcHardcodeGeometryLoader
ZdcHardcodeGeometryLoader()
Definition: ZdcHardcodeGeometryLoader.cc:10
ZdcHardcodeGeometryLoader::extTopology
const ZdcTopology * extTopology
Definition: ZdcHardcodeGeometryLoader.h:33
ZdcTopology::lastCell
int lastCell(HcalZDCDetId::Section section) const
Definition: ZdcTopology.cc:342
PVValHelper::dy
Definition: PVValidationHelpers.h:49
DetId::Detector
Detector
Definition: DetId.h:24
ZdcHardcodeGeometryLoader.h
CaloCellGeometry.h
PVValHelper::dz
Definition: PVValidationHelpers.h:50
triggerObjects_cff.id
id
Definition: triggerObjects_cff.py:31
hgcalPlots.section
section
Definition: hgcalPlots.py:2049
CaloCellGeometry::getParmPtr
static const CCGFloat * getParmPtr(const std::vector< CCGFloat > &vd, ParMgr *mgr, ParVecVec &pvv)
Definition: CaloCellGeometry.cc:117
CaloSubdetectorGeometry
Definition: CaloSubdetectorGeometry.h:22
HcalZDCDetId::LUM
Definition: HcalZDCDetId.h:23
ZdcTopology
Definition: ZdcTopology.h:14
ZdcHardcodeGeometryLoader::makeCell
void makeCell(const HcalZDCDetId &detId, CaloSubdetectorGeometry *geom) const
Definition: ZdcHardcodeGeometryLoader.cc:69
HcalZDCDetId::section
Section section() const
get the section
Definition: HcalZDCDetId.cc:44
HcalZDCDetId::EM
Definition: HcalZDCDetId.h:23
PVValHelper::dx
Definition: PVValidationHelpers.h:48
cuy.dh
dh
Definition: cuy.py:355