Skip to content

Commit c1e3ddf

Browse files
authored
dynamic column for vertex from T0 (#7350)
1 parent 8174715 commit c1e3ddf

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

Framework/Core/include/Framework/AnalysisDataModel.h

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@
1515
#include "MathUtils/Utils.h"
1616
#include <cmath>
1717
#include "Framework/DataTypes.h"
18+
#include "CommonConstants/PhysicsConstants.h"
1819

1920
namespace o2
2021
{
@@ -666,12 +667,16 @@ DECLARE_SOA_COLUMN(AmplitudeC, amplitudeC, float[112]); //!
666667
DECLARE_SOA_COLUMN(TimeA, timeA, float); //!
667668
DECLARE_SOA_COLUMN(TimeC, timeC, float); //!
668669
DECLARE_SOA_COLUMN(TriggerMask, triggerMask, uint8_t); //!
670+
DECLARE_SOA_DYNAMIC_COLUMN(PosZ, posZ, //! Z position calculated from timeA and timeC in cm
671+
[](float t0A, float t0C) -> float {
672+
return o2::constants::physics::LightSpeedCm2NS * (t0C - t0A) / 2;
673+
});
669674
} // namespace ft0
670675

671676
DECLARE_SOA_TABLE(FT0s, "AOD", "FT0", //!
672677
o2::soa::Index<>, ft0::BCId,
673678
ft0::AmplitudeA, ft0::AmplitudeC, ft0::TimeA, ft0::TimeC,
674-
ft0::TriggerMask);
679+
ft0::TriggerMask, ft0::PosZ<ft0::TimeA, ft0::TimeC>);
675680
using FT0 = FT0s::iterator;
676681

677682
namespace fdd

0 commit comments

Comments
 (0)