21void EventContainer::initTRUs()
25 mTRUData[
index].setL0time(INT8_MAX);
29void EventContainer::setCellCommon(
int tower,
double energy,
double time,
ChannelType_t celltype,
bool isLEDmon,
int hwaddress,
int ddlID,
bool doMergeHGLG)
31 auto updateCell = [energy,
time, celltype](
Cell& cell) {
32 cell.setEnergy(energy);
33 cell.setTimeStamp(
time);
34 cell.setType(celltype);
36 auto& datacontainer = isLEDmon ? mLEDMons : mCells;
38 auto found = std::find_if(datacontainer.begin(), datacontainer.end(), [&tower](
const o2::emcal::RecCellInfo& testcell) ->
bool { return testcell.mCellData.getTower() == tower; });
39 if (found != datacontainer.end()) {
42 found->mHWAddressLG = hwaddress;
43 found->mHGOutOfRange =
false;
44 if (found->mCellData.getHighGain()) {
45 if (isCellSaturated(found->mCellData.getEnergy())) {
47 updateCell(found->mCellData);
49 found->mIsLGnoHG =
false;
55 found->mIsLGnoHG =
false;
56 found->mHGOutOfRange =
false;
57 found->mHWAddressHG = hwaddress;
58 if (!isCellSaturated(energy)) {
59 updateCell(found->mCellData);
65 bool hgOutOfRange =
false;
70 hwAddressLG = hwaddress;
73 hgOutOfRange = isCellSaturated(energy);
74 hwAddressHG = hwaddress;
79 ddlID, hwAddressLG, hwAddressHG});
90 ddlID, hwAddressLG, hwAddressHG});
96 auto found = mL0FastORs.find(fastORAbsID);
97 if (found != mL0FastORs.end()) {
98 found->second.setTimeSamples(timesamples, starttime);
106 auto& dataContainer = isLEDmon ? mLEDMons : mCells;
107 std::sort(dataContainer.begin(), dataContainer.end(), [](
const RecCellInfo& lhs,
const RecCellInfo& rhs) ->
bool { return lhs.mCellData.getTower() < rhs.mCellData.getTower(); });
110bool EventContainer::isCellSaturated(
double energy)
const
112 return energy / o2::emcal::constants::EMCAL_ADCENERGY > o2::emcal::constants::OVERFLOWCUT;
117 if (
index >= mTRUData.size()) {
120 return mTRUData[
index];
125 if (
index >= mTRUData.size()) {
128 return mTRUData[
index];
138 auto found = mEvents.find(currentIR);
139 if (found != mEvents.end()) {
140 return found->second;
144 return res.first->second;
149 auto found = mEvents.find(currentIR);
150 if (found == mEvents.end()) {
153 return found->second;
158 std::vector<o2::InteractionRecord>
result;
159 for (
auto&
entry : mEvents) {
176 int currentID = mCurrentEvent;
Reconstruction container for EMCAL Cells and LEDMONs.
EMCAL compressed cell information.
Handler for access of TRU data with invalid TRU index.
TRUIndexException(std::size_t index)
Constructor.
Containter of cells for a given event.
void setFastOR(uint16_t fastORAbsID, uint8_t starttime, const gsl::span< const uint16_t > timesamples)
Add bunch of time series to the container.
void sortCells(bool isLEDmon)
Sort Cells / LEDMONs in container according to tower / module ID.
const TRUDataHandler & readTRUData(std::size_t truIndex) const
Read-only access TRU data of a given TRU.
EventContainer()=default
Constructor.
TRUDataHandler & getTRUData(std::size_t truIndex)
Read and write access TRU data of a given TRU.
Container for FastOR time series.
Handling of access to objects beyond container boundary.
RecoContainerReader(RecoContainer &container)
Constructor.
EventContainer & nextEvent()
Get the next event in container.
bool hasNext() const
Check whehter there are more events in the container.
Handling of access to trigger interaction record not present in container.
Handler for cells/LEDMONS/Trigger data in timeframes.
EventContainer & getEventContainer(const o2::InteractionRecord ¤tIR)
Get container for trigger.
std::vector< o2::InteractionRecord > getOrderedInteractions() const
Get sorted vector interaction records of triggers in container.
Helper class to handle decoded TRU data during the reconstruction.
ChannelType_t
Type of a raw data channel.
@ HIGH_GAIN
High gain channel.
@ LOW_GAIN
Low gain channel.
std::string to_string(gsl::span< T, Size > span)
Container class for cell information for merging.