Hall-D Software  alpha
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Df125EmulatorAlgorithm_v2.h
Go to the documentation of this file.
1 #ifndef _Df125EmulatorAlgorithm_v2_
2 #define _Df125EmulatorAlgorithm_v2_
3 
5 
6 /////////////////////////////////////////////////////////////////
7 // This implements the base class for the f125 firmware emulation
8 // EmulateFirmware needs to be virtually overwritten by the user
9 ////////////////////////////////////////////////////////////////
10 
12  public:
13 
16 
17  //Only the emulation routines need to be overwritten
19 
20  // Many helper functions from the old fa125algos files
21  void fa125_hit(Int_t&, Int_t&, Int_t&, const uint16_t[], Int_t, Int_t, Int_t, Int_t, Int_t, Int_t); // look for a hit
22  void fa125_time(Int_t&, Int_t&, Int_t[], Int_t, Int_t, Int_t, Int_t); // find hit time
23  void fa125_integral(Long_t&, Int_t&, Int_t, const uint16_t[], Int_t, Int_t); // find integral
24  void fa125_max(Int_t&, Int_t&, Int_t, const uint16_t[], Int_t); // find first max amplitude after hit
25  void fa125_algos(Int_t&, Int_t&, Int_t&, Long_t&, Int_t&, Int_t&, Int_t&, const uint16_t[], Int_t, Int_t, Int_t, Int_t, Int_t, Int_t, Int_t, Int_t, Int_t);
26 
27 
28  protected:
29  //Df125EmulatorAlgorithm_v2(){};
30 
31  void upsamplei(Int_t[], Int_t, Int_t[], Int_t); // upsample
32 
33  private:
34 
35  // Enables forced use of default values
38 
39  // Default values, used if FORCE_DEFAULT_xDC=1 or if BORConfig is not found
40  Int_t CDC_WS_DEF ; // hit window start - must be >= F125_CDC_NP
41  Int_t CDC_WE_DEF ; // hit window end - must be at least 20 less than number of samples available
42  Int_t CDC_IE_DEF ; // end integration at the earlier of WE, or this many samples after threshold crossing of TH
43  Int_t CDC_P1_DEF ; // 2**P1 = # samples used for initial pedestal, used to find hit
44  Int_t CDC_P2_DEF ; // 2**P2 = # samples used for pedestal calculated just before hit
45  Int_t CDC_PG_DEF ; // # samples between hit threshold crossing and local pedestal sample
46  Int_t CDC_H_DEF ; // 5 sigma hit threshold
47  Int_t CDC_TH_DEF ; // 4 sigma high timing threshold
48  Int_t CDC_TL_DEF ; // 1 sigma low timing threshold
49  Int_t CDC_IBIT_DEF ; // scaling factor for integral
50  Int_t CDC_ABIT_DEF ; // scaling factor for amplitude
51  Int_t CDC_PBIT_DEF ; // scaling factor for pedestal
52 
53 
54  Int_t FDC_WS_DEF ; // hit window start - must be >= F125_FDC_NP
55  Int_t FDC_WE_DEF ; // hit window end - must be at least 20 less than number of samples available
56  Int_t FDC_IE_DEF ; // end integration at the earlier of WE, or this many samples after threshold crossing of TH
57  Int_t FDC_P1_DEF ; // 2**P1 = # samples used for initial pedestal, used to find hit
58  Int_t FDC_P2_DEF ; // 2**P2 = # samples used for pedestal calculated just before hit
59  Int_t FDC_PG_DEF ; // # samples between hit threshold crossing and local pedestal sample
60  Int_t FDC_H_DEF ; // 5 sigma hit threshold
61  Int_t FDC_TH_DEF ; // 4 sigma high timing threshold
62  Int_t FDC_TL_DEF ; // 1 sigma low timing threshold
63  Int_t FDC_IBIT_DEF ; // scaling factor for integral
64  Int_t FDC_ABIT_DEF ; // scaling factor for amplitude
65  Int_t FDC_PBIT_DEF ; // scaling factor for pedestal
66 
67 
68  //Override values, used if given in command line
69  Int_t CDC_WS ; // hit window start - must be >= F125_CDC_NP
70  Int_t CDC_WE ; // hit window end - must be at least 20 less than number of samples available
71  Int_t CDC_IE ; // end integration at the earlier of WE, or this many samples after threshold crossing of TH
72  Int_t CDC_P1 ; // 2**P1 = # samples used for initial pedestal, used to find hit
73  Int_t CDC_P2 ; // 2**P2 = # samples used for pedestal calculated just before hit
74  Int_t CDC_PG ; // # samples between hit threshold crossing and local pedestal sample
75  Int_t CDC_H ; // 5 sigma hit threshold
76  Int_t CDC_TH ; // 4 sigma high timing threshold
77  Int_t CDC_TL ; // 1 sigma low timing threshold
78  Int_t CDC_IBIT ; // scaling factor for integral
79  Int_t CDC_ABIT ; // scaling factor for amplitude
80  Int_t CDC_PBIT ; // scaling factor for pedestal
81 
82  Int_t FDC_WS ; // hit window start - must be >= F125_FDC_NP
83  Int_t FDC_WE ; // hit window end - must be at least 20 less than number of samples available
84  Int_t FDC_IE ; // end integration at the earlier of WE, or this many samples after threshold crossing of TH
85  Int_t FDC_P1 ; // 2**P1 = # samples used for initial pedestal, used to find hit
86  Int_t FDC_P2 ; // 2**P2 = # samples used for pedestal calculated just before hit
87  Int_t FDC_PG ; // # samples between hit threshold crossing and local pedestal sample
88  Int_t FDC_H ; // 5 sigma hit threshold
89  Int_t FDC_TH ; // 4 sigma high timing threshold
90  Int_t FDC_TL ; // 1 sigma low timing threshold
91  Int_t FDC_IBIT ; // scaling factor for integral
92  Int_t FDC_ABIT ; // scaling factor for amplitude
93  Int_t FDC_PBIT ; // scaling factor for pedestal
94 
95  // Set verbosity
96  int VERBOSE;
97 };
98 
99 #endif // _Df125EmulatorAlgorithm_v2_
100 
101 
102 
void fa125_time(Int_t &, Int_t &, Int_t[], Int_t, Int_t, Int_t, Int_t)
void fa125_max(Int_t &, Int_t &, Int_t, const uint16_t[], Int_t)
void EmulateFirmware(const Df125WindowRawData *, Df125CDCPulse *, Df125FDCPulse *)
void fa125_hit(Int_t &, Int_t &, Int_t &, const uint16_t[], Int_t, Int_t, Int_t, Int_t, Int_t, Int_t)
void fa125_algos(Int_t &, Int_t &, Int_t &, Long_t &, Int_t &, Int_t &, Int_t &, const uint16_t[], Int_t, Int_t, Int_t, Int_t, Int_t, Int_t, Int_t, Int_t, Int_t)
void upsamplei(Int_t[], Int_t, Int_t[], Int_t)
void fa125_integral(Long_t &, Int_t &, Int_t, const uint16_t[], Int_t, Int_t)