HIPO  4.3.0
High Performance Output data format for experimental physics
fizika::reaction Class Reference

Physics analysis helper for filtering and reconstructing reactions from HIPO data. More...

#include <reaction.h>

Public Member Functions

 reaction ()
 Default constructor. More...
 
 reaction (const char *file)
 Construct a reaction from a HIPO file (no filter, no beam setup). More...
 
 reaction (const char *file, std::initializer_list< std::tuple< int, int > > desc)
 Construct a reaction with a particle filter. More...
 
 reaction (const char *file, double benergy, std::initializer_list< std::tuple< int, int > > desc)
 Construct a reaction with beam energy and particle filter. More...
 
 reaction (const char *file, double benergy, int *pids, int *count, int length)
 Construct a reaction with beam energy and C-style filter arrays. More...
 
virtual ~reaction ()
 
fizika::lorentz4cm ()
 
void init_filter (std::initializer_list< std::tuple< int, int > > desc)
 Initialize the particle filter from PID/count pairs. More...
 
fizika::lorentz4 get (std::initializer_list< std::tuple< int, int, int, double > > desc)
 Reconstruct a Lorentz vector from a particle combination. More...
 
fizika::lorentz4 get (int *signs, int *pids, int *skips, double *masses, int length)
 Reconstruct a Lorentz vector from arrays of particle parameters. More...
 
bool next ()
 Advance to the next event and read all banks. More...
 
void get_vector (fizika::lorentz4 &vec, double mass, hipo::bank &b, int order, int ind_px, int ind_py, int ind_pz)
 Fill a Lorentz vector from a bank row's momentum columns and a given mass. More...
 
bool is_valid ()
 Check if the current event passes the particle filter. More...
 
int countpid (int pid)
 Count particles with the given PID that pass status cuts. More...
 
int index (int pid, int skip)
 Find the row index of the Nth particle with the given PID. More...
 
std::vector< hipo::bank > & getBanks ()
 
fizika::lorentz4beam ()
 
fizika::lorentz4target ()
 

Detailed Description

Physics analysis helper for filtering and reconstructing reactions from HIPO data.

Reads REC::Particle banks and provides particle identification filtering, Lorentz vector reconstruction, and exclusive/inclusive reaction selection. Beam and target kinematics are configurable.

Definition at line 37 of file reaction.h.

Constructor & Destructor Documentation

◆ reaction() [1/5]

fizika::reaction::reaction ( )
inline

Default constructor.

Definition at line 62 of file reaction.h.

◆ reaction() [2/5]

fizika::reaction::reaction ( const char *  file)
inline

Construct a reaction from a HIPO file (no filter, no beam setup).

Parameters
filePath to the HIPO file

Definition at line 65 of file reaction.h.

◆ reaction() [3/5]

fizika::reaction::reaction ( const char *  file,
std::initializer_list< std::tuple< int, int > >  desc 
)
inline

Construct a reaction with a particle filter.

Parameters
filePath to the HIPO file
descInitializer list of (pid, count) tuples defining the filter

Definition at line 71 of file reaction.h.

◆ reaction() [4/5]

fizika::reaction::reaction ( const char *  file,
double  benergy,
std::initializer_list< std::tuple< int, int > >  desc 
)
inline

Construct a reaction with beam energy and particle filter.

Parameters
filePath to the HIPO file
benergyBeam energy in GeV
descInitializer list of (pid, count) tuples defining the filter

Definition at line 79 of file reaction.h.

◆ reaction() [5/5]

fizika::reaction::reaction ( const char *  file,
double  benergy,
int *  pids,
int *  count,
int  length 
)
inline

Construct a reaction with beam energy and C-style filter arrays.

Parameters
filePath to the HIPO file
benergyBeam energy in GeV
pidsArray of particle IDs
countArray of required counts per PID
lengthNumber of entries in pids and count arrays

Definition at line 93 of file reaction.h.

◆ ~reaction()

virtual fizika::reaction::~reaction ( )
inlinevirtual

Definition at line 105 of file reaction.h.

Member Function Documentation

◆ beam()

fizika::lorentz4& fizika::reaction::beam ( )
inline
Returns
Reference to the beam Lorentz vector.

Definition at line 223 of file reaction.h.

◆ cm()

fizika::lorentz4& fizika::reaction::cm ( )
inline
Returns
Reference to the center-of-mass Lorentz vector.

Definition at line 109 of file reaction.h.

◆ countpid()

int fizika::reaction::countpid ( int  pid)
inline

Count particles with the given PID that pass status cuts.

Parameters
pidParticle ID to count

Definition at line 192 of file reaction.h.

◆ get() [1/2]

fizika::lorentz4 fizika::reaction::get ( int *  signs,
int *  pids,
int *  skips,
double *  masses,
int  length 
)
inline

Reconstruct a Lorentz vector from arrays of particle parameters.

Parameters
signsArray of signs (+1 or -1)
pidsArray of particle IDs
skipsArray of occurrence indices
massesArray of assumed masses
lengthNumber of particles

Definition at line 148 of file reaction.h.

◆ get() [2/2]

fizika::lorentz4 fizika::reaction::get ( std::initializer_list< std::tuple< int, int, int, double > >  desc)
inline

Reconstruct a Lorentz vector from a particle combination.

Parameters
descInitializer list of (sign, pid, skip, mass) tuples. sign: +1 to add, -1 to subtract. skip: occurrence index.
Returns
Combined Lorentz vector

Definition at line 129 of file reaction.h.

◆ get_vector()

void fizika::reaction::get_vector ( fizika::lorentz4 vec,
double  mass,
hipo::bank b,
int  order,
int  ind_px,
int  ind_py,
int  ind_pz 
)
inline

Fill a Lorentz vector from a bank row's momentum columns and a given mass.

Definition at line 173 of file reaction.h.

◆ getBanks()

std::vector<hipo::bank>& fizika::reaction::getBanks ( )
inline
Returns
Reference to the vector of banks.

Definition at line 221 of file reaction.h.

◆ index()

int fizika::reaction::index ( int  pid,
int  skip 
)
inline

Find the row index of the Nth particle with the given PID.

Parameters
pidParticle ID to search for
skipOccurrence index (0 = first match)
Returns
Row index or -1 if not found

Definition at line 207 of file reaction.h.

◆ init_filter()

void fizika::reaction::init_filter ( std::initializer_list< std::tuple< int, int > >  desc)
inline

Initialize the particle filter from PID/count pairs.

Parameters
descInitializer list of (pid, count) tuples

Definition at line 113 of file reaction.h.

◆ is_valid()

bool fizika::reaction::is_valid ( )
inline

Check if the current event passes the particle filter.

Returns
True if all required PIDs have the required counts

Definition at line 179 of file reaction.h.

◆ next()

bool fizika::reaction::next ( )
inline

Advance to the next event and read all banks.

Returns
False at end of file

Definition at line 164 of file reaction.h.

◆ target()

fizika::lorentz4& fizika::reaction::target ( )
inline
Returns
Reference to the target Lorentz vector.

Definition at line 225 of file reaction.h.


The documentation for this class was generated from the following file: