Project
Loading...
Searching...
No Matches
o2::emcal::Cell Class Reference

EMCAL compressed cell information. More...

#include <Cell.h>

Public Types

enum class  EncoderVersion { EncodingV0 , EncodingV1 , EncodingV2 }
 

Public Member Functions

 Cell ()=default
 Default constructor.
 
 Cell (short tower, float energy, float timestamp, ChannelType_t ctype=ChannelType_t::LOW_GAIN)
 Constructor.
 
 Cell (uint16_t towerBits, uint16_t energyBits, uint16_t timestampBits, uint16_t channelBits, EncoderVersion version=EncoderVersion::EncodingV1)
 Constructor, from encoded bit representation.
 
 ~Cell ()=default
 Destructor.
 
void setTower (short tower)
 Set the tower ID.
 
short getTower () const
 Get the tower ID.
 
void setTimeStamp (float timestamp)
 Set the time stamp.
 
float getTimeStamp () const
 Get the time stamp.
 
void setEnergy (float energy)
 Set the energy of the cell.
 
float getEnergy () const
 Get the energy of the cell.
 
void setAmplitude (float amplitude)
 Set the amplitude of the cell.
 
float getAmplitude () const
 Get cell amplitude.
 
void setType (ChannelType_t ctype)
 Set the type of the cell.
 
ChannelType_t getType () const
 Get the type of the cell.
 
bool isChannelType (ChannelType_t ctype) const
 Check whether the cell is of a given type.
 
void setLowGain ()
 Mark cell as low gain cell.
 
Bool_t getLowGain () const
 Check whether the cell is a low gain cell.
 
void setHighGain ()
 Mark cell as high gain cell.
 
Bool_t getHighGain () const
 Check whether the cell is a high gain cell.
 
void setLEDMon ()
 Mark cell as LED monitor cell.
 
Bool_t getLEDMon () const
 Check whether the cell is a LED monitor cell.
 
void setTRU ()
 Mark cell as TRU cell.
 
Bool_t getTRU () const
 Check whether the cell is a TRU cell.
 
void truncate (EncoderVersion version=EncoderVersion::EncodingV1)
 Apply compression as done during writing to / reading from CTF.
 
void PrintStream (std::ostream &stream) const
 
void initialiseFromEncoded (uint16_t towerIDBits, uint16_t timestampBits, uint16_t energyBits, uint16_t celltypeBits, EncoderVersion version=EncoderVersion::EncodingV1)
 Initialize cell class from bit representation (for CTF decoding)
 
uint16_t getTowerIDEncoded () const
 Get encoded bit representation of tower ID (for CTF)
 
uint16_t getTimeStampEncoded () const
 Get encoded bit representation of timestamp (for CTF)
 
uint16_t getEnergyEncoded (EncoderVersion version=EncoderVersion::EncodingV2) const
 Get encoded bit representation of energy (for CTF)
 
uint16_t getCellTypeEncoded () const
 Get encoded bit representation of cell type (for CTF)
 
void initializeFromPackedBitfieldV0 (const char *bitfield)
 

Static Public Member Functions

static float getEnergyFromPackedBitfieldV0 (const char *bitfield)
 
static float getTimeFromPackedBitfieldV0 (const char *bitfield)
 
static ChannelType_t getCellTypeFromPackedBitfieldV0 (const char *bitfield)
 
static short getTowerFromPackedBitfieldV0 (const char *bitfield)
 
static uint16_t encodeTime (float timestamp)
 
static uint16_t encodeEnergyV0 (float energy)
 
static uint16_t encodeEnergyV1 (float energy, ChannelType_t celltype)
 
static uint16_t encodeEnergyV2 (float energy, ChannelType_t celltype)
 
static uint16_t V0toV1 (uint16_t energybits, ChannelType_t celltype)
 
static uint16_t V0toV2 (uint16_t energybits, ChannelType_t celltype)
 
static uint16_t V1toV2 (uint16_t energybits, ChannelType_t celltype)
 
static float decodeTime (uint16_t timestampBits)
 
