test
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 | Static Public Member Functions | Protected Member Functions | Private Attributes
HGCalGeometry Class Referencefinal

#include <HGCalGeometry.h>

Inheritance diagram for HGCalGeometry:
CaloSubdetectorGeometry

Public Types

enum  { k_NumberOfParametersPerShape = 12 }
 
enum  { k_NumberOfShapes = 50 }
 
typedef HGCalGeometryRecord AlignedRecord
 
typedef CaloCellGeometry::CCGFloat CCGFloat
 
typedef std::vector< FlatTrdCellVec
 
typedef std::vector< GlobalPointCornersVec
 
typedef std::set< DetIdDetIdSet
 
typedef PHGCalRcd PGeometryRecord
 
typedef CaloCellGeometry::Pt3D Pt3D
 
typedef CaloCellGeometry::Pt3DVec Pt3DVec
 
- Public Types inherited from CaloSubdetectorGeometry
typedef CaloCellGeometry::CCGFloat CCGFloat
 
typedef std::vector
< CaloCellGeometry const * > 
CellSet
 
typedef std::set< DetIdDetIdSet
 
typedef std::vector< CCGFloatDimVec
 
typedef std::vector< unsigned int > IVec
 
typedef CaloCellGeometry::ParMgr ParMgr
 
typedef CaloCellGeometry::ParVec ParVec
 
typedef CaloCellGeometry::ParVecVec ParVecVec
 
typedef std::vector< CCGFloatTrVec
 

Public Member Functions

std::string cellElement () const
 
virtual void fillNamedParams (DDFilteredView fv)
 
virtual DetIdSet getCells (const GlobalPoint &r, double dR) const override
 Get a list of all cells within a dR of the given cell. More...
 
virtual DetId getClosestCell (const GlobalPoint &r) const override
 
CornersVec getCorners (const DetId &id) const
 Returns the corner points of this cell's volume. More...
 
virtual const CaloCellGeometrygetGeometry (const DetId &id) const override
 Get the cell geometry of a given detector id. Should return false if not found. More...
 
GlobalPoint getPosition (const DetId &id) const
 
virtual void getSummary (CaloSubdetectorGeometry::TrVec &trVector, CaloSubdetectorGeometry::IVec &iVector, CaloSubdetectorGeometry::DimVec &dimVector, CaloSubdetectorGeometry::IVec &dinsVector) const
 
virtual const std::vector
< DetId > & 
getValidDetIds (DetId::Detector det=DetId::Detector(0), int subdet=0) const override
 Get a list of valid detector ids (for the given subdetector) More...
 
const std::vector< DetId > & getValidGeomDetIds (void) const
 
 HGCalGeometry (const HGCalTopology &topology)
 
virtual void initializeParms () override
 
void localCorners (Pt3DVec &lc, const CCGFloat *pv, unsigned int i, Pt3D &ref)
 
virtual void newCell (const GlobalPoint &f1, const GlobalPoint &f2, const GlobalPoint &f3, const CCGFloat *parm, const DetId &detId) override
 
void sortDetIds ()
 
const HGCalTopologytopology () const
 
virtual ~HGCalGeometry ()
 
- Public Member Functions inherited from CaloSubdetectorGeometry
void allocateCorners (CaloCellGeometry::CornersVec::size_type n)
 
void allocatePar (ParVec::size_type n, unsigned int m)
 
 CaloSubdetectorGeometry ()
 
CaloCellGeometry::CornersMgrcornersMgr ()
 
CCGFloat deltaEta (const DetId &detId) const
 
CCGFloat deltaPhi (const DetId &detId) const
 
virtual void fillDefaultNamedParameters () const
 
virtual CellSet getCellSet (const GlobalPoint &r, double dR) const
 
virtual unsigned int numberOfParametersPerShape () const
 
virtual unsigned int numberOfShapes () const
 
virtual unsigned int numberOfTransformParms () const
 
ParMgrparMgr ()
 
const ParMgrparMgrConst () const
 
ParVecVecparVecVec ()
 
const ParVecVecparVecVec () const
 
virtual bool present (const DetId &id) const
 is this detid present in the geometry? More...
 
virtual ~CaloSubdetectorGeometry ()
 The base class DOES assume that it owns the CaloCellGeometry objects. More...
 

Static Public Member Functions

static std::string dbString ()
 
static std::string producerTag ()
 

Protected Member Functions

void addValidID (const DetId &id)
 
virtual const CaloCellGeometrycellGeomPtr (uint32_t index) const override
 
unsigned int getClosestCellIndex (const GlobalPoint &r) const
 
virtual unsigned int indexFor (const DetId &id) const override
 
unsigned int sizeForDenseIndex () const
 
- Protected Member Functions inherited from CaloSubdetectorGeometry
void addValidID (const DetId &id)
 
virtual unsigned int sizeForDenseIndex (const DetId &id) const
 

Private Attributes

CellVec m_cellVec
 
bool m_halfType
 
ForwardSubdetector m_subdet
 
const HGCalTopologym_topology
 
std::vector< DetIdm_validGeomIds
 

Additional Inherited Members

- Static Protected Member Functions inherited from CaloSubdetectorGeometry
static CCGFloat deltaR (const GlobalPoint &p1, const GlobalPoint &p2)
 
- Protected Attributes inherited from CaloSubdetectorGeometry
ParVecVec m_parVecVec
 
std::vector< DetIdm_validIds
 

Detailed Description

Definition at line 26 of file HGCalGeometry.h.

Member Typedef Documentation

Definition at line 39 of file HGCalGeometry.h.

Definition at line 32 of file HGCalGeometry.h.

typedef std::vector<FlatTrd> HGCalGeometry::CellVec

Definition at line 30 of file HGCalGeometry.h.

typedef std::vector<GlobalPoint> HGCalGeometry::CornersVec

Definition at line 37 of file HGCalGeometry.h.

typedef std::set<DetId> HGCalGeometry::DetIdSet

Definition at line 36 of file HGCalGeometry.h.

Definition at line 40 of file HGCalGeometry.h.

Definition at line 33 of file HGCalGeometry.h.

Definition at line 34 of file HGCalGeometry.h.

Member Enumeration Documentation

anonymous enum
Enumerator
k_NumberOfParametersPerShape 

Definition at line 42 of file HGCalGeometry.h.

anonymous enum
Enumerator
k_NumberOfShapes 

Definition at line 43 of file HGCalGeometry.h.

Constructor & Destructor Documentation

HGCalGeometry::HGCalGeometry ( const HGCalTopology topology)

Definition at line 24 of file HGCalGeometry.cc.

References gather_cfg::cout, CaloSubdetectorGeometry::m_validIds, topology(), and HGCalTopology::totalGeomModules().

25  : m_topology( topology_ ),
26  m_cellVec( topology_.totalGeomModules()),
27  m_validGeomIds( topology_.totalGeomModules()),
28  m_halfType( topology_.detectorType()),
29  m_subdet( topology_.subDetector()) {
30 
31  m_validIds.reserve( topology().totalModules());
32 #ifdef DebugLog
33  std::cout << "Expected total # of Geometry Modules "
34  << topology().totalGeomModules() << std::endl;
35 #endif
36 }
std::vector< DetId > m_validGeomIds
const HGCalTopology & m_topology
unsigned int totalGeomModules() const
std::vector< DetId > m_validIds
const HGCalTopology & topology() const
Definition: HGCalGeometry.h:96
ForwardSubdetector m_subdet
tuple cout
Definition: gather_cfg.py:145
CellVec m_cellVec
HGCalGeometry::~HGCalGeometry ( )
virtual

Definition at line 38 of file HGCalGeometry.cc.

38 { }

Member Function Documentation

void HGCalGeometry::addValidID ( const DetId id)
protected

Definition at line 265 of file HGCalGeometry.cc.

265  {
266  edm::LogError("HGCalGeom") << "HGCalGeometry::addValidID is not implemented";
267 }
std::string HGCalGeometry::cellElement ( ) const

Definition at line 223 of file HGCalGeometry.cc.

References HGCEE, HGCHEB, HGCHEF, and m_subdet.

223  {
224  if (m_subdet == HGCEE) return "HGCalEE";
225  else if (m_subdet == HGCHEF) return "HGCalHEFront";
226  else if (m_subdet == HGCHEB) return "HGCalHEBack";
227  else return "Unknown";
228 }
ForwardSubdetector m_subdet
const CaloCellGeometry * HGCalGeometry::cellGeomPtr ( uint32_t  index) const
overrideprotectedvirtual

Implements CaloSubdetectorGeometry.

Definition at line 254 of file HGCalGeometry.cc.

References m_cellVec, m_validGeomIds, and CaloCellGeometry::param().

Referenced by getGeometry(), and getSummary().

254  {
255  if ((index >= m_cellVec.size()) || (m_validGeomIds[index].rawId() == 0))
256  return 0;
257  const CaloCellGeometry* cell ( &m_cellVec[ index ] ) ;
258 #ifdef DebugLog
259  // std::cout << "cellGeomPtr " << m_cellVec[index];
260 #endif
261  if (0 == cell->param()) return 0;
262  return cell;
263 }
std::vector< DetId > m_validGeomIds
CellVec m_cellVec
static std::string HGCalGeometry::dbString ( )
inlinestatic

Definition at line 45 of file HGCalGeometry.h.

Referenced by CaloGeometryDBEP< T, U >::produceAligned().

45 { return "PHGCalRcd" ; }
void HGCalGeometry::fillNamedParams ( DDFilteredView  fv)
virtual

Definition at line 40 of file HGCalGeometry.cc.

40 {}
HGCalGeometry::DetIdSet HGCalGeometry::getCells ( const GlobalPoint r,
double  dR 
) const
overridevirtual

Get a list of all cells within a dR of the given cell.

The default implementation makes a loop over all cell geometries. Cleverer implementations are suggested to use rough conversions between eta/phi and ieta/iphi and test on the boundaries.

Reimplemented from CaloSubdetectorGeometry.

Definition at line 219 of file HGCalGeometry.cc.

219  {
221  return dss;
222 }
std::set< DetId > DetIdSet
Definition: HGCalGeometry.h:36
DetId HGCalGeometry::getClosestCell ( const GlobalPoint r) const
overridevirtual

Reimplemented from CaloSubdetectorGeometry.

Definition at line 183 of file HGCalGeometry.cc.

References HGCalDDDConstants::assignCell(), gather_cfg::cout, HGCalTopology::dddConstants(), HGCalTopology::decode(), HGCalTopology::encode(), HGCalDDDConstants::geomMode(), getClosestCellIndex(), HGCalTopology::DecodedDetId::iCell, HGCalTopology::DecodedDetId::iLay, HGCalTopology::DecodedDetId::iSec, HGCalTopology::DecodedDetId::iSubSec, m_cellVec, m_validGeomIds, Square, topology(), HGCalDDDConstants::waferTypeT(), PV3DBase< T, PVType, FrameType >::x(), PV3DBase< T, PVType, FrameType >::y(), PV3DBase< T, PVType, FrameType >::z(), and HGCalTopology::DecodedDetId::zside.

183  {
184  unsigned int cellIndex = getClosestCellIndex(r);
185  if (cellIndex < m_cellVec.size()) {
187  HepGeom::Point3D<float> local;
188  if (topology().dddConstants().geomMode() == HGCalGeometryMode::Square) {
189  local = m_cellVec[cellIndex].getLocal(r);
190  } else {
191  if (r.z() > 0) local = HepGeom::Point3D<float>(r.x(),r.y(),0);
192  else local = HepGeom::Point3D<float>(-r.x(),r.y(),0);
193  }
194  std::pair<int,int> kxy =
195  topology().dddConstants().assignCell(local.x(),local.y(),id_.iLay,
196  id_.iSubSec,true);
197  id_.iCell = kxy.second;
199  id_.iSubSec = kxy.first;
200  } else {
201  id_.iSec = kxy.first;
202  id_.iSubSec = topology().dddConstants().waferTypeT(kxy.first);
203  if (id_.iSubSec != 1) id_.iSubSec = -1;
204  }
205 #ifdef DebugLog
206  std::cout << "getClosestCell: local " << local << " Id " << id_.zside
207  << ":" << id_.iLay << ":" << id_.iSec << ":" << id_.iSubSec
208  << ":" << id_.iCell << std::endl;
209 #endif
210 
211  //check if returned cell is valid
212  if (id_.iCell>=0) return topology().encode(id_);
213  }
214 
215  //if not valid or out of bounds return a null DetId
216  return DetId();
217 }
std::vector< DetId > m_validGeomIds
unsigned int getClosestCellIndex(const GlobalPoint &r) const
T y() const
Definition: PV3DBase.h:63
DetId encode(const DecodedDetId &id_) const
T z() const
Definition: PV3DBase.h:64
const HGCalTopology & topology() const
Definition: HGCalGeometry.h:96
HGCalGeometryMode geomMode() const
DecodedDetId decode(const DetId &id) const
Definition: DetId.h:18
const HGCalDDDConstants & dddConstants() const
std::pair< int, int > assignCell(float x, float y, int lay, int subSec, bool reco) const
tuple cout
Definition: gather_cfg.py:145
T x() const
Definition: PV3DBase.h:62
int waferTypeT(int wafer) const
CellVec m_cellVec
unsigned int HGCalGeometry::getClosestCellIndex ( const GlobalPoint r) const
protected

Definition at line 270 of file HGCalGeometry.cc.

References gather_cfg::cout, getPosition(), relval_2017::k, m_cellVec, M_PI, PV3DBase< T, PVType, FrameType >::phi(), z, and PV3DBase< T, PVType, FrameType >::z().

Referenced by getClosestCell().

270  {
271 
272  float phip = r.phi();
273  float zp = r.z();
274  unsigned int cellIndex = m_cellVec.size();
275  float dzmin(9999), dphimin(9999), dphi10(0.175);
276  for (unsigned int k=0; k<m_cellVec.size(); ++k) {
277  float dphi = phip-m_cellVec[k].phiPos();
278  while (dphi > M_PI) dphi -= 2*M_PI;
279  while (dphi <= -M_PI) dphi += 2*M_PI;
280  if (fabs(dphi) < dphi10) {
281  float dz = fabs(zp - m_cellVec[k].getPosition().z());
282  if (dz < (dzmin+0.001)) {
283  dzmin = dz;
284  if (fabs(dphi) < (dphimin+0.01)) {
285  cellIndex = k;
286  dphimin = fabs(dphi);
287  } else {
288  if (cellIndex >= m_cellVec.size()) cellIndex = k;
289  }
290  }
291  }
292  }
293 #ifdef DebugLog
294  std::cout << "getClosestCellIndex::Input " << zp << ":" << phip << " Index "
295  << cellIndex;
296  if (cellIndex < m_cellVec.size())
297  std::cout << " Cell z " << m_cellVec[cellIndex].getPosition().z() << ":"
298  << dzmin << " phi " << m_cellVec[cellIndex].phiPos() << ":"
299  << dphimin;
300  std::cout << std::endl;
301 
302 #endif
303  return cellIndex;
304 }
Geom::Phi< T > phi() const
Definition: PV3DBase.h:69
GlobalPoint getPosition(const DetId &id) const
T z() const
Definition: PV3DBase.h:64
#define M_PI
tuple cout
Definition: gather_cfg.py:145
CellVec m_cellVec
HGCalGeometry::CornersVec HGCalGeometry::getCorners ( const DetId id) const

Returns the corner points of this cell's volume.

Definition at line 158 of file HGCalGeometry.cc.

References HGCalTopology::dddConstants(), HGCalTopology::decode(), i, HGCalTopology::DecodedDetId::iCell, HGCalTopology::DecodedDetId::iLay, indexFor(), HGCalTopology::DecodedDetId::iSec, HGCalTopology::DecodedDetId::iSubSec, HGCalDDDConstants::locateCell(), HGCalDDDConstants::locateCellHex(), m_cellVec, Square, topology(), and create_public_lumi_plots::xy.

158  {
159 
160  HGCalGeometry::CornersVec co (8, GlobalPoint(0,0,0));
161  unsigned int cellIndex = indexFor(id);
162  if (cellIndex < m_cellVec.size()) {
164  std::pair<float,float> xy;
165  if (topology().dddConstants().geomMode() == HGCalGeometryMode::Square) {
166  xy = topology().dddConstants().locateCell(id_.iCell,id_.iLay,id_.iSubSec,true);
167  } else {
168  xy = topology().dddConstants().locateCellHex(id_.iCell,id_.iSec,true);
169  }
170  float dz = m_cellVec[cellIndex].param()[0];
171  float dx = 0.5*m_cellVec[cellIndex].param()[11];
172  static const int signx[] = {-1,-1,1,1,-1,-1,1,1};
173  static const int signy[] = {-1,1,1,-1,-1,1,1,-1};
174  static const int signz[] = {-1,-1,-1,-1,1,1,1,1};
175  for (unsigned int i = 0; i != 8; ++i) {
176  const HepGeom::Point3D<float> lcoord(xy.first+signx[i]*dx,xy.second+signy[i]*dx,signz[i]*dz);
177  co[i] = m_cellVec[cellIndex].getPosition(lcoord);
178  }
179  }
180  return co;
181 }
int i
Definition: DBlmapReader.cc:9
Global3DPoint GlobalPoint
Definition: GlobalPoint.h:10
std::vector< GlobalPoint > CornersVec
Definition: HGCalGeometry.h:37
std::pair< float, float > locateCell(int cell, int lay, int type, bool reco) const
std::pair< float, float > locateCellHex(int cell, int wafer, bool reco) const
const HGCalTopology & topology() const
Definition: HGCalGeometry.h:96
virtual unsigned int indexFor(const DetId &id) const override
DecodedDetId decode(const DetId &id) const
const HGCalDDDConstants & dddConstants() const
CellVec m_cellVec
const CaloCellGeometry * HGCalGeometry::getGeometry ( const DetId id) const
overridevirtual

Get the cell geometry of a given detector id. Should return false if not found.

Reimplemented from CaloSubdetectorGeometry.

Definition at line 111 of file HGCalGeometry.cc.

References cellGeomPtr(), HGCEEDetId::geometryCell(), HGCHEDetId::geometryCell(), HGCalDetId::geometryCell(), HGCEE, Square, and topology().

Referenced by PFHGCalRecHitCreator< DET, Layer, subdet >::importRecHits().

111  {
112  if (id == DetId()) return 0; // nothing to get
113  DetId geoId;
114  if (topology().dddConstants().geomMode() == HGCalGeometryMode::Square) {
115  geoId = (id.subdetId() == HGCEE ?
116  (DetId)(HGCEEDetId(id).geometryCell()) :
117  (DetId)(HGCHEDetId(id).geometryCell()));
118  } else {
119  geoId = (DetId)(HGCalDetId(id).geometryCell());
120  }
121  const uint32_t cellIndex (topology().detId2denseGeomId(geoId));
122  /*
123  if (cellIndex < m_cellVec.size()) {
124  HGCalTopology::DecodedDetId id_ = topology().decode(id);
125  std::pair<float,float> xy = topology().dddConstants().locateCell(id_iCell,id_iLay,id_.iSubSec,true);
126  const HepGeom::Point3D<float> lcoord(xy.first,xy.second,0);
127  std::auto_ptr<FlatTrd> cellGeom(new FlatTrd(m_cellVec[cellIndex],lcoord));
128  return cellGeom.release();
129  }
130  */
131  return cellGeomPtr (cellIndex);
132 
133 }
HGCalDetId geometryCell() const
Definition: HGCalDetId.h:36
HGCHEDetId geometryCell() const
Definition: HGCHEDetId.cc:46
const HGCalTopology & topology() const
Definition: HGCalGeometry.h:96
Definition: DetId.h:18
HGCEEDetId geometryCell() const
Definition: HGCEEDetId.h:34
virtual const CaloCellGeometry * cellGeomPtr(uint32_t index) const override
GlobalPoint HGCalGeometry::getPosition ( const DetId id) const

