Main Page | Namespace List | Class Hierarchy | Alphabetical List | Class List | Directories | File List | Namespace Members | Class Members | File Members

UTIL::CellIDEncoder< T > Class Template Reference

#include <CellIDEncoder.h>

Inheritance diagram for UTIL::CellIDEncoder< T >:

UTIL::BitField64 List of all members.

Public Types

typedef std::map< std::string,
unsigned int > 
IndexMap

Public Member Functions

 CellIDEncoder (const std::string &cellIDEncoding, LCCollection *col)
void setCellID (T *hit)
void setCellIDFlag ()
lcio::long64 getValue ()
void setValue (lcio::long64 value)
BitFieldValueoperator[] (size_t index)
const BitFieldValueoperator[] (size_t index) const
BitFieldValueoperator[] (const std::string &name)
const BitFieldValueoperator[] (const std::string &name) const
unsigned highestBit ()
size_t size ()
size_t index (const std::string &name) const
unsigned lowWord () const
unsigned highWord () const
std::string fieldDescription () const
std::string valueString () const

Protected Member Functions

int cellID1Bit ()
void addField (const std::string &name, unsigned offset, int width)
void init (const std::string &initString)

Protected Attributes

LCCollection_col
T * _oldHit
std::vector< BitFieldValue * > _fields
lcio::long64 _value
IndexMap _map
lcio::long64 _joined

Detailed Description

template<class T>
class UTIL::CellIDEncoder< T >

Convenient class for encoding cellIDs for various hit objects. It sets the proper collection parameter LCIO::CellIDEncoding and sets the proper flag bit for storing a second cellid if necessary. See UTIL::BitField64 for a description of the encoding string. Example:
  CellIDEncoder<SimCalorimeterHitImpl> cd( "i:20,j:20,k:20" ,calVec ) ;
  for(int j=0;j<NHITS;j++){
   SimCalorimeterHitImpl* hit = new SimCalorimeterHitImpl ;
   cd["i"] = j ;
   cd["j"] = j + 100 ;
   cd["k"] = j + 200 ;
   cd.setCellID( hit ) ;
  }

See also:
BitField64
Version:
Id
CellIDEncoder.h,v 1.1 2006/03/22 17:38:22 gaede Exp

Definition at line 43 of file CellIDEncoder.h.


Member Typedef Documentation

typedef std::map<std::string, unsigned int> UTIL::BitField64::IndexMap [inherited]
 

Definition at line 138 of file BitField64.h.


Constructor & Destructor Documentation

template<class T>
UTIL::CellIDEncoder< T >::CellIDEncoder const std::string &  cellIDEncoding,
LCCollection col
[inline]
 

Constructor reads encoding string from collection parameter LCIO::CellIDEncoding.

Definition at line 49 of file CellIDEncoder.h.


Member Function Documentation

void UTIL::BitField64::addField const std::string &  name,
unsigned  offset,
int  width
[protected, inherited]
 

Add an additional field to the list

Definition at line 169 of file BitField64.cc.

References UTIL::BitField64::_fields, UTIL::BitField64::_joined, UTIL::BitField64::_map, UTIL::BitField64::_value, and UTIL::BitFieldValue::mask().

Referenced by UTIL::BitField64::init().

template<class T>
int UTIL::CellIDEncoder< T >::cellID1Bit  )  [inline, protected]
 

Definition at line 94 of file CellIDEncoder.h.

std::string UTIL::BitField64::fieldDescription  )  const [inherited]
 

Return a valid description string of all fields

Definition at line 133 of file BitField64.cc.

References UTIL::BitField64::_fields.

lcio::long64 UTIL::BitField64::getValue  )  [inline, inherited]
 

Returns the current 64bit value

Definition at line 168 of file BitField64.h.

unsigned UTIL::BitField64::highestBit  )  [inherited]
 

Highest bit used in fields [0-63]

