Hall-D Software  alpha
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
DTPOLHit_factory.h
Go to the documentation of this file.
1 #ifndef _DTPOLHit_factory_
2 #define _DTPOLHit_factory_
3 
4 #include <JANA/JFactory.h>
6 #include "DTPOLHit.h"
7 
8 
9 class DTPOLHit_factory:public jana::JFactory<DTPOLHit>{
10 public:
13 
14  // Geometric information
15  static const int NSECTORS = 32;
16  static const int NRINGS = 24;
17 
18  static const double SECTOR_DIVISION;
19  static const double INNER_RADIUS; // From "ACTIVE INNER DIAMETER" in catalog
20  static const double OUTER_RADIUS ; // From "ACTIVE OUTER DIAMETER" in catalog
21  static const double RING_DIVISION ;
22  // (OUTER_RADIUS - INNER_RADIUS) / DTPOLRingDigiHit::NRINGS;
23  // 1mm, agrees with "JUNCTION ELEMENT SEPARATION" in catalog
24 
25 
26  // overall scale factors
27  double a_scale;
28  double t_scale;
29  double t_base;
30 
31  // calibration constants stored by channel
32  vector<double> a_gains;
33  vector<double> a_pedestals;
34  vector<double> adc_time_offsets;
35 
37  double ADC_THRESHOLD;
38 
39  int GetSector(int slot,int channel);
40  double GetPhi(int sector);
41  double GetPulseTime(const vector<uint16_t> waveform,double w_min,double w_max,double minpeakheight);
42  DTPOLHit* FindMatch(int sector, double T);
43  const double GetConstant(const vector<double> &the_table,const int in_sector) const;
44  const double GetConstant(const vector<double> &the_table,const DTPOLHit *the_hit) const;
45 private:
46  jerror_t init(void); // Called once at program start.
47  jerror_t brun(jana::JEventLoop *eventLoop, int32_t runnumber); // Called everytime a new run number is detected.
48  jerror_t evnt(jana::JEventLoop *eventLoop, uint64_t eventnumber); // Called every event.
49  jerror_t erun(void); // Called everytime run number changes, provided brun has been called.
50  jerror_t fini(void); // Called after last event of last event source has been processed.
51 
52 };
53 
54 #endif // _DTPOLHit_factory_
jerror_t fini(void)
int GetSector(int slot, int channel)
vector< double > a_gains
jerror_t erun(void)
static const int NRINGS
const double GetConstant(const vector< double > &the_table, const int in_sector) const
vector< double > adc_time_offsets
DTPOLHit * FindMatch(int sector, double T)
static const double INNER_RADIUS
double GetPhi(int sector)
double GetPulseTime(const vector< uint16_t > waveform, double w_min, double w_max, double minpeakheight)
jerror_t evnt(jana::JEventLoop *eventLoop, uint64_t eventnumber)
static const double SECTOR_DIVISION
static const double RING_DIVISION
static const double OUTER_RADIUS
vector< double > a_pedestals
jerror_t brun(jana::JEventLoop *eventLoop, int32_t runnumber)
jerror_t init(void)
static const int NSECTORS