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
CaloTowerGeometry Class Reference

#include <CaloTowerGeometry.h>

Inheritance diagram for CaloTowerGeometry:
CaloSubdetectorGeometry

Public Types

enum  { k_NumberOfParametersPerShape = 5 }
 
typedef CaloTowerGeometryRecord AlignedRecord
 
typedef CaloTowerAlignmentRcd AlignmentRecord
 
typedef CaloCellGeometry::CCGFloat CCGFloat
 
typedef std::vector
< IdealObliquePrism
CellVec
 
typedef CaloTowerDetId DetIdType
 
typedef PCaloTowerRcd 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

unsigned int alignmentTransformIndexGlobal (const DetId &id)
 
unsigned int alignmentTransformIndexLocal (const DetId &id)
 
 CaloTowerGeometry (const CaloTowerTopology *cttopo_)
 
virtual const CaloCellGeometrygetGeometry (const DetId &id) const
 Get the cell geometry of a given detector id. Should return false if not found. More...
 
virtual void getSummary (CaloSubdetectorGeometry::TrVec &trVector, CaloSubdetectorGeometry::IVec &iVector, CaloSubdetectorGeometry::DimVec &dimVector, CaloSubdetectorGeometry::IVec &dinsVector) const
 
virtual void newCell (const GlobalPoint &f1, const GlobalPoint &f2, const GlobalPoint &f3, const CCGFloat *parm, const DetId &detId)
 
virtual unsigned int numberOfCellsForCorners () const
 
virtual unsigned int numberOfParametersPerShape () const
 
virtual unsigned int numberOfShapes () const
 
virtual ~CaloTowerGeometry ()
 
- 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 DetIdSet getCells (const GlobalPoint &r, double dR) const
 Get a list of all cells within a dR of the given cell. More...
 
virtual CellSet getCellSet (const GlobalPoint &r, double dR) const
 
virtual DetId getClosestCell (const GlobalPoint &r) const
 
virtual const std::vector
< DetId > & 
getValidDetIds (DetId::Detector det=DetId::Detector(0), int subdet=0) const
 Get a list of valid detector ids (for the given subdetector) More...
 
virtual void initializeParms ()
 
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 void localCorners (Pt3DVec &lc, const CCGFloat *pv, unsigned int i, Pt3D &ref)
 
static unsigned int numberOfAlignments ()
 
static std::string producerTag ()
 

Protected Member Functions

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

Private Attributes

const CaloTowerTopologycttopo
 
int k_NumberOfCellsForCorners
 
int k_NumberOfShapes
 
CellVec m_cellVec
 
CaloSubdetectorGeometry::IVec m_dins
 

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

Only DetId::Calo, subdet=1 DetIds are handled by this class.

Author
J. Mans - Minnesota

Definition at line 16 of file CaloTowerGeometry.h.

Member Typedef Documentation

Definition at line 27 of file CaloTowerGeometry.h.

Definition at line 26 of file CaloTowerGeometry.h.

Definition at line 22 of file CaloTowerGeometry.h.

Definition at line 20 of file CaloTowerGeometry.h.

Definition at line 29 of file CaloTowerGeometry.h.

Definition at line 28 of file CaloTowerGeometry.h.

Definition at line 23 of file CaloTowerGeometry.h.

Definition at line 24 of file CaloTowerGeometry.h.

Member Enumeration Documentation

anonymous enum
Enumerator
k_NumberOfParametersPerShape 

Definition at line 35 of file CaloTowerGeometry.h.

Constructor & Destructor Documentation

CaloTowerGeometry::CaloTowerGeometry ( const CaloTowerTopology cttopo_)

Definition at line 12 of file CaloTowerGeometry.cc.

12  :
13  cttopo(cttopo_),
17 {
18 }
int lastHFRing() const
const CaloTowerTopology * cttopo
uint32_t sizeForDenseIndexing() const
CaloTowerGeometry::~CaloTowerGeometry ( )
virtual

