Hall-D Software  alpha
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
JEventProcessor_BCAL_TDC_Timing.h
Go to the documentation of this file.
1 // $Id$
2 //
3 // File: JEventProcessor_BCAL_TDC_Timing.h
4 // Created: Tue Jul 28 10:55:56 EDT 2015
5 // Creator: mstaib (on Linux egbert 2.6.32-504.30.3.el6.x86_64 x86_64)
6 //
7 
8 #ifndef _JEventProcessor_BCAL_TDC_Timing_
9 #define _JEventProcessor_BCAL_TDC_Timing_
10 
11 #include <JANA/JEventProcessor.h>
12 #include <BCAL/DBCALGeometry.h>
13 #include <TRACKING/DTrackFitter.h>
14 
15 class JEventProcessor_BCAL_TDC_Timing:public jana::JEventProcessor{
16  public:
19  const char* className(void){return "JEventProcessor_BCAL_TDC_Timing";}
20 
21  private:
22  jerror_t init(void); ///< Called once at program start.
23  jerror_t brun(jana::JEventLoop *eventLoop, int32_t runnumber); ///< Called everytime a new run number is detected.
24  jerror_t evnt(jana::JEventLoop *eventLoop, uint64_t eventnumber); ///< Called every event.
25  jerror_t erun(void); ///< Called everytime run number changes, provided brun has been called.
26  jerror_t fini(void); ///< Called after last event of last event source has been processed.
27 
28  uint32_t VERBOSE;
30 
31  double Z_TARGET;
32 
33  //Used as a key for maps
35  public:
37  cellId(cellId), end(end) {}
38 
39  int cellId;
41 
42  bool operator<(const readout_channel &c) const {
43  if (cellId<c.cellId) return true;
44  if (cellId>c.cellId) return false;
46  return false;
47  }
48  };
49 
50  //For now timewalk corrections are of the form f(ADC) = c0 + c1/(ADC-c3)^c2
51  //Store all coefficients in one structure
53  public:
55  a_thresh(0), c0(0), c1(0), c2(0) {}
56  timewalk_coefficients(float c0, float c1, float c2, float a_thresh) :
57  a_thresh(a_thresh), c0(c0), c1(c1), c2(c2) {}
58  float a_thresh,c0,c1,c2;
59  };
60 
61  map<readout_channel,timewalk_coefficients> tdc_timewalk_map;
62 
63 };
64 
65 #endif // _JEventProcessor_BCAL_TDC_Timing_
66 
#define c
jerror_t brun(jana::JEventLoop *eventLoop, int32_t runnumber)
Called everytime a new run number is detected.
jerror_t init(void)
Called once at program start.
timewalk_coefficients(float c0, float c1, float c2, float a_thresh)
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.
map< readout_channel, timewalk_coefficients > tdc_timewalk_map
jerror_t fini(void)
Called after last event of last event source has been processed.