Skip to content

hipo-search

Search for events matching complex queries across multiple files.

Synopsis

hipo-search [options] <files...>

Description

hipo-search finds events matching specified criteria and reports results. Unlike hipo-filter, it can search across multiple files and optionally save matching events to a new file.

Options

Option Description Default
-e, --expr <expr> Filter expression (repeatable, required) -
--or Use OR logic (default: AND) -
-o, --output <file> Write matching events to file -
-m, --max <n> Stop after N matches (-1 = all) -1
-f, --format <fmt> Output format: plain, csv, json plain
-q, --quiet Suppress progress output -
--no-color Disable colored output -

Expression Syntax

See Expression Syntax Reference for complete details.

Bank::Name.column op value
Bank::Name.column IN (val1, val2, ...)
Bank::Name.column BETWEEN min AND max

Supported operators: ==, !=, <, <=, >, >=, IN, BETWEEN

Examples

# Find events with electrons
hipo-search -e "REC::Particle.pid == 11" data.hipo

# Find events with leptons (IN operator)
hipo-search -e "REC::Particle.pid IN (11, -11)" data.hipo
# Find events with momentum in range
hipo-search -e "REC::Particle.p BETWEEN 0.5 AND 2.0" data.hipo

Multiple Conditions

# AND logic (default)
hipo-search -e "REC::Particle.pid == 11" -e "REC::Track.ndf >= 10" data.hipo

# OR logic
hipo-search -e "REC::Particle.pid == 11" --or -e "REC::Particle.pid == -11" data.hipo

Save Results

# Save matching events to new file
hipo-search -e "REC::Particle.pid == 11" -o electrons.hipo data.hipo
# Search across multiple files with glob
hipo-search -e "REC::Particle.charge != 0" -m 100 "data_*.hipo"

Output Formats

# JSON output for scripting
hipo-search -e "REC::Particle.pid == 11" -f json data.hipo

# CSV output
hipo-search -e "REC::Particle.pid == 11" -f csv data.hipo

See Also