Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
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
Prev Previous commit
Next Next commit
Adding int16 and uint16 to Expressions.
Putting example in correlations
  • Loading branch information
jgrosseo committed Mar 4, 2021
commit 51d44ce32a3fc5fef7ee5c7df301466e319e0f35
5 changes: 2 additions & 3 deletions Analysis/Tasks/PWGCF/correlations.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -57,9 +57,8 @@ struct CorrelationTask {
O2_DEFINE_CONFIGURABLE(cfgEfficiencyAssociated, std::string, "", "CCDB path to efficiency object for associated particles")

// Filters and input definitions
Filter collisionFilter = (nabs(aod::collision::posZ) < cfgCutVertex);
// Filter vertexTypeFilter = aod::collision::flags == (uint16_t) 0 || aod::collision::flags == (uint16_t) 1;
// Filter vertexTypeFilter = aod::collision::flags == (uint16_t) o2::aod::collision::CollisionFlagsRun2::Run2VertexerTracks || aod::collision::flags == (uint16_t) o2::aod::collision::CollisionFlagsRun2::Run2VertexerTracksNoConstraint;
Filter collisionFilter = nabs(aod::collision::posZ) < cfgCutVertex;
Filter vertexTypeFilter = aod::collision::flags == (uint16_t) aod::collision::CollisionFlagsRun2::Run2VertexerTracks || aod::collision::flags == (uint16_t) aod::collision::CollisionFlagsRun2::Run2VertexerTracksNoConstraint;
Filter trackFilter = (nabs(aod::track::eta) < cfgCutEta) && (aod::track::pt > cfgCutPt) && ((aod::track::isGlobalTrack == (uint8_t) true) || (aod::track::isGlobalTrackSDD == (uint8_t) true));
using myTracks = soa::Filtered<soa::Join<aod::Tracks, aod::TrackSelection>>;

Expand Down
7 changes: 4 additions & 3 deletions Framework/Core/include/Framework/AnalysisDataModel.h
Original file line number Diff line number Diff line change
Expand Up @@ -519,9 +519,10 @@ DECLARE_SOA_COLUMN(SPDClustersL0, spdClustersL0, uint16_t);
DECLARE_SOA_COLUMN(SPDClustersL1, spdClustersL1, uint16_t);
} // namespace run2

// DECLARE_SOA_TABLE(Run2CollInfos, "AOD", "RUN2COLLINFO", )
DECLARE_SOA_TABLE(Run2BCInfos, "AOD", "RUN2BCINFO", run2::EventCuts, run2::TriggerMaskNext50, run2::SPDClustersL0,
run2::SPDClustersL1)
DECLARE_SOA_TABLE(Run2BCInfos, "AOD", "RUN2BCINFO", run2::EventCuts, run2::TriggerMaskNext50,
run2::SPDClustersL0, run2::SPDClustersL1)

using Run2BCInfo = Run2BCInfos::iterator;

// ---- MC tables ----
namespace mccollision
Expand Down
8 changes: 5 additions & 3 deletions Framework/Core/include/Framework/Expressions.h
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ struct LiteralStorage {
using stored_pack = framework::pack<T...>;
};

using LiteralValue = LiteralStorage<int, bool, float, double, uint8_t, int64_t>;
using LiteralValue = LiteralStorage<int, bool, float, double, uint8_t, int64_t, int16_t, uint16_t, int8_t>;

template <typename T>
constexpr auto selectArrowType()
Expand All @@ -69,14 +69,16 @@ constexpr auto selectArrowType()
return atype::FLOAT;
} else if constexpr (std::is_same_v<T, double>) {
return atype::DOUBLE;
} else if constexpr (std::is_same_v<T, uint8_t>) {
return atype::UINT8;
} else if constexpr (std::is_same_v<T, int8_t>) {
return atype::INT8;
} else if constexpr (std::is_same_v<T, uint16_t>) {
return atype::UINT16;
} else if constexpr (std::is_same_v<T, int16_t>) {
return atype::INT16;
} else if constexpr (std::is_same_v<T, int64_t>) {
return atype::INT64;
} else if constexpr (std::is_same_v<T, uint8_t>) {
return atype::UINT8;
} else {
return atype::NA;
}
Expand Down
11 changes: 11 additions & 0 deletions Framework/Core/src/Expressions.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,8 @@ std::shared_ptr<arrow::DataType> concreteArrowType(atype::type type)
return arrow::int8();
case atype::INT16:
return arrow::int16();
case atype::UINT16:
return arrow::uint16();
case atype::INT32:
return arrow::int32();
case atype::INT64:
Expand Down Expand Up @@ -456,6 +458,15 @@ gandiva::NodePtr createExpressionTree(Operations const& opSpecs,
if (content.index() == 5) {
return gandiva::TreeExprBuilder::MakeLiteral(std::get<int64_t>(content));
}
if (content.index() == 6) {
return gandiva::TreeExprBuilder::MakeLiteral(std::get<int16_t>(content));
}
if (content.index() == 7) {
return gandiva::TreeExprBuilder::MakeLiteral(std::get<uint16_t>(content));
}
if (content.index() == 8) {
return gandiva::TreeExprBuilder::MakeLiteral(std::get<int8_t>(content));
}
throw runtime_error("Malformed LiteralNode");
}

Expand Down