LCIO  "2.7.4"
 All Classes Namespaces Functions Variables Typedefs Friends Pages
ParticleIDImpl.h
1 // -*- C++ -*-
2 #ifndef IMPL_PARTICLEIDIMPL_H
3 #define IMPL_PARTICLEIDIMPL_H 1
4 
5 #include "EVENT/ParticleID.h"
6 #include "AccessChecked.h"
7 #include <functional>
8 
9 namespace IMPL {
10 
11 
14  class PIDSort : public std::binary_function<EVENT::ParticleID*,EVENT::ParticleID*,bool>{
15  public:
16  bool operator()(const EVENT::ParticleID* p1, const EVENT::ParticleID* p2){
17  return p1->getLikelihood() > p2->getLikelihood() ;
18  }
19  };
20 
21 
30 
31  public:
32 
35  ParticleIDImpl() ;
36 
38  virtual ~ParticleIDImpl() ;
39 
40  virtual int id() const { return simpleUID() ; }
41 
44  virtual int getType() const ;
45 
48  virtual int getPDG() const ;
49 
52  virtual float getLikelihood() const ;
53 
58  virtual int getAlgorithmType() const ;
59 
63  virtual const EVENT::FloatVec & getParameters() const ;
64 
67  virtual EVENT::FloatVec& parameters() ;
68 
69  // setters
70  void setType( int type ) ;
71  void setPDG( int pdg ) ;
72  void setLikelihood( float logL ) ;
73  void setAlgorithmType(int algorithmType ) ;
74  void addParameter( float p ) ;
75 
76  protected:
77  int _type ;
78  int _pdg ;
79  float _likelihood ;
80  int _algorithmType ;
81  EVENT::FloatVec _parameters ;
82 
83 }; // class
84 
85 } // namespace IMPL
86 #endif /* ifndef IMPL_PARTICLEIDIMLP_H */
virtual const EVENT::FloatVec & getParameters() const
Parameters associated with this hypothesis.
Definition: ParticleIDImpl.cc:27
Implementation of ParticleID.
Definition: ParticleIDImpl.h:29
std::vector< float > FloatVec
Vector of floats.
Definition: LCIOSTLTypes.h:18
virtual ~ParticleIDImpl()
Destructor.
Definition: ParticleIDImpl.cc:12
virtual float getLikelihood() const =0
The likelihood of this hypothesis - in a user defined normalization.
Helper class to sort ParticleIDs wrt.
Definition: ParticleIDImpl.h:14
virtual int id() const
Returns an object id for internal (debugging) use in LCIO.
Definition: ParticleIDImpl.h:40
Persistent interface for LCIO ParticleIDs.
Definition: ParticleID.h:28
virtual int getType() const
Type - userdefined.
Definition: ParticleIDImpl.cc:15
virtual int getAlgorithmType() const
Type of the algorithm/module that created this hypothesis - NOTE: must be unique within one collectio...
Definition: ParticleIDImpl.cc:24
ParticleIDImpl()
Default constructor, initializes values to 0.
Definition: ParticleIDImpl.cc:5
virtual float getLikelihood() const
The likelihood of this hypothesis - in a user defined normalization.
Definition: ParticleIDImpl.cc:21
Controls access to objects.
Definition: AccessChecked.h:17
virtual int getPDG() const
The PDG code of this id - UnknownPDG ( 999999 ) if unknown.
Definition: ParticleIDImpl.cc:18
virtual EVENT::FloatVec & parameters()
Access to parameters associated with this hypothesis.
Definition: ParticleIDImpl.cc:31