CMS 3D CMS Logo

ZdcHardcodeGeometryLoader.cc
Go to the documentation of this file.
6 #include <algorithm>
7 
9 
11  theTopology ( new ZdcTopology ) ,
12  extTopology ( theTopology )
13 {
14  init();
15 }
16 
18  theTopology( nullptr ) ,
19  extTopology( &ht )
20 {
21  init();
22 }
23 
25 {
26 }
27 
30 {
32  if(subdet == HcalZDCDetId::SubdetectorId)
33  {
34  fill(HcalZDCDetId::EM ,hg );
35  fill(HcalZDCDetId::LUM ,hg );
36  fill(HcalZDCDetId::HAD ,hg );
37 // 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.
38  }
39  return hg;
40 }
41 
44 {
46  fill(HcalZDCDetId::EM ,hg );
47  fill(HcalZDCDetId::LUM ,hg );
48  fill(HcalZDCDetId::HAD ,hg );
49 // fill(HcalZDCDetId::RPD ,hg );
50  return hg;
51 }
52 
54  ReturnType geom )
55 {
56  // start by making the new HcalDetIds
57  std::vector<HcalZDCDetId> zdcIds;
59  int firstCell = extTopology->firstCell(section);
60  int lastCell = extTopology->lastCell(section);
61  for(int ichannel = firstCell; ichannel <= lastCell; ++ichannel) {
62  id = HcalZDCDetId(section, true, ichannel);
63  if(extTopology->valid(id)) zdcIds.emplace_back(id);
64  id = HcalZDCDetId(section, false, ichannel);
65  if(extTopology->valid(id)) zdcIds.emplace_back(id);
66  }
68  if( geom->parMgr() == nullptr ) geom->allocatePar(
71 
72  edm::LogInfo("ZdcHardcodeGeometry") << "Number of ZDC DetIds made: " << section << " " << zdcIds.size();
73 
74  // for each new HcalZdcDetId, make a CaloCellGeometry
75 
76  for(std::vector<HcalZDCDetId>::const_iterator zdcIdItr = zdcIds.begin();
77  zdcIdItr != zdcIds.end(); ++zdcIdItr)
78  {
79  makeCell( *zdcIdItr, geom ) ;
80  }
81 }
82 
83 void
85  ReturnType geom) const
86 {
87  double zside ( detId.zside() ) ;
88 
89  const HcalZDCDetId::Section section ( detId.section() ) ;
90 
91  const int channel ( detId.channel() ) ;
92 
93 //********* Here are all the hardcoded numbers you need to know, in **cm**
94 //********* Most are from the zdc.xml and zdclum.xml files ******
95 
96  static const double x0 ( 0 ) ; // these 3 are for the "mother" volume
97  static const double y0 ( 0 ) ;
98  static const double z0 ( 14000 ) ;
99 
100  static const double angEM ( 0 ) ; // the angles of front face wrt vertical
101  static const double angLUM ( 0 ) ;
102  static const double angRPD ( 0 ) ;
103  static const double angHAD ( atan( 1. ) ) ; // this is 45 deg
104 
105  // these dimensions are **half**-sizes
106 
107  static const double dxHAD ( 4.8 ) ;
108  static const double dxEM ( dxHAD/5. ) ;
109  static const double dxLUM ( 4.8 ) ; // to be updated when known
110  static const double dxRPD ( 4.8 ) ; // to be updated when known
111 
112  static const double dhEM ( 6.25 ) ;
113  static const double dhLUM ( 6.25 ) ; // to be updated when known
114  static const double dhHAD ( 6.25 ) ;
115  static const double dhRPD ( 6.25 ) ; // to be updated when known
116 
117  static const double dzEM ( 33.*0.15 ) ;
118  static const double dzLUM ( 23.5 ) ; // to be updated when known
119  static const double dzHAD ( 0.82*6./cos(angHAD) ) ;
120  static const double dzRPD ( 23.5 ) ; // to be updated when known
121 
122  // these are not half-dimensions, they are offsets from nominal
123  // for the center-of-front-face points
124 
125  static const double xOffEM ( -4.*dxEM ) ;
126  static const double xOffLUM ( 0 ) ;
127  static const double xOffHAD ( 0 ) ;
128  static const double xOffRPD ( 0 ) ;
129 
130  static const double yOffEM ( 0 ) ;
131  static const double yOffLUM ( 0 ) ;
132  static const double yOffHAD ( 0 ) ;
133  static const double yOffRPD ( 0 ) ;
134 
135  static const double zOffEM ( -49.85 - 0.15 ) ;
136  static const double zOffLUM ( -39.555 ) ;
137  static const double zOffHAD ( -29.00 ) ;
138  static const double zOffRPD ( -39.555 ) ;
139 
140 //++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
141 
142  double dx, dh, dz, x, y, z, an ;
143 
144  if( section==HcalZDCDetId::EM ) {
145  dx = dxEM ;
146  dh = dhEM ;
147  dz = dzEM ;
148  an = angEM ;
149  x = zside*( x0 + xOffEM + ( channel - 1.0 )*dxEM*2. ) ;
150  y = y0 + yOffEM ;
151  z = zside*( z0 + zOffEM ) ;
152  } else if( section==HcalZDCDetId::LUM ) {
153  dx = dxLUM ;
154  dh = dhLUM ;
155  dz = dzLUM ;
156  an = angLUM ;
157  x = zside*( x0 + xOffLUM ) ;
158  y = y0 + yOffLUM ;
159  z = zside*( z0 + zOffLUM + ( channel - 1.0 )*dzLUM*2. ) ;
160  } else if( section==HcalZDCDetId::RPD ) {
161  dx = dxRPD ;
162  dh = dhRPD ;
163  dz = dzRPD ;
164  an = angRPD ;
165  x = zside*( x0 + xOffRPD ) ;
166  y = y0 + yOffRPD ;
167  z = zside*( z0 + zOffRPD + ( channel - 1.0 )*dzRPD*2. ) ;
168  } else {
169  assert( section==HcalZDCDetId::HAD ) ;
170  dx = dxHAD ;
171  dh = dhHAD ;
172  dz = dzHAD ;
173  an = angHAD ;
174  x = zside*( x0 + xOffHAD ) ;
175  y = y0 + yOffHAD ;
176  z = zside*( z0 + zOffHAD + ( channel - 1.0 )*dzHAD*2. ) ;
177  }
178 
179  const GlobalPoint fc ( x, y, z );
180 
181  const double dy ( dh*cos( an ) ) ;
182 
183  std::vector<CCGFloat> zz ;
185  zz.emplace_back( an ) ;
186  zz.emplace_back( dx ) ;
187  zz.emplace_back( dy ) ;
188  zz.emplace_back( dz ) ;
189 
190  geom->newCell( fc, fc, fc,
192  geom->parMgr(),
193  geom->parVecVec() ),
194  detId ) ;
195 }
196 
197 
virtual void newCell(const GlobalPoint &f1, const GlobalPoint &f2, const GlobalPoint &f3, const CCGFloat *parm, const DetId &detId)=0
int zside() const
get the z-side of the cell (1/-1)
Definition: HcalZDCDetId.h:39
#define nullptr
int zside(DetId const &)
void allocatePar(ParVec::size_type n, unsigned int m)
void makeCell(const HcalZDCDetId &detId, CaloSubdetectorGeometry *geom) const
virtual bool valid(const HcalZDCDetId &id) const
Definition: ZdcTopology.cc:29
int lastCell(HcalZDCDetId::Section section) const
Definition: ZdcTopology.cc:282
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)
static const int SubdetectorId
Definition: HcalZDCDetId.h:25
CaloCellGeometry::CornersMgr * cornersMgr()
Detector
Definition: DetId.h:26
int channel() const
get the channel
Definition: HcalZDCDetId.cc:62
Section section() const
get the section
Definition: HcalZDCDetId.cc:47
int firstCell(HcalZDCDetId::Section section) const
Definition: ZdcTopology.cc:270
void allocateCorners(CaloCellGeometry::CornersVec::size_type n)
dh
Definition: cuy.py:355
CaloCellGeometry::CCGFloat CCGFloat