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
 
using CellMayOwnPtr = CaloCellGeometryMayOwnPtr
 
using CellPtr = CaloCellGeometryPtr
 
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)
 
CaloCellGeometryMayOwnPtr getGeometry (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 bool valid (const DetId &id) const
 
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

CaloCellGeometryPtr getGeometryRawPtr (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 CellPtr cellGeomPtr (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

◆ AlignedRecord

Definition at line 25 of file CaloTowerGeometry.h.

◆ AlignmentRecord

Definition at line 24 of file CaloTowerGeometry.h.

◆ CCGFloat

Definition at line 20 of file CaloTowerGeometry.h.

◆ CellVec

Definition at line 18 of file CaloTowerGeometry.h.

◆ DetIdType

Definition at line 27 of file CaloTowerGeometry.h.

◆ PGeometryRecord

Definition at line 26 of file CaloTowerGeometry.h.

◆ Pt3D

Definition at line 21 of file CaloTowerGeometry.h.

◆ Pt3DVec

Definition at line 22 of file CaloTowerGeometry.h.

Member Enumeration Documentation

◆ anonymous enum

anonymous enum
Enumerator
k_NumberOfParametersPerShape 

Definition at line 29 of file CaloTowerGeometry.h.

Constructor & Destructor Documentation

◆ CaloTowerGeometry()

CaloTowerGeometry::CaloTowerGeometry ( const CaloTowerTopology cttopo)

◆ ~CaloTowerGeometry()

CaloTowerGeometry::~CaloTowerGeometry ( )
override

Definition at line 18 of file CaloTowerGeometry.cc.

18 {}

Member Function Documentation

◆ alignmentTransformIndexGlobal()

unsigned int CaloTowerGeometry::alignmentTransformIndexGlobal ( const DetId id)

Definition at line 34 of file CaloTowerGeometry.cc.

References DetId::Calo.

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

34 { return (unsigned int)DetId::Calo - 1; }

◆ alignmentTransformIndexLocal()

unsigned int CaloTowerGeometry::alignmentTransformIndexLocal ( const DetId id)

Definition at line 20 of file CaloTowerGeometry.cc.

References cms::cuda::assert(), CaloTowerTopology::firstHEDoublePhiRing(), CaloTowerTopology::firstHFQuadPhiRing(), CaloGenericDetId::isCaloTower(), m_cttopo, and HLT_IsoTrack_cff::offset.

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

20  {
21  const CaloGenericDetId gid(id);
22  assert(gid.isCaloTower());
23 
24  const CaloTowerDetId cid(id);
25  const int iea(cid.ietaAbs());
26  const unsigned int ip((cid.iphi() - 1) / 4);
27  const int izoff((cid.zside() + 1) / 2);
28  const unsigned int offset(izoff * 3 * 18);
29 
30  return (offset + ip +
31  (m_cttopo->firstHFQuadPhiRing() <= iea ? 36 : (m_cttopo->firstHEDoublePhiRing() <= iea ? 18 : 0)));
32 }
const CaloTowerTopology * m_cttopo
int firstHFQuadPhiRing() const
assert(be >=bs)
int firstHEDoublePhiRing() const

◆ dbString()

static std::string CaloTowerGeometry::dbString ( )
inlinestatic

Definition at line 31 of file CaloTowerGeometry.h.

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

31 { return "PCaloTowerRcd"; }

◆ getGeometry()

CaloCellGeometryMayOwnPtr 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 54 of file CaloTowerGeometry.h.

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

54  {
56  }
const CaloTowerTopology * m_cttopo
virtual CellPtr cellGeomPtr(uint32_t index) const
uint32_t denseIndex(const DetId &id) const

◆ getGeometryRawPtr()

CaloCellGeometryPtr CaloTowerGeometry::getGeometryRawPtr ( uint32_t  index) const
overrideprotectedvirtual

Implements CaloSubdetectorGeometry.

Definition at line 55 of file CaloTowerGeometry.cc.

References m_cellVec.

55  {
56  // Modify the RawPtr class
57  return CaloCellGeometryPtr(m_cellVec.size() <= index || nullptr == m_cellVec[index].param() ? nullptr
58  : &m_cellVec[index]);
59 }

◆ getSummary()

void CaloTowerGeometry::getSummary ( CaloSubdetectorGeometry::TrVec trVector,
CaloSubdetectorGeometry::IVec iVector,
CaloSubdetectorGeometry::DimVec dimVector,
CaloSubdetectorGeometry::IVec dinsVector 
) const
overridevirtual

Reimplemented from CaloSubdetectorGeometry.

Definition at line 61 of file CaloTowerGeometry.cc.

References cms::cuda::assert(), SplitLinear::begin, CaloSubdetectorGeometry::cellGeomPtr(), ALPAKA_ACCELERATOR_NAMESPACE::brokenline::dVec, runTauDisplay::gp, mps_fire::i, ALPAKA_ACCELERATOR_NAMESPACE::vertexFinder::iv, isotrackApplyRegressor::k, m_dins, groupFilesInBlocks::nn, numberOfCellsForCorners(), numberOfParametersPerShape(), numberOfShapes(), CaloSubdetectorGeometry::numberOfTransformParms(), convertSQLiteXML::ok, CaloSubdetectorGeometry::parVecVec(), MetAnalyzer::pv(), findQualityFiles::rr, and groupFilesInBlocks::tt.

64  {
66  iVec.reserve(numberOfShapes() == 1 ? 1 : numberOfCellsForCorners());
68  dinsVec.reserve(numberOfCellsForCorners());
69 
70  for (const auto& pv : parVecVec()) {
71  for (float iv : pv) {
72  dVec.emplace_back(iv);
73  }
74  }
75 
76  for (unsigned int i(0); i < numberOfCellsForCorners(); ++i) {
77  Tr3D tr;
78  auto ptr(cellGeomPtr(i));
79 
80  if (nullptr != ptr) {
81  dinsVec.emplace_back(i);
82 
83  ptr->getTransform(tr, (Pt3DVec*)nullptr);
84 
85  if (Tr3D() == tr) { // for preshower there is no rotation
86  const GlobalPoint& gp(ptr->getPosition());
87  tr = HepGeom::Translate3D(gp.x(), gp.y(), gp.z());
88  }
89 
90  const CLHEP::Hep3Vector tt(tr.getTranslation());
91  tVec.emplace_back(tt.x());
92  tVec.emplace_back(tt.y());
93  tVec.emplace_back(tt.z());
94  if (6 == numberOfTransformParms()) {
95  const CLHEP::HepRotation rr(tr.getRotation());
96  const ROOT::Math::Transform3D rtr(
97  rr.xx(), rr.xy(), rr.xz(), tt.x(), rr.yx(), rr.yy(), rr.yz(), tt.y(), rr.zx(), rr.zy(), rr.zz(), tt.z());
99  rtr.GetRotation(ea);
100  tVec.emplace_back(ea.Phi());
101  tVec.emplace_back(ea.Theta());
102  tVec.emplace_back(ea.Psi());
103  }
104 
105  const CCGFloat* par(ptr->param());
106 
107  unsigned int ishape(9999);
108  for (unsigned int ivv(0); ivv != parVecVec().size(); ++ivv) {
109  bool ok(true);
110  const CCGFloat* pv(&(*parVecVec()[ivv].begin()));
111  for (unsigned int k(0); k != numberOfParametersPerShape(); ++k) {
112  ok = ok && (fabs(par[k] - pv[k]) < 1.e-6);
113  }
114  if (ok) {
115  ishape = ivv;
116  break;
117  }
118  }
119  assert(9999 != ishape);
120 
121  const unsigned int nn((numberOfShapes() == 1) ? (unsigned int)1 : m_dins.size());
122  if (iVec.size() < nn)
123  iVec.emplace_back(ishape);
124  }
125  }
126 }
CaloCellGeometry::Tr3D Tr3D
virtual unsigned int numberOfCellsForCorners() const
unsigned int numberOfShapes() const override
virtual unsigned int numberOfTransformParms() const
unsigned int numberOfParametersPerShape() const override
assert(be >=bs)
Definition: TTTypes.h:54
def pv(vc)
Definition: MetAnalyzer.py:7
CaloCellGeometry::CCGFloat CCGFloat
CaloSubdetectorGeometry::IVec m_dins
AlgebraicVector EulerAngles
Definition: Definitions.h:34
CaloCellGeometry::Pt3DVec Pt3DVec
CaloCellGeometry::Tr3D Tr3D
virtual CellPtr cellGeomPtr(uint32_t index) const

◆ indexFor()

unsigned int CaloTowerGeometry::indexFor ( const DetId id) const
inlineoverrideprotectedvirtual

Reimplemented from CaloSubdetectorGeometry.

Definition at line 64 of file CaloTowerGeometry.h.

References CaloTowerTopology::denseIndex(), and m_cttopo.

64 { return m_cttopo->denseIndex(id); }
const CaloTowerTopology * m_cttopo
uint32_t denseIndex(const DetId &id) const

◆ localCorners()

void CaloTowerGeometry::localCorners ( Pt3DVec lc,
const CCGFloat pv,
unsigned int  i,
Pt3D ref 
)
static

Definition at line 36 of file CaloTowerGeometry.cc.

References IdealObliquePrism::localCorners().

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

36  {
38 }
static void localCorners(Pt3DVec &vec, const CCGFloat *pv, Pt3D &ref)

◆ newCell()

void CaloTowerGeometry::newCell ( const GlobalPoint f1,
const GlobalPoint f2,
const GlobalPoint f3,
const CCGFloat parm,
const DetId detId 
)
overridevirtual

Implements CaloSubdetectorGeometry.

Definition at line 40 of file CaloTowerGeometry.cc.

References CaloSubdetectorGeometry::addValidID(), cms::cuda::assert(), CaloSubdetectorGeometry::cornersMgr(), CaloTowerTopology::denseIndex(), hcalRecHitTable_cff::detId, validate-o2o-wbm::f1, CaloGenericDetId::isCaloTower(), m_cellVec, m_cttopo, and m_dins.

41  {
42  const CaloGenericDetId cgid(detId);
43 
44  assert(cgid.isCaloTower());
45 
46  const CaloTowerDetId cid(detId);
47 
48  const unsigned int di(m_cttopo->denseIndex(cid));
49 
50  m_cellVec[di] = IdealObliquePrism(f1, cornersMgr(), parm);
52  m_dins.emplace_back(di);
53 }
const CaloTowerTopology * m_cttopo
assert(be >=bs)
CaloSubdetectorGeometry::IVec m_dins
void addValidID(const DetId &id)
CaloCellGeometry::CornersMgr * cornersMgr()
uint32_t denseIndex(const DetId &id) const

◆ numberOfAlignments()

static unsigned int CaloTowerGeometry::numberOfAlignments ( )
inlinestatic

Definition at line 42 of file CaloTowerGeometry.h.

42 { return 0; }

◆ numberOfCellsForCorners()

virtual unsigned int CaloTowerGeometry::numberOfCellsForCorners ( ) const
inlinevirtual

◆ numberOfParametersPerShape()

unsigned int CaloTowerGeometry::numberOfParametersPerShape ( ) const
inlineoverridevirtual

◆ numberOfShapes()

unsigned int CaloTowerGeometry::numberOfShapes ( ) const
inlineoverridevirtual

Reimplemented from CaloSubdetectorGeometry.

Definition at line 33 of file CaloTowerGeometry.h.

References k_NumberOfShapes.

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

33 { return k_NumberOfShapes; }

◆ producerTag()

static std::string CaloTowerGeometry::producerTag ( )
inlinestatic

◆ sizeForDenseIndex()

unsigned int CaloTowerGeometry::sizeForDenseIndex ( const DetId id) const
inlineoverrideprotectedvirtual

Reimplemented from CaloSubdetectorGeometry.

Definition at line 65 of file CaloTowerGeometry.h.

References m_cttopo, and CaloTowerTopology::sizeForDenseIndexing().

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

Member Data Documentation

◆ k_NumberOfCellsForCorners

int CaloTowerGeometry::k_NumberOfCellsForCorners
private

Definition at line 72 of file CaloTowerGeometry.h.

Referenced by numberOfCellsForCorners().

◆ k_NumberOfShapes

int CaloTowerGeometry::k_NumberOfShapes
private

Definition at line 73 of file CaloTowerGeometry.h.

Referenced by numberOfShapes().

◆ m_cellVec

CellVec CaloTowerGeometry::m_cellVec
private

Definition at line 74 of file CaloTowerGeometry.h.

Referenced by getGeometryRawPtr(), and newCell().

◆ m_cttopo

const CaloTowerTopology* CaloTowerGeometry::m_cttopo
private

◆ m_dins

CaloSubdetectorGeometry::IVec CaloTowerGeometry::m_dins
private

Definition at line 75 of file CaloTowerGeometry.h.

Referenced by getSummary(), and newCell().