|
ATLAS Offline Software
|
Go to the documentation of this file.
33 TempInterface (
size_t size) : m_size (
size) {}
36 virtual size_t size_v()
const {
return m_size; }
37 virtual size_t capacity_v()
const {
return m_size; }
74 if( nremaining == 0) {
89 dyn_auxids = iio->getDynamicAuxIDs();
90 sel_auxids = iio->getSelectedAuxIDs();
95 copy.resize (nremaining);
100 if(auxid == SG::null_auxid)
continue;
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)) {
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 "
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);
171 if (linked_auxid != null_auxid) {
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 (&
copy);
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,
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;
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));
250 val = compressors[nmantissa].reduceFloatPrecision(
val);
void copyAuxStoreThinned(const SG::IConstAuxStore &orig, SG::IAuxStore ©, const SG::ThinningInfo *info)
Helper to copy an aux store while applying thinning.
virtual const void * getData(SG::auxid_t auxid) const =0
Return the data vector for one 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.
static AuxTypeRegistry & instance()
Return the singleton registry instance.
void copyAuxStoreThinned NO_SANITIZE_UNDEFINED(const SG::IConstAuxStore &orig, SG::IAuxStore ©, const SG::ThinningInfo *info)
Helper to copy an aux store while applying thinning.
Hold thinning decisions for one container.
bool thinned(size_t ndx) const
Return true if element ndx should be thinned.
Hold thinning decisions for one container.
size_t thinnedSize() const
Return the size of the container being thinned after thinning.
virtual size_t size() const =0
Return the number of elements in the store.
Interface providing I/O for a generic auxiliary store.
Handle mappings between names and auxid_t.
void setStore(SG::IAuxStore *store)
Set the store associated with this object.
bool isSigned() const
Are elements being written as signed numbers?
uint8_t nmantissa() const
The number of bits used for the mantissa portion of a float-point representation, excluding a sign bi...
Hold thinning/slimming information for a given object.
size_t auxid_t
Identifier for a particular aux data item.
Helper to copy an aux store while applying thinning.
std::string typeinfoName(const std::type_info &ti)
Convert a type_info to a demangled string.
bool isFloat() const
Are elements being written as floating-point numbers?
Interface providing I/O for a generic auxiliary store.
#define ATHCONTAINERS_WARNING(ctx, msg)
uint8_t nbits() const
The number of bits used to store each element.
Helper for emitting error messages.
Hold information about an option setting request.
virtual const IAuxTypeVector * linkedVector(SG::auxid_t) const
Return interface for a linked variable.
Interface for non-const operations on an auxiliary store.
Container to hold aux data to be stored in a packed form.
Abstract interface for manipulating vectors of arbitrary types.
virtual const SG::auxid_set_t & getDecorIDs() const =0
Return a set of identifiers for decorations in this store.
Handle mappings between names and auxid_t.
Interface for non-const operations on an auxiliary store.
A set of aux data identifiers.
bool rounding() const
Should floats be rounded during writing?
Helper to disable undefined behavior sanitizer for a function.
Manage lookup of vectors of auxiliary data.
Interface for const operations on an auxiliary store.
Interface for const operations on an auxiliary store.
virtual const SG::auxid_set_t & getAuxIDs() const =0
Return a set of identifiers for existing data items in this store.
virtual size_t capacity_v() const =0
Return the capacity of the container.
virtual size_t size_v() const =0
Return the size of the container.
float scale() const
Return the scale for floating-point numbers.
Describe how the contents of a PackedContainer are to be saved.
bool test(bit_t bit) const
Test to see if a bit is set.