Hall-D Software  alpha
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
DFDCHit_factory.h
Go to the documentation of this file.
1 // $Id$
2 //
3 // File: DFDCHit_factory.h
4 // Created: Wed Aug 7 11:55:02 EDT 2013
5 // Creator: davidl (on Darwin harriet.jlab.org 11.4.2 i386)
6 //
7 
8 #ifndef _DFDCHit_factory_
9 #define _DFDCHit_factory_
10 
11 #include <vector>
12 using namespace std;
13 
14 #include <JANA/JFactory.h>
15 #include "TTAB/DTTabUtilities.h"
16 
17 #include "DFDCHit.h"
18 #include "DFDCWireDigiHit.h"
19 #include "DFDCCathodeDigiHit.h"
20 
21 // store constants indexed by gPlane/element number
22 typedef vector< vector<double> > fdc_digi_constants_t;
23 
24 class DFDCHit_factory:public jana::JFactory<DFDCHit>{
25  public:
28 
29  // overall scale factors
30  double a_scale;
31  double t_scale;
32  double t_base;
33  double fadc_t_base;
34 
35  // calibration constant tables
39 
40  const double GetConstant(const fdc_digi_constants_t &the_table,
41  const int in_gPlane, const int in_element) const;
42  const double GetConstant(const fdc_digi_constants_t &the_table,
43  const DFDCCathodeDigiHit *the_digihit) const;
44  const double GetConstant(const fdc_digi_constants_t &the_table,
45  const DFDCWireDigiHit *the_digihit) const;
46  const double GetConstant(const fdc_digi_constants_t &the_table,
47  const DFDCHit *the_hit) const;
48  //const double GetConstant(const fdc_digi_constants_t &the_table,
49  // const DTranslationTable *ttab,
50  // const int in_rocid, const int in_slot, const int in_channel) const;
51 
52  private:
53  jerror_t init(void); ///< Called once at program start.
54  jerror_t brun(jana::JEventLoop *eventLoop, int32_t runnumber); ///< Called everytime a new run number is detected.
55  jerror_t evnt(jana::JEventLoop *eventLoop, uint64_t eventnumber); ///< Called every event.
56  jerror_t erun(void); ///< Called everytime run number changes, provided brun has been called.
57  jerror_t fini(void); ///< Called after last event of last event source has been processed.
58 
59  void LoadPackageCalibTables(jana::JEventLoop *eventLoop, string ccdb_prefix);
60 };
61 
62 #endif // _DFDCHit_factory_
63 
fdc_digi_constants_t a_gains
vector< vector< double > > fdc_digi_constants_t
fdc_digi_constants_t timing_offsets
fdc_digi_constants_t a_pedestals
class DFDCHit: definition for a basic FDC hit data type.
Definition: DFDCHit.h:20