Hall-D Software  alpha
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
DTAGMHit_factory_Calib.h
Go to the documentation of this file.
1 // $Id$
2 //
3 // File: DTAGMHit_factory_Calib.h
4 // Created: Sat Aug 2 12:23:43 EDT 2014
5 // Creator: jonesrt (on Linux gluey.phys.uconn.edu)
6 //
7 
8 #ifndef _DTAGMHit_factory_Calib_
9 #define _DTAGMHit_factory_Calib_
10 
11 #include <vector>
12 using namespace std;
13 
14 #include <JANA/JFactory.h>
15 #include "TTAB/DTTabUtilities.h"
16 
17 #include "DTAGMHit.h"
18 #include "DTAGMGeometry.h"
19 
20 class DTAGMHit_factory_Calib: public jana::JFactory<DTAGMHit> {
21  public:
24  const char* Tag(void){return "Calib";}
25 
26  static const int k_fiber_dead = 0;
27  static const int k_fiber_good = 1;
28  static const int k_fiber_bad = 2;
29  static const int k_fiber_noisy = 3;
30 
31  // config. parameter
33  //int USE_ADC, PEAK_CUT;
34  int USE_ADC, CUT_FACTOR;
35 
36  // overall scale factors
37  double fadc_a_scale; // pixels per fADC pulse integral count
38  double fadc_t_scale; // ns per fADC time count
39  double t_base;
40  double t_tdc_base;
41 
42  // calibration constants stored in row, column format
43  double fadc_gains[TAGM_MAX_ROW+1][TAGM_MAX_COLUMN+1];
44  double fadc_pedestals[TAGM_MAX_ROW+1][TAGM_MAX_COLUMN+1];
45  double fadc_time_offsets[TAGM_MAX_ROW+1][TAGM_MAX_COLUMN+1];
47  double fiber_quality[TAGM_MAX_ROW+1][TAGM_MAX_COLUMN+1];
48  double tw_c0[TAGM_MAX_ROW+1][TAGM_MAX_COLUMN+1];
49  double tw_c1[TAGM_MAX_ROW+1][TAGM_MAX_COLUMN+1];
50  double tw_c2[TAGM_MAX_ROW+1][TAGM_MAX_COLUMN+1];
51  double tw_c3[TAGM_MAX_ROW+1][TAGM_MAX_COLUMN+1];
52  double ref[TAGM_MAX_ROW+1][TAGM_MAX_COLUMN+1];
53  double int_cuts[TAGM_MAX_ROW+1][TAGM_MAX_COLUMN+1];
54 
55  bool load_ccdb_constants(std::string table_name,
56  std::string column_name,
57  double table[TAGM_MAX_ROW+1][TAGM_MAX_COLUMN+1]);
58  private:
59  jerror_t init(void); ///< Called once at program start
60  jerror_t brun(jana::JEventLoop *eventLoop, int32_t runnumber); ///< Called everytime a new run number is detected
61  jerror_t evnt(jana::JEventLoop *eventLoop, uint64_t eventnumber); ///< Called every event
62  jerror_t erun(void); ///< Called everytime run number changes, if brun has been called
63  jerror_t fini(void); ///< Called after last event of last event source has been processed
64 
66 };
67 
68 #endif // _DTAGMHit_factory_Calib_
#define TAGM_MAX_COLUMN
Definition: DTAGMGeometry.h:19
char string[256]
vector< double > tdc_time_offsets
#define TAGM_MAX_ROW
Definition: DTAGMGeometry.h:18