static float decodeEnergyV0 (uint16_t energybits)
 
static float decodeEnergyV1 (uint16_t energybits, ChannelType_t celltype)
 
static float decodeEnergyV2 (uint16_t energybits, ChannelType_t celltype)
 

Detailed Description

EMCAL compressed cell information.

Author
Anders Knospe, University of Houston
Markus Fasel marku.nosp@m.s.fa.nosp@m.sel@c.nosp@m.ern..nosp@m.ch, Oak Ridge National Laboratory
Since
March 6, 2019

Cell content

The cell class contains the relevant information for each tower per event

  • Tower ID
  • Energy of the raw fit
  • Time of the raw fit
  • Type of the cell

Compression for CTF

While cell type and tower ID have a predefined range based on the hardware design, energy and time have a finite resolution influenced by the resolution of the digitizer. This is used in order to compress the information stored in the compressed timeframe by not storing the full double values but instead assigning a certain amount of bits to each information. Therefore for certain information (energy, time) precision loss has to be taken into account. The number of bits assigned to each data member in the encoding are as follows:

Content Number of bits Resolution Range
Tower ID 15 - 0 to 17644
Time (ns) 11 0.73 ns -600 to 900 ns
Energy (GeV) 14 0.0153 GeV 0 to 250 GeV
Cell type 2 - 0=LG, 1=HG, 2=LEMon, 4=TRU

The remaining bits are 0

Definition at line 58 of file Cell.h.

Member Enumeration Documentation

◆ EncoderVersion

Enumerator
EncodingV0 
EncodingV1 
EncodingV2 

Definition at line 61 of file Cell.h.

Constructor & Destructor Documentation

◆ Cell() [1/3]

o2::emcal::Cell::Cell ( )
default

Default constructor.

◆ Cell() [2/3]

Cell::Cell ( short  tower,
float  energy,
float  timestamp,
ChannelType_t  ctype = ChannelType_t::LOW_GAIN 
)

Constructor.

Parameters
towerTower ID
energyEnergy
timestampCell time
ctypeChannel type

Definition at line 75 of file Cell.cxx.

◆ Cell() [3/3]

Cell::Cell ( uint16_t  towerBits,
uint16_t  energyBits,
uint16_t  timestampBits,
uint16_t  channelBits,
EncoderVersion  version = EncoderVersion::EncodingV1 
)

Constructor, from encoded bit representation.

Parameters
towerTower bitsets
energyEnergy bits
timestampCell time bits
ctypeChannel type bits
versionEncoding version

Definition at line 79 of file Cell.cxx.

◆ ~Cell()

o2::emcal::Cell::~Cell ( )
default

Destructor.

Member Function Documentation

◆ decodeEnergyV0()

float Cell::decodeEnergyV0 ( uint16_t  energybits)
static

Definition at line 293 of file Cell.cxx.

◆ decodeEnergyV1()

float Cell::decodeEnergyV1 ( uint16_t  energybits,
ChannelType_t  celltype 
)
static

Definition at line 298 of file Cell.cxx.

◆ decodeEnergyV2()

float Cell::decodeEnergyV2 ( uint16_t  energybits,
ChannelType_t  celltype 
)
static

Definition at line 324 of file Cell.cxx.

◆ decodeTime()

float Cell::decodeTime ( uint16_t  timestampBits)
static

Definition at line 288 of file Cell.cxx.

◆ encodeEnergyV0()

uint16_t Cell::encodeEnergyV0 ( float  energy)
static

Definition at line 197 of file Cell.cxx.

◆ encodeEnergyV1()

uint16_t Cell::encodeEnergyV1 ( float  energy,
ChannelType_t  celltype 
)
static

Definition at line 208 of file Cell.cxx.

◆ encodeEnergyV2()

uint16_t Cell::encodeEnergyV2 ( float  energy,
ChannelType_t  celltype 
)
static

Definition at line 239 of file Cell.cxx.

◆ encodeTime()

uint16_t Cell::encodeTime ( float  timestamp)
static

Definition at line 183 of file Cell.cxx.

