14 : theGeometries(geos),
18 theDetUnitIds(nullptr),
55 int idx =
id.det() - 1;
64 throw cms::Exception(
"NoGeometry") <<
"No Tracking Geometry is available for DetId " <<
id.rawId() << std::endl;
73 if (theGeometrie ==
nullptr)
76 if (
detTypes.size() + ptr->size() < ptr->capacity())
77 ptr->resize(
detTypes.size() + ptr->size());
79 ptr->emplace_back(detType);
82 if (
theDetTypes.compare_exchange_strong(expect, ptr.get(), std::memory_order_acq_rel)) {
86 return *
theDetTypes.load(std::memory_order_acquire);
93 if (theGeometrie ==
nullptr)
96 if (
detUnits.size() + ptr->size() < ptr->capacity())
97 ptr->resize(
detUnits.size() + ptr->size());
99 ptr->emplace_back(detUnit);
102 if (
theDetUnits.compare_exchange_strong(expect, ptr.get(), std::memory_order_acq_rel)) {
106 return *
theDetUnits.load(std::memory_order_acquire);
110 if (!
theDets.load(std::memory_order_acquire)) {
113 if (theGeometrie ==
nullptr)
116 if (
dets.size() + ptr->size() < ptr->capacity())
117 ptr->resize(
dets.size() + ptr->size());
118 for (
auto det :
dets)
119 ptr->emplace_back(det);
122 if (
theDets.compare_exchange_strong(expect, ptr.get(), std::memory_order_acq_rel)) {
126 return *
theDets.load(std::memory_order_acquire);
133 if (theGeometrie ==
nullptr)
136 if (
detUnitIds.size() + ptr->size() < ptr->capacity())
139 ptr->emplace_back(detUnitId);
142 if (
theDetUnitIds.compare_exchange_strong(expect, ptr.get(), std::memory_order_acq_rel)) {
150 if (!
theDetIds.load(std::memory_order_acquire)) {
153 if (theGeometrie ==
nullptr)
156 if (
detIds.size() + ptr->size() < ptr->capacity())
157 ptr->resize(
detIds.size() + ptr->size());
159 ptr->emplace_back(detId);
162 if (
theDetIds.compare_exchange_strong(expect, ptr.get(), std::memory_order_acq_rel)) {
166 return *
theDetIds.load(std::memory_order_acquire);
const DetContainer & dets() const override
Returm a vector of all GeomDet (including all GeomDetUnits)
std::vector< const TrackingGeometry * > theGeometries
const DetContainer & detUnits() const override
Returm a vector of all GeomDet.
std::atomic< DetIdContainer * > theDetUnitIds
~GlobalTrackingGeometry() override
const GeomDet * idToDet(DetId) const override
std::atomic< DetContainer * > theDets
const DetIdContainer & detIds() const override
Returm a vector of all GeomDet DetIds (including those of GeomDetUnits)
std::vector< const GeomDet * > DetContainer
std::atomic< DetIdContainer * > theDetIds
virtual const GeomDet * idToDetUnit(DetId) const =0
Return the pointer to the GeomDetUnit corresponding to a given DetId.
std::atomic< DetTypeContainer * > theDetTypes
const TrackingGeometry * slaveGeometry(DetId id) const
Return the pointer to the actual geometry for a given DetId.
std::atomic< DetContainer * > theDetUnits
GlobalTrackingGeometry(std::vector< const TrackingGeometry * > &geos)
virtual const GeomDet * idToDet(DetId) const =0
std::vector< DetId > DetIdContainer
std::vector< const GeomDetType * > DetTypeContainer
const DetTypeContainer & detTypes() const override
Return a vector of all det types.
const DetIdContainer & detUnitIds() const override
Returm a vector of all GeomDetUnit DetIds.
const GeomDet * idToDetUnit(DetId) const override
Return the pointer to the GeomDetUnit corresponding to a given DetId.