Skip to content

Commit d856bed

Browse files
committed
add long to IR converter to InteractionRecord
1 parent 59ef48a commit d856bed

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

DataFormats/common/include/CommonDataFormat/InteractionRecord.h

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -124,6 +124,12 @@ struct InteractionRecord {
124124
orbit = l / o2::constants::lhc::LHCMaxBunches;
125125
}
126126

127+
static InteractionRecord long2IR(int64_t l)
128+
{
129+
// set from long BC counter
130+
return {uint16_t(l % o2::constants::lhc::LHCMaxBunches), uint32_t(l / o2::constants::lhc::LHCMaxBunches)};
131+
}
132+
127133
bool operator>(const InteractionRecord& other) const
128134
{
129135
return (orbit == other.orbit) ? (bc > other.bc) : (orbit > other.orbit);

0 commit comments

Comments
 (0)