Hall-D Software  alpha
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
libraries/TRIGGER/DTrigger.h
Go to the documentation of this file.
1 #ifndef _DTrigger_
2 #define _DTrigger_
3 
4 #include <JANA/JObject.h>
5 #include <JANA/JFactory.h>
6 
7 class DTrigger : public jana::JObject
8 {
9  public:
11 
12  //GETTERS
13  uint32_t Get_L1TriggerBits(void) const{return dL1TriggerBits;}
15  bool Get_IsPhysicsEvent(void) const;
16 
17  //SETTERS
18  void Set_L1TriggerBits(uint32_t locL1TriggerBits){dL1TriggerBits = locL1TriggerBits;}
19  void Set_L1FrontPanelTriggerBits(uint32_t locL1FrontPanelTriggerBits){dL1FrontPanelTriggerBits = locL1FrontPanelTriggerBits;}
20 
21  // the second argument to AddString is printf style format
22  void toStrings(vector<pair<string,string> >& items) const
23  {
24  AddString(items, "dL1TriggerBits", "%ld", dL1TriggerBits);
25  AddString(items, "dL1FrontPanelTriggerBits", "%ld", dL1FrontPanelTriggerBits);
26  }
27 
28  private:
29  //NOTE: If is EPICS/SYNC/etc. event, both L1 values will be 0
30  uint32_t dL1TriggerBits;
32 };
33 
34 inline bool DTrigger::Get_IsPhysicsEvent(void) const
35 {
36  //Both L1 = 0: EPICS/SYNC/etc. //L1 = 8: PS
37  return ((dL1FrontPanelTriggerBits == 0) && (dL1TriggerBits != 0) && (dL1TriggerBits != 8));
38 }
39 
40 #endif // _DTrigger_
uint32_t Get_L1TriggerBits(void) const
uint32_t Get_L1FrontPanelTriggerBits(void) const
uint32_t dL1FrontPanelTriggerBits
JOBJECT_PUBLIC(DTrigger)
bool Get_IsPhysicsEvent(void) const
void toStrings(vector< pair< string, string > > &items) const
void Set_L1FrontPanelTriggerBits(uint32_t locL1FrontPanelTriggerBits)
void Set_L1TriggerBits(uint32_t locL1TriggerBits)