Hall-D Software  alpha
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
DBeamCurrent.h
Go to the documentation of this file.
1 // $Id$
2 //
3 // File: DBeamCurrent.h
4 // Created: Tue Feb 21 04:25:03 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_
9 #define _DBeamCurrent_
10 
11 #include <JANA/JObject.h>
12 #include <JANA/JFactory.h>
13 
14 class DBeamCurrent:public jana::JObject{
15  public:
17 
18  // This gives the approximate electron beam current
19  // for the current event. The values are obtained
20  // from the CCDB which was populated from values
21  // in the EPICS archive. The values were obtained
22  // from EPICS using the mySampler program so they
23  // are interpolations between values to estimate the
24  // current at 1 sec. intervals throughout the run.
25  // These values were further reduced by looking
26  // for boundaries where the current changes by more
27  // than 3nA. Thus, the beam current cannot be considered
28  // accurate to better than 3nA.
29  //
30  // The t_prev and t_next values give the time in
31  // seconds of the previous and next beam trips.
32  // The method IsFiducial() can be used to easily check
33  // if this event is in a region far from any beam
34  // trips and that the beam current was greater then
35  // some minumum (default is 5nA).
36 
37  double Ibeam; // electron beam current in nA
38  double t; // time relative to start of run in seconds
39  double t_prev; // time since last trip in sec
40  double t_next; // time to next trip in sec
41  bool is_fiducial; // true if this event is in fiducial region of time
42 
43 
44  // This method is used primarily for pretty printing
45  // the second argument to AddString is printf style format
46  void toStrings(vector<pair<string,string> > &items)const{
47  AddString(items, "Ibeam", "%5.1f", Ibeam);
48  AddString(items, "t", "%f", t);
49  AddString(items, "t_prev", "%f", t_prev);
50  AddString(items, "t_next", "%f", t_next);
51  AddString(items, "is_fiducial", "%d", is_fiducial ? 1:0);
52  }
53 
54 };
55 
56 #endif // _DBeamCurrent_
57 
void toStrings(vector< pair< string, string > > &items) const
Definition: DBeamCurrent.h:46
bool is_fiducial
Definition: DBeamCurrent.h:41
double Ibeam
Definition: DBeamCurrent.h:37
JOBJECT_PUBLIC(DBeamCurrent)
double t_prev
Definition: DBeamCurrent.h:39
double t_next
Definition: DBeamCurrent.h:40