Skip to content

Commit 55915a0

Browse files
authored
[Common] Add dynamic column for TOF signal in another BC (#14881)
1 parent 745cb50 commit 55915a0

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

Common/DataModel/PIDResponseTOF.h

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -254,12 +254,18 @@ namespace pidtofsignal
254254
DECLARE_SOA_COLUMN(TOFSignal, tofSignal, float); //! TOF signal from track time
255255
DECLARE_SOA_DYNAMIC_COLUMN(EventCollisionTime, eventCollisionTime, //! Event collision time used for the track. Needs the TOF
256256
[](float signal, float tMinusTexp, float texp) -> float { return texp + tMinusTexp - signal; });
257+
DECLARE_SOA_DYNAMIC_COLUMN(TOFSignalInAnotherBC, tofSignalInAnotherBC, //! TOF signal but computed in another Bunch Crossing. Needs the original globalBC and the new globalBC to compute the delta time to apply to the signal.
258+
[](float signal, int64_t originalGlobalBC, int64_t newGlobalBC) -> float {
259+
const int64_t deltaBcPos = originalGlobalBC - newGlobalBC;
260+
return signal + o2::constants::lhc::LHCBunchSpacingNS * deltaBcPos * 1000.0f;
261+
});
257262

258263
} // namespace pidtofsignal
259264

260265
DECLARE_SOA_TABLE(TOFSignal, "AOD", "TOFSignal", //! Table of the TOF signal
261266
pidtofsignal::TOFSignal,
262-
pidtofsignal::EventCollisionTime<pidtofsignal::TOFSignal>);
267+
pidtofsignal::EventCollisionTime<pidtofsignal::TOFSignal>,
268+
pidtofsignal::TOFSignalInAnotherBC<pidtofsignal::TOFSignal>);
263269

264270
namespace pidtofevtime
265271
{

0 commit comments

Comments
 (0)