CMS 3D CMS Logo

List of all members | Public Types | Public Member Functions | Static Public Member Functions | Public Attributes | Static Public Attributes | Protected Member Functions | Private Attributes
ZdcGeometry Class Reference

#include <ZdcGeometry.h>

Inheritance diagram for ZdcGeometry:
CaloSubdetectorGeometry

Public Types

typedef ZDCGeometryRecord AlignedRecord
 
typedef ZDCAlignmentRcd AlignmentRecord
 
typedef CaloCellGeometry::CCGFloat CCGFloat
 
typedef std::vector< IdealZDCTrapezoidCellVec
 
typedef HcalZDCDetId DetIdType
 
typedef PZdcRcd PGeometryRecord
 
typedef CaloCellGeometry::Pt3D Pt3D
 
typedef CaloCellGeometry::Pt3DVec Pt3DVec
 
typedef CaloCellGeometry::Tr3D Tr3D
 
- 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

void getSummary (CaloSubdetectorGeometry::TrVec &tVec, CaloSubdetectorGeometry::IVec &iVec, CaloSubdetectorGeometry::DimVec &dVec, CaloSubdetectorGeometry::IVec &dins) const override
 
void newCell (const GlobalPoint &f1, const GlobalPoint &f2, const GlobalPoint &f3, const CCGFloat *parm, const DetId &detId) override
 
unsigned int numberOfParametersPerShape () const override
 
unsigned int numberOfShapes () const override
 
 ZdcGeometry ()
 
 ZdcGeometry (const ZdcTopology *topology)
 
 ~ZdcGeometry () 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 std::shared_ptr< const CaloCellGeometrygetGeometry (const DetId &id) const
 Get the cell geometry of a given detector id. Should return false if not found. More...
 
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 unsigned int alignmentTransformIndexGlobal (const DetId &id)
 
static unsigned int alignmentTransformIndexLocal (const DetId &id)
 
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 ()
 

Public Attributes

uint32_t k_NumberOfCellsForCornersN
 

Static Public Attributes

static constexpr int k_NumberOfCellsForCorners = HcalZDCDetId::kSizeForDenseIndexing
 
static constexpr int k_NumberOfParametersPerShape = 4
 
static constexpr int k_NumberOfShapes = 3
 

Protected Member Functions

const CaloCellGeometrygetGeometryRawPtr (uint32_t index) const override
 
unsigned int indexFor (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
 
virtual unsigned int sizeForDenseIndex (const DetId &id) const
 

Private Attributes

DetId::Detector lastReqDet_
 
int lastReqSubdet_
 
CellVec m_cellVec
 
bool m_ownsTopology
 
const ZdcTopologytheTopology
 

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 12 of file ZdcGeometry.h.

Member Typedef Documentation

◆ AlignedRecord

Definition at line 22 of file ZdcGeometry.h.

◆ AlignmentRecord

Definition at line 21 of file ZdcGeometry.h.

◆ CCGFloat

Definition at line 16 of file ZdcGeometry.h.

◆ CellVec

Definition at line 14 of file ZdcGeometry.h.

◆ DetIdType

Definition at line 24 of file ZdcGeometry.h.

◆ PGeometryRecord

Definition at line 23 of file ZdcGeometry.h.

◆ Pt3D

Definition at line 17 of file ZdcGeometry.h.

◆ Pt3DVec

Definition at line 18 of file ZdcGeometry.h.

◆ Tr3D

Definition at line 19 of file ZdcGeometry.h.

Constructor & Destructor Documentation

◆ ZdcGeometry() [1/2]

ZdcGeometry::ZdcGeometry ( )

Definition at line 22 of file ZdcGeometry.cc.

24  theTopology(nullptr),
26  lastReqSubdet_(0),
27  m_ownsTopology(true),
29  edm::LogWarning("HCalGeom") << "ZdcGeometry::Wrong constructor called";
30 }
CellVec m_cellVec
Definition: ZdcGeometry.h:78
static constexpr int32_t kSizeForDenseIndexingRun1
Definition: HcalZDCDetId.h:201
bool m_ownsTopology
Definition: ZdcGeometry.h:76
DetId::Detector lastReqDet_
Definition: ZdcGeometry.h:74
const ZdcTopology * theTopology
Definition: ZdcGeometry.h:73
uint32_t k_NumberOfCellsForCornersN
Definition: ZdcGeometry.h:27
Detector
Definition: DetId.h:24
int lastReqSubdet_
Definition: ZdcGeometry.h:75
Log< level::Warning, false > LogWarning

