CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
List of all members | Public Types | Public Member Functions | Private Member Functions | Private Attributes
ZdcHardcodeGeometryLoader Class Reference

#include <ZdcHardcodeGeometryLoader.h>

Public Types

typedef CaloSubdetectorGeometryReturnType
 

Public Member Functions

virtual ReturnType load (DetId::Detector det, int subdet)
 
ReturnType load ()
 
 ZdcHardcodeGeometryLoader ()
 
 ZdcHardcodeGeometryLoader (const ZdcTopology &ht)
 
virtual ~ZdcHardcodeGeometryLoader ()
 

Private Member Functions

void fill (HcalZDCDetId::Section section, CaloSubdetectorGeometry *cg)
 
void init ()
 
void makeCell (const HcalZDCDetId &detId, CaloSubdetectorGeometry *geom) const
 

Private Attributes

const ZdcTopologyextTopology
 
float theEMSectiondX
 
float theEMSectiondY
 
float theEMSectiondZ
 
float theHADSectiondX
 
float theHADSectiondY
 
float theHADSectiondZ
 
float theLUMSectiondX
 
float theLUMSectiondY
 
float theLUMSectiondZ
 
float theRPDSectiondX
 
float theRPDSectiondY
 
float theRPDSectiondZ
 
ZdcTopologytheTopology
 

Detailed Description

Author
E. Garcia - UIC

Definition at line 17 of file ZdcHardcodeGeometryLoader.h.

Member Typedef Documentation

Definition at line 20 of file ZdcHardcodeGeometryLoader.h.

Constructor & Destructor Documentation

ZdcHardcodeGeometryLoader::ZdcHardcodeGeometryLoader ( )

Definition at line 10 of file ZdcHardcodeGeometryLoader.cc.

References init().

ZdcHardcodeGeometryLoader::ZdcHardcodeGeometryLoader ( const ZdcTopology ht)
explicit

Definition at line 17 of file ZdcHardcodeGeometryLoader.cc.

References init().

17  :
18  theTopology( 0 ) ,
19  extTopology( &ht )
20 {
21  init();
22 }
virtual ZdcHardcodeGeometryLoader::~ZdcHardcodeGeometryLoader ( )
inlinevirtual

Definition at line 24 of file ZdcHardcodeGeometryLoader.h.

References theTopology.

24 { delete theTopology ; }

Member Function Documentation

void ZdcHardcodeGeometryLoader::fill ( HcalZDCDetId::Section  section,
CaloSubdetectorGeometry cg 
)
private

Definition at line 53 of file ZdcHardcodeGeometryLoader.cc.

References CaloSubdetectorGeometry::allocateCorners(), CaloSubdetectorGeometry::allocatePar(), CaloSubdetectorGeometry::cornersMgr(), extTopology, ZdcTopology::firstCell(), ZdcGeometry::k_NumberOfParametersPerShape, ZdcGeometry::k_NumberOfShapes, HcalZDCDetId::kSizeForDenseIndexing, ZdcTopology::lastCell(), makeCell(), CaloSubdetectorGeometry::parMgr(), and ZdcTopology::valid().

Referenced by load().

55 {
56  // start by making the new HcalDetIds
57  std::vector<HcalZDCDetId> zdcIds;
58  HcalZDCDetId id;
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.push_back(id);
64  id = HcalZDCDetId(section, false, ichannel);
65  if(extTopology->valid(id)) zdcIds.push_back(id);
66  }
67  if( geom->cornersMgr() == 0 ) geom->allocateCorners( HcalZDCDetId::kSizeForDenseIndexing ) ;
68  if( geom->parMgr() == 0 ) 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 }
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
int firstCell(HcalZDCDetId::Section section) const
Definition: ZdcTopology.cc:270
void ZdcHardcodeGeometryLoader::init ( void  )
private

Definition at line 24 of file ZdcHardcodeGeometryLoader.cc.

Referenced by ZdcHardcodeGeometryLoader().

25 {
26 }
ZdcHardcodeGeometryLoader::ReturnType ZdcHardcodeGeometryLoader::load ( DetId::Detector  det,
int  subdet 
)
virtual

Definition at line 29 of file ZdcHardcodeGeometryLoader.cc.

References HcalZDCDetId::EM, extTopology, fill(), HcalZDCDetId::HAD, HcalZDCDetId::LUM, and HcalZDCDetId::SubdetectorId.

Referenced by ZdcHardcodeGeometryEP::produce().

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 }
void fill(HcalZDCDetId::Section section, CaloSubdetectorGeometry *cg)
static const int SubdetectorId
Definition: HcalZDCDetId.h:25
CaloSubdetectorGeometry * ReturnType
ZdcHardcodeGeometryLoader::ReturnType ZdcHardcodeGeometryLoader::load ( )

Definition at line 43 of file ZdcHardcodeGeometryLoader.cc.

References HcalZDCDetId::EM, extTopology, fill(), HcalZDCDetId::HAD, and HcalZDCDetId::LUM.

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 }
void fill(HcalZDCDetId::Section section, CaloSubdetectorGeometry *cg)
CaloSubdetectorGeometry * ReturnType
void ZdcHardcodeGeometryLoader::makeCell ( const HcalZDCDetId detId,
CaloSubdetectorGeometry geom 
) const
private

Definition at line 84 of file ZdcHardcodeGeometryLoader.cc.

References assert(), HcalZDCDetId::channel(), funct::cos(), cuy::dh, HcalZDCDetId::EM, benchmark_cfg::fc, CaloCellGeometry::getParmPtr(), HcalZDCDetId::HAD, ZdcGeometry::k_NumberOfParametersPerShape, HcalZDCDetId::LUM, CaloSubdetectorGeometry::newCell(), CaloSubdetectorGeometry::parMgr(), CaloSubdetectorGeometry::parVecVec(), HcalZDCDetId::RPD, HcalZDCDetId::section(), x, y, z, HcalZDCDetId::zside(), and ecaldqm::zside().

Referenced by fill().

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.push_back( an ) ;
186  zz.push_back( dx ) ;
187  zz.push_back( dy ) ;
188  zz.push_back( dz ) ;
189 
190  geom->newCell( fc, fc, fc,
192  geom->parMgr(),
193  geom->parVecVec() ),
194  detId ) ;
195 }
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
assert(m_qm.get())
int zside(DetId const &)
Cos< T >::type cos(const T &t)
Definition: Cos.h:22
static const CCGFloat * getParmPtr(const std::vector< CCGFloat > &vd, ParMgr *mgr, ParVecVec &pvv)
int channel() const
get the channel
Definition: HcalZDCDetId.cc:62
Section section() const
get the section
Definition: HcalZDCDetId.cc:47
tuple dh
Definition: cuy.py:353

Member Data Documentation

const ZdcTopology* ZdcHardcodeGeometryLoader::extTopology
private

Definition at line 36 of file ZdcHardcodeGeometryLoader.h.

Referenced by fill(), and load().

float ZdcHardcodeGeometryLoader::theEMSectiondX
private

Definition at line 38 of file ZdcHardcodeGeometryLoader.h.

float ZdcHardcodeGeometryLoader::theEMSectiondY
private

Definition at line 39 of file ZdcHardcodeGeometryLoader.h.

float ZdcHardcodeGeometryLoader::theEMSectiondZ
private

Definition at line 40 of file ZdcHardcodeGeometryLoader.h.

float ZdcHardcodeGeometryLoader::theHADSectiondX
private

Definition at line 44 of file ZdcHardcodeGeometryLoader.h.

float ZdcHardcodeGeometryLoader::theHADSectiondY
private

Definition at line 45 of file ZdcHardcodeGeometryLoader.h.

float ZdcHardcodeGeometryLoader::theHADSectiondZ
private

Definition at line 46 of file ZdcHardcodeGeometryLoader.h.

float ZdcHardcodeGeometryLoader::theLUMSectiondX
private

Definition at line 41 of file ZdcHardcodeGeometryLoader.h.

float ZdcHardcodeGeometryLoader::theLUMSectiondY
private

Definition at line 42 of file ZdcHardcodeGeometryLoader.h.

float ZdcHardcodeGeometryLoader::theLUMSectiondZ
private

Definition at line 43 of file ZdcHardcodeGeometryLoader.h.

float ZdcHardcodeGeometryLoader::theRPDSectiondX
private

Definition at line 47 of file ZdcHardcodeGeometryLoader.h.

float ZdcHardcodeGeometryLoader::theRPDSectiondY
private

Definition at line 48 of file ZdcHardcodeGeometryLoader.h.

float ZdcHardcodeGeometryLoader::theRPDSectiondZ
private

Definition at line 49 of file ZdcHardcodeGeometryLoader.h.

ZdcTopology* ZdcHardcodeGeometryLoader::theTopology
private

Definition at line 35 of file ZdcHardcodeGeometryLoader.h.

Referenced by ~ZdcHardcodeGeometryLoader().