4 #include <Math/Transform3D.h> 5 #include <Math/EulerAngles.h> 36 const std::vector<DetId>&
60 uint32_t
index ( ~0 ) ;
79 return ( closest > 0.9e9 ||
80 (uint32_t)(~0) == index ?
DetId(0) :
88 const double dR2 ( dR*dR ) ;
89 const double eta ( r.
eta() ) ;
90 const double phi ( r.
phi() ) ;
103 if( fabs(
eta - eta0 ) <
dR )
107 if( delp >
M_PI ) delp = 2*
M_PI - delp ;
111 if( dist2 < dR2 ) dss.insert(
m_validIds[i] ) ;
124 CellSet cells; cells.reserve(ids.size());
125 for (
auto id : ids) cells.emplace_back(
getGeometry(
id));
132 assert(
nullptr ==
m_cmgr ) ;
161 dVec.emplace_back( iv ) ;
169 assert(
nullptr != ptr ) ;
175 tr = HepGeom::Translate3D(
gp.x(),
gp.y(),
gp.z() ) ;
178 const CLHEP::Hep3Vector
tt ( tr.getTranslation() ) ;
179 tVec.emplace_back(
tt.x() ) ;
180 tVec.emplace_back(
tt.y() ) ;
181 tVec.emplace_back(
tt.z() ) ;
184 const CLHEP::HepRotation
rr ( tr.getRotation() ) ;
185 const ROOT::Math::Transform3D rtr (
rr.xx(),
rr.xy(),
rr.xz(),
tt.x(),
187 rr.zx(),
rr.zy(),
rr.zz(),
tt.z() ) ;
189 rtr.GetRotation( ea ) ;
190 tVec.emplace_back( ea.Phi() ) ;
191 tVec.emplace_back( ea.Theta() ) ;
192 tVec.emplace_back( ea.Psi() ) ;
197 unsigned int ishape ( 9999 ) ;
198 for(
unsigned int ivv ( 0 ) ; ivv !=
parVecVec().size() ; ++ivv )
204 ok = ok && ( fabs( par[
k] - pv[
k] ) < 1.e-6 ) ;
212 assert( 9999 != ishape ) ;
215 if( iVec.size() <
nn ) iVec.emplace_back( ishape ) ;
224 if(!
m_deltaPhi.load(std::memory_order_acquire))
227 auto ptr =
new std::vector<CCGFloat>(kSize);
228 for( uint32_t
i ( 0 ) ;
i != kSize ; ++
i )
231 if(
nullptr != cellPtr )
260 if(
M_PI < dPhi1 ) dPhi1 = fabs( dPhi1 - 2.*
M_PI ) ;
261 if(
M_PI < dPhi2 ) dPhi2 = fabs( dPhi2 - 2.*
M_PI ) ;
262 (*ptr)[
i] = dPhi1>dPhi2 ? dPhi1 : dPhi2 ;
265 std::vector<CCGFloat>* expect =
nullptr;
266 bool exchanged =
m_deltaPhi.compare_exchange_strong(expect, ptr, std::memory_order_acq_rel);
267 if (!exchanged)
delete ptr;
276 if(!
m_deltaEta.load(std::memory_order_acquire))
279 auto ptr =
new std::vector<CCGFloat> ( kSize ) ;
280 for( uint32_t
i ( 0 ) ;
i != kSize ; ++
i )
283 if(
nullptr != cellPtr )
312 (*ptr)[
i] = dEta1>dEta2 ? dEta1 : dEta2 ;
315 std::vector<CCGFloat>* expect =
nullptr;
316 bool exchanged =
m_deltaEta.compare_exchange_strong(expect, ptr, std::memory_order_acq_rel);
317 if (!exchanged)
delete ptr;
CaloCellGeometry::CornersMgr * m_cmgr
std::set< DetId > DetIdSet
std::vector< CCGFloat > DimVec
virtual unsigned int numberOfParametersPerShape() const
virtual const GlobalPoint & getPosition() const
Returns the position of reference for this cell.
CCGFloat deltaPhi(const DetId &detId) const
Geom::Phi< T > phi() const
MgrType::size_type size_type
Global3DPoint GlobalPoint
std::vector< unsigned int > IVec
std::vector< CaloCellGeometry const * > CellSet
std::vector< CCGFloat > TrVec
CaloCellGeometry::Tr3D Tr3D
CaloCellGeometry::Pt3DVec Pt3DVec
HepGeom::Transform3D Tr3D
uint32_t sizeForDenseIndexing() const
std::vector< Pt3D > Pt3DVec
CCGFloat deltaEta(const DetId &detId) const
CaloCellGeometry::CCGFloat CCGFloat
EZMgrFL< GlobalPoint > CornersMgr
void allocatePar(ParVec::size_type n, unsigned int m)
virtual CellSet getCellSet(const GlobalPoint &r, double dR) 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)
virtual const CaloCellGeometry * getGeometry(const DetId &id) const
Get the cell geometry of a given detector id. Should return false if not found.
static constexpr unsigned int k_cornerSize
virtual void getSummary(TrVec &trVector, IVec &iVector, DimVec &dimVector, IVec &dinsVector) const
virtual bool present(const DetId &id) const
is this detid present in the geometry?
virtual DetIdSet getCells(const GlobalPoint &r, double dR) const
Get a list of all cells within a dR of the given cell.
const CCGFloat * param() const
virtual unsigned int numberOfShapes() const
virtual void getTransform(Tr3D &tr, Pt3DVec *lptr) const
--------— only needed by specific utility; overloaded when needed -—
std::vector< DetId > m_validIds
std::atomic< std::vector< CCGFloat > * > m_deltaPhi
CaloSubdetectorGeometry::CCGFloat CCGFloat
virtual const CaloCellGeometry * cellGeomPtr(uint32_t index) const =0
uint32_t denseIndex() const
CaloSubdetectorGeometry()
virtual DetId getClosestCell(const GlobalPoint &r) const
AlgebraicVector EulerAngles
void addValidID(const DetId &id)
CaloCellGeometry::Pt3DVec Pt3DVec
HepGeom::Point3D< CCGFloat > Pt3D
CaloCellGeometry::Pt3D Pt3D
CaloCellGeometry::ParMgr ParMgr
T1 deltaR2(T1 eta1, T2 phi1, T3 eta2, T4 phi2)
CornersVec const & getCorners() const
Returns the corner points of this cell's volume.
CaloCellGeometry::Tr3D Tr3D
virtual unsigned int indexFor(const DetId &id) const
virtual ~CaloSubdetectorGeometry()
The base class DOES assume that it owns the CaloCellGeometry objects.
void allocateCorners(CaloCellGeometry::CornersVec::size_type n)
std::atomic< std::vector< CCGFloat > * > m_deltaEta
virtual unsigned int numberOfTransformParms() const
virtual unsigned int sizeForDenseIndex(const DetId &id) const