◆ ZdcGeometry() [2/2]

ZdcGeometry::ZdcGeometry ( const ZdcTopology topology)
explicit

Definition at line 32 of file ZdcGeometry.cc.

33  : k_NumberOfCellsForCornersN(topology->kSizeForDenseIndexing()),
36  lastReqSubdet_(0),
37  m_ownsTopology(false),
CellVec m_cellVec
Definition: ZdcGeometry.h:78
bool m_ownsTopology
Definition: ZdcGeometry.h:76
DetId::Detector lastReqDet_
Definition: ZdcGeometry.h:74
const ZdcTopology * theTopology
Definition: ZdcGeometry.h:73
uint32_t k_NumberOfCellsForCornersN
Definition: ZdcGeometry.h:27
Detector
Definition: DetId.h:24
int lastReqSubdet_
Definition: ZdcGeometry.h:75

◆ ~ZdcGeometry()

ZdcGeometry::~ZdcGeometry ( )
override

Definition at line 40 of file ZdcGeometry.cc.

References m_ownsTopology, and theTopology.

40  {
41  if (m_ownsTopology)
42  delete theTopology;
43 }
bool m_ownsTopology
Definition: ZdcGeometry.h:76
const ZdcTopology * theTopology
Definition: ZdcGeometry.h:73

Member Function Documentation

◆ alignmentTransformIndexGlobal()

unsigned int ZdcGeometry::alignmentTransformIndexGlobal ( const DetId id)
static

Definition at line 70 of file ZdcGeometry.cc.

References DetId::Calo.

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

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

◆ alignmentTransformIndexLocal()

unsigned int ZdcGeometry::alignmentTransformIndexLocal ( const DetId id)
static

Definition at line 63 of file ZdcGeometry.cc.

References cms::cuda::assert(), CaloGenericDetId::isZDC(), and HcalZDCDetId::zside().

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

63  {
64  const CaloGenericDetId gid(id);
65  assert(gid.isZDC());
66 
67  return (0 > HcalZDCDetId(id).zside() ? 0 : 1);
68 }
assert(be >=bs)
constexpr int32_t zside() const
get the z-side of the cell (1/-1)
Definition: HcalZDCDetId.h:90

◆ dbString()

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

Definition at line 33 of file ZdcGeometry.h.

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

33 { return "PZdcRcd"; }

◆ getGeometryRawPtr()

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

Implements CaloSubdetectorGeometry.

Definition at line 94 of file ZdcGeometry.cc.

References m_cellVec, and CaloCellGeometry::param().

94  {
95  // Modify the RawPtr class
96  if (m_cellVec.size() < index)
97  return nullptr;
98  const CaloCellGeometry* cell(&m_cellVec[index]);
99  return (((cell == nullptr) || (nullptr == cell->param())) ? nullptr : cell);
100 }
CellVec m_cellVec
Definition: ZdcGeometry.h:78

◆ getSummary()

void ZdcGeometry::getSummary ( CaloSubdetectorGeometry::TrVec tVec,
CaloSubdetectorGeometry::IVec iVec,
CaloSubdetectorGeometry::DimVec dVec,
CaloSubdetectorGeometry::IVec dins 
) const
overridevirtual

Reimplemented from CaloSubdetectorGeometry.

Definition at line 102 of file ZdcGeometry.cc.

References cms::cuda::assert(), CaloSubdetectorGeometry::cellGeomPtr(), ALPAKA_ACCELERATOR_NAMESPACE::brokenline::dVec, runTauDisplay::gp, mps_fire::i, ALPAKA_ACCELERATOR_NAMESPACE::vertexFinder::iv, dqmdumpme::k, HcalZDCDetId::kSizeForDenseIndexingRun1, CaloSubdetectorGeometry::m_validIds, groupFilesInBlocks::nn, numberOfParametersPerShape(), numberOfShapes(), CaloSubdetectorGeometry::numberOfTransformParms(), convertSQLiteXML::ok, CaloSubdetectorGeometry::parVecVec(), MetAnalyzer::pv(), findQualityFiles::rr, and groupFilesInBlocks::tt.