◆ getAmplitude()

float o2::emcal::Cell::getAmplitude ( ) const
inline

Get cell amplitude.

Returns
Cell amplitude in GeV

Definition at line 117 of file Cell.h.

◆ getCellTypeEncoded()

uint16_t Cell::getCellTypeEncoded ( ) const

Get encoded bit representation of cell type (for CTF)

Returns
Encoded bit representation

Definition at line 113 of file Cell.cxx.

◆ getCellTypeFromPackedBitfieldV0()

ChannelType_t Cell::getCellTypeFromPackedBitfieldV0 ( const char bitfield)
static

Definition at line 167 of file Cell.cxx.

◆ getEnergy()

float o2::emcal::Cell::getEnergy ( ) const
inline

Get the energy of the cell.

Returns
Energy of the cell

Definition at line 109 of file Cell.h.

◆ getEnergyEncoded()

uint16_t Cell::getEnergyEncoded ( EncoderVersion  version = EncoderVersion::EncodingV2) const

Get encoded bit representation of energy (for CTF)

Parameters
versionEncoding verions
Returns
Encoded bit representation

The energy range covered by the cell is 0 - 250 GeV, with a resolution of 0.0153 GeV. In case an energy exceeding the limits is provided the energy is set to the limits (0 in case of negative energy, 250. in case of energies > 250 GeV)

Definition at line 94 of file Cell.cxx.

◆ getEnergyFromPackedBitfieldV0()

float Cell::getEnergyFromPackedBitfieldV0 ( const char bitfield)
static

Definition at line 157 of file Cell.cxx.

◆ getHighGain()

Bool_t o2::emcal::Cell::getHighGain ( ) const
inline

Check whether the cell is a high gain cell.

Returns
True if the cell type is high gain, false otherwise

Definition at line 144 of file Cell.h.

◆ getLEDMon()

Bool_t o2::emcal::Cell::getLEDMon ( ) const
inline

Check whether the cell is a LED monitor cell.

Returns
True if the cell type is LED monitor, false otherwise

Definition at line 151 of file Cell.h.

◆ getLowGain()

Bool_t o2::emcal::Cell::getLowGain ( ) const
inline

Check whether the cell is a low gain cell.

Returns
True if the cell type is low gain, false otherwise

Definition at line 137 of file Cell.h.

◆ getTimeFromPackedBitfieldV0()

float Cell::getTimeFromPackedBitfieldV0 ( const char bitfield)
static

Definition at line 162 of file Cell.cxx.

◆ getTimeStamp()

float o2::emcal::Cell::getTimeStamp ( ) const
inline

Get the time stamp.

Returns
Time in ns

Definition at line 101 of file Cell.h.

◆ getTimeStampEncoded()

uint16_t Cell::getTimeStampEncoded ( ) const

Get encoded bit representation of timestamp (for CTF)

Returns
Encoded bit representation

The time stamp is expressed in ns and has a resolution of 1 ns. The time range which can be stored is from -1023 to 1023 ns. In case the range is exceeded the time is set to the limit of the range.

Definition at line 89 of file Cell.cxx.

◆ getTower()

short o2::emcal::Cell::getTower ( ) const
inline

Get the tower ID.

Returns
Tower ID

Definition at line 93 of file Cell.h.

◆ getTowerFromPackedBitfieldV0()

short Cell::getTowerFromPackedBitfieldV0 ( const char bitfield)
static

Definition at line 172 of file Cell.cxx.

◆ getTowerIDEncoded()

uint16_t Cell::getTowerIDEncoded ( ) const

Get encoded bit representation of tower ID (for CTF)

Returns
Encoded bit representation

Same as getTower - no compression applied for tower ID

Definition at line 84 of file Cell.cxx.

◆ getTRU()

Bool_t o2::emcal::Cell::getTRU ( ) const
inline

Check whether the cell is a TRU cell.

Returns
True if the cell type is TRU, false otherwise

Definition at line 158 of file Cell.h.

◆ getType()

