CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
List of all members | Public Types | Public Member Functions | Static Public Member Functions | Protected Member Functions | Private Member Functions | Private Attributes
FastTimeGeometry Class Referencefinal

#include <FastTimeGeometry.h>

Inheritance diagram for FastTimeGeometry:
CaloSubdetectorGeometry

Public Types

enum  { k_NumberOfParametersPerShape = 12 }
 
enum  { k_NumberOfShapes = 50 }
 
typedef FastTimeGeometryRecord AlignedRecord
 
typedef CaloCellGeometry::CCGFloat CCGFloat
 
typedef std::vector< FlatTrdCellVec
 
typedef std::vector< GlobalPointCornersVec
 
typedef std::set< DetIdDetIdSet
 
typedef PFastTimeRcd 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

std::string cellElement () const
 
 FastTimeGeometry (const FastTimeTopology &topology)
 
virtual void fillNamedParams (DDFilteredView fv)
 
DetIdSet getCells (const GlobalPoint &r, double dR) const override
 Get a list of all cells within a dR of the given cell. More...
 
DetId getClosestCell (const GlobalPoint &r) const override
 
CornersVec getCorners (const DetId &id) const
 Returns the corner points of this cell's volume. More...
 
std::shared_ptr< const
CaloCellGeometry
getGeometry (const DetId &id) const override
 Get the cell geometry of a given detector id. Should return false if not found. More...
 
GlobalPoint getPosition (const DetId &id) const
 
void getSummary (CaloSubdetectorGeometry::TrVec &trVector, CaloSubdetectorGeometry::IVec &iVector, CaloSubdetectorGeometry::DimVec &dimVector, CaloSubdetectorGeometry::IVec &dinsVector) const override
 
const std::vector< DetId > & getValidDetIds (DetId::Detector det=DetId::Detector(0), int subdet=0) const override
 Get a list of valid detector ids (for the given subdetector) More...
 
const std::vector< DetId > & getValidGeomDetIds (void) const
 
void initializeParms () override
 
void localCorners (Pt3DVec &lc, const CCGFloat *pv, unsigned int i, Pt3D &ref)
 
void newCell (const GlobalPoint &f1, const GlobalPoint &f2, const GlobalPoint &f3, const CCGFloat *parm, const DetId &detId) override
 
bool present (const DetId &id) const override
 is this detid present in the geometry? More...
 
void sortDetIds ()
 
const FastTimeTopologytopology () const
 
 ~FastTimeGeometry () 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 CellSet getCellSet (const GlobalPoint &r, double dR) const
 
virtual unsigned int numberOfParametersPerShape () const
 
virtual unsigned int numberOfShapes () const
 
virtual unsigned int numberOfTransformParms () const
 
CaloSubdetectorGeometryoperator= (const CaloSubdetectorGeometry &)=delete
 
ParMgrparMgr ()
 
const ParMgrparMgrConst () const
 
ParVecVecparVecVec ()
 
const ParVecVecparVecVec () const
 
virtual ~CaloSubdetectorGeometry ()
 The base class DOES assume that it owns the CaloCellGeometry objects. More...
 

Static Public Member Functions

static std::string dbString ()
 
static std::string producerTag ()
 

Protected Member Functions

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

Private Member Functions

std::shared_ptr< const
CaloCellGeometry
cellGeomPtr (uint32_t index, const GlobalPoint &p) const
 

Private Attributes

CellVec m_cellVec
 
ForwardSubdetector m_subdet
 
const FastTimeTopologym_topology
 
int m_Type
 
std::vector< DetIdm_validGeomIds
 

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 24 of file FastTimeGeometry.h.

Member Typedef Documentation

Definition at line 35 of file FastTimeGeometry.h.

Definition at line 28 of file FastTimeGeometry.h.

typedef std::vector<FlatTrd> FastTimeGeometry::CellVec

Definition at line 26 of file FastTimeGeometry.h.

Definition at line 33 of file FastTimeGeometry.h.

typedef std::set<DetId> FastTimeGeometry::DetIdSet

Definition at line 32 of file FastTimeGeometry.h.

Definition at line 36 of file FastTimeGeometry.h.

Definition at line 29 of file FastTimeGeometry.h.

