Hall-D Software  alpha
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
JEventProcessor_pedestals.h
Go to the documentation of this file.
1 // $Id$
2 //
3 // File: JEventProcessor_pedestals.h
4 // Created: Fri Jun 20 22:13:58 EDT 2014
5 // Creator: davidl (on Darwin harriet.local 13.2.0 i386)
6 //
7 
8 #ifndef _JEventProcessor_pedestals_
9 #define _JEventProcessor_pedestals_
10 
11 #include <TH2.h>
12 
13 #include <JANA/JEventProcessor.h>
14 #include <DAQ/DDAQAddress.h>
15 
16 class JEventProcessor_pedestals:public jana::JEventProcessor{
17  public:
20  const char* className(void){return "JEventProcessor_pedestals";}
21 
22  class csc_t{
23  public:
24  csc_t(uint32_t rocid, uint32_t slot, uint32_t channel):rocid(rocid), slot(slot), channel(channel){}
25  uint32_t rocid;
26  uint32_t slot;
27  uint32_t channel;
28  };
29 
30  TH2D* GetHist(const DDAQAddress *hit);
31 
32  map<csc_t, TH2D*> all_hists;
33  //pthread_mutex_t mutex;
34 
35  private:
36  jerror_t init(void); ///< Called once at program start.
37  jerror_t brun(jana::JEventLoop *eventLoop, int32_t runnumber); ///< Called everytime a new run number is detected.
38  jerror_t evnt(jana::JEventLoop *eventLoop, uint64_t eventnumber); ///< Called every event.
39  jerror_t erun(void); ///< Called everytime run number changes, provided brun has been called.
40  jerror_t fini(void); ///< Called after last event of last event source has been processed.
41 
42 };
43 
44 // Need to define a less-than operator for csc_t so it can be used as a key in the map
46  if(a.rocid < b.rocid) return true;
47  if(a.rocid > b.rocid) return false;
48  if(a.slot < b.slot) return true;
49  if(a.slot > b.slot) return false;
50  if(a.channel < b.channel) return true;
51  return false;
52 }
53 
54 
55 #endif // _JEventProcessor_pedestals_
56 
jerror_t brun(jana::JEventLoop *eventLoop, int32_t runnumber)
Called everytime a new run number is detected.
bool operator<(const DSourceComboUse &lhs, const DSourceComboUse &rhs)
Definition: DSourceCombo.h:95
jerror_t evnt(jana::JEventLoop *eventLoop, uint64_t eventnumber)
Called every event.
jerror_t erun(void)
Called everytime run number changes, provided brun has been called.
csc_t(uint32_t rocid, uint32_t slot, uint32_t channel)
This class holds the Crate, Slot, Channel address for a digitized value from the DAQ system...
Definition: DDAQAddress.h:26
TH2D * GetHist(const DDAQAddress *hit)
jerror_t init(void)
Called once at program start.
jerror_t fini(void)
Called after last event of last event source has been processed.