Hall-D Software  alpha
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
DDIRCPmtHit_factory.h
Go to the documentation of this file.
1 // $Id$
2 //
3 // File: DDIRCPmtHit_factory.h
4 //
5 
6 #ifndef _DDIRCPmtHit_factory_
7 #define _DDIRCPmtHit_factory_
8 
9 #include <vector>
10 using namespace std;
11 
12 #include <JANA/JFactory.h>
13 #include "TTAB/DTranslationTable.h"
14 #include "DDIRCTDCDigiHit.h"
15 #include "DDIRCPmtHit.h"
16 
17 // store constants so that they can be accessed by pixel number
18 typedef vector<double> dirc_digi_constants_t;
19 typedef vector<int> dirc_digi_constants_s;
20 
21 class DDIRCPmtHit_factory:public jana::JFactory<DDIRCPmtHit>{
22  public:
25 
26  static const int DIRC_MAX_CHANNELS = 6912; // number of active channels expected
27 
30  BAD,
31  NOISY
32  };
33 
34  // calibration constants stored in channel format
35  vector<dirc_digi_constants_t> time_offsets;
36  vector<dirc_digi_constants_s> channel_status;
37 
38  private:
39  jerror_t init(void); ///< Called once at program start.2
40  jerror_t brun(jana::JEventLoop *eventLoop, int32_t runnumber); ///< Called everytime a new run number is detected.
41  jerror_t evnt(jana::JEventLoop *eventLoop, uint64_t eventnumber); ///< Called every event.
42  jerror_t erun(void); ///< Called everytime run number changes, provided brun has been called.
43  jerror_t fini(void); ///< Called after last event of last event source has been processed.
44 
45  double t_base[2];
46  bool applyTimeOffset, applyTimewalk;
47 };
48 
49 #endif // _DDIRCPmtHit_factory_
50 
vector< double > dirc_digi_constants_t
vector< dirc_digi_constants_s > channel_status
vector< dirc_digi_constants_t > time_offsets
vector< int > dirc_digi_constants_s