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

◆ 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.

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

References DetId::Calo.

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

◆ alignmentTransformIndexLocal()

unsigned int CaloTowerGeometry::alignmentTransformIndexLocal ( const DetId id)

Definition at line 20 of file CaloTowerGeometry.cc.

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 }

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

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

◆ dbString()

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

Definition at line 31 of file CaloTowerGeometry.h.

31 { return "PCaloTowerRcd"; }

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

◆ getGeometry()

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

54  {
55  return cellGeomPtr(m_cttopo->denseIndex(id));
56  }

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

◆ getGeometryRawPtr()

const CaloCellGeometry * CaloTowerGeometry::getGeometryRawPtr ( uint32_t  index) const
overrideprotectedvirtual

Implements CaloSubdetectorGeometry.

Definition at line 55 of file CaloTowerGeometry.cc.

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

References m_cellVec, and CaloCellGeometry::param().

◆ 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.

64  {
66  iVec.reserve(numberOfShapes() == 1 ? 1 : numberOfCellsForCorners());
67  dVec.reserve(numberOfShapes() * numberOfParametersPerShape());
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 }

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

◆ indexFor()

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

Reimplemented from CaloSubdetectorGeometry.

Definition at line 64 of file CaloTowerGeometry.h.

64 { return m_cttopo->denseIndex(id); }

References CaloTowerTopology::denseIndex(), and m_cttopo.

◆ localCorners()

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

◆ 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.

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);
51  addValidID(detId);
52  m_dins.emplace_back(di);
53 }

References CaloSubdetectorGeometry::addValidID(), cms::cuda::assert(), CaloSubdetectorGeometry::cornersMgr(), CaloTowerTopology::denseIndex(), DeadROC_duringRun::f1, CaloGenericDetId::isCaloTower(), m_cellVec, m_cttopo, and m_dins.

◆ 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

Reimplemented from CaloSubdetectorGeometry.

Definition at line 34 of file CaloTowerGeometry.h.

References k_NumberOfParametersPerShape.

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

◆ numberOfShapes()

unsigned int CaloTowerGeometry::numberOfShapes ( ) const
inlineoverridevirtual

Reimplemented from CaloSubdetectorGeometry.

Definition at line 33 of file CaloTowerGeometry.h.

33 { return k_NumberOfShapes; }

References k_NumberOfShapes.

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

◆ producerTag()

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

Definition at line 40 of file CaloTowerGeometry.h.

40 { return "TOWER"; }

Referenced by PCaloGeometryBuilder::beginRun(), and CaloGeometryBuilder::CaloGeometryBuilder().

◆ sizeForDenseIndex()

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

Reimplemented from CaloSubdetectorGeometry.

Definition at line 65 of file CaloTowerGeometry.h.

65 { return m_cttopo->sizeForDenseIndexing(); }

References m_cttopo, and CaloTowerTopology::sizeForDenseIndexing().

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().

CaloTowerGeometry::k_NumberOfShapes
int k_NumberOfShapes
Definition: CaloTowerGeometry.h:73
CaloTowerGeometry::m_cellVec
CellVec m_cellVec
Definition: CaloTowerGeometry.h:74
mps_fire.i
i
Definition: mps_fire.py:355
CaloTowerGeometry::m_cttopo
const CaloTowerTopology * m_cttopo
Definition: CaloTowerGeometry.h:71
CaloGenericDetId
Definition: CaloGenericDetId.h:12
groupFilesInBlocks.tt
int tt
Definition: groupFilesInBlocks.py:144
findQualityFiles.rr
string rr
Definition: findQualityFiles.py:185
CCGFloat
CaloCellGeometry::CCGFloat CCGFloat
Definition: CaloCellGeometry.cc:4
CaloTowerGeometry::numberOfParametersPerShape
unsigned int numberOfParametersPerShape() const override
Definition: CaloTowerGeometry.h:34
CaloTowerGeometry::numberOfShapes
unsigned int numberOfShapes() const override
Definition: CaloTowerGeometry.h:33
CaloTowerTopology::firstHEDoublePhiRing
int firstHEDoublePhiRing() const
Definition: CaloTowerTopology.h:44
cms::cuda::assert
assert(be >=bs)
CaloSubdetectorGeometry::numberOfTransformParms
virtual unsigned int numberOfTransformParms() const
Definition: CaloSubdetectorGeometry.h:94
convertSQLiteXML.ok
bool ok
Definition: convertSQLiteXML.py:98
DetId::Calo
Definition: DetId.h:29
IdealObliquePrism
Definition: IdealObliquePrism.h:28
CaloTowerTopology::lastHFRing
int lastHFRing() const
Definition: CaloTowerTopology.h:41
CaloTowerGeometry::m_dins
CaloSubdetectorGeometry::IVec m_dins
Definition: CaloTowerGeometry.h:75
Tr3D
CaloCellGeometry::Tr3D Tr3D
Definition: CaloCellGeometry.cc:7
dqmdumpme.k
k
Definition: dqmdumpme.py:60
Point3DBase< float, GlobalTag >
IdealObliquePrism::localCorners
static void localCorners(Pt3DVec &vec, const CCGFloat *pv, Pt3D &ref)
Definition: IdealObliquePrism.cc:45
Tr3D
CaloCellGeometry::Tr3D Tr3D
Definition: CaloTowerGeometry.cc:10
runTauDisplay.gp
gp
Definition: runTauDisplay.py:431
CaloCellGeometry
Definition: CaloCellGeometry.h:50
CaloTowerGeometry::k_NumberOfCellsForCorners
int k_NumberOfCellsForCorners
Definition: CaloTowerGeometry.h:72
MetAnalyzer.pv
def pv(vc)
Definition: MetAnalyzer.py:7
CaloSubdetectorGeometry::addValidID
void addValidID(const DetId &id)
Definition: CaloSubdetectorGeometry.cc:27
align::EulerAngles
AlgebraicVector EulerAngles
Definition: Definitions.h:34
groupFilesInBlocks.nn
nn
Definition: groupFilesInBlocks.py:150
CaloSubdetectorGeometry::cornersMgr
CaloCellGeometry::CornersMgr * cornersMgr()
Definition: CaloSubdetectorGeometry.h:82
CaloTowerTopology::sizeForDenseIndexing
uint32_t sizeForDenseIndexing() const
Definition: CaloTowerTopology.h:56
AlignmentPI::index
index
Definition: AlignmentPayloadInspectorHelper.h:46
Pt3DVec
CaloCellGeometry::Pt3DVec Pt3DVec
Definition: CaloCellGeometry.cc:6
CaloTowerGeometry::k_NumberOfParametersPerShape
Definition: CaloTowerGeometry.h:29
CaloSubdetectorGeometry::parVecVec
ParVecVec & parVecVec()
Definition: CaloSubdetectorGeometry.h:89
CaloSubdetectorGeometry::cellGeomPtr
virtual std::shared_ptr< const CaloCellGeometry > cellGeomPtr(uint32_t index) const
Definition: CaloSubdetectorGeometry.cc:260
hltrates_dqm_sourceclient-live_cfg.offset
offset
Definition: hltrates_dqm_sourceclient-live_cfg.py:82
CaloTowerGeometry::numberOfCellsForCorners
virtual unsigned int numberOfCellsForCorners() const
Definition: CaloTowerGeometry.h:35
DeadROC_duringRun.f1
f1
Definition: DeadROC_duringRun.py:219
begin
#define begin
Definition: vmac.h:32
CaloTowerTopology::denseIndex
uint32_t denseIndex(const DetId &id) const
Definition: CaloTowerTopology.cc:235
CaloTowerTopology::firstHFQuadPhiRing
int firstHFQuadPhiRing() const
Definition: CaloTowerTopology.h:46
CaloTowerDetId
Definition: CaloTowerDetId.h:12