Hall-D Software  alpha
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
DSCHit_factory.h
Go to the documentation of this file.
1 // $Id$
2 //
3 // File: DSCHit_factory.h
4 // Created: Tue Aug 6 12:53:32 EDT 2013
5 // Creator: davidl (on Darwin harriet.jlab.org 11.4.2 i386)
6 //
7 
8 #ifndef _DSCHit_factory_
9 #define _DSCHit_factory_
10 
11 #include <JANA/JFactory.h>
12 #include <DANA/DApplication.h>
13 #include <HDGEOMETRY/DGeometry.h>
14 #include <TTAB/DTTabUtilities.h>
15 #include "DSCHit.h"
16 #include "DSCDigiHit.h"
17 
18 
19 class DSCHit_factory:public jana::JFactory<DSCHit>{
20  public:
23 
24  // overall scale factors
25  double a_scale;
26  double t_scale;
27  double t_base;
28  double t_tdc_base;
29 
30  // calibration constants stored by channel
31  vector<double> a_gains;
32  vector<double> a_pedestals;
33  vector<double> adc_time_offsets;
34  vector<double> tdc_time_offsets;
35  vector<vector<double> >timewalk_parameters;
36 
37  //map<string,double> propogation_corr_factors;
38  //double<string,double> attenuation_corr_factors;
39 
42  double ADC_THRESHOLD;
45 
46  DSCHit* FindMatch(vector<DSCHit*>&schits,int sector, double T);
47 
48  const double GetConstant(const vector<double> &the_table,
49  const int in_sector) const;
50  const double GetConstant(const vector<double> &the_table,
51  const DSCDigiHit *the_digihit) const;
52  const double GetConstant(const vector<double> &the_table,
53  const DSCHit *the_hit) const;
54  //const double GetConstant(const vector<double> &the_table,
55  // const DTranslationTable *ttab,
56  // const int in_rocid, const int in_slot, const int in_channel) const;
57 
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, provided brun has been called.
63  jerror_t fini(void); ///< Called after last event of last event source has been processed.
64 
67 };
68 
69 #endif // _DSCHit_factory_
70 
jerror_t erun(void)
Called everytime run number changes, provided brun has been called.
bool REQUIRE_ADC_TDC_MATCH
const double GetConstant(const vector< double > &the_table, const int in_sector) const
vector< double > tdc_time_offsets
DSCHit * FindMatch(vector< DSCHit * > &schits, int sector, double T)
vector< vector< double > > timewalk_parameters
jerror_t evnt(jana::JEventLoop *eventLoop, uint64_t eventnumber)
Called every event.
jerror_t init(void)
Called once at program start.
vector< double > a_pedestals
double HIT_TIME_WINDOW
Definition: DSCHit.h:14
jerror_t fini(void)
Called after last event of last event source has been processed.
double USE_TIMEWALK_CORRECTION
double DELTA_T_ADC_TDC_MAX
double ADC_THRESHOLD
vector< double > a_gains
vector< double > adc_time_offsets
jerror_t brun(jana::JEventLoop *eventLoop, int32_t runnumber)
Called everytime a new run number is detected.