ATLAS Offline Software
Loading...
Searching...
No Matches
DetCondFloat Class Reference

#include <DetCondFloat.h>

Collaboration diagram for DetCondFloat:

Public Member Functions

 DetCondFloat ()
 DetCondFloat (const int size, const std::string &tag)
virtual ~DetCondFloat ()
int size () const
const std::string & tag () const
int add (const Identifier &ident, const float *f)
void share (const Identifier &ident, const int index)
const float * find (const Identifier &ident) const
int findindex (const Identifier &ident) const
virtual void print () const
virtual void print2 () const

Protected Types

typedef std::less< Identifierlessp
typedef std::map< Identifier, int, lesspBufferMap

Protected Attributes

int m_size
std::string m_tag
BufferMap m_bufmap
std::vector< float > m_buf

Detailed Description

Definition at line 40 of file DetCondFloat.h.

Member Typedef Documentation

◆ BufferMap

typedef std::map<Identifier,int,lessp> DetCondFloat::BufferMap
protected

Definition at line 60 of file DetCondFloat.h.

◆ lessp

typedef std::less<Identifier> DetCondFloat::lessp
protected

Definition at line 59 of file DetCondFloat.h.

Constructor & Destructor Documentation

◆ DetCondFloat() [1/2]

DetCondFloat::DetCondFloat ( )
inline

Definition at line 68 of file DetCondFloat.h.

68: m_size(0), m_tag("null") {}
std::string m_tag

◆ DetCondFloat() [2/2]

DetCondFloat::DetCondFloat ( const int size,
const std::string & tag )
inline

Definition at line 70 of file DetCondFloat.h.

70 :
71m_size(size), m_tag(tag) {}
int size() const
const std::string & tag() const

◆ ~DetCondFloat()

DetCondFloat::~DetCondFloat ( )
inlinevirtual

Definition at line 73 of file DetCondFloat.h.

73{}

Member Function Documentation

◆ add()

int DetCondFloat::add ( const Identifier & ident,
const float * f )

Definition at line 13 of file DetCondFloat.cxx.

13 {
14 // get pointer to added objects
15 size_t j=m_buf.size();
16 // add them in to the buffer
17 m_buf.resize(j+m_size);
18 for (int i=0;i<m_size;++i) m_buf[j+i]=f[i];
19 // put new map entry
20 m_bufmap[ident]=j;
21 return j;
22}
BufferMap m_bufmap
std::vector< float > m_buf
@ ident
Definition HitInfo.h:77

◆ find()

const float * DetCondFloat::find ( const Identifier & ident) const

Definition at line 29 of file DetCondFloat.cxx.

29 {
30 BufferMap::const_iterator itr=m_bufmap.find(ident);
31 if (itr!=m_bufmap.end()) {
32 // return pointer to datastructure
33 return &m_buf[itr->second];
34 } else {
35 // identifier not in map, return null pointer
36 return 0;
37 }
38}

◆ findindex()

int DetCondFloat::findindex ( const Identifier & ident) const

Definition at line 40 of file DetCondFloat.cxx.

40 {
41 BufferMap::const_iterator itr=m_bufmap.find(ident);
42 if (itr!=m_bufmap.end()) {
43 // return index in datastructure, for subsequent share call
44 return itr->second;
45 } else {
46 // identifier not in map, return -ve offset to signal error
47 return -1;
48 }
49}

◆ print()

void DetCondFloat::print ( ) const
virtual

Definition at line 51 of file DetCondFloat.cxx.

51 {
52 std::cout << "DetCondFloat " << m_tag << " has granularity " << m_size <<
53 " with " << m_bufmap.size() << " entries and " << m_buf.size() <<
54 " elements" << std::endl;
55}

◆ print2()

void DetCondFloat::print2 ( ) const
virtual

Definition at line 57 of file DetCondFloat.cxx.

57 {
58 print();
59 int i=0;
60 for (BufferMap::const_iterator itr=m_bufmap.begin();
61 itr!=m_bufmap.end(); ++itr,++i) {
62 int j=itr->second;
63 std::cout << "Element " << i << " ident " << (itr->first).getString() <<
64 "offset " << j << " values:";
65 for (int k=j; k<j+m_size; ++k) std::cout << " " << m_buf[k];
66 std::cout << std::endl;
67 }
68}
virtual void print() const

◆ share()

void DetCondFloat::share ( const Identifier & ident,
const int index )

Definition at line 24 of file DetCondFloat.cxx.

24 {
25 // add object which is pointing to already existing buffer space
27}
str index
Definition DeMoScan.py:362

◆ size()

int DetCondFloat::size ( ) const
inline

Definition at line 75 of file DetCondFloat.h.

75{return m_size;}

◆ tag()

const std::string & DetCondFloat::tag ( ) const
inline

Definition at line 77 of file DetCondFloat.h.

77{return m_tag;}

Member Data Documentation

◆ m_buf

std::vector<float> DetCondFloat::m_buf
protected

Definition at line 62 of file DetCondFloat.h.

◆ m_bufmap

BufferMap DetCondFloat::m_bufmap
protected

Definition at line 61 of file DetCondFloat.h.

◆ m_size

int DetCondFloat::m_size
protected

Definition at line 57 of file DetCondFloat.h.

◆ m_tag

std::string DetCondFloat::m_tag
protected

Definition at line 58 of file DetCondFloat.h.


The documentation for this class was generated from the following files: