Hall-D Software  alpha
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
DPSHit_factory.h
Go to the documentation of this file.
1 // $Id$
2 //
3 // File: DPSHit_factory.h
4 // Created: Wed Oct 15 16:45:01 EDT 2014
5 // Creator: staylor (on Linux gluon05.jlab.org 2.6.32-358.18.1.el6.x86_64 x86_64)
6 //
7 
8 
9 #ifndef _DPSHit_factory_
10 #define _DPSHit_factory_
11 
12 #include <JANA/JFactory.h>
13 #include "DPSHit.h"
14 #include "DPSDigiHit.h"
15 #include "DPSGeometry.h"
16 
17 #include <utility>
18 
19 typedef vector< vector<double> > ps_digi_constants_t;
20 
21 class DPSHit_factory:public jana::JFactory<DPSHit>{
22  public:
25 
26  // config. parameter
27  double ADC_THRESHOLD;
28 
29  // overall scale factors
30  double a_scale;
31  double t_scale;
32  double t_base;
33 
34  // calibration constants stored by channel
38 
39  const double GetConstant( const ps_digi_constants_t &the_table,
40  const DPSGeometry::Arm in_arm, const int in_column,
41  const DPSGeometry &psGeom ) const;
42  const double GetConstant( const ps_digi_constants_t &the_table,
43  const DPSDigiHit *the_digihit, const DPSGeometry &psGeom ) const;
44  const double GetConstant( const ps_digi_constants_t &the_table,
45  const DPSHit *the_hit, const DPSGeometry &psGeom ) const;
46 
47  private:
48  jerror_t init(void); ///< Called once at program start.
49  jerror_t brun(jana::JEventLoop *eventLoop, int32_t runnumber); ///< Called everytime a new run number is detected.
50  jerror_t evnt(jana::JEventLoop *eventLoop, uint64_t eventnumber); ///< Called every event.
51  jerror_t erun(void); ///< Called everytime run number changes, provided brun has been called.
52  jerror_t fini(void); ///< Called after last event of last event source has been processed.
53 
54  void FillCalibTable(ps_digi_constants_t &table, string table_name,
55  const DPSGeometry &psGeom);
56 
58 };
59 
60 #endif // _DPSHit_factory_
Definition: DPSHit.h:15
ps_digi_constants_t adc_time_offsets
jerror_t brun(jana::JEventLoop *eventLoop, int32_t runnumber)
Called everytime a new run number is detected.
ps_digi_constants_t adc_gains
jerror_t init(void)
Called once at program start.
double ADC_THRESHOLD
ps_digi_constants_t adc_pedestals
vector< vector< double > > ps_digi_constants_t
void FillCalibTable(ps_digi_constants_t &table, string table_name, const DPSGeometry &psGeom)
jerror_t evnt(jana::JEventLoop *eventLoop, uint64_t eventnumber)
Called every event.
const double GetConstant(const ps_digi_constants_t &the_table, const DPSGeometry::Arm in_arm, const int in_column, const DPSGeometry &psGeom) const
jerror_t erun(void)
Called everytime run number changes, provided brun has been called.
jerror_t fini(void)
Called after last event of last event source has been processed.