Hall-D Software  alpha
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
DNeutralParticle.h
Go to the documentation of this file.
1 // $Id$
2 //
3 // File: DNeutralParticle.h
4 // Created: Tue Aug 9 14:29:24 EST 2011
5 // Creator: pmatt (on Linux ifarml6 2.6.18-128.el5 x86_64)
6 //
7 
8 #ifndef _DNeutralParticle_
9 #define _DNeutralParticle_
10 
11 #include <vector>
12 #include <JANA/JObject.h>
14 #include <PID/DNeutralShower.h>
15 #include <particleType.h>
16 
17 using namespace std;
18 
19 class DNeutralParticle : public jana::JObject
20 {
21  public:
22  JOBJECT_PUBLIC(DNeutralParticle);
23 
24  vector<const DNeutralParticleHypothesis*> dNeutralParticleHypotheses;
26 
27  const DNeutralParticleHypothesis* Get_BestFOM(void) const;
28  const DNeutralParticleHypothesis* Get_Hypothesis(Particle_t locPID) const;
29 
30  void toStrings(vector<pair<string,string> > &items) const
31  {
32  AddString(items, "Nhypotheses", "%d", dNeutralParticleHypotheses.size());
33  }
34 };
35 
37 {
38  if(dNeutralParticleHypotheses.empty())
39  return NULL;
40  double locBestFOM = -2.0;
41  const DNeutralParticleHypothesis* locBestNeutralParticleHypotheses = dNeutralParticleHypotheses[0];
42  for(size_t loc_i = 0; loc_i < dNeutralParticleHypotheses.size(); ++loc_i)
43  {
44  if(dNeutralParticleHypotheses[loc_i]->Get_FOM() > locBestFOM)
45  {
46  locBestNeutralParticleHypotheses = dNeutralParticleHypotheses[loc_i];
47  locBestFOM = locBestNeutralParticleHypotheses->Get_FOM();
48  }
49  }
50  return locBestNeutralParticleHypotheses;
51 }
52 
54 {
55  for(unsigned int loc_i = 0; loc_i < dNeutralParticleHypotheses.size(); ++loc_i)
56  {
57  if(dNeutralParticleHypotheses[loc_i]->PID() == locPID)
58  return dNeutralParticleHypotheses[loc_i];
59  }
60  return NULL;
61 }
62 
63 #endif // _DNeutralParticle_
64 
vector< const DNeutralParticleHypothesis * > dNeutralParticleHypotheses
const DNeutralParticleHypothesis * Get_Hypothesis(Particle_t locPID) const
const DNeutralParticleHypothesis * Get_BestFOM(void) const
const DNeutralShower * dNeutralShower
void toStrings(vector< pair< string, string > > &items) const
Particle_t
Definition: particleType.h:12