Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 4 additions & 3 deletions PWGEM/PhotonMeson/Core/EMBitFlags.h
Original file line number Diff line number Diff line change
Expand Up @@ -37,17 +37,18 @@ class EMBitFlags

/// \brief check bit i
/// \param i index of bit that should be checked
/// \return false if the bit was set before
[[nodiscard]] bool test(std::size_t i) const;

/// \brief set bit i
/// \brief set bit i to false
/// \param i index of bit which value should be set
void set(std::size_t i);

/// \brief reset bit i
/// \brief reset bit i to true
/// \param i index of bit which value should be reset
void reset(std::size_t i);

/// \brief resetting all flags to false
/// \brief resetting all flags to true
void clear();

/// \brief reserve space in the underlying storage for nBits bits
Expand Down
22 changes: 22 additions & 0 deletions PWGEM/PhotonMeson/Core/EMCConversionCandidate.h
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
#define PWGEM_PHOTONMESON_CORE_EMCCONVERSIONCANDIDATE_H_

#include <concepts>
#include <cstdint>

namespace o2::analysis::em
{
Expand All @@ -34,6 +35,13 @@ concept IsEmcConversionCandidate = requires(T const& c) {
{ c.e2() } -> std::convertible_to<float>;
{ c.e1() } -> std::convertible_to<float>;
{ c.deltaPhi() } -> std::convertible_to<float>;
{ c.harmonicEt() } -> std::convertible_to<float>;
{ c.m021() } -> std::convertible_to<float>;
{ c.m022() } -> std::convertible_to<float>;
{ c.time1() } -> std::convertible_to<float>;
{ c.time2() } -> std::convertible_to<float>;
{ c.ncell1() } -> std::convertible_to<uint8_t>;
{ c.ncell2() } -> std::convertible_to<uint8_t>;
};

struct EMCConversionCandidate {
Expand All @@ -46,6 +54,13 @@ struct EMCConversionCandidate {
float mE2;
float mE1;
float mDeltaPhi;
float mHarmonicEt;
float mM021;
float mM022;
float mTime1;
float mTime2;
uint8_t mNcell1;
uint8_t mNcell2;

[[nodiscard]] float minv() const { return mMinv; }
[[nodiscard]] float deltaEta() const { return mDeltaEta; }
Expand All @@ -56,6 +71,13 @@ struct EMCConversionCandidate {
[[nodiscard]] float e2() const { return mE2; }
[[nodiscard]] float e1() const { return mE1; }
[[nodiscard]] float deltaPhi() const { return mDeltaPhi; }
[[nodiscard]] float harmonicEt() const { return mHarmonicEt; }
[[nodiscard]] float m021() const { return mM021; }
[[nodiscard]] float m022() const { return mM022; }
[[nodiscard]] float time1() const { return mTime1; }
[[nodiscard]] float time2() const { return mTime2; }
[[nodiscard]] uint8_t ncell1() const { return mNcell1; }
[[nodiscard]] uint8_t ncell2() const { return mNcell2; }
};

} // namespace o2::analysis::em
Expand Down
26 changes: 21 additions & 5 deletions PWGEM/PhotonMeson/Core/EmMlResponseEMCConversion.h
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,14 @@ enum class InputFeaturesEMCConversion : uint8_t {
totE,
e2,
e1,
deltaPhi
deltaPhi,
harmonicEt,
m021,
m022,
time1,
time2,
ncell1,
ncell2
};

template <typename TypeOutputScore = float>
Expand All @@ -65,9 +72,9 @@ class EmMlResponseEMCConversion : public MlResponse<TypeOutputScore>
virtual ~EmMlResponseEMCConversion() = default;

template <o2::analysis::em::IsEmcConversionCandidate TCandidate>
std::vector<float> getInputFeatures(TCandidate const& candidate)
void getInputFeatures(TCandidate const& candidate, std::vector<float>& inputFeatures)
{
std::vector<float> inputFeatures;
inputFeatures.clear();
for (const auto& idx : MlResponse<TypeOutputScore>::mCachedIndices) {
switch (idx) {
CHECK_AND_FILL_VEC_EMC_CONV(minv)
Expand All @@ -79,9 +86,15 @@ class EmMlResponseEMCConversion : public MlResponse<TypeOutputScore>
CHECK_AND_FILL_VEC_EMC_CONV(e2)
CHECK_AND_FILL_VEC_EMC_CONV(e1)
CHECK_AND_FILL_VEC_EMC_CONV(deltaPhi)
CHECK_AND_FILL_VEC_EMC_CONV(harmonicEt)
CHECK_AND_FILL_VEC_EMC_CONV(m021)
CHECK_AND_FILL_VEC_EMC_CONV(m022)
CHECK_AND_FILL_VEC_EMC_CONV(time1)
CHECK_AND_FILL_VEC_EMC_CONV(time2)
CHECK_AND_FILL_VEC_EMC_CONV(ncell1)
CHECK_AND_FILL_VEC_EMC_CONV(ncell2)
}
}
return inputFeatures;
}

protected:
Expand All @@ -90,7 +103,10 @@ class EmMlResponseEMCConversion : public MlResponse<TypeOutputScore>
MlResponse<TypeOutputScore>::mAvailableInputFeatures = {
FILL_MAP_EMC_CONV(minv), FILL_MAP_EMC_CONV(deltaEta), FILL_MAP_EMC_CONV(deltaR),
FILL_MAP_EMC_CONV(phiv), FILL_MAP_EMC_CONV(rConv), FILL_MAP_EMC_CONV(totE),
FILL_MAP_EMC_CONV(e2), FILL_MAP_EMC_CONV(e1), FILL_MAP_EMC_CONV(deltaPhi)};
FILL_MAP_EMC_CONV(e2), FILL_MAP_EMC_CONV(e1), FILL_MAP_EMC_CONV(deltaPhi),
FILL_MAP_EMC_CONV(harmonicEt), FILL_MAP_EMC_CONV(m021), FILL_MAP_EMC_CONV(m022),
FILL_MAP_EMC_CONV(time1), FILL_MAP_EMC_CONV(time2), FILL_MAP_EMC_CONV(ncell1),
FILL_MAP_EMC_CONV(ncell2)};
}
};

Expand Down
Loading
Loading