Convenient class for setting and retrieving particle id information attached to ReconstructedParticles. More...
#include <UTIL/PIDHandler.h>
Public Member Functions | |
PIDHandler (const LCCollection *col) | |
Create PIDHandler for reading from the given collection - read the collection parameters PIDAlgorithmTypeName, PIDAlgorithmTypeID and the corresponding ParameterNames_PIDAlgorithmTypeName if they exist. | |
PIDHandler (LCCollection *col) | |
Create PIDHandler for setting PID information in the given collection. More... | |
~PIDHandler () | |
Update the collection parameter when going out of scope. | |
int | addAlgorithm (const std::string &algoName, const StringVec ¶meterNames) |
Add a new algorithm and return the corresponding algorithm id. | |
int | getAlgorithmID (const std::string &algoName) |
Return the typeID of algorithm algoName - throws UnknownAlgorithm. | |
const std::string & | getAlgorithmName (int algoID) |
Return the name of the algorithm with id - throws UnknownAlgorithm. | |
int | getParameterIndex (int algorithmID, const std::string &pName) |
The index of parameter pName for the algorithm with algorithmID - throws UnknownAlgoritm. | |
const ParticleID & | getParticleID (LCObject *particle, int algorithmID) |
Return the (first) ParticleID object for the given algorithm and particle (or cluster) - throws UnknownAlgorithm. More... | |
ParticleIDVec | getParticleIDs (LCObject *p, int id) |
Return all PID objects for a given algorithm - ordered with decreasing likelihood - throws UnknownAlgorithm. | |
void | setParticleIDUsed (IMPL::ReconstructedParticleImpl *particle, int algorithmID) |
Set the particleID algorithm that is used for this particle's kinematic variables. More... | |
const StringVec & | getParameterNames (int algorithmID) |
The names of parameters for the algorithm with algorithmID - throws UnknownAlgoritm. | |
const IntVec & | getAlgorithmIDs () |
Return the IDs of all known Algorithms. | |
void | setParticleID (LCObject *p, int userType, int PDG, float likelihood, int algorithmID, const FloatVec ¶ms) |
Set the particleID information for this particle (or cluster) - throws UnknownAlgorithm. | |
Protected Member Functions | |
int | nextID () |
void | init (const LCCollection *col) |
Protected Attributes | |
LCCollection * | _col |
CPM | _cpm |
int | _type |
int | _maxID |
PNM | _pNames |
CPMINV | _cpmInv |
IntVec | _ids |
Convenient class for setting and retrieving particle id information attached to ReconstructedParticles.
Use one instance of PIDHandler for one LCCollection only. When used for setting particle id information the scope of the PIDHandler must match that of the collection, as the collection parameters are updated automatically when the PIDHandler object goes out of scope. Reads (and updates) the collection parameters PIDAlgorithmTypeName, PIDAlgorithmTypeID and the corresponding ParameterNames_PIDAlgorithmTypeName for every algorithm used.
UTIL::PIDHandler::PIDHandler | ( | LCCollection * | col | ) |
Create PIDHandler for setting PID information in the given collection.
const ParticleID & UTIL::PIDHandler::getParticleID | ( | LCObject * | particle, |
int | algorithmID | ||
) |
Return the (first) ParticleID object for the given algorithm and particle (or cluster) - throws UnknownAlgorithm.
Only use if you know there is only one PID object for the algorithms or if you simply want the most likely PID for this algorithm.
References getParticleIDs().
void UTIL::PIDHandler::setParticleIDUsed | ( | IMPL::ReconstructedParticleImpl * | particle, |
int | algorithmID | ||
) |
Set the particleID algorithm that is used for this particle's kinematic variables.
References IMPL::ReconstructedParticleImpl::getParticleIDs().