Hall-D Software  alpha
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
DEventRFBunch.h
Go to the documentation of this file.
1 // $Id$
2 //
3 // File: DEventRFBunch.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 _DEventRFBunch_
9 #define _DEventRFBunch_
10 
11 #include <vector>
12 #include <utility>
13 #include <string>
14 
15 #include "GlueX.h"
16 #include "JANA/JObject.h"
17 
18 using namespace std;
19 
20 class DEventRFBunch : public jana::JObject
21 {
22  public:
23  JOBJECT_PUBLIC(DEventRFBunch);
24 
25  void Set_Content(DetectorSystem_t locTimeSource, double locTime, double locTimeVariance, unsigned int locNumParticleVotes = 0);
26  void Reset(void);
27 
28  DetectorSystem_t dTimeSource = SYS_NULL; //e.g. SYS_RF, SYS_START, SYS_NULL (no valid source or not enough tracks/showers to pick it)
29 
30  double dTime; //The RF time propagated to the center of the target. This time is defined at the center of the target.
31  double dTimeVariance;
32  unsigned int dNumParticleVotes; //e.g. will trust time much more if 2+ rather than "1" or "0"
33 
34  void toStrings(vector<pair<string,string> > &items) const
35  {
36  AddString(items, "Source System", "%s", SystemName(dTimeSource));
37  AddString(items, "t", "%3.5f", dTime);
38  AddString(items, "var_t", "%3.2f", dTimeVariance);
39  AddString(items, "#tracks", "%i", dNumParticleVotes);
40  }
41 };
42 
43 inline void DEventRFBunch::Reset(void)
44 {
45  dTimeSource = SYS_NULL;
46  dTime = 0.0;
47  dTimeVariance = 0.0;
48  dNumParticleVotes = 0;
49 }
50 
51 inline void DEventRFBunch::Set_Content(DetectorSystem_t locTimeSource, double locTime, double locTimeVariance, unsigned int locNumParticleVotes)
52 {
53  dTimeSource = locTimeSource;
54  dTime = locTime;
55  dTimeVariance = locTimeVariance;
56  dNumParticleVotes = locNumParticleVotes;
57 }
58 
59 #endif // _DEventRFBunch_
60 
void Set_Content(DetectorSystem_t locTimeSource, double locTime, double locTimeVariance, unsigned int locNumParticleVotes=0)
Definition: DEventRFBunch.h:51
Definition: GlueX.h:16
DetectorSystem_t
Definition: GlueX.h:15
void Reset(void)
Definition: DEventRFBunch.h:43
double dTimeVariance
Definition: DEventRFBunch.h:31
const char * SystemName(DetectorSystem_t sys)
Definition: GlueX.h:38
void toStrings(vector< pair< string, string > > &items) const
Definition: DEventRFBunch.h:34
unsigned int dNumParticleVotes
Definition: DEventRFBunch.h:32