6#include "GaudiKernel/MsgStream.h"
11 std::multimap<int,Identifier> indexmap;
15 indexmap.insert(std::pair<int,Identifier>(std::abs(itr->second),itr->first));
16 std::vector< std::vector<float> > tmp(
m_buf);
20 for (;i<(int)tmp.size();i++){
23 std::multimap<int,Identifier>::iterator pos;
24 for ( pos=indexmap.lower_bound(i); pos!=indexmap.upper_bound(i); ++pos){
27 shared_id=pos->second;
28 this->
push_back(shared_id,tmp[std::abs(i)]);
30 this->
share(pos->second,shared_id);
36 std::cout <<
"dbg:" <<
m_bufmap.size() <<
" " <<
m_buf.size() << std::endl;
41 os << store.tag() << std::endl ;
44 std::map<int, std::vector<Identifier> > indextoidentmap ;
46 indextoidentmap[it.second].push_back(it.first) ;
48 os << indextoidentmap.size() << std::endl ;
51 for( std::map<
int, std::vector<Identifier> >
::const_iterator it = indextoidentmap.begin() ;
52 it != indextoidentmap.end(); ++it) {
53 os << it->second.size() <<
" " ;
54 for(
auto vit : it->second)
56 const std::vector<float>&
data = store[it->second.front()] ;
57 os <<
data.size() <<
" " ;
70 std::vector<int> identifiers(0) ;
71 std::vector<float>
data(0) ;
72 constexpr int maxLines=2000000;
73 constexpr int maxSize=2000000;
76 if ((nlines>=0) and (nlines<maxLines)) {
77 for(
int iline = 0; iline <nlines; ++iline) {
80 if ((size>=0) and (size<maxSize)){
81 identifiers.resize(size) ;
82 for(
int i=0; i<size; ++i) is >> (identifiers[i]) ;
86 log << MSG::ERROR <<
"size of identifier is incorrect" <<
endmsg;
90 if ((size>=0) and (size<maxSize)){
92 for(
int i=0; i<size; ++i) is >> (
data[i]) ;
96 log << MSG::ERROR <<
"size of data is incorrect" <<
endmsg;
101 std::vector<int>::const_iterator it = identifiers.begin() ;
std::ostream & operator<<(std::ostream &os, const FloatArrayStore &store)
std::istream & operator>>(std::istream &is, FloatArrayStore &store)
char data[hepevt_bytes_allocation_ATLAS]
class FloatArrayStore Access and manipulate an indexed storage of float vectors
void cleanUp()
remove data with no index pointing to it
void share(const Identifier &ident, const Identifier &referenceIdent)
makes index ident share data with referenceIdent
BufferMap::const_iterator map_citr
BufferMap m_bufmap
The std::map.
void push_back(const Identifier &ident, const std::vector< float > &value)
makes new indices
void dbg() const
print method
Buffer m_buf
The std::vector<float> stored in each second element.
singleton-like access to IMessageSvc via open function and helper
IMessageSvc * getMessageSvc(bool quiet=false)