Definition at line 30 of file FastTimeGeometry.h.

Member Enumeration Documentation

anonymous enum
Enumerator
k_NumberOfParametersPerShape 

Definition at line 38 of file FastTimeGeometry.h.

anonymous enum
Enumerator
k_NumberOfShapes 

Definition at line 39 of file FastTimeGeometry.h.

Constructor & Destructor Documentation

FastTimeGeometry::FastTimeGeometry ( const FastTimeTopology topology)

Definition at line 15 of file FastTimeGeometry.cc.

References gather_cfg::cout, CaloSubdetectorGeometry::m_validIds, topology(), and FastTimeTopology::totalGeomModules().

16  : m_topology(topology_),
17  m_cellVec(topology_.totalGeomModules()),
18  m_validGeomIds(topology_.totalGeomModules()),
19  m_Type(topology_.detectorType()),
20  m_subdet(topology_.subDetector()) {
21  m_validIds.reserve(topology().totalModules());
22 #ifdef EDM_ML_DEBUG
23  std::cout << "Expected total # of Geometry Modules " << topology().totalGeomModules() << std::endl;
24 #endif
25 }
unsigned int totalGeomModules() const
const FastTimeTopology & topology() const
std::vector< DetId > m_validIds
tuple cout
Definition: gather_cfg.py:144
ForwardSubdetector m_subdet
std::vector< DetId > m_validGeomIds
const FastTimeTopology & m_topology
FastTimeGeometry::~FastTimeGeometry ( )
override

Definition at line 27 of file FastTimeGeometry.cc.

27 {}

Member Function Documentation

void FastTimeGeometry::addValidID ( const DetId id)
protected

Definition at line 189 of file FastTimeGeometry.cc.

189  {
190  edm::LogError("FastTimeGeom") << "FastTimeGeometry::addValidID is not implemented";
191 }
Log< level::Error, false > LogError
std::string FastTimeGeometry::cellElement ( ) const

Definition at line 134 of file FastTimeGeometry.cc.

References m_Type.

134  {
135  if (m_Type == 1)
136  return "FastTimeBarrel";
137  else if (m_Type == 2)
138  return "FastTimeEndcap";
139  else
140  return "Unknown";
141 }
std::shared_ptr< const CaloCellGeometry > FastTimeGeometry::cellGeomPtr ( uint32_t  index) const
overrideprotectedvirtual

Reimplemented from CaloSubdetectorGeometry.

Definition at line 164 of file FastTimeGeometry.cc.

References m_cellVec, and m_validGeomIds.

Referenced by cellGeomPtr(), getGeometry(), and getSummary().

164  {
165  if ((index >= m_cellVec.size()) || (m_validGeomIds[index].rawId() == 0))
166  return nullptr;
167  static const auto do_not_delete = [](const void*) {};
168  auto cell = std::shared_ptr<const CaloCellGeometry>(&m_cellVec[index], do_not_delete);
169  if (nullptr == cell->param())
170  return nullptr;
171  return cell;
172 }
std::vector< DetId > m_validGeomIds
std::shared_ptr< const CaloCellGeometry > FastTimeGeometry::cellGeomPtr ( uint32_t  index,
const GlobalPoint p 
) const
private

Definition at line 174 of file FastTimeGeometry.cc.

References cellGeomPtr(), m_cellVec, and m_validGeomIds.

174  {
175  if ((index >= m_cellVec.size()) || (m_validGeomIds[index].rawId() == 0))
176  return nullptr;
177  if (pos == GlobalPoint())
178  return cellGeomPtr(index);
179  auto cell = std::make_shared<FlatTrd>(m_cellVec[index]);
180  cell->setPosition(pos);
181 #ifdef EDM_ML_DEBUG
182 //std::cout << "cellGeomPtr " << newcell << ":" << cell << std::endl;
183 #endif
184  if (nullptr == cell->param())
185  return nullptr;
186  return cell;
187 }
Global3DPoint GlobalPoint
Definition: GlobalPoint.h:10
std::shared_ptr< const CaloCellGeometry > cellGeomPtr(uint32_t index) const override
std::vector< DetId > m_validGeomIds
static std::string FastTimeGeometry::dbString ( )
inlinestatic

Definition at line 41 of file FastTimeGeometry.h.

