UTIL::PIDHandler Class Reference

Convenient class for setting and retrieving particle id information attached to ReconstructedParticles. More...

#include <UTIL/PIDHandler.h>

List of all members.

Public Member Functions

 PIDHandler (const PIDHandler &)
PIDHandleroperator= (const PIDHandler &)
 PIDHandler (const EVENT::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 (EVENT::LCCollection *col)
 Create PIDHandler for setting PID information in the given collection

  • read and update the collection parameters PIDAlgorithmTypeName, PIDAlgorithmTypeID and the corresponding ParameterNames_PIDAlgorithmTypeName if they exist.

 ~PIDHandler ()
 Update the collection parameter when going out of scope.
int addAlgorithm (const std::string &algoName, const EVENT::StringVec &parameterNames)
 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 EVENT::ParticleIDgetParticleID (EVENT::LCObject *particle, int algorithmID)
 Return the (first) ParticleID object for the given algorithm and particle (or cluster) - throws UnknownAlgorithm.
EVENT::ParticleIDVec getParticleIDs (EVENT::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


const EVENT::StringVecgetParameterNames (int algorithmID)
 The names of parameters for the algorithm with algorithmID - throws UnknownAlgoritm.
const EVENT::IntVecgetAlgorithmIDs ()
 Return the IDs of all known Algorithms.
void setParticleID (EVENT::LCObject *p, int userType, int PDG, float likelihood, int algorithmID, const EVENT::FloatVec &params)
 Set the particleID information for this particle (or cluster) - throws UnknownAlgorithm.

Protected Member Functions

int nextID ()
void init (const EVENT::LCCollection *col)

Detailed Description

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.

See also:
ReconstructedParticle
ParticleID
Author:
F.Gaede, DESY
Version:
Id
PIDHandler.h,v 1.2 2010-01-21 16:28:25 gaede Exp

Member Function Documentation

const ParticleID & UTIL::PIDHandler::getParticleID ( EVENT::LCObject particle,
int  algorithmID 
)

Return the (first) ParticleID object for the given algorithm and particle (or cluster) - throws UnknownAlgorithm.

If no object is found for the given algorithmID a default initialized dummy object is returned. 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().


The documentation for this class was generated from the following files:
 All Classes Namespaces Functions Variables Typedefs Friends

Generated on 6 Mar 2020 for LCIO by  doxygen 1.6.1