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.push_back(
getGeometry(
id));
159 const ParVec& pv ( *ivv ) ;
162 dVec.push_back( *iv ) ;
176 tr = HepGeom::Translate3D( gp.x(), gp.y(), gp.z() ) ;
179 const CLHEP::Hep3Vector
tt ( tr.getTranslation() ) ;
180 tVec.push_back(
tt.x() ) ;
181 tVec.push_back(
tt.y() ) ;
182 tVec.push_back(
tt.z() ) ;
185 const CLHEP::HepRotation
rr ( tr.getRotation() ) ;
186 const ROOT::Math::Transform3D rtr (
rr.xx(),
rr.xy(),
rr.xz(),
tt.x(),
188 rr.zx(),
rr.zy(),
rr.zz(),
tt.z() ) ;
190 rtr.GetRotation( ea ) ;
191 tVec.push_back( ea.Phi() ) ;
192 tVec.push_back( ea.Theta() ) ;
193 tVec.push_back( ea.Psi() ) ;
198 unsigned int ishape ( 9999 ) ;
199 for(
unsigned int ivv ( 0 ) ; ivv !=
parVecVec().size() ; ++ivv )
205 ok = ok && ( fabs( par[
k] - pv[
k] ) < 1.e-6 ) ;
213 assert( 9999 != ishape ) ;
216 if( iVec.size() < nn ) iVec.push_back( ishape ) ;
225 if(!
m_deltaPhi.load(std::memory_order_acquire))
228 auto ptr =
new std::vector<CCGFloat>(kSize);
229 for( uint32_t
i ( 0 ) ;
i != kSize ; ++
i )
261 if(
M_PI < dPhi1 ) dPhi1 = fabs( dPhi1 - 2.*
M_PI ) ;
262 if(
M_PI < dPhi2 ) dPhi2 = fabs( dPhi2 - 2.*
M_PI ) ;
263 (*ptr)[
i] = dPhi1>dPhi2 ? dPhi1 : dPhi2 ;
266 std::vector<CCGFloat>* expect =
nullptr;
267 bool exchanged =
m_deltaPhi.compare_exchange_strong(expect, ptr, std::memory_order_acq_rel);
268 if (!exchanged)
delete ptr;
277 if(!
m_deltaEta.load(std::memory_order_acquire))
280 auto ptr =
new std::vector<CCGFloat> ( kSize ) ;
281 for( uint32_t
i ( 0 ) ;
i != kSize ; ++
i )
313 (*ptr)[
i] = dEta1>dEta2 ? dEta1 : dEta2 ;
316 std::vector<CCGFloat>* expect =
nullptr;
317 bool exchanged =
m_deltaEta.compare_exchange_strong(expect, ptr, std::memory_order_acq_rel);
318 if (!exchanged)
delete ptr;
CaloCellGeometry::CornersMgr * m_cmgr
std::set< DetId > DetIdSet
std::vector< CCGFloat > DimVec
virtual unsigned int numberOfParametersPerShape() const
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
const_iterator begin() const
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.
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
CaloCellGeometry::CCGFloat CCGFloat
uint32_t denseIndex() const
virtual const CaloCellGeometry * cellGeomPtr(uint32_t index) const =0
CaloSubdetectorGeometry()
virtual DetId getClosestCell(const GlobalPoint &r) const
CaloCellGeometry::Pt3D Pt3D
AlgebraicVector EulerAngles
void addValidID(const DetId &id)
CaloCellGeometry::Pt3DVec Pt3DVec
HepGeom::Point3D< CCGFloat > Pt3D
CaloCellGeometry::ParMgr ParMgr
T1 deltaR2(T1 eta1, T2 phi1, T3 eta2, T4 phi2)
CaloCellGeometry::Tr3D Tr3D
virtual unsigned int indexFor(const DetId &id) const
MgrType::const_iterator const_iterator
virtual ~CaloSubdetectorGeometry()
The base class DOES assume that it owns the CaloCellGeometry objects.
const_iterator end() const
void allocateCorners(CaloCellGeometry::CornersVec::size_type n)
std::atomic< std::vector< CCGFloat > * > m_deltaEta
virtual unsigned int numberOfTransformParms() const
const GlobalPoint & getPosition() const
Returns the position of reference for this cell.
virtual unsigned int sizeForDenseIndex(const DetId &id) const
virtual const CornersVec & getCorners() const =0
Returns the corner points of this cell's volume.