16#include <hipo4/reader.h>
17#include <iguana/algorithms/AlgorithmSequence.h>
24 fmt::print(
"{:=^70}\n",
" " + header +
" ");
29int main(
int argc,
char** argv)
34 char const* inFileName = argc > argi ? argv[argi++] :
"data.hipo";
35 int const numEvents = argc > argi ? std::stoi(argv[argi++]) : 1;
38 hipo::reader reader(inFileName,{0});
41 hipo::banklist banks = reader.getBanks({
"RUN::config",
45 "REC::Scintillator"});
46 enum banks_enum { b_config,
51 seq.
Add(
"clas12::EventBuilderFilter");
52 seq.
Add(
"clas12::SectorFinder");
53 seq.
Add(
"clas12::MomentumCorrection");
56 seq.
SetOption(
"clas12::EventBuilderFilter",
"log",
"debug");
57 seq.
SetOption(
"clas12::MomentumCorrection",
"log",
"debug");
60 seq.
SetOption<std::vector<int>>(
"clas12::EventBuilderFilter",
"pids", {11, 211, -211});
67 while(reader.next(banks) && (numEvents == 0 || iEvent++ < numEvents)) {
User-level class for running a sequence of algorithms.
void SetOption(std::string const &algo_name, std::string const &key, const OPTION_TYPE val)
void Stop() override
Finalize this algorithm after all events are processed.
void Run(hipo::banklist &banks) const override
Run this algorithm for an event.
void Add(std::string const &class_name, std::string const &instance_name="")
void Start(hipo::banklist &banks) override
Initialize this algorithm before any events are processed, with the intent to process banks
int main(int argc, char **argv)
main function
void prettyPrint(std::string header, hipo::bank &bank)
show a bank along with a header