All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
ParticleID.h
Go to the documentation of this file.
1 ////////////////////////////////////////////////////////////////////////////
2 // \version
3 //
4 // \brief Definition of data product to hold ParticleID information
5 //
6 // \author brebel@fnal.gov, tjyang@fnal.gov
7 //
8 ////////////////////////////////////////////////////////////////////////////
9 #ifndef ANAB_PARTICLEID_H
10 #define ANAB_PARTICLEID_H
11 
12 #include <vector>
13 #include <iosfwd>
14 #include <iostream>
15 #include <iomanip>
16 #include <bitset>
19 
20 namespace anab {
21 
22 struct sParticleIDAlgScores { ///< determined particle ID
23  std::string fAlgName; ///< Algorithm name (to be defined by experiment). Set to "AlgNameNotSet" by default.
24  kVariableType fVariableType; ///< Variable type enum: defined in ParticleID_VariableTypeEnums.h. Set to kNotSet by default.
25  kTrackDir fTrackDir; ///< Track direction enum: defined in ParticleID_VariableTypeEnums.h. Set to kNoDirection by default.
26  int fNdf; ///< Number of degrees of freedom used by algorithm, if applicable. Set to -9999 by default.
27  int fAssumedPdg; ///< PDG of particle hypothesis assumed by algorithm, if applicable. Set to 0 by default.
28  float fValue; ///< Result of Particle ID algorithm/test
29  std::bitset<8> fPlaneMask; ///< Bitset for PlaneID used by algorithm, allowing for multiple planes and up to 8 total planes. Set to all 0s by default. Convention for bitset is that fPlaneMask[0] (i.e. bit 0) represents plane 0, bit 1 represents plane 1, and so on (with plane conventions defined by the experiment).
30 
32  fAlgName = "AlgNameNotSet";
35  fAssumedPdg = 0;
36  fNdf = -9999;
37  fValue = -9999.;
38  // fPlaneMask will use default constructor: sets all values to 0
39  }
40 
41 };
42 
43  class ParticleID{
44  private:
45 
46  std::vector<sParticleIDAlgScores> fParticleIDAlgScores; ///< Vector of structs to hold outputs from generic PID algorithms
47  geo::PlaneID fPlaneID; ///< Plane id.
48 
49  public:
50 
51  ParticleID();
52  ParticleID(const std::vector<anab::sParticleIDAlgScores> &ParticleIDAlgScores,
53  const geo::PlaneID& planeID);
54 
55  friend std::ostream& operator << (std::ostream &o, ParticleID const& a);
56 
57  const std::vector<anab::sParticleIDAlgScores> & ParticleIDAlgScores() const;
58 
59  const geo::PlaneID& PlaneID() const;
60 
61  };
62 
63 }
64 
65 inline const std::vector<anab::sParticleIDAlgScores> & anab::ParticleID::ParticleIDAlgScores() const { return fParticleIDAlgScores; }
66 
67 inline const geo::PlaneID& anab::ParticleID::PlaneID() const {return fPlaneID;}
68 
69 #endif //ANAB_PARTICLEID_H
const geo::PlaneID & PlaneID() const
Definition: ParticleID.h:67
friend std::ostream & operator<<(std::ostream &o, ParticleID const &a)
Definition: ParticleID.cxx:31
The data type to uniquely identify a Plane.
Definition: geo_types.h:472
float fValue
Result of Particle ID algorithm/test.
Definition: ParticleID.h:28
std::bitset< 8 > fPlaneMask
Bitset for PlaneID used by algorithm, allowing for multiple planes and up to 8 total planes...
Definition: ParticleID.h:29
process_name gaushit a
std::string fAlgName
&lt; determined particle ID
Definition: ParticleID.h:23
int fNdf
Number of degrees of freedom used by algorithm, if applicable. Set to -9999 by default.
Definition: ParticleID.h:26
kTrackDir fTrackDir
Track direction enum: defined in ParticleID_VariableTypeEnums.h. Set to kNoDirection by default...
Definition: ParticleID.h:25
kVariableType fVariableType
Variable type enum: defined in ParticleID_VariableTypeEnums.h. Set to kNotSet by default.
Definition: ParticleID.h:24
const std::vector< anab::sParticleIDAlgScores > & ParticleIDAlgScores() const
Definition: ParticleID.h:65
Definition of data types for geometry description.
std::vector< sParticleIDAlgScores > fParticleIDAlgScores
Vector of structs to hold outputs from generic PID algorithms.
Definition: ParticleID.h:46
geo::PlaneID fPlaneID
Plane id.
Definition: ParticleID.h:47
int fAssumedPdg
PDG of particle hypothesis assumed by algorithm, if applicable. Set to 0 by default.
Definition: ParticleID.h:27