CMS 3D CMS Logo

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< IdealObliquePrismCellVec
 
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< std::shared_ptr< const CaloCellGeometry > > 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)
 
std::shared_ptr< const CaloCellGeometrygetGeometry (const DetId &id) const override
 Get the cell geometry of a given detector id. Should return false if not found. More...
 
void getSummary (CaloSubdetectorGeometry::TrVec &trVector, CaloSubdetectorGeometry::IVec &iVector, CaloSubdetectorGeometry::DimVec &dimVector, CaloSubdetectorGeometry::IVec &dinsVector) const override
 
void newCell (const GlobalPoint &f1, const GlobalPoint &f2, const GlobalPoint &f3, const CCGFloat *parm, const DetId &detId) override
 
virtual unsigned int numberOfCellsForCorners () const
 
unsigned int numberOfParametersPerShape () const override
 
unsigned int numberOfShapes () const override
 
 ~CaloTowerGeometry () override
 
- Public Member Functions inherited from CaloSubdetectorGeometry
void allocateCorners (CaloCellGeometry::CornersVec::size_type n)
 
void allocatePar (ParVec::size_type n, unsigned int m)
 
 CaloSubdetectorGeometry ()
 
 CaloSubdetectorGeometry (const CaloSubdetectorGeometry &)=delete
 avoid copies More...
 
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
 
CaloSubdetectorGeometryoperator= (const CaloSubdetectorGeometry &)=delete
 
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

const CaloCellGeometrygetGeometryRawPtr (uint32_t index) const override
 
unsigned int indexFor (const DetId &id) const override
 
unsigned int sizeForDenseIndex (const DetId &id) const override
 
- Protected Member Functions inherited from CaloSubdetectorGeometry
void addValidID (const DetId &id)
 
virtual std::shared_ptr< const CaloCellGeometrycellGeomPtr (uint32_t index) const
 

Private Attributes

int k_NumberOfCellsForCorners
 
int k_NumberOfShapes
 
CellVec m_cellVec
 
const CaloTowerTopologym_cttopo
 
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 31 of file CaloTowerGeometry.h.

Constructor & Destructor Documentation

CaloTowerGeometry::CaloTowerGeometry ( const CaloTowerTopology cttopo)

Definition at line 12 of file CaloTowerGeometry.cc.

Referenced by numberOfCellsForCorners().

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

Definition at line 21 of file CaloTowerGeometry.cc.

Referenced by numberOfCellsForCorners().

21 { }

Member Function Documentation

unsigned int CaloTowerGeometry::alignmentTransformIndexGlobal ( const DetId id)

Definition at line 42 of file CaloTowerGeometry.cc.

References DetId::Calo.

Referenced by numberOfAlignments(), and 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 CaloTowerTopology::firstHEDoublePhiRing(), CaloTowerTopology::firstHFQuadPhiRing(), CaloGenericDetId::isCaloTower(), m_cttopo, and PFRecoTauDiscriminationByIsolation_cfi::offset.

Referenced by numberOfAlignments(), and 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  ( m_cttopo->firstHFQuadPhiRing() <= iea ? 36 :
38  ( m_cttopo->firstHEDoublePhiRing() <= iea ? 18 : 0 ) ) ) ;
39 }
const CaloTowerTopology * m_cttopo
int firstHEDoublePhiRing() const
int firstHFQuadPhiRing() const
static std::string CaloTowerGeometry::dbString ( )
inlinestatic

Definition at line 33 of file CaloTowerGeometry.h.

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

33 { return "PCaloTowerRcd" ; }
std::shared_ptr<const CaloCellGeometry> CaloTowerGeometry::getGeometry ( const DetId id) const
inlineoverridevirtual

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

Reimplemented from CaloSubdetectorGeometry.

Definition at line 60 of file CaloTowerGeometry.h.

References CaloSubdetectorGeometry::cellGeomPtr(), CaloTowerTopology::denseIndex(), getSummary(), and m_cttopo.

60  {
61  return cellGeomPtr( m_cttopo->denseIndex(id) ) ;
62  }
const CaloTowerTopology * m_cttopo
virtual std::shared_ptr< const CaloCellGeometry > cellGeomPtr(uint32_t index) const
uint32_t denseIndex(const DetId &id) const
const CaloCellGeometry * CaloTowerGeometry::getGeometryRawPtr ( uint32_t  index) const
overrideprotectedvirtual

Implements CaloSubdetectorGeometry.

Definition at line 73 of file CaloTowerGeometry.cc.