Definition at line 21 of file CaloTowerGeometry.cc.

21 { }

Member Function Documentation

unsigned int CaloTowerGeometry::alignmentTransformIndexGlobal ( const DetId id)

Definition at line 42 of file CaloTowerGeometry.cc.

References DetId::Calo.

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

42  {
43  return (unsigned int) DetId::Calo - 1 ;
44 }
unsigned int CaloTowerGeometry::alignmentTransformIndexLocal ( const DetId id)

Definition at line 25 of file CaloTowerGeometry.cc.

References assert(), cttopo, CaloTowerTopology::firstHEDoublePhiRing(), CaloTowerTopology::firstHFQuadPhiRing(), CaloGenericDetId::isCaloTower(), and hltrates_dqm_sourceclient-live_cfg::offset.

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

25  {
26 
27  const CaloGenericDetId gid ( id ) ;
28  assert( gid.isCaloTower() ) ;
29 
30  const CaloTowerDetId cid ( id ) ;
31  const int iea ( cid.ietaAbs() ) ;
32  const unsigned int ip ( ( cid.iphi() - 1 )/4 ) ;
33  const int izoff ( ( cid.zside() + 1 )/2 ) ;
34  const unsigned int offset ( izoff*3*18) ;
35 
36  return ( offset + ip +
37  ( cttopo->firstHFQuadPhiRing() <= iea ? 36 :
38  ( cttopo->firstHEDoublePhiRing() <= iea ? 18 : 0 ) ) ) ;
39 }
assert(m_qm.get())
const CaloTowerTopology * cttopo
int firstHEDoublePhiRing() const
int firstHFQuadPhiRing() const
const CaloCellGeometry * CaloTowerGeometry::cellGeomPtr ( uint32_t  index) const
protectedvirtual

Implements CaloSubdetectorGeometry.

Definition at line 74 of file CaloTowerGeometry.cc.

References m_cellVec, and CaloCellGeometry::param().

Referenced by getGeometry(), and getSummary().

74  {
75  const CaloCellGeometry* cell ( &m_cellVec[ index ] ) ;
76  return ( m_cellVec.size() < index ||
77  0 == cell->param() ? 0 : cell ) ;
78 }
static std::string CaloTowerGeometry::dbString ( )
inlinestatic

Definition at line 37 of file CaloTowerGeometry.h.

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

37 { return "PCaloTowerRcd" ; }
virtual const CaloCellGeometry* CaloTowerGeometry::getGeometry ( const DetId id) const
inlinevirtual

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

Reimplemented from CaloSubdetectorGeometry.

Definition at line 68 of file CaloTowerGeometry.h.

References cellGeomPtr(), cttopo, and CaloTowerTopology::denseIndex().

68  {
69  return cellGeomPtr( cttopo->denseIndex(id) ) ;
70  }
const CaloTowerTopology * cttopo
uint32_t denseIndex(const DetId &id) const
virtual const CaloCellGeometry * cellGeomPtr(uint32_t index) const
void CaloTowerGeometry::getSummary ( CaloSubdetectorGeometry::TrVec trVector,
CaloSubdetectorGeometry::IVec iVector,
CaloSubdetectorGeometry::DimVec dimVector,
CaloSubdetectorGeometry::IVec dinsVector 
) const
virtual

Reimplemented from CaloSubdetectorGeometry.

Definition at line 81 of file CaloTowerGeometry.cc.

References assert(), begin, EZArrayFL< T >::begin(), cellGeomPtr(), EZArrayFL< T >::end(), CaloCellGeometry::getPosition(), CaloCellGeometry::getTransform(), i, relval_2017::k, m_dins, numberOfCellsForCorners(), numberOfParametersPerShape(), numberOfShapes(), CaloSubdetectorGeometry::numberOfTransformParms(), convertSQLiteXML::ok, CaloCellGeometry::param(), CaloSubdetectorGeometry::parVecVec(), MetAnalyzer::pv(), findQualityFiles::rr, and groupFilesInBlocks::tt.

84  {
86  iVec.reserve( numberOfShapes()==1 ? 1 : numberOfCellsForCorners() ) ;
87  dVec.reserve( numberOfShapes()*numberOfParametersPerShape() ) ;
88  dinsVec.reserve(numberOfCellsForCorners());
89 
90  for (ParVecVec::const_iterator ivv (parVecVec().begin()) ;
91  ivv != parVecVec().end() ; ++ivv) {
92  const ParVec& pv ( *ivv ) ;
93  for (ParVec::const_iterator iv ( pv.begin() ) ; iv != pv.end() ; ++iv) {
94  dVec.push_back( *iv ) ;
95  }
96  }
97 
98  for (unsigned int i ( 0 ) ; i < numberOfCellsForCorners() ; ++i) {
99  Tr3D tr ;
100  const CaloCellGeometry* ptr ( cellGeomPtr( i ) ) ;
101 
102  if (0 != ptr) {
103  dinsVec.push_back( i );
104 
105  ptr->getTransform( tr, ( Pt3DVec* ) 0 ) ;
106 
107  if( Tr3D() == tr ) { // for preshower there is no rotation
108  const GlobalPoint& gp ( ptr->getPosition() ) ;
109  tr = HepGeom::Translate3D( gp.x(), gp.y(), gp.z() ) ;
110  }
111 
112  const CLHEP::Hep3Vector tt ( tr.getTranslation() ) ;
113  tVec.push_back( tt.x() ) ;
114  tVec.push_back( tt.y() ) ;
115  tVec.push_back( tt.z() ) ;
116  if (6 == numberOfTransformParms()) {
117  const CLHEP::HepRotation rr ( tr.getRotation() ) ;
118  const ROOT::Math::Transform3D rtr (rr.xx(), rr.xy(), rr.xz(), tt.x(),
119  rr.yx(), rr.yy(), rr.yz(), tt.y(),
120  rr.zx(), rr.zy(), rr.zz(), tt.z());
122  rtr.GetRotation( ea ) ;
123  tVec.push_back( ea.Phi() ) ;
124  tVec.push_back( ea.Theta() ) ;
125  tVec.push_back( ea.Psi() ) ;
126  }
127 
128  const CCGFloat* par ( ptr->param() ) ;
129 
130  unsigned int ishape ( 9999 ) ;
131  for( unsigned int ivv ( 0 ) ; ivv != parVecVec().size() ; ++ivv ) {
132  bool ok ( true ) ;
133  const CCGFloat* pv ( &(*parVecVec()[ivv].begin() ) ) ;
134  for( unsigned int k ( 0 ) ; k != numberOfParametersPerShape() ; ++k ) {
135  ok = ok && ( fabs( par[k] - pv[k] ) < 1.e-6 ) ;
136  }
137  if( ok ) {
138  ishape = ivv ;
139  break ;
140  }
141  }
142  assert( 9999 != ishape ) ;
143 
144  const unsigned int nn (( numberOfShapes()==1) ? (unsigned int)1 : m_dins.size() ) ;
145  if( iVec.size() < nn ) iVec.push_back( ishape ) ;
146  }
147  }
148 }
int i
Definition: DBlmapReader.cc:9
virtual unsigned int numberOfCellsForCorners() const
assert(m_qm.get())
virtual unsigned int numberOfParametersPerShape() const
CaloCellGeometry::CCGFloat CCGFloat
CaloSubdetectorGeometry::IVec m_dins
CaloCellGeometry::ParVec ParVec
AlgebraicVector EulerAngles
Definition: Definitions.h:36
CaloCellGeometry::Pt3DVec Pt3DVec
CaloCellGeometry::Tr3D Tr3D
virtual unsigned int numberOfShapes() const
MgrType::const_iterator const_iterator
Definition: EZArrayFL.h:27
#define begin
Definition: vmac.h:30
virtual unsigned int numberOfTransformParms() const
virtual const CaloCellGeometry * cellGeomPtr(uint32_t index) const
virtual unsigned int CaloTowerGeometry::indexFor ( const DetId id) const
inlineprotectedvirtual

