26int main(
int argc,
char** argv)
31 char const* in_file = argc > argi ? argv[argi++] :
"data.hipo";
32 int const num_events = argc > argi ? std::stoi(argv[argi++]) : 100;
33 bool const interactive_mode = argc > argi ? std::string(argv[argi++]) ==
"true" :
false;
37 algo_eventbuilder_filter.
SetOption<std::vector<int>>(
"pids", {11, 211, -211});
38 algo_eventbuilder_filter.
Start();
41 auto app = interactive_mode ?
new TApplication(
"app", &argc, argv) :
nullptr;
47 auto frame_init = MakeHipoDataFrame(in_file).Range(0, num_events);
50 fmt::print(
"DATAFRAME COLUMNS:\n");
51 for(
auto const& column_name : frame_init.GetColumnNames())
52 fmt::print(
" - {}\n", column_name);
58 auto frame_filtered = frame_init
60 "REC_Particle_EventBuilderFilter",
61 [&](std::vector<int>
const& pids)
62 {
return algo_eventbuilder_filter.
Filter(pids); },
65 "REC_Particle_pid_good",
66 [](std::vector<int>
const& pids, std::deque<bool>& filter)
68 std::vector<int> result;
69 for(std::deque<bool>::size_type i = 0; i < filter.size(); i++) {
71 result.push_back(pids.at(i));
75 {
"REC_Particle_pid",
"REC_Particle_EventBuilderFilter"});
78 auto hist = frame_filtered.Histo1D({
"pid_filter",
"PDG", 6000, -3000, 3000},
"REC_Particle_pid_good");
81 auto canv =
new TCanvas(
"canv",
"canv", 1600, 1200);
84 if(interactive_mode) {
85 fmt::print(
"\n\nShowing plots interactively;\npress ^C to exit.\n\n");
89 canv->SaveAs(
"out-iguana-dataframe-example.png");