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

container class for CaloCompactCell objects More...

#include <CaloCompactCellContainer.h>

Collaboration diagram for CaloCompactCellContainer:

Classes

class  compact_input_iterator
 store the compact cell with index iCell More...
class  compact_output_iterator
 Simple iterator-like object for writing to the container. More...

Public Types

typedef int value_type
 value type for the internal data

Public Member Functions

 CaloCompactCellContainer ()
 default Constructor.
 CaloCompactCellContainer (const std::vector< value_type > &theCompactData)
 Constructor.
virtual ~CaloCompactCellContainer ()
const std::vector< value_type > & getData () const
 returns the entire compact cell container (includes header)
std::vector< value_type > & getData ()
 returns the entire compact cell container (includes header)
const std::vector< value_type > getHeader () const
 returns header portion of the compact cell container
void resize (const unsigned int &totalSize)
 resize the data vector to totalSize (includes Header)
void setHeader (const std::vector< value_type > &theHeader)
 replaces the current header (if there was one)
compact_input_iterator compact_begin_input () const
 Return a new compact_input_iterator pointing at the start of the data.
compact_input_iterator compact_begin_input_from (int) const
 Return a new compact_input_iterator pointing at position given as the parameter BUT from the end of the data.
compact_output_iterator compact_begin_output (int headerLength)
 Return a new compact_output_iterator pointing at the start of the data.

Private Attributes

std::vector< value_type > m_compactData
 vector containing header and compact cell data.

Detailed Description

container class for CaloCompactCell objects

Version
$Id: CaloCompactCellContainer.h,v 1.7 2008-11-20 21:35:56 ssnyder Exp $
Author
Sven Menke menke.nosp@m.@mpp.nosp@m.mu.mp.nosp@m.g.de
Date
03-August-2004

Container class to contain compactified CaloCell objects from a complete CaloCellContainer. The completeness is required in the sense that for every Calorimeter present in the CaloCellContainer all possible cells have to be filled. This allows for not storing the Identifier for the cells. The compact cells (and instances of this class) are produced by the CaloCompactCellTool in CaloTools.

Definition at line 36 of file CaloCompactCellContainer.h.

Member Typedef Documentation

◆ value_type

value type for the internal data

The internal data format has a length of 32bit. Therefore this type must have the length of 32 bits.

Definition at line 46 of file CaloCompactCellContainer.h.

Constructor & Destructor Documentation

◆ CaloCompactCellContainer() [1/2]

CaloCompactCellContainer::CaloCompactCellContainer ( )
inline

default Constructor.

Definition at line 59 of file CaloCompactCellContainer.h.

60 {
61 m_compactData.resize(0);
62 };
std::vector< value_type > m_compactData
vector containing header and compact cell data.

◆ CaloCompactCellContainer() [2/2]

CaloCompactCellContainer::CaloCompactCellContainer ( const std::vector< value_type > & theCompactData)
inline

Constructor.

Parameters
theCompactDataThe vector holding the header and CaloCompactCell data

Definition at line 69 of file CaloCompactCellContainer.h.

69 :
70 m_compactData(theCompactData)
71 { };

◆ ~CaloCompactCellContainer()

virtual CaloCompactCellContainer::~CaloCompactCellContainer ( )
inlinevirtual

Definition at line 73 of file CaloCompactCellContainer.h.

73{ };

Member Function Documentation

◆ compact_begin_input()

CaloCompactCellContainer::compact_input_iterator CaloCompactCellContainer::compact_begin_input ( ) const
inline

Return a new compact_input_iterator pointing at the start of the data.

Definition at line 289 of file CaloCompactCellContainer.h.

290{
292}

◆ compact_begin_input_from()

CaloCompactCellContainer::compact_input_iterator CaloCompactCellContainer::compact_begin_input_from ( int pos) const
inline

Return a new compact_input_iterator pointing at position given as the parameter BUT from the end of the data.

Definition at line 296 of file CaloCompactCellContainer.h.

296 {
297 return compact_input_iterator (m_compactData.end() - pos);
298}

◆ compact_begin_output()

CaloCompactCellContainer::compact_output_iterator CaloCompactCellContainer::compact_begin_output ( int headerLength)
inline

Return a new compact_output_iterator pointing at the start of the data.

Parameters
headerLengthThe length of the header in front of the data.

Definition at line 356 of file CaloCompactCellContainer.h.

357{
358 return compact_output_iterator (m_compactData.begin() + headerLength);
359}
Simple iterator-like object for writing to the container.

◆ getData() [1/2]

std::vector< value_type > & CaloCompactCellContainer::getData ( )
inline

returns the entire compact cell container (includes header)

Returns
a reference to the vector holding the compact data

Definition at line 88 of file CaloCompactCellContainer.h.

88 {
89 return m_compactData;
90 };

◆ getData() [2/2]

const std::vector< value_type > & CaloCompactCellContainer::getData ( ) const
inline

returns the entire compact cell container (includes header)

Returns
a const reference to the vector holding the compact data

Definition at line 80 of file CaloCompactCellContainer.h.

80 {
81 return m_compactData;
82 };

◆ getHeader()

const std::vector< CaloCompactCellContainer::value_type > CaloCompactCellContainer::getHeader ( ) const

returns header portion of the compact cell container

Returns
a const vector holding the header data

Definition at line 22 of file CaloCompactCellContainer.cxx.

23{
24 std::vector<value_type> theHeader(m_compactData[0]);
25 for(int i=0;i<m_compactData[0];i++)
26 theHeader[i] = m_compactData[i];
27 return theHeader;
28}

◆ resize()

void CaloCompactCellContainer::resize ( const unsigned int & totalSize)

resize the data vector to totalSize (includes Header)

Parameters
totalSizethe total size in unites of value_type

Definition at line 30 of file CaloCompactCellContainer.cxx.

31{
33}
static unsigned int totalSize(const MultiDimArray< T, N > &ht)

◆ setHeader()

void CaloCompactCellContainer::setHeader ( const std::vector< value_type > & theHeader)

replaces the current header (if there was one)

Parameters
theHeaderthe new header

used by the compactifier tool on creation of the container

Definition at line 35 of file CaloCompactCellContainer.cxx.

37{
38 for(unsigned int i=0;i<theHeader.size();i++)
39 m_compactData[i] = theHeader[i];
40}

Member Data Documentation

◆ m_compactData

std::vector<value_type> CaloCompactCellContainer::m_compactData
private

vector containing header and compact cell data.

the first int in the vector must contain the header length (in number of 32bit ints) including the first int

Definition at line 56 of file CaloCompactCellContainer.h.


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