Definition at line 135 of file HGCalGeometry.cc.

References gather_cfg::cout, HGCalTopology::dddConstants(), HGCalTopology::decode(), HGCalTopology::DecodedDetId::iCell, HGCalTopology::DecodedDetId::iLay, indexFor(), HGCalTopology::DecodedDetId::iSec, HGCalTopology::DecodedDetId::iSubSec, HGCalDDDConstants::locateCell(), HGCalDDDConstants::locateCellHex(), m_cellVec, Square, topology(), and create_public_lumi_plots::xy.

Referenced by getClosestCellIndex().

135  {
136 
137  unsigned int cellIndex = indexFor(id);
138  GlobalPoint glob;
139  if (cellIndex < m_cellVec.size()) {
141  std::pair<float,float> xy;
142  if (topology().dddConstants().geomMode() == HGCalGeometryMode::Square) {
143  xy = topology().dddConstants().locateCell(id_.iCell,id_.iLay,id_.iSubSec,true);
144  } else {
145  xy = topology().dddConstants().locateCellHex(id_.iCell,id_.iSec,true);
146  }
147  const HepGeom::Point3D<float> lcoord(xy.first,xy.second,0);
148  glob = m_cellVec[cellIndex].getPosition(lcoord);
149 #ifdef DebugLog
150  std::cout << "getPosition:: index " << cellIndex << " Local " << lcoord.x()
151  << ":" << lcoord.y() << " ID " << id_.iCell << ":" << id_.iLay
152  << " Global " << glob << std::endl;
153 #endif
154  }
155  return glob;
156 }
std::pair< float, float > locateCell(int cell, int lay, int type, bool reco) const
std::pair< float, float > locateCellHex(int cell, int wafer, bool reco) const
const HGCalTopology & topology() const
Definition: HGCalGeometry.h:96
virtual unsigned int indexFor(const DetId &id) const override
DecodedDetId decode(const DetId &id) const
const HGCalDDDConstants & dddConstants() const
tuple cout
Definition: gather_cfg.py:145
CellVec m_cellVec
void HGCalGeometry::getSummary ( CaloSubdetectorGeometry::TrVec trVector,
CaloSubdetectorGeometry::IVec iVector,
CaloSubdetectorGeometry::DimVec dimVector,
CaloSubdetectorGeometry::IVec dinsVector 
) const
virtual

Reimplemented from CaloSubdetectorGeometry.

Definition at line 324 of file HGCalGeometry.cc.

References HGCalParameters::hgtrap::alpha, HGCalParameters::hgtrap::bl, cellGeomPtr(), HGCalParameters::hgtrap::cellSize, HGCalTopology::dddConstants(), HGCalParameters::hgtrap::dz, HGCalDDDConstants::getModule(), CaloCellGeometry::getPosition(), CaloCellGeometry::getTransform(), HGCalDDDConstants::getTrForm(), HGCalDDDConstants::getTrFormN(), HGCalParameters::hgtrap::h, HGCEE, i, relval_2017::k, k_NumberOfParametersPerShape, k_NumberOfShapes, HGCalParameters::hgtrform::lay, HGCEEDetId::layer(), HGCHEDetId::layer(), m_validGeomIds, CaloSubdetectorGeometry::numberOfParametersPerShape(), CaloSubdetectorGeometry::numberOfShapes(), CaloSubdetectorGeometry::numberOfTransformParms(), findQualityFiles::rr, HGCalDDDConstants::sectors(), Square, DetId::subdetId(), HGCalParameters::hgtrap::tl, topology(), HGCalTopology::totalGeomModules(), groupFilesInBlocks::tt, HGCalDDDConstants::volumes(), and HGCalDDDConstants::waferInLayer().

