Utilities¶
hipo::hipoeventfile¶
Simplified event file reader with range-based iteration.
hipoeventfile(const char *filename);
dictionary& dictionary();
bool next();
void read(event& evt);
// Range-based iteration
iterator begin();
iterator end();
hipo::hipoeventfile file("data.hipo");
hipo::bank particles(file.dictionary().getSchema("REC::Particle"));
for (auto& event : file) {
event.read(particles);
// process...
}
hipo::fusion¶
Multi-file reader with event merging:
hipo::reaction¶
Physics analysis helper with particle identification:
reaction(reader& r, const char *definition);
bool next();
bool hasParticle(int pid);
double px(int index);
double py(int index);
double pz(int index);
double mass();
double missingMass();
hipo::reader reader("data.hipo");
hipo::reaction rxn(reader, "11:2212:211:-211:Kp");
while (rxn.next()) {
if (rxn.hasParticle(321)) {
double mm = rxn.missingMass();
}
}
hipo::tuple¶
Write flat n-tuple files (text format):
hipo::Parser¶
Expression parser for row filtering:
Used internally by bank::rowlist::filter(const char*). For performance, construct once and reuse:
hipo::Parser parser("pid==11&&charge<0");
while (reader.next(list)) {
list[0].getMutableRowList().filter(parser);
}
hipo::benchmark¶
Simple timing utility:
hipo::utils¶
Static utility functions:
static std::string substring(const std::string& str, const char* start, const char* end, int offset);
static int findEndOfStructure(const char* buffer, int size, int group, int item);
hipo::datastream¶
Abstract I/O abstraction:
class datastream {
virtual void open(const char *filename) = 0;
virtual void read(char *buffer, int size) = 0;
virtual long size() = 0;
virtual long position() = 0;
virtual void position(long pos) = 0;
};
Implementations:
datastreamLocalFile-- wrapsstd::ifstreamdatastreamXrootd-- wraps XrdClient (compile with-D__XROOTD__)
hipo::ThreadPool¶
Thread pool for parallel processing:
ThreadPool(int numThreads, const std::string& name = "Worker");
template<typename F>
std::future<void> submit(F&& func);
void shutdown();
hipo::ProgressTracker¶
Visual progress bar for long operations:
ProgressTracker(std::size_t total, Config config = {});
void start();
void increment();
void finish();
Configuration: