33 TempInterface (
size_t size) : m_size (
size) {}
34 using AuxVectorData::setStore;
36 virtual size_t size_v()
const override {
return m_size; }
37 virtual size_t capacity_v()
const override {
return m_size; }
65 size_t size = orig.
size();
73 size_t nremaining = dec ? dec->
thinnedSize() : size;
74 if( nremaining == 0) {
89 dyn_auxids = iio->getDynamicAuxIDs();
90 sel_auxids = iio->getSelectedAuxIDs();
95 copy.resize (nremaining);
104 if (
r.isLinked (auxid))
continue;
114 if (dyn_auxids.
test(auxid) || !new_auxids.
test(auxid)) {
116 if (info->vetoed(auxid))
continue;
122 if (dyn_auxids.
test(auxid) && !sel_auxids.
test(auxid)) {
127 const void* src = orig.
getData (auxid);
133 if (decors.
test (auxid) &&
r.getName (auxid) !=
"mcEventWeights") {
134 std::ostringstream
ss;
135 ss <<
"unlocked decoration " <<
r.getName(auxid)
136 <<
" (" << auxid <<
") in object of type "
137 << AthContainers_detail::typeinfoName (
typeid (orig));
144 const std::type_info* typ = iio->getIOType (auxid);
145 if (strstr (typ->name(),
"PackedContainer") !=
nullptr) {
162 const size_t eltSize{
r.getEltSize(auxid) };
163 const std::string typeName{
r.getTypeName(auxid) };
164 const unsigned int nmantissa{ info !=
nullptr ? info->compression(auxid) : 0 };
167 void* dst = copy.getData (auxid, nremaining, nremaining);
174 size_t sz = v->size();
175 copy.getData (linked_auxid, 0,
sz);
179 TempInterface srciface (orig.
size());
180 srciface.setStore (&orig);
181 TempInterface dstiface (copy.size());
182 dstiface.setStore (©);
185 if (nremaining == size) {
187 r.copyForOutput (auxid, dstiface, 0, srciface, 0, size);
191 for (std::size_t isrc = 0, idst = 0; isrc < size; ++isrc) {
192 if (!dec || !dec->
thinned(isrc)) {
193 r.copyForOutput (auxid, dstiface, idst, srciface, isrc, 1);
214 const std::size_t idst,
216 const std::size_t eltSize,
217 const std::string& typeName,
218 const unsigned int nmantissa)
223 static const unsigned int NMANTISSA_MAX = 23;
224 if (nmantissa == 0 || nmantissa >= NMANTISSA_MAX)
return;
227 static const std::vector<CxxUtils::FloatCompressor> compressors = [] {
228 std::vector<CxxUtils::FloatCompressor>
result;
229 result.reserve(NMANTISSA_MAX);
230 for (std::size_t idx = 0; idx < NMANTISSA_MAX; ++idx)
236 char* eltPtr =
reinterpret_cast<char*
>(dst) + idst*eltSize;
239 if(typeName ==
"float") {
241 float* f =
reinterpret_cast<float*
> (eltPtr);
242 for (
size_t i = 0; i < n; i++) {
243 *f = compressors[nmantissa].reduceFloatPrecision(*f);
246 }
else if (typeName ==
"std::vector<float>"){
247 for (
size_t i = 0; i < n; i++) {
248 std::vector<float> &vals = *(
reinterpret_cast<std::vector<float>*
>(eltPtr));
249 for(
auto &val: vals) {
250 val = compressors[nmantissa].reduceFloatPrecision(val);
Handle mappings between names and auxid_t.
Interface providing I/O for a generic auxiliary store.
Interface for non-const operations on an auxiliary store.
Interface for const operations on an auxiliary store.
Hold thinning decisions for one container.
bool test(bit_t bit) const
Test to see if a bit is set.
Hold information about an option setting request.
Handle mappings between names and auxid_t.
static AuxTypeRegistry & instance()
Return the singleton registry instance.
Manage lookup of vectors of auxiliary data.
Interface providing I/O for a generic auxiliary store.
Interface for non-const operations on an auxiliary store.
Abstract interface for manipulating vectors of arbitrary types.
Interface for const operations on an auxiliary store.
virtual const SG::auxid_set_t & getDecorIDs() const =0
Return a set of identifiers for decorations in this store.
virtual const IAuxTypeVector * linkedVector(SG::auxid_t) const
Return interface for a linked variable.
virtual const SG::auxid_set_t & getAuxIDs() const =0
Return a set of identifiers for existing data items in this store.
virtual const void * getData(SG::auxid_t auxid) const =0
Return the data vector for one aux data item.
virtual size_t size() const =0
Return the number of elements in the store.
Container to hold aux data to be stored in a packed form.
const PackedParameters & parms() const
Return the packing parameters for this container.
Describe how the contents of a PackedContainer are to be saved.
bool isSigned() const
Are elements being written as signed numbers?
bool isFloat() const
Are elements being written as floating-point numbers?
uint8_t nbits() const
The number of bits used to store each element.
bool rounding() const
Should floats be rounded during writing?
uint8_t nmantissa() const
The number of bits used for the mantissa portion of a float-point representation, excluding a sign bi...
float scale() const
Return the scale for floating-point numbers.
Hold thinning decisions for one container.
bool thinned(size_t ndx) const
Return true if element ndx should be thinned.
size_t thinnedSize() const
Return the size of the container being thinned after thinning.
Hold thinning/slimming information for a given object.
A set of aux data identifiers.
Helper to copy an aux store while applying thinning.
Helper for emitting error messages.
#define ATHCONTAINERS_WARNING(ctx, msg)
void copyAuxStoreThinned(const SG::IConstAuxStore &orig, SG::IAuxStore ©, const SG::ThinningInfo *info)
Helper to copy an aux store while applying thinning.
static const auxid_t null_auxid
To signal no aux data item.
void lossyFloatCompress(void *dst, const std::size_t dst_index, const std::size_t n, const std::size_t eltSize, const std::string &typeName, const unsigned int nmantissa)
Helper method to apply lossy float compression.
size_t auxid_t
Identifier for a particular aux data item.
Helper to disable undefined behavior sanitizer for a function.
#define NO_SANITIZE_UNDEFINED