105  {
106  tVec.reserve(m_validIds.size() * numberOfTransformParms());
107  iVec.reserve(numberOfShapes() == 1 ? 1 : m_validIds.size());
109 
110  for (const auto& pv : parVecVec()) {
111  for (float iv : pv) {
112  dVec.emplace_back(iv);
113  }
114  }
115 
116  for (uint32_t i(0); i != m_validIds.size(); ++i) {
117  Tr3D tr;
118  std::shared_ptr<const CaloCellGeometry> ptr(cellGeomPtr(i));
119 #ifdef EDM_ML_DEBUG
120  edm::LogVerbatim("ZDCGeom") << "ZDCGeometry:Summary " << i << ":" << HcalZDCDetId::kSizeForDenseIndexingRun1
121  << " Pointer " << ptr << ":" << (nullptr != ptr);
122 #endif
123  if (i < static_cast<int32_t>(HcalZDCDetId::kSizeForDenseIndexingRun1))
124  assert(nullptr != ptr);
125  if (ptr != nullptr) {
126  ptr->getTransform(tr, (Pt3DVec*)nullptr);
127 
128  if (Tr3D() == tr) { // for preshower there is no rotation
129  const GlobalPoint& gp(ptr->getPosition());
130  tr = HepGeom::Translate3D(gp.x(), gp.y(), gp.z());
131  }
132 
133  const CLHEP::Hep3Vector tt(tr.getTranslation());
134  tVec.emplace_back(tt.x());
135  tVec.emplace_back(tt.y());
136  tVec.emplace_back(tt.z());
137  if (6 == numberOfTransformParms()) {
138  const CLHEP::HepRotation rr(tr.getRotation());
139  const ROOT::Math::Transform3D rtr(
140  rr.xx(), rr.xy(), rr.xz(), tt.x(), rr.yx(), rr.yy(), rr.yz(), tt.y(), rr.zx(), rr.zy(), rr.zz(), tt.z());
142  rtr.GetRotation(ea);
143  tVec.emplace_back(ea.Phi());
144  tVec.emplace_back(ea.Theta());
145  tVec.emplace_back(ea.Psi());
146  }
147 
148  const CCGFloat* par(ptr->param());
149 
150  unsigned int ishape(9999);
151  for (unsigned int ivv(0); ivv != parVecVec().size(); ++ivv) {
152  bool ok(true);
153  const CCGFloat* pv(&(*parVecVec()[ivv].begin()));
154  for (unsigned int k(0); k != numberOfParametersPerShape(); ++k) {
155  ok = ok && (fabs(par[k] - pv[k]) < 1.e-6);
156  }
157  if (ok) {
158  ishape = ivv;
159  break;
160  }
161  }
162  assert(9999 != ishape);
163 
164  const unsigned int nn((numberOfShapes() == 1) ? (unsigned int)1 : m_validIds.size());
165  if (iVec.size() < nn)
166  iVec.emplace_back(ishape);
167  }
168  }
169 }
Log< level::Info, true > LogVerbatim
virtual unsigned int numberOfTransformParms() const
CaloCellGeometry::Tr3D Tr3D
Definition: ZdcGeometry.h:19
static constexpr int32_t kSizeForDenseIndexingRun1
Definition: HcalZDCDetId.h:201
assert(be >=bs)
Definition: TTTypes.h:54
std::vector< DetId > m_validIds
def pv(vc)
Definition: MetAnalyzer.py:7
CaloCellGeometry::CCGFloat CCGFloat
AlgebraicVector EulerAngles
Definition: Definitions.h:34
CaloCellGeometry::Pt3DVec Pt3DVec
CaloCellGeometry::Tr3D Tr3D
virtual std::shared_ptr< const CaloCellGeometry > cellGeomPtr(uint32_t index) const
unsigned int numberOfParametersPerShape() const override
Definition: ZdcGeometry.h:36
unsigned int numberOfShapes() const override
Definition: ZdcGeometry.h:35

◆ indexFor()

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

Reimplemented from CaloSubdetectorGeometry.

Definition at line 67 of file ZdcGeometry.h.

References ZdcTopology::detId2DenseIndex(), and theTopology.

67 { return theTopology->detId2DenseIndex(id); }
uint32_t detId2DenseIndex(const DetId &id) const
Definition: ZdcTopology.cc:396
const ZdcTopology * theTopology
Definition: ZdcGeometry.h:73

◆ localCorners()

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

Definition at line 72 of file ZdcGeometry.cc.

References IdealZDCTrapezoid::localCorners().

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