41 { return "PFastTimeRcd"; }
void FastTimeGeometry::fillNamedParams ( DDFilteredView  fv)
virtual

Definition at line 29 of file FastTimeGeometry.cc.

29 {}
FastTimeGeometry::DetIdSet FastTimeGeometry::getCells ( const GlobalPoint r,
double  dR 
) const
overridevirtual

Get a list of all cells within a dR of the given cell.

The default implementation makes a loop over all cell geometries. Cleverer implementations are suggested to use rough conversions between eta/phi and ieta/iphi and test on the boundaries.

Reimplemented from CaloSubdetectorGeometry.

Definition at line 129 of file FastTimeGeometry.cc.

129  {
131  return dss;
132 }
std::set< DetId > DetIdSet
DetId FastTimeGeometry::getClosestCell ( const GlobalPoint r) const
overridevirtual

Reimplemented from CaloSubdetectorGeometry.

Definition at line 107 of file FastTimeGeometry.cc.

References gather_cfg::cout, FastTimeTopology::dddConstants(), FastTimeDDDConstants::getEtaPhi(), FastTimeDDDConstants::getZPhi(), m_Type, PV3DBase< T, PVType, FrameType >::perp(), phi, PV3DBase< T, PVType, FrameType >::phi(), topology(), PV3DBase< T, PVType, FrameType >::x(), PV3DBase< T, PVType, FrameType >::y(), PV3DBase< T, PVType, FrameType >::z(), and ecaldqm::zside().

107  {
108  int zside = (r.z() > 0) ? 1 : -1;
109  std::pair<int, int> etaZPhi;
110  if (m_Type == 1) {
111  double zz = (zside > 0) ? r.z() : -r.z();
112  etaZPhi = topology().dddConstants().getZPhi(zz, r.phi());
113  } else {
114  double phi = (zside > 0) ? static_cast<double>(r.phi()) : atan2(r.y(), -r.x());
115  // Cast needed to resolve compile-time ambiguity of ? operator between
116  // convertible Phi class and atan2 template function.
117 
118  etaZPhi = topology().dddConstants().getEtaPhi(r.perp(), phi);
119  }
120  FastTimeDetId id = FastTimeDetId(m_Type, etaZPhi.first, etaZPhi.second, zside);
121 #ifdef EDM_ML_DEBUG
122  std::cout << "getClosestCell: for (" << r.x() << ", " << r.y() << ", " << r.z() << ") Id " << id.type() << ":"
123  << id.zside() << ":" << id.ieta() << ":" << id.iphi() << std::endl;
124 #endif
125 
126  return (topology().valid(id) ? DetId(id) : DetId());
127 }
T perp() const
Definition: PV3DBase.h:69
std::pair< int, int > getEtaPhi(double r, double phi) const
Geom::Phi< T > phi() const
Definition: PV3DBase.h:66
const FastTimeTopology & topology() const
T y() const
Definition: PV3DBase.h:60
int zside(DetId const &)
std::pair< int, int > getZPhi(double z, double phi) const
T z() const
Definition: PV3DBase.h:61
Definition: DetId.h:17
tuple cout
Definition: gather_cfg.py:144
T x() const
Definition: PV3DBase.h:59
const FastTimeDDDConstants & dddConstants() const
FastTimeGeometry::CornersVec FastTimeGeometry::getCorners ( const DetId id) const

Returns the corner points of this cell's volume.

Definition at line 97 of file FastTimeGeometry.cc.

References FastTimeTopology::dddConstants(), FastTimeDDDConstants::getCorners(), FastTimeDetId::ieta(), FastTimeDetId::iphi(), m_Type, submitPVResolutionJobs::out, topology(), and FastTimeDetId::zside().

Referenced by FWRecoGeometryESProducer::addFTLGeometry().

