All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
PFParticle.cxx
Go to the documentation of this file.
1 ////////////////////////////////////////////////////////////////////////////
2 //
3 // \brief Definition of PFParticle object for LArSoft
4 //
5 // \author usher@slac.stanford.edu
6 //
7 ////////////////////////////////////////////////////////////////////////////
8 
10 
11 #include <utility>
12 #include <iomanip>
13 #include <ostream>
14 
15 namespace recob{
16 
18  fPdgCode(0), fSelf(0), fParent(PFParticle::kPFParticlePrimary)
19  {}
20 
21  PFParticle::PFParticle(int pdgCode, size_t self, size_t parent, const std::vector<size_t>& daughters) :
22  fPdgCode(pdgCode),
23  fSelf(self),
24  fParent(parent),
25  fDaughters(daughters)
26  {}
27 
28  PFParticle::PFParticle(int pdgCode, size_t self, size_t parent, std::vector<size_t>&& daughters) :
29  fPdgCode(pdgCode),
30  fSelf(self),
31  fParent(parent),
32  fDaughters(std::move(daughters))
33  {}
34 
35  //----------------------------------------------------------------------
36  // ostream operator.
37  //
38  std::ostream& operator<< (std::ostream& o, const PFParticle& c)
39  {
40  o << std::setiosflags(std::ios::fixed) << std::setprecision(2);
41  o << "PFParticle hypothesis PDG Code " << std::setw(8) << std::right << c.PdgCode()
42  << ", is primary = " << c.IsPrimary()
43  << ", # Daughters " << std::setw(5) << std::right << c.NumDaughters() << std::endl;
44 
45  return o;
46  }
47 
48  //----------------------------------------------------------------------
49  // less than operator - basically sort in order of index into main collection
50  bool operator< (const PFParticle& a, const PFParticle& b)
51  {
52  return a.Self() < b.Self();
53  }
54 
55 
56 }// namespace
double std(const std::vector< short > &wf, const double ped_mean, size_t start, size_t nsample)
Definition: UtilFunc.cxx:42
int NumDaughters() const
Returns the number of daughter particles flowing from this one.
Definition: PFParticle.h:89
size_t Self() const
Returns the index of this particle.
Definition: PFParticle.h:92
bool operator<(Cluster const &a, Cluster const &b)
Definition: Cluster.cxx:196
walls no right
Definition: selectors.fcl:105
int PdgCode() const
Return the type of particle as a PDG ID.
Definition: PFParticle.h:83
process_name gaushit a
bool IsPrimary() const
Returns whether the particle is the root of the flow.
Definition: PFParticle.h:86
Hierarchical representation of particle flow.
Definition: PFParticle.h:44
PFParticle()
Default constructor necessary for gccxml - not really for public use.
Definition: PFParticle.cxx:17
std::ostream & operator<<(std::ostream &o, Cluster const &c)
Definition: Cluster.cxx:173