327  {
328 
329  unsigned int numberOfCells = topology().totalGeomModules(); // total Geom Modules both sides
332 
333  trVector.reserve( numberOfCells * numberOfTransformParms());
334  iVector.reserve( numberOfCells );
335  dimVector.reserve( numberOfShapes * numberOfParametersPerShape );
336  dinsVector.reserve( numberOfCells );
337 
338  if (topology().geomMode() == HGCalGeometryMode::Square) {
339  for (unsigned int k=0; k <topology().dddConstants().volumes(); ++k) {
342  params[0] = vol.dz;
343  params[1] = params[2] = 0;
344  params[3] = params[7] = vol.h;
345  params[4] = params[8] = vol.bl;
346  params[5] = params[9] = vol.tl;
347  params[6] = params[10]= vol.alpha;
348  params[11]= vol.cellSize;
349  dimVector.insert( dimVector.end(), params.begin(), params.end());
350  }
351  } else {
352  for (unsigned itr=0; itr<topology().dddConstants().getTrFormN(); ++itr) {
354  int layer = mytr.lay;
355  for (int wafer=0; wafer<topology().dddConstants().sectors(); ++wafer) {
356  if (topology().dddConstants().waferInLayer(wafer,layer,true)) {
357  HGCalParameters::hgtrap vol = topology().dddConstants().getModule(wafer, true, true);
359  params[0] = vol.dz;
360  params[1] = params[2] = 0;
361  params[3] = params[7] = vol.h;
362  params[4] = params[8] = vol.bl;
363  params[5] = params[9] = vol.tl;
364  params[6] = params[10]= vol.alpha;
365  params[11]= vol.cellSize;
366  dimVector.insert( dimVector.end(), params.begin(), params.end());
367  }
368  }
369  }
370  }
371 
372  for( unsigned int i( 0 ); i < numberOfCells; ++i )
373  {
374  DetId detId = m_validGeomIds[i];
375  int layer = ((detId.subdetId() == ForwardSubdetector::HGCEE) ?
376  (HGCEEDetId(detId).layer()) :
377  (HGCHEDetId(detId).layer()));
378  dinsVector.push_back( topology().detId2denseGeomId( detId ));
379  iVector.push_back( layer );
380 
381  Tr3D tr;
382  const CaloCellGeometry* ptr( cellGeomPtr( i ));
383  if( 0 != ptr )
384  {
385  ptr->getTransform( tr, ( Pt3DVec* ) 0 );
386 
387  if( Tr3D() == tr ) // there is no rotation
388  {
389  const GlobalPoint& gp( ptr->getPosition());
390  tr = HepGeom::Translate3D( gp.x(), gp.y(), gp.z());
391  }
392 
393  const CLHEP::Hep3Vector tt( tr.getTranslation());
394  trVector.push_back( tt.x());
395  trVector.push_back( tt.y());
396  trVector.push_back( tt.z());
397  if( 6 == numberOfTransformParms())
398  {
399  const CLHEP::HepRotation rr( tr.getRotation());
400  const ROOT::Math::Transform3D rtr( rr.xx(), rr.xy(), rr.xz(), tt.x(),
401  rr.yx(), rr.yy(), rr.yz(), tt.y(),
402  rr.zx(), rr.zy(), rr.zz(), tt.z());
404  rtr.GetRotation( ea );
405  trVector.push_back( ea.Phi());
406  trVector.push_back( ea.Theta());
407  trVector.push_back( ea.Psi());
408  }
409  }
410  }
411 }
std::vector< DetId > m_validGeomIds
int i
Definition: DBlmapReader.cc:9
virtual unsigned int numberOfParametersPerShape() const
HGCalParameters::hgtrform getTrForm(unsigned int k) const
int layer() const
get the layer #
Definition: HGCHEDetId.h:50
unsigned int totalGeomModules() const
unsigned int getTrFormN() const
virtual unsigned int numberOfShapes() const
std::vector< float > ParmVec
const HGCalTopology & topology() const
Definition: HGCalGeometry.h:96
int sectors() const
int subdetId() const
get the contents of the subdetector field (not cast into any detector&#39;s numbering enum) ...
Definition: DetId.h:37
Definition: DetId.h:18
AlgebraicVector EulerAngles
Definition: Definitions.h:36
int layer() const
get the layer #
Definition: HGCEEDetId.h:49
const HGCalDDDConstants & dddConstants() const
CaloCellGeometry::Pt3DVec Pt3DVec
CaloCellGeometry::Tr3D Tr3D
virtual const CaloCellGeometry * cellGeomPtr(uint32_t index) const override
virtual unsigned int numberOfTransformParms() const
HGCalParameters::hgtrap getModule(unsigned int k, bool hexType, bool reco) const
bool waferInLayer(int wafer, int lay, bool reco) const
unsigned int volumes() const
virtual const std::vector<DetId>& HGCalGeometry::getValidDetIds ( DetId::Detector  det = DetId::Detector(0),
int  subdet = 0 
) const
inlineoverridevirtual

Get a list of valid detector ids (for the given subdetector)

Note
The implementation in this class is relevant for SubdetectorGeometries which handle only a single subdetector at a time. It does not look at the det and subdet arguments.

Reimplemented from CaloSubdetectorGeometry.

Definition at line 76 of file HGCalGeometry.h.

References CaloSubdetectorGeometry::m_validIds.

76 { return m_validIds; }
std::vector< DetId > m_validIds
const std::vector<DetId>& HGCalGeometry::getValidGeomDetIds ( void  ) const
inline

Definition at line 77 of file HGCalGeometry.h.

References m_validGeomIds.

77 { return m_validGeomIds; }
std::vector< DetId > m_validGeomIds
unsigned int HGCalGeometry::indexFor ( const DetId id) const
overrideprotectedvirtual

Reimplemented from CaloSubdetectorGeometry.

Definition at line 230 of file HGCalGeometry.cc.

References gather_cfg::cout, TauDecayModes::dec, HGCalTopology::detId2denseGeomId(), HGCEEDetId::geometryCell(), HGCHEDetId::geometryCell(), HGCalDetId::geometryCell(), HGCEE, m_cellVec, DetId::rawId(), Square, and topology().

Referenced by getCorners(), and getPosition().

230  {
231  unsigned int cellIndex = m_cellVec.size();
232  if (id != DetId()) {
233  DetId geoId;
234  if (topology().dddConstants().geomMode() == HGCalGeometryMode::Square) {
235  geoId = (id.subdetId() == HGCEE ?
236  (DetId)(HGCEEDetId(id).geometryCell()) :
237  (DetId)(HGCHEDetId(id).geometryCell()));
238  } else {
239  geoId = (DetId)(HGCalDetId(id).geometryCell());
240  }
241  cellIndex = topology().detId2denseGeomId(geoId);
242 #ifdef DebugLog
243  std::cout << "indexFor " << std::hex << id.rawId() << ":" << geoId.rawId()
244  << std::dec << " index " << cellIndex << std::endl;
245 #endif
246  }
247  return cellIndex;
248 }
uint32_t rawId() const
get the raw id
Definition: DetId.h:43
HGCalDetId geometryCell() const
Definition: HGCalDetId.h:36
virtual uint32_t detId2denseGeomId(const DetId &id) const
HGCHEDetId geometryCell() const
Definition: HGCHEDetId.cc:46
const HGCalTopology & topology() const
Definition: HGCalGeometry.h:96
Definition: DetId.h:18
HGCEEDetId geometryCell() const
Definition: HGCEEDetId.h:34
tuple cout
Definition: gather_cfg.py:145
CellVec m_cellVec
void HGCalGeometry::initializeParms ( )
overridevirtual

Reimplemented from CaloSubdetectorGeometry.

Definition at line 42 of file HGCalGeometry.cc.

42  {
43 }
void HGCalGeometry::localCorners ( Pt3DVec lc,
const CCGFloat pv,
unsigned int  i,
Pt3D ref 
)

Definition at line 45 of file HGCalGeometry.cc.

References FlatTrd::localCorners().

48  {
49  FlatTrd::localCorners( lc, pv, ref ) ;
50 }
static void localCorners(Pt3DVec &vec, const CCGFloat *pv, Pt3D &ref)
Definition: FlatTrd.cc:159
void HGCalGeometry::newCell ( const GlobalPoint f1,
const GlobalPoint f2,
const GlobalPoint f3,
const CCGFloat parm,
const DetId detId 
)
overridevirtual

Implements CaloSubdetectorGeometry.

Definition at line 52 of file HGCalGeometry.cc.

References CaloSubdetectorGeometry::cornersMgr(), gather_cfg::cout, HGCalTopology::dddConstants(), TauDecayModes::dec, HGCalTopology::decode(), alcaDQMUpload::encode(), HGCEEDetId::geometryCell(), HGCHEDetId::geometryCell(), HGCalDetId::geometryCell(), HGCEE, m_cellVec, m_halfType, m_subdet, m_validGeomIds, CaloSubdetectorGeometry::m_validIds, HGCalDDDConstants::maxCells(), HGCalDDDConstants::numberCellsHexagon(), DetId::rawId(), Square, DetId::subdetId(), topology(), PV3DBase< T, PVType, FrameType >::x(), PV3DBase< T, PVType, FrameType >::y(), and PV3DBase< T, PVType, FrameType >::z().

Referenced by HGCalGeometryLoader::buildGeom().

56  {
57 
58  DetId geomId;
59  int cells;
61  if (topology().dddConstants().geomMode() == HGCalGeometryMode::Square) {
62  geomId = (detId.subdetId() == HGCEE ?
63  (DetId)(HGCEEDetId(detId).geometryCell()) :
64  (DetId)(HGCHEDetId(detId).geometryCell()));
65  cells = topology().dddConstants().maxCells(id.iLay,true);
66  } else {
67  geomId = (DetId)(HGCalDetId(detId).geometryCell());
68  cells = topology().dddConstants().numberCellsHexagon(id.iSec);
69  }
70  const uint32_t cellIndex (topology().detId2denseGeomId(detId));
71 
72  m_cellVec.at( cellIndex ) = FlatTrd( cornersMgr(), f1, f2, f3, parm ) ;
73  m_validGeomIds.at( cellIndex ) = geomId ;
74 
75 #ifdef DebugLog
76  unsigned int nOld = m_validIds.size();
77 #endif
78  for (int cell = 0; cell < cells; ++cell) {
79  id.iCell = cell;
80  m_validIds.push_back( topology().encode(id));
81  if ((topology().dddConstants().geomMode() == HGCalGeometryMode::Square) &&
82  (!m_halfType)) {
83  id.iSubSec = -id.iSubSec;
84  m_validIds.push_back( topology().encode(id));
85  id.iSubSec = -id.iSubSec;
86  }
87  }
88 
89 #ifdef DebugLog
90  std::cout << "HGCalGeometry::newCell-> [" << cellIndex << "]"
91  << " front:" << f1.x() << '/' << f1.y() << '/' << f1.z()
92  << " back:" << f2.x() << '/' << f2.y() << '/' << f2.z()
93  << " eta|phi " << m_cellVec[cellIndex].etaPos() << ":"
94  << m_cellVec[cellIndex].phiPos() << " id:";
95  if (topology().dddConstants().geomMode() != HGCalGeometryMode::Square) {
96  std::cout << HGCalDetId(detId);
97  } else if (m_subdet == HGCEE) {
98  std::cout << HGCEEDetId(detId);
99  } else {
100  std::cout << HGCHEDetId(detId);
101  }
102  unsigned int nNew = m_validIds.size();
103  std::cout << " with valid DetId from " << nOld << " to " << nNew
104  << std::endl;
105  std::cout << "Cell[" << cellIndex << "] " << std::hex << geomId.rawId()
106  << ":" << m_validGeomIds[cellIndex].rawId() << std::dec
107  << std::endl;
108 #endif
109 }
std::vector< DetId > m_validGeomIds
A base class to handle the particular shape of HGCal volumes.
Definition: FlatTrd.h:19
T y() const
Definition: PV3DBase.h:63
uint32_t rawId() const
get the raw id
Definition: DetId.h:43
HGCalDetId geometryCell() const
Definition: HGCalDetId.h:36
int numberCellsHexagon(int wafer) const
HGCHEDetId geometryCell() const
Definition: HGCHEDetId.cc:46
std::vector< DetId > m_validIds
T z() const
Definition: PV3DBase.h:64
const HGCalTopology & topology() const
Definition: HGCalGeometry.h:96
int subdetId() const
get the contents of the subdetector field (not cast into any detector&#39;s numbering enum) ...
Definition: DetId.h:37
DecodedDetId decode(const DetId &id) const
Definition: DetId.h:18
ForwardSubdetector m_subdet
const HGCalDDDConstants & dddConstants() const
HGCEEDetId geometryCell() const
Definition: HGCEEDetId.h:34
CaloCellGeometry::CornersMgr * cornersMgr()
tuple cout
Definition: gather_cfg.py:145
int maxCells(bool reco) const
T x() const
Definition: PV3DBase.h:62
CellVec m_cellVec
static std::string HGCalGeometry::producerTag ( )
inlinestatic

Definition at line 93 of file HGCalGeometry.h.

Referenced by PCaloGeometryBuilder::beginRun().

93 { return "HGCal" ; }
unsigned int HGCalGeometry::sizeForDenseIndex ( ) const
protected

Definition at line 250 of file HGCalGeometry.cc.

References topology(), and HGCalTopology::totalGeomModules().

250  {
251  return topology().totalGeomModules();
252 }
unsigned int totalGeomModules() const
const HGCalTopology & topology() const
Definition: HGCalGeometry.h:96
void HGCalGeometry::sortDetIds ( void  )

Definition at line 318 of file HGCalGeometry.cc.

References CaloSubdetectorGeometry::m_validIds.

Referenced by HGCalGeometryLoader::build().

318  {
319  m_validIds.shrink_to_fit();
320  std::sort( m_validIds.begin(), m_validIds.end(), rawIdSort());
321 }
std::vector< DetId > m_validIds
const HGCalTopology& HGCalGeometry::topology ( ) const
inline

Definition at line 96 of file HGCalGeometry.h.

References m_topology.

Referenced by getClosestCell(), getCorners(), getGeometry(), getPosition(), getSummary(), HGCalGeometry(), indexFor(), newCell(), and sizeForDenseIndex().

96 {return m_topology;}
const HGCalTopology & m_topology

Member Data Documentation

CellVec HGCalGeometry::m_cellVec
private
bool HGCalGeometry::m_halfType
private

Definition at line 114 of file HGCalGeometry.h.

Referenced by newCell().

ForwardSubdetector HGCalGeometry::m_subdet
private

Definition at line 115 of file HGCalGeometry.h.

Referenced by cellElement(), and newCell().

const HGCalTopology& HGCalGeometry::m_topology
private

Definition at line 110 of file HGCalGeometry.h.

Referenced by topology().

std::vector<DetId> HGCalGeometry::m_validGeomIds
private

Definition at line 113 of file HGCalGeometry.h.

Referenced by cellGeomPtr(), getClosestCell(), getSummary(), getValidGeomDetIds(), and newCell().