97  {
98  FastTimeDetId id_ = FastTimeDetId(id);
99  auto corners = topology().dddConstants().getCorners(m_Type, id_.ieta(), id_.iphi(), id_.zside());
101  for (const auto& corner : corners) {
102  out.emplace_back(0.1 * corner.x(), 0.1 * corner.y(), 0.1 * corner.z());
103  }
104  return out;
105 }
int ieta() const
get the absolute value of the cell #&#39;s along x-axis (EC) | z-axis (Barel)
Definition: FastTimeDetId.h:41
std::vector< GlobalPoint > CornersVec
const FastTimeTopology & topology() const
int iphi() const
get the absolute value of the cell #&#39;s along y-axis (EC) | phi (Barrel)
Definition: FastTimeDetId.h:45
int zside() const
get the z-side of the cell (1/-1)
Definition: FastTimeDetId.h:48
std::vector< GlobalPoint > getCorners(int type, int izeta, int iphi, int zside) const
const FastTimeDDDConstants & dddConstants() const
std::shared_ptr< const CaloCellGeometry > FastTimeGeometry::getGeometry ( const DetId id) const
overridevirtual

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

Reimplemented from CaloSubdetectorGeometry.

Definition at line 74 of file FastTimeGeometry.cc.

References cellGeomPtr(), FastTimeDetId::geometryCell(), getPosition(), and topology().

74  {
75  if (id == DetId())
76  return nullptr; // nothing to get
77  DetId geoId = (DetId)(FastTimeDetId(id).geometryCell());
78  const uint32_t cellIndex(topology().detId2denseGeomId(geoId));
79  const GlobalPoint pos = (id != geoId) ? getPosition(id) : GlobalPoint();
80  return cellGeomPtr(cellIndex, pos);
81 }
FastTimeDetId geometryCell() const
Definition: FastTimeDetId.h:32
Global3DPoint GlobalPoint
Definition: GlobalPoint.h:10
const FastTimeTopology & topology() const
GlobalPoint getPosition(const DetId &id) const
std::shared_ptr< const CaloCellGeometry > cellGeomPtr(uint32_t index) const override
Definition: DetId.h:17
const CaloCellGeometry * FastTimeGeometry::getGeometryRawPtr ( uint32_t  index) const
overrideprotectedvirtual

Implements CaloSubdetectorGeometry.

Definition at line 158 of file FastTimeGeometry.cc.

References m_cellVec, and CaloCellGeometry::param().

Referenced by present().

158  {
159  // Modify the RawPtr class
160  const CaloCellGeometry* cell(&m_cellVec[index]);
161  return (m_cellVec.size() < index || nullptr == cell->param() ? nullptr : cell);
162 }
GlobalPoint FastTimeGeometry::getPosition ( const DetId id) const

Definition at line 91 of file FastTimeGeometry.cc.

References FastTimeTopology::dddConstants(), FastTimeDDDConstants::getPosition(), FastTimeDetId::ieta(), FastTimeDetId::iphi(), m_Type, topology(), and FastTimeDetId::zside().

Referenced by getGeometry().

91  {
92  FastTimeDetId id_ = FastTimeDetId(id);
93  auto pos = topology().dddConstants().getPosition(m_Type, id_.ieta(), id_.iphi(), id_.zside());
94  return GlobalPoint(0.1 * pos.x(), 0.1 * pos.y(), 0.1 * pos.z());
95 }
int ieta() const
get the absolute value of the cell #&#39;s along x-axis (EC) | z-axis (Barel)
Definition: FastTimeDetId.h:41
Global3DPoint GlobalPoint
Definition: GlobalPoint.h:10
const FastTimeTopology & topology() const
int iphi() const
get the absolute value of the cell #&#39;s along y-axis (EC) | phi (Barrel)
Definition: FastTimeDetId.h:45
int zside() const
get the z-side of the cell (1/-1)
Definition: FastTimeDetId.h:48
GlobalPoint getPosition(int type, int izeta, int iphi, int zside) const
const FastTimeDDDConstants & dddConstants() const
void FastTimeGeometry::getSummary ( CaloSubdetectorGeometry::TrVec trVector,
CaloSubdetectorGeometry::IVec iVector,
CaloSubdetectorGeometry::DimVec dimVector,
CaloSubdetectorGeometry::IVec dinsVector 
) const
overridevirtual

Reimplemented from CaloSubdetectorGeometry.

Definition at line 205 of file FastTimeGeometry.cc.

