Hall-D Software  alpha
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
DEventRFBunch_factory_Thrown.cc
Go to the documentation of this file.
1 // $Id$
2 //
3 // File: DEventRFBunch_factory_Thrown.cc
4 // Created: Thu Dec 3 17:27:55 EST 2009
5 // Creator: pmatt (on Linux ifarml6 2.6.18-128.el5 x86_64)
6 //
7 
9 #include <deque>
10 
11 using namespace jana;
12 
13 //------------------
14 // init
15 //------------------
17 {
18  return NOERROR;
19 }
20 
21 //------------------
22 // brun
23 //------------------
24 jerror_t DEventRFBunch_factory_Thrown::brun(jana::JEventLoop *locEventLoop, int32_t runnumber)
25 {
26  return NOERROR;
27 }
28 
29 //------------------
30 // evnt
31 //------------------
32 jerror_t DEventRFBunch_factory_Thrown::evnt(jana::JEventLoop *locEventLoop, uint64_t eventnumber)
33 {
34  vector<const DMCThrown*> locMCThrowns;
35  locEventLoop->Get(locMCThrowns);
36  if(locMCThrowns.empty())
37  return NOERROR; //not a MC event!
38 
39  vector<const DRFTime*> locRFTimes;
40  locEventLoop->Get(locRFTimes, "TRUTH");
41  if(locRFTimes.empty())
42  {
43  DEventRFBunch *locEventRFBunch = new DEventRFBunch;
44  locEventRFBunch->dTime = numeric_limits<double>::quiet_NaN();
45  locEventRFBunch->dTimeVariance = numeric_limits<double>::quiet_NaN();
46  locEventRFBunch->dNumParticleVotes = 0;
47  locEventRFBunch->dTimeSource = SYS_NULL;
48  _data.push_back(locEventRFBunch);
49  return NOERROR;
50  }
51 
52  DEventRFBunch *locEventRFBunch = new DEventRFBunch;
53  locEventRFBunch->dTime = locRFTimes[0]->dTime;
54  locEventRFBunch->dTimeVariance = 0.0;
55  locEventRFBunch->dNumParticleVotes = 0;
56  locEventRFBunch->dTimeSource = SYS_RF;
57  _data.push_back(locEventRFBunch);
58 
59  return NOERROR;
60 }
61 
62 //------------------
63 // erun
64 //------------------
66 {
67  return NOERROR;
68 }
69 
70 //------------------
71 // fini
72 //------------------
74 {
75  return NOERROR;
76 }
77 
Definition: GlueX.h:30
jerror_t erun(void)
Called everytime run number changes, provided brun has been called.
jerror_t init(void)
Called once at program start.
Definition: GlueX.h:16
jerror_t evnt(jana::JEventLoop *locEventLoop, uint64_t eventnumber)
Called every event.
double dTimeVariance
Definition: DEventRFBunch.h:31
jerror_t brun(jana::JEventLoop *locEventLoop, int32_t runnumber)
Called everytime a new run number is detected.
DetectorSystem_t dTimeSource
Definition: DEventRFBunch.h:28
jerror_t fini(void)
Called after last event of last event source has been processed.
unsigned int dNumParticleVotes
Definition: DEventRFBunch.h:32