Definition at line 106 of file BitField64.cc.

References UTIL::BitField64::_fields.

unsigned UTIL::BitField64::highWord  )  const [inline, inherited]
 

The high word, bits 32-63

Definition at line 218 of file BitField64.h.

size_t UTIL::BitField64::index const std::string &  name  )  const [inherited]
 

Index for field named 'name'

Definition at line 94 of file BitField64.cc.

References UTIL::BitField64::_map.

void UTIL::BitField64::init const std::string &  initString  )  [protected, inherited]
 

Decode the initialization string as described in the constructor.

See also:
BitField64( const std::string& initString )

Definition at line 192 of file BitField64.cc.

References UTIL::BitField64::addField().

unsigned UTIL::BitField64::lowWord  )  const [inline, inherited]
 

The low word, bits 0-31

Definition at line 214 of file BitField64.h.

const BitFieldValue& UTIL::BitField64::operator[] const std::string &  name  )  const [inline, inherited]
 

Const Access to field through name .

Definition at line 206 of file BitField64.h.

BitFieldValue& UTIL::BitField64::operator[] const std::string &  name  )  [inline, inherited]
 

Access to field through name .

Definition at line 200 of file BitField64.h.

const BitFieldValue& UTIL::BitField64::operator[] size_t  index  )  const [inline, inherited]
 

Const acces to field through index

Definition at line 183 of file BitField64.h.

BitFieldValue& UTIL::BitField64::operator[] size_t  index  )  [inline, inherited]
 

Acces to field through index

Definition at line 177 of file BitField64.h.

template<class T>
void UTIL::CellIDEncoder< T >::setCellID T *  hit  )  [inline]
 

Definition at line 60 of file CellIDEncoder.h.

template<class T>
void UTIL::CellIDEncoder< T >::setCellIDFlag  )  [inline]
 

Helper method that sets/unsets the proper bit for storing a second cellid word

Definition at line 70 of file CellIDEncoder.h.

void UTIL::BitField64::setValue lcio::long64  value  )  [inline, inherited]
 

Set a new 64bit value

Definition at line 172 of file BitField64.h.

Referenced by UTIL::CellIDDecoder< T >::operator()().

size_t UTIL::BitField64::size  )  [inline, inherited]
 

Number of values

Definition at line 192 of file BitField64.h.

std::string UTIL::BitField64::valueString  )  const [inherited]
 

Return a string with a comma separated list of the current sub field values

Definition at line 119 of file BitField64.cc.

References UTIL::BitField64::_fields.


Member Data Documentation

template<class T>
LCCollection* UTIL::CellIDEncoder< T >::_col [protected]
 

Definition at line 97 of file CellIDEncoder.h.

std::vector<BitFieldValue*> UTIL::BitField64::_fields [protected, inherited]
 

Definition at line 246 of file BitField64.h.

Referenced by UTIL::BitField64::addField(), UTIL::BitField64::fieldDescription(), UTIL::BitField64::highestBit(), and UTIL::BitField64::valueString().

lcio::long64 UTIL::BitField64::_joined [protected, inherited]
 

Definition at line 249 of file BitField64.h.

Referenced by UTIL::BitField64::addField().

IndexMap UTIL::BitField64::_map [protected, inherited]
 

Definition at line 248 of file BitField64.h.

Referenced by UTIL::BitField64::addField(), UTIL::BitField64::index(), and UTIL::operator<<().

template<class T>
T* UTIL::CellIDEncoder< T >::_oldHit [protected]
 

Definition at line 98 of file CellIDEncoder.h.

lcio::long64 UTIL::BitField64::_value [protected, inherited]
 

Definition at line 247 of file BitField64.h.

Referenced by UTIL::BitField64::addField(), and UTIL::operator<<().


The documentation for this class was generated from the following file:
Generated on Sun Jun 3 06:32:40 2007 for A TPC Tracking Environment by  doxygen 1.3.9.1