References cellGeomPtr(), FastTimeTopology::dddConstants(), FastTimeDDDConstants::getRin(), FastTimeDDDConstants::getRout(), FastTimeDDDConstants::getZHalf(), runTauDisplay::gp, mps_fire::i, isotrackApplyRegressor::k, k_NumberOfParametersPerShape, k_NumberOfShapes, m_Type, m_validGeomIds, CaloSubdetectorGeometry::numberOfParametersPerShape(), CaloSubdetectorGeometry::numberOfShapes(), CaloSubdetectorGeometry::numberOfTransformParms(), submitPVValidationJobs::params, findQualityFiles::rr, topology(), FastTimeTopology::totalGeomModules(), and groupFilesInBlocks::tt.

208  {
209  unsigned int numberOfCells = topology().totalGeomModules(); // total Geom Modules both sides
212 
213  trVector.reserve(numberOfCells * numberOfTransformParms());
214  iVector.reserve(numberOfCells);
215  dimVector.reserve(numberOfShapes * numberOfParametersPerShape);
216  dinsVector.reserve(numberOfCells);
217 
218  for (unsigned int k = 0; k < topology().totalGeomModules(); ++k) {
221  params[1] = params[2] = 0;
225  params[6] = params[10] = 0;
226  params[11] = (k == 0) ? 1.0 : -1.0;
227  dimVector.insert(dimVector.end(), params.begin(), params.end());
228  }
229 
230  for (unsigned int i(0); i < numberOfCells; ++i) {
231  DetId detId = m_validGeomIds[i];
232  dinsVector.emplace_back(topology().detId2denseGeomId(detId));
233  iVector.emplace_back(1);
234 
235  Tr3D tr;
236  auto ptr(cellGeomPtr(i));
237  if (nullptr != ptr) {
238  ptr->getTransform(tr, (Pt3DVec*)nullptr);
239 
240  if (Tr3D() == tr) { // there is no rotation
241  const GlobalPoint& gp(ptr->getPosition());
242  tr = HepGeom::Translate3D(gp.x(), gp.y(), gp.z());
243  }
244 
245  const CLHEP::Hep3Vector tt(tr.getTranslation());
246  trVector.emplace_back(tt.x());
247  trVector.emplace_back(tt.y());
248  trVector.emplace_back(tt.z());
249  if (6 == numberOfTransformParms()) {
250  const CLHEP::HepRotation rr(tr.getRotation());
251  const ROOT::Math::Transform3D rtr(
252  rr.xx(), rr.xy(), rr.xz(), tt.x(), rr.yx(), rr.yy(), rr.yz(), tt.y(), rr.zx(), rr.zy(), rr.zz(), tt.z());
254  rtr.GetRotation(ea);
255  trVector.emplace_back(ea.Phi());
256  trVector.emplace_back(ea.Theta());
257  trVector.emplace_back(ea.Psi());
258  }
259  }
260  }
261 }
unsigned int totalGeomModules() const
virtual unsigned int numberOfParametersPerShape() const
const FastTimeTopology & topology() const
std::vector< float > ParmVec
virtual unsigned int numberOfShapes() const
std::shared_ptr< const CaloCellGeometry > cellGeomPtr(uint32_t index) const override
Definition: DetId.h:17
AlgebraicVector EulerAngles
Definition: Definitions.h:34
double getRin(int type) const
CaloCellGeometry::Pt3DVec Pt3DVec
CaloCellGeometry::Tr3D Tr3D
double getRout(int type) const
double getZHalf(int type) const
virtual unsigned int numberOfTransformParms() const
const FastTimeDDDConstants & dddConstants() const
std::vector< DetId > m_validGeomIds
const std::vector<DetId>& FastTimeGeometry::getValidDetIds ( DetId::Detector  det = DetId::Detector(0),
int  subdet = 0 
) const
inlineoverridevirtual

Get a list of valid detector ids (for the given subdetector)

Note
The implementation in this class is relevant for SubdetectorGeometries which handle only a single subdetector at a time. It does not look at the det and subdet arguments.

Reimplemented from CaloSubdetectorGeometry.

Definition at line 71 of file FastTimeGeometry.h.

References CaloSubdetectorGeometry::m_validIds.

Referenced by FWRecoGeometryESProducer::addFTLGeometry().

71  {
72  return m_validIds;
73  }
std::vector< DetId > m_validIds
const std::vector<DetId>& FastTimeGeometry::getValidGeomDetIds ( void  ) const
inline

