Hall-D Software  alpha
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
DBeamCurrent_factory.h
Go to the documentation of this file.
1 // $Id$
2 //
3 // File: DBeamCurrent_factory.h
4 // Created: Tue Feb 21 04:25:04 EST 2017
5 // Creator: davidl (on Linux gluon48.jlab.org 2.6.32-431.20.3.el6.x86_64 x86_64)
6 //
7 
8 #ifndef _DBeamCurrent_factory_
9 #define _DBeamCurrent_factory_
10 
11 #include <JANA/JFactory.h>
12 #include "DBeamCurrent.h"
13 
14 class DBeamCurrent_factory:public jana::JFactory<DBeamCurrent>{
15  public:
18 
19  typedef struct{
20  double t;
21  double Ibeam;
22  double t_trip_prev; // time relative to this boundary of previous beam trip
23  double t_trip_next; // time relative to this boundary of next beam trip
24  }Boundary;
25 
28 
29  vector<Boundary> boundaries; // key=time val=Ibeam
30  vector<double> trip;
31  vector<double> recover;
32 
33  double ticks_per_sec;
35  uint32_t rcdb_start_time;
36 
37 
38  // This returns the integrated fiducial time between the
39  // given times. The values t_start and t_end should be
40  // in seconds since the start of the run. If t_end is
41  // set to 0.0 then the integration is done for the entire
42  // run. WARNING: that will span all files in the run!
43  double IntegratedFiducialTime(double t_start=0.0, double t_end=0.0);
44 
45  // Return the total integrated time of the run.
46  double IntegratedTime(void);
47 
48  jerror_t init(void); ///< Called once at program start.
49  jerror_t brun(jana::JEventLoop *eventLoop, int32_t runnumber); ///< Called everytime a new run number is detected.
50  jerror_t evnt(jana::JEventLoop *eventLoop, uint64_t eventnumber); ///< Called every event.
51  jerror_t erun(void); ///< Called everytime run number changes, provided brun has been called.
52  jerror_t fini(void); ///< Called after last event of last event source has been processed.
53 };
54 
55 #endif // _DBeamCurrent_factory_
56 
jerror_t fini(void)
Called after last event of last event source has been processed.
vector< Boundary > boundaries
jerror_t evnt(jana::JEventLoop *eventLoop, uint64_t eventnumber)
Called every event.
jerror_t brun(jana::JEventLoop *eventLoop, int32_t runnumber)
Called everytime a new run number is detected.
double IntegratedFiducialTime(double t_start=0.0, double t_end=0.0)
vector< double > recover
jerror_t erun(void)
Called everytime run number changes, provided brun has been called.
jerror_t init(void)
Called once at program start.