ChannelType_t o2::emcal::Cell::getType ( ) const
inline

Get the type of the cell.

Returns
Type of the cell (HIGH_GAIN, LOW_GAIN, LEDMON, TRU)

Definition at line 125 of file Cell.h.

◆ initialiseFromEncoded()

void o2::emcal::Cell::initialiseFromEncoded ( uint16_t  towerIDBits,
uint16_t  timestampBits,
uint16_t  energyBits,
uint16_t  celltypeBits,
EncoderVersion  version = EncoderVersion::EncodingV1 
)
inline

Initialize cell class from bit representation (for CTF decoding)

Parameters
towerIDBitsEncoded tower ID
timestampBitsEncoded timestamp
energyBitsEncoded energy
celltypeBitsEncoded cell type
versionEncoder version

Definition at line 172 of file Cell.h.

◆ initializeFromPackedBitfieldV0()

void Cell::initializeFromPackedBitfieldV0 ( const char bitfield)

Definition at line 148 of file Cell.cxx.

◆ isChannelType()

bool o2::emcal::Cell::isChannelType ( ChannelType_t  ctype) const
inline

Check whether the cell is of a given type.

Parameters
ctypeType of the cell (HIGH_GAIN, LOW_GAIN, LEDMON, TRU)
Returns
True if the type of the cell matches the requested type, false otherwise

Definition at line 130 of file Cell.h.

◆ PrintStream()

void Cell::PrintStream ( std::ostream &  stream) const

Definition at line 350 of file Cell.cxx.

◆ setAmplitude()

void o2::emcal::Cell::setAmplitude ( float  amplitude)
inline

Set the amplitude of the cell.

Parameters
amplitudeCell amplitude

Definition at line 113 of file Cell.h.

◆ setEnergy()

void o2::emcal::Cell::setEnergy ( float  energy)
inline

Set the energy of the cell.

Energy of the cell in GeV

Definition at line 105 of file Cell.h.

◆ setHighGain()

void o2::emcal::Cell::setHighGain ( )
inline

Mark cell as high gain cell.

Definition at line 140 of file Cell.h.

◆ setLEDMon()

void o2::emcal::Cell::setLEDMon ( )
inline

Mark cell as LED monitor cell.

Definition at line 147 of file Cell.h.

◆ setLowGain()

void o2::emcal::Cell::setLowGain ( )
inline

Mark cell as low gain cell.

Definition at line 133 of file Cell.h.

◆ setTimeStamp()

void o2::emcal::Cell::setTimeStamp ( float  timestamp)
inline

Set the time stamp.

Parameters
timestampTime in ns

Definition at line 97 of file Cell.h.

◆ setTower()

void o2::emcal::Cell::setTower ( short  tower)
inline

Set the tower ID.

Parameters
towerTower ID

Definition at line 89 of file Cell.h.

◆ setTRU()

void o2::emcal::Cell::setTRU ( )
inline

Mark cell as TRU cell.

Definition at line 154 of file Cell.h.

◆ setType()

void o2::emcal::Cell::setType ( ChannelType_t  ctype)
inline

Set the type of the cell.

Parameters
ctypeType of the cell (HIGH_GAIN, LOW_GAIN, LEDMON, TRU)

Definition at line 121 of file Cell.h.

◆ truncate()

void Cell::truncate ( EncoderVersion  version = EncoderVersion::EncodingV1)

Apply compression as done during writing to / reading from CTF.

Parameters
versionEncoder version

Definition at line 177 of file Cell.cxx.

◆ V0toV1()

uint16_t Cell::V0toV1 ( uint16_t  energybits,
ChannelType_t  celltype 
)
static

Definition at line 270 of file Cell.cxx.

◆ V0toV2()

uint16_t Cell::V0toV2 ( uint16_t  energybits,
ChannelType_t  celltype 
)
static

Definition at line 276 of file Cell.cxx.

◆ V1toV2()

uint16_t Cell::V1toV2 ( uint16_t  energybits,
ChannelType_t  celltype 
)
static

Definition at line 282 of file Cell.cxx.


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