Hall-D Software  alpha
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
DFCALHit_factory.h
Go to the documentation of this file.
1 // $Id$
2 //
3 // File: DFCALHit_factory.h
4 // Created: Tue Aug 6 12:23:43 EDT 2013
5 // Creator: davidl (on Darwin harriet.jlab.org 11.4.2 i386)
6 //
7 
8 #ifndef _DFCALHit_factory_
9 #define _DFCALHit_factory_
10 
11 #include <vector>
12 using namespace std;
13 
14 #include <JANA/JFactory.h>
15 #include "TTAB/DTranslationTable.h"
16 #include "DFCALDigiHit.h"
17 #include "DFCALHit.h"
18 
19 // store constants so that they can be accessed by row/column number
20 typedef vector< vector<double> > fcal_digi_constants_t;
21 
22 class DFCALHit_factory:public jana::JFactory<DFCALHit>{
23  public:
26 
27  static const int FCAL_MAX_CHANNELS = 2800; // number of active channels expected
28 
31  BAD,
32  NOISY
33  };
34 
35  // overall scale factors
36  double a_scale;
37  double t_scale;
38  double t_base;
39 
40  // calibration constants stored in row, column format
46 
47  const double GetConstant(const fcal_digi_constants_t &the_table,
48  const int in_row, const int in_column) const;
49  const double GetConstant(const fcal_digi_constants_t &the_table,
50  const DFCALDigiHit *the_digihit) const;
51  const double GetConstant(const fcal_digi_constants_t &the_table,
52  const DFCALHit *the_hit) const;
53  //const double GetConstant(const fcal_digi_constants_t &the_table,
54  // const DTranslationTable *ttab,
55  // const int in_rocid, const int in_slot, const int in_channel) const;
56  private:
57  jerror_t init(void); ///< Called once at program start.2
58  jerror_t brun(jana::JEventLoop *eventLoop, int32_t runnumber); ///< Called everytime a new run number is detected.
59  jerror_t evnt(jana::JEventLoop *eventLoop, uint64_t eventnumber); ///< Called every event.
60  jerror_t erun(void); ///< Called everytime run number changes, provided brun has been called.
61  jerror_t fini(void); ///< Called after last event of last event source has been processed.
62 
63  void FillCalibTable( fcal_digi_constants_t &table,
64  const vector<double> &raw_table,
65  const DFCALGeometry &fcalGeom);
66 
68 };
69 
70 #endif // _DFCALHit_factory_
71 
fcal_digi_constants_t block_qualities
vector< vector< double > > fcal_digi_constants_t
fcal_digi_constants_t gains
fcal_digi_constants_t ADC_Offsets
fcal_digi_constants_t pedestals
fcal_digi_constants_t time_offsets