Definition at line 74 of file FastTimeGeometry.h.

References m_validGeomIds.

74 { return m_validGeomIds; }
std::vector< DetId > m_validGeomIds
unsigned int FastTimeGeometry::indexFor ( const DetId id) const
overrideprotectedvirtual

Reimplemented from CaloSubdetectorGeometry.

Definition at line 143 of file FastTimeGeometry.cc.

References gather_cfg::cout, TauDecayModes::dec, FastTimeTopology::detId2denseGeomId(), FastTimeDetId::geometryCell(), m_cellVec, DetId::rawId(), and topology().

143  {
144  unsigned int cellIndex = m_cellVec.size();
145  if (id != DetId()) {
146  DetId geoId = (DetId)(FastTimeDetId(id).geometryCell());
147  cellIndex = topology().detId2denseGeomId(geoId);
148 #ifdef EDM_ML_DEBUG
149  std::cout << "indexFor " << std::hex << id.rawId() << ":" << geoId.rawId() << std::dec << " index " << cellIndex
150  << std::endl;
151 #endif
152  }
153  return cellIndex;
154 }
FastTimeDetId geometryCell() const
Definition: FastTimeDetId.h:32
constexpr uint32_t rawId() const
get the raw id
Definition: DetId.h:57
const FastTimeTopology & topology() const
virtual uint32_t detId2denseGeomId(const DetId &id) const
Definition: DetId.h:17
tuple cout
Definition: gather_cfg.py:144
void FastTimeGeometry::initializeParms ( )
overridevirtual

Reimplemented from CaloSubdetectorGeometry.

Definition at line 31 of file FastTimeGeometry.cc.

31 {}
void FastTimeGeometry::localCorners ( Pt3DVec lc,
const CCGFloat pv,
unsigned int  i,
Pt3D ref 
)

Definition at line 33 of file FastTimeGeometry.cc.

References FlatTrd::localCorners().

33  {
34  FlatTrd::localCorners(lc, pv, ref);
35 }
static void localCorners(Pt3DVec &vec, const CCGFloat *pv, Pt3D &ref)
Definition: FlatTrd.cc:153
void FastTimeGeometry::newCell ( const GlobalPoint f1,
const GlobalPoint f2,
const GlobalPoint f3,
const CCGFloat parm,
const DetId detId 
)
overridevirtual

Implements CaloSubdetectorGeometry.

Definition at line 37 of file FastTimeGeometry.cc.

References CaloSubdetectorGeometry::cornersMgr(), gather_cfg::cout, FastTimeTopology::dddConstants(), TauDecayModes::dec, FastTimeTopology::decode(), FastTimeTopology::encode(), FastTimeDetId::geometryCell(), m_cellVec, m_Type, m_validGeomIds, CaloSubdetectorGeometry::m_validIds, HLT_FULL_cff::nPhi, FastTimeDDDConstants::numberEtaZ(), FastTimeDDDConstants::numberPhi(), phi, DetId::rawId(), topology(), PV3DBase< T, PVType, FrameType >::x(), PV3DBase< T, PVType, FrameType >::y(), and PV3DBase< T, PVType, FrameType >::z().

Referenced by FastTimeGeometryLoader::buildGeom().

