12#ifndef ALICEO2_EMCAL_CELL_H_
13#define ALICEO2_EMCAL_CELL_H_
89 void setTower(
short tower) { mTowerID = tower; }
175 setTimestampEncoded(timestampBits);
176 setTowerIDEncoded(towerIDBits);
177 setChannelTypeEncoded(celltypeBits);
226 static float decodeTime(uint16_t timestampBits);
239 void setTimestampEncoded(uint16_t timestampBits);
243 void setTowerIDEncoded(uint16_t towerIDBits);
247 void setChannelTypeEncoded(uint16_t channelTypeBits);
249 float mEnergy = FLT_MIN;
250 float mTimestamp = FLT_MIN;
251 short mTowerID = SHRT_MAX;
EMCAL compressed cell information.
void setLEDMon()
Mark cell as LED monitor cell.
static uint16_t encodeEnergyV2(float energy, ChannelType_t celltype)
void setType(ChannelType_t ctype)
Set the type of the cell.
static short getTowerFromPackedBitfieldV0(const char *bitfield)
uint16_t getCellTypeEncoded() const
Get encoded bit representation of cell type (for CTF)
bool isChannelType(ChannelType_t ctype) const
Check whether the cell is of a given type.
static uint16_t encodeTime(float timestamp)
void setTimeStamp(float timestamp)
Set the time stamp.
void initializeFromPackedBitfieldV0(const char *bitfield)
static uint16_t V0toV1(uint16_t energybits, ChannelType_t celltype)
void setTower(short tower)
Set the tower ID.
Bool_t getLEDMon() const
Check whether the cell is a LED monitor cell.
uint16_t getTowerIDEncoded() const
Get encoded bit representation of tower ID (for CTF)
void truncate(EncoderVersion version=EncoderVersion::EncodingV1)
Apply compression as done during writing to / reading from CTF.
ChannelType_t getType() const
Get the type of the cell.
Cell()=default
Default constructor.
Bool_t getLowGain() const
Check whether the cell is a low gain cell.
Bool_t getHighGain() const
Check whether the cell is a high gain cell.
static ChannelType_t getCellTypeFromPackedBitfieldV0(const char *bitfield)
Bool_t getTRU() const
Check whether the cell is a TRU cell.
static uint16_t V1toV2(uint16_t energybits, ChannelType_t celltype)
void setEnergy(float energy)
Set the energy of the cell.
~Cell()=default
Destructor.
uint16_t getEnergyEncoded(EncoderVersion version=EncoderVersion::EncodingV2) const
Get encoded bit representation of energy (for CTF)
static float decodeEnergyV1(uint16_t energybits, ChannelType_t celltype)
void setTRU()
Mark cell as TRU cell.
uint16_t getTimeStampEncoded() const
Get encoded bit representation of timestamp (for CTF)
void setHighGain()
Mark cell as high gain cell.
void setAmplitude(float amplitude)
Set the amplitude of the cell.
static uint16_t encodeEnergyV1(float energy, ChannelType_t celltype)
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)
float getEnergy() const
Get the energy of the cell.
void PrintStream(std::ostream &stream) const
float getTimeStamp() const
Get the time stamp.
static float getTimeFromPackedBitfieldV0(const char *bitfield)
float getAmplitude() const
Get cell amplitude.
void setLowGain()
Mark cell as low gain cell.
static uint16_t V0toV2(uint16_t energybits, ChannelType_t celltype)
static float getEnergyFromPackedBitfieldV0(const char *bitfield)
static float decodeEnergyV2(uint16_t energybits, ChannelType_t celltype)
static float decodeTime(uint16_t timestampBits)
short getTower() const
Get the tower ID.
static uint16_t encodeEnergyV0(float energy)
static float decodeEnergyV0(uint16_t energybits)
std::ostream & operator<<(std::ostream &stream, const Cell &cell)
Stream operator for EMCAL cell.
ChannelType_t
Type of a raw data channel.
@ HIGH_GAIN
High gain channel.
@ LOW_GAIN
Low gain channel.
@ LEDMON
LED monitor channel.
a couple of static helper functions to create timestamp values for CCDB queries or override obsolete ...