CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
ZdcHardcodeGeometryLoader.cc
Go to the documentation of this file.
6 #include <algorithm>
7 
9  theTopology ( new ZdcTopology ) ,
10  extTopology ( theTopology )
11 {
12  init();
13 }
14 
16  theTopology( 0 ) ,
17  extTopology( &ht )
18 {
19  init();
20 }
21 
23 {
24 }
25 
28 {
30  if(subdet == HcalZDCDetId::SubdetectorId)
31  {
32  fill(HcalZDCDetId::EM ,hg );
33  fill(HcalZDCDetId::LUM ,hg );
34  fill(HcalZDCDetId::HAD ,hg );
35  }
36  return hg;
37 }
38 
41 {
43  fill(HcalZDCDetId::EM ,hg );
44  fill(HcalZDCDetId::LUM ,hg );
45  fill(HcalZDCDetId::HAD ,hg );
46  return hg;
47 }
48 
50  ReturnType geom )
51 {
52  // start by making the new HcalDetIds
53  std::vector<HcalZDCDetId> zdcIds;
55  int firstCell = extTopology->firstCell(section);
56  int lastCell = extTopology->lastCell(section);
57  for(int ichannel = firstCell; ichannel <= lastCell; ++ichannel) {
58  id = HcalZDCDetId(section, true, ichannel);
59  if(extTopology->valid(id)) zdcIds.push_back(id);
60  id = HcalZDCDetId(section, false, ichannel);
61  if(extTopology->valid(id)) zdcIds.push_back(id);
62  }
64  if( geom->parMgr() == 0 ) geom->allocatePar(
67 
68  edm::LogInfo("ZdcHardcodeGeometry") << "Number of ZDC DetIds made: " << section << " " << zdcIds.size();
69 
70  // for each new HcalZdcDetId, make a CaloCellGeometry
71 
72  for(std::vector<HcalZDCDetId>::const_iterator zdcIdItr = zdcIds.begin();
73  zdcIdItr != zdcIds.end(); ++zdcIdItr)
74  {
75  geom->addCell( *zdcIdItr, makeCell(*zdcIdItr, geom ) );
76  }
77 }
78 
81  ReturnType geom) const
82 {
83  double zside ( detId.zside() ) ;
84 
85  const HcalZDCDetId::Section section ( detId.section() ) ;
86 
87  const int channel ( detId.channel() ) ;
88 
89 //********* Here are all the hardcoded numbers you need to know, in **cm**
90 //********* Most are from the zdc.xml and zdclum.xml files ******
91 
92  static const double x0 ( 0 ) ; // these 3 are for the "mother" volume
93  static const double y0 ( 0 ) ;
94  static const double z0 ( 14000 ) ;
95 
96  static const double angEM ( 0 ) ; // the angles of front face wrt vertical
97  static const double angLUM ( 0 ) ;
98  static const double angHAD ( atan( 1. ) ) ; // this is 45 deg
99 
100  // these dimensions are **half**-sizes
101 
102  static const double dxHAD ( 4.8 ) ;
103  static const double dxEM ( dxHAD/5. ) ;
104  static const double dxLUM ( 4.8 ) ; // to be updated when known
105 
106  static const double dhEM ( 6.25 ) ;
107  static const double dhLUM ( 6.25 ) ; // to be updated when known
108  static const double dhHAD ( 6.25 ) ;
109 
110  static const double dzEM ( 33.*0.15 ) ;
111  static const double dzLUM ( 23.5 ) ; // to be updated when known
112  static const double dzHAD ( 0.82*6./cos(angHAD) ) ;
113 
114  // these are not half-dimensions, they are offsets from nominal
115  // for the center-of-front-face points
116 
117  static const double xOffEM ( -4.*dxEM ) ;
118  static const double xOffLUM ( 0 ) ;
119  static const double xOffHAD ( 0 ) ;
120 
121  static const double yOffEM ( 0 ) ;
122  static const double yOffLUM ( 0 ) ;
123  static const double yOffHAD ( 0 ) ;
124 
125  static const double zOffEM ( -49.85 - 0.15 ) ;
126  static const double zOffLUM ( -39.555 ) ;
127  static const double zOffHAD ( -29.00 ) ;
128 
129 //++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
130 
131  double dx, dh, dz, x, y, z, an ;
132 
133  if( section==HcalZDCDetId::EM )
134  {
135  dx = dxEM ;
136  dh = dhEM ;
137  dz = dzEM ;
138  an = angEM ;
139  x = zside*( x0 + xOffEM + ( channel - 1.0 )*dxEM*2. ) ;
140  y = y0 + yOffEM ;
141  z = zside*( z0 + zOffEM ) ;
142  }
143  else
144  {
145  if( section==HcalZDCDetId::LUM )
146  {
147  dx = dxLUM ;
148  dh = dhLUM ;
149  dz = dzLUM ;
150  an = angLUM ;
151  x = zside*( x0 + xOffLUM ) ;
152  y = y0 + yOffLUM ;
153  z = zside*( z0 + zOffLUM + ( channel - 1.0 )*dzLUM*2. ) ;
154  }
155  else
156  {
157  assert( section==HcalZDCDetId::HAD ) ;
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 
168  const GlobalPoint faceCenter ( x, y, z );
169 
170  const double dy ( dh*cos( an ) ) ;
171 
172  std::vector<double> zz ;
174  zz.push_back( an ) ;
175  zz.push_back( dx ) ;
176  zz.push_back( dy ) ;
177  zz.push_back( dz ) ;
178 
179  return new calogeom::IdealZDCTrapezoid(
180  faceCenter,
181  geom->cornersMgr(),
183  geom->parMgr(),
184  geom->parVecVec() ) );
185 }
186 
187 
int zside() const
get the z-side of the cell (1/-1)
Definition: HcalZDCDetId.h:36
void allocatePar(ParVec::size_type n, unsigned int m)
void addCell(const DetId &id, CaloCellGeometry *ccg)
Add a cell to the geometry.
virtual bool valid(const HcalZDCDetId &id) const
Definition: ZdcTopology.cc:25
Definition: DDAxes.h:10
int lastCell(HcalZDCDetId::Section section) const
Definition: ZdcTopology.cc:259
Cos< T >::type cos(const T &t)
Definition: Cos.h:22
void fill(HcalZDCDetId::Section section, CaloSubdetectorGeometry *cg)
Section section() const
get the section
Definition: HcalZDCDetId.h:38
CaloCellGeometry * makeCell(const HcalZDCDetId &detId, CaloSubdetectorGeometry *geom) const
static const int SubdetectorId
Definition: HcalZDCDetId.h:22
CaloCellGeometry::CornersMgr * cornersMgr()
Detector
Definition: DetId.h:26
static const double * getParmPtr(const std::vector< double > &vd, ParMgr *mgr, ParVecVec &pvv)
int channel() const
get the channel
Definition: HcalZDCDetId.h:42
int firstCell(HcalZDCDetId::Section section) const
Definition: ZdcTopology.cc:248
void allocateCorners(CaloCellGeometry::CornersVec::size_type n)