References m_cellVec, and CaloCellGeometry::param().

Referenced by sizeForDenseIndex().

73  {
74  // Modify the RawPtr class
75  const CaloCellGeometry* cell(&m_cellVec[index]);
76  return (m_cellVec.size() < index ||
77  nullptr == cell->param() ? nullptr : cell);
78 }
void CaloTowerGeometry::getSummary ( CaloSubdetectorGeometry::TrVec trVector,
CaloSubdetectorGeometry::IVec iVector,
CaloSubdetectorGeometry::DimVec dimVector,
CaloSubdetectorGeometry::IVec dinsVector 
) const
overridevirtual

Reimplemented from CaloSubdetectorGeometry.

Definition at line 81 of file CaloTowerGeometry.cc.

References begin, CaloSubdetectorGeometry::cellGeomPtr(), runTauDisplay::gp, mps_fire::i, gen::k, m_dins, groupFilesInBlocks::nn, numberOfCellsForCorners(), numberOfParametersPerShape(), numberOfShapes(), CaloSubdetectorGeometry::numberOfTransformParms(), convertSQLiteXML::ok, CaloSubdetectorGeometry::parVecVec(), MetAnalyzer::pv(), findQualityFiles::rr, and groupFilesInBlocks::tt.

Referenced by getGeometry().

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

Reimplemented from CaloSubdetectorGeometry.

Definition at line 71 of file CaloTowerGeometry.h.

References CaloTowerTopology::denseIndex(), and m_cttopo.

71 { return m_cttopo->denseIndex(id); }
const CaloTowerTopology * m_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 numberOfAlignments(), and CaloGeometryDBEP< T, U >::produceAligned().

50  {
52 }
static void localCorners(Pt3DVec &vec, const CCGFloat *pv, Pt3D &ref)
def pv(vc)
Definition: MetAnalyzer.py:6
void CaloTowerGeometry::newCell ( const GlobalPoint f1,
const GlobalPoint f2,
const GlobalPoint f3,
const CCGFloat parm,
const DetId detId 
)
overridevirtual

Implements CaloSubdetectorGeometry.

Definition at line 55 of file CaloTowerGeometry.cc.

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

Referenced by numberOfAlignments().

59  {
60  const CaloGenericDetId cgid ( detId ) ;
61 
62  assert( cgid.isCaloTower() ) ;
63 
64  const CaloTowerDetId cid ( detId ) ;
65 
66  const unsigned int di ( m_cttopo->denseIndex(cid) ) ;
67 
68  m_cellVec[ di ] = IdealObliquePrism( f1, cornersMgr(), parm ) ;
69  addValidID( detId ) ;
70  m_dins.emplace_back( di );
71 }
const CaloTowerTopology * m_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
virtual unsigned int CaloTowerGeometry::numberOfCellsForCorners ( ) const
inlinevirtual
unsigned int CaloTowerGeometry::numberOfParametersPerShape ( ) const
inlineoverridevirtual
unsigned int CaloTowerGeometry::numberOfShapes ( ) const
inlineoverridevirtual
static std::string CaloTowerGeometry::producerTag ( )
inlinestatic
unsigned int CaloTowerGeometry::sizeForDenseIndex ( const DetId id) const
inlineoverrideprotectedvirtual

Reimplemented from CaloSubdetectorGeometry.

Definition at line 72 of file CaloTowerGeometry.h.

References getGeometryRawPtr(), m_cttopo, and CaloTowerTopology::sizeForDenseIndexing().

72 { return m_cttopo->sizeForDenseIndexing(); }
const CaloTowerTopology * m_cttopo
uint32_t sizeForDenseIndexing() const

Member Data Documentation

int CaloTowerGeometry::k_NumberOfCellsForCorners
private

Definition at line 79 of file CaloTowerGeometry.h.

Referenced by numberOfCellsForCorners().

int CaloTowerGeometry::k_NumberOfShapes
private

Definition at line 80 of file CaloTowerGeometry.h.

Referenced by numberOfShapes().

CellVec CaloTowerGeometry::m_cellVec
private

Definition at line 81 of file CaloTowerGeometry.h.

Referenced by getGeometryRawPtr(), and newCell().

const CaloTowerTopology* CaloTowerGeometry::m_cttopo
private
CaloSubdetectorGeometry::IVec CaloTowerGeometry::m_dins
private

Definition at line 82 of file CaloTowerGeometry.h.

Referenced by getSummary(), and newCell().