◆ newCell()

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

Implements CaloSubdetectorGeometry.

Definition at line 76 of file ZdcGeometry.cc.

References CaloSubdetectorGeometry::addValidID(), cms::cuda::assert(), CaloSubdetectorGeometry::cornersMgr(), TauDecayModes::dec, hcalRecHitTable_cff::detId, ZdcTopology::detId2DenseIndex(), DeadROC_duringRun::f1, CaloGenericDetId::isZDC(), m_cellVec, DetId::rawId(), and theTopology.

80  {
81  const CaloGenericDetId cgid(detId);
82 #ifdef EDM_ML_DEBUG
83  edm::LogVerbatim("ZDCGeom") << "ZDCGeometry " << HcalZDCDetId(detId) << " Generic ID " << std::hex << cgid.rawId()
84  << std::dec << " ZDC? " << cgid.isZDC();
85 #endif
86  assert(cgid.isZDC());
87 
88  const unsigned int di(theTopology->detId2DenseIndex(detId));
89 
90  m_cellVec[di] = IdealZDCTrapezoid(f1, cornersMgr(), parm);
92 }
Log< level::Info, true > LogVerbatim
CellVec m_cellVec
Definition: ZdcGeometry.h:78
assert(be >=bs)
uint32_t detId2DenseIndex(const DetId &id) const
Definition: ZdcTopology.cc:396
const ZdcTopology * theTopology
Definition: ZdcGeometry.h:73
void addValidID(const DetId &id)
constexpr uint32_t rawId() const
get the raw id
Definition: DetId.h:57
CaloCellGeometry::CornersMgr * cornersMgr()

◆ numberOfAlignments()

static unsigned int ZdcGeometry::numberOfAlignments ( )
inlinestatic

Definition at line 47 of file ZdcGeometry.h.

Referenced by FakeCaloAlignmentEP::produceZdcAli(), and TestCaloAlignmentEP::produceZdcAli().

47 { return 2; }

◆ numberOfParametersPerShape()

unsigned int ZdcGeometry::numberOfParametersPerShape ( ) const
inlineoverridevirtual

Reimplemented from CaloSubdetectorGeometry.

Definition at line 36 of file ZdcGeometry.h.

References k_NumberOfParametersPerShape.

Referenced by getSummary().

static constexpr int k_NumberOfParametersPerShape
Definition: ZdcGeometry.h:31

◆ numberOfShapes()

unsigned int ZdcGeometry::numberOfShapes ( ) const
inlineoverridevirtual

Reimplemented from CaloSubdetectorGeometry.

Definition at line 35 of file ZdcGeometry.h.

References k_NumberOfShapes.

Referenced by getSummary().

35 { return k_NumberOfShapes; }
static constexpr int k_NumberOfShapes
Definition: ZdcGeometry.h:29

◆ producerTag()

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

Member Data Documentation

◆ k_NumberOfCellsForCorners

constexpr int ZdcGeometry::k_NumberOfCellsForCorners = HcalZDCDetId::kSizeForDenseIndexing
static

Definition at line 26 of file ZdcGeometry.h.

◆ k_NumberOfCellsForCornersN

uint32_t ZdcGeometry::k_NumberOfCellsForCornersN

Definition at line 27 of file ZdcGeometry.h.

◆ k_NumberOfParametersPerShape

constexpr int ZdcGeometry::k_NumberOfParametersPerShape = 4
static

◆ k_NumberOfShapes

constexpr int ZdcGeometry::k_NumberOfShapes = 3
static

◆ lastReqDet_

DetId::Detector ZdcGeometry::lastReqDet_
mutableprivate

Definition at line 74 of file ZdcGeometry.h.

◆ lastReqSubdet_

int ZdcGeometry::lastReqSubdet_
mutableprivate

Definition at line 75 of file ZdcGeometry.h.

◆ m_cellVec

CellVec ZdcGeometry::m_cellVec
private

Definition at line 78 of file ZdcGeometry.h.

Referenced by getGeometryRawPtr(), and newCell().

◆ m_ownsTopology

bool ZdcGeometry::m_ownsTopology
private

Definition at line 76 of file ZdcGeometry.h.

Referenced by ~ZdcGeometry().

◆ theTopology

const ZdcTopology* ZdcGeometry::theTopology
private

Definition at line 73 of file ZdcGeometry.h.

Referenced by indexFor(), newCell(), and ~ZdcGeometry().