Hall-D Software  alpha
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
DDAQAddress.h
Go to the documentation of this file.
1 // $Id$
2 // $HeadURL$
3 //
4 // File: DDAQAddress.h
5 // Created: Mon Jun 24 10:11:30 EDT 2013
6 // Creator: davidl (on Darwin harriet.jlab.org 11.4.2 i386)
7 //
8 
9 #ifndef _DDAQAddress_
10 #define _DDAQAddress_
11 
12 #include <JANA/JObject.h>
13 #include <JANA/jerror.h>
14 
15 //--------------------------------------------------------------
16 /// This class holds the Crate, Slot, Channel address for
17 /// a digitized value from the DAQ system. It is a base class
18 /// for the low-level hit objects generated by the DAQ system.
19 ///
20 /// It also holds the trigger number for cases when this hit
21 /// was read in a multi-event block (i.e. "entangled" or "blocked"
22 /// events). The value of itrigger will always be zero for DAQ
23 /// containing a single L1-triggered event.
24 ///
25 //--------------------------------------------------------------
26 class DDAQAddress:public jana::JObject{
27  public:
29  DDAQAddress(uint32_t rocid=0, uint32_t slot=0, uint32_t channel=0, uint32_t itrigger=0):rocid(rocid),slot(slot),channel(channel),itrigger(itrigger){};
30  virtual ~DDAQAddress(){}
31 
32  uint32_t rocid; // crate
33  uint32_t slot; // slot
34  uint32_t channel; // channel
35  uint32_t itrigger; // trigger number within block (starting from 0)
36 
37  bool operator==(const DDAQAddress &d){
38  if(d.rocid != rocid ) return false;
39  if(d.slot != slot ) return false;
40  if(d.channel != channel ) return false;
41  if(d.itrigger != itrigger) return false;
42  return true;
43  }
44 
45  // This method is used primarily for pretty printing
46  // the second argument to AddString is printf style format
47  void toStrings(vector<pair<string,string> > &items)const{
48  AddString(items, "rocid", "%d", rocid);
49  AddString(items, "slot", "%d", slot);
50  AddString(items, "channel", "%d", channel);
51  AddString(items, "itrigger", "%d", itrigger);
52  }
53 };
54 
55 #endif // _DDAQAddress_
56 
void toStrings(vector< pair< string, string > > &items) const
Definition: DDAQAddress.h:47
bool operator==(const DDAQAddress &d)
Definition: DDAQAddress.h:37
JOBJECT_PUBLIC(DDAQAddress)
virtual ~DDAQAddress()
Definition: DDAQAddress.h:30
This class holds the Crate, Slot, Channel address for a digitized value from the DAQ system...
Definition: DDAQAddress.h:26
uint32_t channel
Definition: DDAQAddress.h:34
uint32_t rocid
Definition: DDAQAddress.h:32
uint32_t itrigger
Definition: DDAQAddress.h:35
DDAQAddress(uint32_t rocid=0, uint32_t slot=0, uint32_t channel=0, uint32_t itrigger=0)
Definition: DDAQAddress.h:29
uint32_t slot
Definition: DDAQAddress.h:33