Reimplemented from CaloSubdetectorGeometry.

Definition at line 80 of file CaloTowerGeometry.h.

References cttopo, and CaloTowerTopology::denseIndex().

80 { return cttopo->denseIndex(id); }
const CaloTowerTopology * cttopo
uint32_t denseIndex(const DetId &id) const
void CaloTowerGeometry::localCorners ( Pt3DVec lc,
const CCGFloat pv,
unsigned int  i,
Pt3D ref 
)
static

Definition at line 47 of file CaloTowerGeometry.cc.

References IdealObliquePrism::localCorners().

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

50  {
52 }
static void localCorners(Pt3DVec &vec, const CCGFloat *pv, Pt3D &ref)
void CaloTowerGeometry::newCell ( const GlobalPoint f1,
const GlobalPoint f2,
const GlobalPoint f3,
const CCGFloat parm,
const DetId detId 
)
virtual

Implements CaloSubdetectorGeometry.

Definition at line 55 of file CaloTowerGeometry.cc.

References CaloSubdetectorGeometry::addValidID(), assert(), CaloSubdetectorGeometry::cornersMgr(), cttopo, CaloTowerTopology::denseIndex(), CaloGenericDetId::isCaloTower(), m_cellVec, and m_dins.

59  {
60  const CaloGenericDetId cgid ( detId ) ;
61 
62  assert( cgid.isCaloTower() ) ;
63 
64  const CaloTowerDetId cid ( detId ) ;
65 
66  const unsigned int di ( cttopo->denseIndex(cid) ) ;
67 
68  m_cellVec[ di ] = IdealObliquePrism( f1, cornersMgr(), parm ) ;
69  addValidID( detId ) ;
70  m_dins.push_back( di );
71 }
assert(m_qm.get())
const CaloTowerTopology * cttopo
CaloSubdetectorGeometry::IVec m_dins
uint32_t denseIndex(const DetId &id) const
void addValidID(const DetId &id)
CaloCellGeometry::CornersMgr * cornersMgr()
static unsigned int CaloTowerGeometry::numberOfAlignments ( )
inlinestatic

Definition at line 49 of file CaloTowerGeometry.h.

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

49 { return 0 ; }
virtual unsigned int CaloTowerGeometry::numberOfCellsForCorners ( ) const
inlinevirtual
virtual unsigned int CaloTowerGeometry::numberOfParametersPerShape ( ) const
inlinevirtual
virtual unsigned int CaloTowerGeometry::numberOfShapes ( ) const
inlinevirtual
static std::string CaloTowerGeometry::producerTag ( )
inlinestatic
virtual unsigned int CaloTowerGeometry::sizeForDenseIndex ( const DetId id) const
inlineprotectedvirtual

Reimplemented from CaloSubdetectorGeometry.

Definition at line 81 of file CaloTowerGeometry.h.

References cttopo, and CaloTowerTopology::sizeForDenseIndexing().

81 { return cttopo->sizeForDenseIndexing(); }
const CaloTowerTopology * cttopo
uint32_t sizeForDenseIndexing() const

Member Data Documentation

const CaloTowerTopology* CaloTowerGeometry::cttopo
private
int CaloTowerGeometry::k_NumberOfCellsForCorners
private

Definition at line 85 of file CaloTowerGeometry.h.

Referenced by numberOfCellsForCorners().

int CaloTowerGeometry::k_NumberOfShapes
private

Definition at line 86 of file CaloTowerGeometry.h.

Referenced by numberOfShapes().

CellVec CaloTowerGeometry::m_cellVec
private

Definition at line 87 of file CaloTowerGeometry.h.

Referenced by cellGeomPtr(), and newCell().

CaloSubdetectorGeometry::IVec CaloTowerGeometry::m_dins
private

Definition at line 88 of file CaloTowerGeometry.h.

Referenced by getSummary(), and newCell().