Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add another LHCb analysis layout and fix layout vis #827

Merged
merged 2 commits into from
Jan 9, 2024
Merged
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
19 changes: 19 additions & 0 deletions examples/root/lhcb_analysis/lhcb.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -358,6 +358,24 @@ namespace
true>::template fn,
true>;

// Like 8, but split H1.ProbK and H2.PropK again
template<std::size_t ManBits = 16>
using Custom8Sep = llama::mapping::Split<
llama::ArrayExtentsDynamic<RE::NTupleSize_t, 1>,
Event,
mp_list<mp_list<H1, IsMuon>, mp_list<H2, IsMuon>, mp_list<H3, IsMuon>>,
llama::mapping::BindBitPackedIntAoS<llama::Constant<1>, llama::mapping::SignBit::Discard>::fn,
llama::mapping::BindSplit<
mp_list<mp_list<H1, ProbK>>,
llama::mapping::BindChangeType<llama::mapping::BindAoS<>::fn, mp_list<mp_list<double, float>>>::fn,
llama::mapping::BindSplit<
mp_list<mp_list<H2, ProbK>>,
llama::mapping::BindChangeType<llama::mapping::BindAoS<>::fn, mp_list<mp_list<double, float>>>::fn,
llama::mapping::BindBitPackedFloatAoS<llama::Constant<6>, llama::Constant<ManBits>>::template fn,
true>::template fn,
true>::template fn,
true>;

using Custom9 = llama::mapping::Split<
llama::ArrayExtentsDynamic<RE::NTupleSize_t, 1>,
Event,
Expand Down Expand Up @@ -610,6 +628,7 @@ auto main(int argc, const char* argv[]) -> int
// testAnalysis<Custom7, true>(inputFile, treeName, "Custom7_S");
testAnalysis<Custom8<>>(inputFile, treeName, "Custom8");
// testAnalysis<Custom8<>, true>(inputFile, treeName, "Custom8_S");
testAnalysis<Custom8Sep<>>(inputFile, treeName, "Custom8Sep");
testAnalysis<Custom9>(inputFile, treeName, "Custom9");
testAnalysis<Custom10>(inputFile, treeName, "Custom10");
// testAnalysis<Custom9, true>(inputFile, treeName, "Custom9_S");
Expand Down
9 changes: 8 additions & 1 deletion include/llama/DumpMapping.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -371,7 +371,14 @@ namespace llama

if(hasAnyComputedField<Mapping>)
{
writeBlobHeader(Mapping::blobCount, computedSizeSoFar, "Comp.");
if(computedSizeSoFar > 0)
writeBlobHeader(Mapping::blobCount, computedSizeSoFar, "Comp.");
else
{
const auto blobRows = (wrapByteCount - 1) / wrapByteCount;
blobYOffset[Mapping::blobCount + 1]
= blobYOffset[Mapping::blobCount] + blobRows * byteSizeInPixel; // fix-up, omit gap
}

// fix total SVG size
const auto i = svg.find("987654321");
Expand Down
Loading