38  {
40  DetId geomId = (DetId)(FastTimeDetId(detId).geometryCell());
41  int nEtaZ = topology().dddConstants().numberEtaZ(m_Type);
43 
44  const uint32_t cellIndex(topology().detId2denseGeomId(detId));
45 
46  m_cellVec.at(cellIndex) = FlatTrd(cornersMgr(), f1, f2, f3, parm);
47  m_validGeomIds.at(cellIndex) = geomId;
48 
49 #ifdef EDM_ML_DEBUG
50  unsigned int nOld = m_validIds.size();
51 #endif
52  for (int etaZ = 1; etaZ <= nEtaZ; ++etaZ) {
53  id.iEtaZ = etaZ;
54  for (int phi = 1; phi <= nPhi; ++phi) {
55  id.iPhi = phi;
56  DetId idc = topology().encode(id);
57  if (topology().valid(idc)) {
58  m_validIds.emplace_back(idc);
59  }
60  }
61  }
62 
63 #ifdef EDM_ML_DEBUG
64  std::cout << "FastTimeGeometry::newCell-> [" << cellIndex << "]"
65  << " front:" << f1.x() << '/' << f1.y() << '/' << f1.z() << " back:" << f2.x() << '/' << f2.y() << '/'
66  << f2.z() << " eta|phi " << m_cellVec[cellIndex].etaPos() << ":" << m_cellVec[cellIndex].phiPos()
67  << " id:" << FastTimeDetId(detId) << " with valid DetId from " << nOld << " to " << m_validIds.size()
68  << std::endl;
69  std::cout << "Cell[" << cellIndex << "] " << std::hex << geomId.rawId() << ":" << m_validGeomIds[cellIndex].rawId()
70  << std::dec << std::endl;
71 #endif
72 }
DecodedDetId decode(const DetId &id) const
A base class to handle the particular shape of HGCal volumes.
Definition: FlatTrd.h:19
int numberEtaZ(int type) const
FastTimeDetId geometryCell() const
Definition: FastTimeDetId.h:32
constexpr uint32_t rawId() const
get the raw id
Definition: DetId.h:57
const FastTimeTopology & topology() const
T y() const
Definition: PV3DBase.h:60
int numberPhi(int type) const
std::vector< DetId > m_validIds
T z() const
Definition: PV3DBase.h:61
Definition: DetId.h:17
CaloCellGeometry::CornersMgr * cornersMgr()
DetId encode(const DecodedDetId &id_) const
tuple cout
Definition: gather_cfg.py:144
T x() const
Definition: PV3DBase.h:59
const FastTimeDDDConstants & dddConstants() const
std::vector< DetId > m_validGeomIds
bool FastTimeGeometry::present ( const DetId id) const
overridevirtual

is this detid present in the geometry?

Reimplemented from CaloSubdetectorGeometry.

Definition at line 83 of file FastTimeGeometry.cc.

References FastTimeDetId::geometryCell(), getGeometryRawPtr(), and topology().

83  {
84  if (id == DetId())
85  return false;
86  DetId geoId = (DetId)(FastTimeDetId(id).geometryCell());
87  const uint32_t index(topology().detId2denseGeomId(geoId));
88  return (nullptr != getGeometryRawPtr(index));
89 }
FastTimeDetId geometryCell() const
Definition: FastTimeDetId.h:32
const FastTimeTopology & topology() const
Definition: DetId.h:17
const CaloCellGeometry * getGeometryRawPtr(uint32_t index) const override
static std::string FastTimeGeometry::producerTag ( )
inlinestatic

Definition at line 90 of file FastTimeGeometry.h.

90 { return "FastTime"; }
unsigned int FastTimeGeometry::sizeForDenseIndex ( ) const
protected

Definition at line 156 of file FastTimeGeometry.cc.

References topology(), and FastTimeTopology::totalGeomModules().

156 { return topology().totalGeomModules(); }
unsigned int totalGeomModules() const
const FastTimeTopology & topology() const
void FastTimeGeometry::sortDetIds ( void  )

Definition at line 200 of file FastTimeGeometry.cc.

References CaloSubdetectorGeometry::m_validIds.

Referenced by FastTimeGeometryLoader::build().

200  {
201  m_validIds.shrink_to_fit();
202  std::sort(m_validIds.begin(), m_validIds.end(), rawIdSort());
203 }
std::vector< DetId > m_validIds
const FastTimeTopology& FastTimeGeometry::topology ( ) const
inline

Member Data Documentation

CellVec FastTimeGeometry::m_cellVec
private

Definition at line 112 of file FastTimeGeometry.h.

Referenced by cellGeomPtr(), getGeometryRawPtr(), indexFor(), and newCell().

ForwardSubdetector FastTimeGeometry::m_subdet
private

Definition at line 115 of file FastTimeGeometry.h.

const FastTimeTopology& FastTimeGeometry::m_topology
private

Definition at line 110 of file FastTimeGeometry.h.

Referenced by topology().

int FastTimeGeometry::m_Type
private
std::vector<DetId> FastTimeGeometry::m_validGeomIds
private

Definition at line 113 of file FastTimeGeometry.h.

Referenced by cellGeomPtr(), getSummary(), getValidGeomDetIds(), and newCell().