CGEM BOSS 6.6.5.h
BESIII Offline Software System
Loading...
Searching...
No Matches
InductionGar.h
Go to the documentation of this file.
1#ifndef INDUCTIONGAR_H
2#define INDUCTIONGAR_H
3
7
8#include <vector>
9#include <set>
10#include <string>
11#include "TH1D.h"
12#include "TFile.h"
13
14class G4Svc;
15
16class CTF{ // as Convolution_Tbranch_fft
17public:
19 std::vector<double> TBranch;
20public:
21 CTF();
22 ~CTF();
23 TH1D Convolution_Tbranch_fft(const double *Input_Curr_plot_001);
24
25};
26
27class CEF{ // as Convolution_Ebranch_fft ;
28 //didnot wished to play with this, yet too lazy to switch to a ConvFuncFft(double (* func)(double*), min=0,max=1000) version
29public:
31 std::vector<double> EBranch;
32public:
33 CEF();
34 ~CEF();
35 TH1D Convolution_Ebranch_fft(const double *Input_Curr_plot_001);
36};
37
38class InductionGar: public Induction {
39public:
42
43 void init(ICgemGeomSvc* geomSvc, double magConfig);
44
45 void setDebugOutput(bool debugOutput){m_debugOutput = debugOutput;}
46
47 void setMultiElectrons(int layer, int nElectrons, const std::vector<Float_t>& x, const std::vector<Float_t>& y, const std::vector<Float_t> &z, const std::vector<Float_t> &t);
48
49 /* output info of fired strips */
50 int getNXstrips() const {return m_nXstrips;}
51 int getNVstrips() const {return m_nVstrips;}
52 int getXstripSheet(int n) const {return m_xstripSheet[n];}
53 int getXstripID(int n) const {return m_xstripID[n];}
54 int getVstripSheet(int n) const {return m_vstripSheet[n];}
55 int getVstripID(int n) const {return m_vstripID[n];}
56 double getXstripQ(int n) const {return m_xstripQ[n];}
57 double getVstripQ(int n) const {return m_vstripQ[n];}
58 double getXstripT(int n) const {return m_xstripT_Branch[n];}
59 double getVstripT(int n) const {return m_vstripT_Branch[n];}
60 double getXstripT_Branch(int n) const {return m_xstripT_Branch[n];}
61 double getVstripT_Branch(int n) const {return m_vstripT_Branch[n];}
62 double getXstripQ_Branch(int n) const {return m_xstripQ_Branch[n];}
63 double getVstripQ_Branch(int n) const {return m_vstripQ_Branch[n];}
64 double getXfirstT(int n) const {return m_xTfirst[n];}
65 double getVfirstT(int n) const {return m_vTfirst[n];}
66
67 void setLUTFilePath(std::string path){m_LUTFilePath = path;}
68 void setV2EfineFile(std::string path){m_V2EfineFile = path;}
69 void setVsampleDelay(double delay){sample_delay = delay;}
70 void setStoreFlag(bool flag){storeFlag = flag;}
71 void setSaturation(bool flag) {m_saturation=flag;}
72
73 void setNgapsSect(int n) {m_Ngaps_microSector=n;}
74 void setGapSizeSect(double size) {m_gap_microSector=size;}
75 void setScaleSignalX(double ScaleSignalX) {m_ScaleSignalX = ScaleSignalX;}
76 void setGapShiftSect(vector<double> shift)
77 {
78 m_gapShift_microSector[0][0]=shift[0];
79 m_gapShift_microSector[0][1]=shift[1];
80 m_gapShift_microSector[1][0]=shift[2];
81 m_gapShift_microSector[1][1]=shift[3];
82 m_gapShift_microSector[2][0]=shift[4];
83 m_gapShift_microSector[2][1]=shift[5];
84
85 }
86 void setMicroSectorWidthRad(vector<double> width)
87 {
88 m_microSector_width[0][0]=width[0];
89 m_microSector_width[0][1]=width[1];
90 m_microSector_width[1][0]=width[2];
91 m_microSector_width[1][1]=width[3];
92 m_microSector_width[2][0]=width[4];
93 m_microSector_width[2][1]=width[5];
94
95 }
96 void setQinGausSigma(vector<double> sigma)
97 {
98 m_QinGausSigma[0]=sigma[0];
99 m_QinGausSigma[1]=sigma[1];
100 }
101private:
102 ICgemGeomSvc* m_geomSvc;
103 double m_magConfig; /* magnetic field */
104 bool m_debugOutput;
105 bool m_saturation;
106
107 std::string m_LUTFilePath;
108 std::string m_V2EfineFile;
109 /* fired strips */
110 int m_nXstrips;
111 int m_nVstrips;
112 std::vector<int> m_xstripSheet;
113 std::vector<int> m_xstripID;
114 std::vector<int> m_vstripSheet;
115 std::vector<int> m_vstripID;
116 std::vector<double> m_xstripQ;
117 std::vector<double> m_vstripQ;
118 std::vector<double> m_xstripT_Branch;
119 std::vector<double> m_vstripT_Branch;
120 std::vector<double> m_xstripQ_Branch;
121 std::vector<double> m_vstripQ_Branch;
122 std::vector<double> m_xTfirst;//time when first electron leave 3rd gem
123 std::vector<double> m_vTfirst;
124
125 std::map<int, double> m_mapQ[2][2];//[nSheet][XV-view]
126
127 double RatioX[3][5][5][4]; // [layer][bin-x][bin-y][Index of IDx]
128 double RatioV[3][5][5][4]; // [layer][bin-x][bin-y][Index of IDv]
129
130 //TH1D * SignalX[3][5][5][4]; // [layer][bin-x][bin-y][Index of IDx]
131 //TH1D * SignalV[3][5][5][4]; // [layer][bin-x][bin-y][Index of IDv]
132
133 double SignalX[3][5][5][4][100]; // [layer][bin-x][bin-y][Index of IDx]
134 double SignalV[3][5][5][4][100]; // [layer][bin-x][bin-y][Index of IDv]
135
136 double T_thr_V[3][2][2][1395];//[layer][sheet][XV-view][ID]
137 double E_thr_V[3][2][2][1395];//[layer][sheet][XV-view][ID]
138 double QDC_slope[3][2][2][1395];//[layer][sheet][XV-view][ID]
139 double QDC_const[3][2][2][1395];//[layer][sheet][XV-view][ID]
140 double Qsaturation[3][2][2][1395];
141
142 double Vref[3][2][2][1395];//[layer][sheet][XV-view][ID]
143 double toE_slope[3][2][2][1395];//[layer][sheet][XV-view][ID]
144 double toE_const[3][2][2][1395];//[layer][sheet][XV-view][ID]
145
146 double sample_delay;//ns
147 bool storeFlag;
148 double VQ_slope;
149 double VQ_const;//V-Q curve
150
151 CTF ctf;
152 CEF cef;
153
154 ConvolveWithConst Signal_ConvolverX[3][5][5][4];//[layer][bin-x][bin-y][Index of IDx]
155 ConvolveWithConst Signal_ConvolverV[3][5][5][4];//fft convolver version of signals
156
157 void conv1PerGrid_legacy(int Save_Grid, double *hist_bin_Content,
158 const std::vector<int> &hitlist, int layer, int axis);
159 void conv1PerGrid_fft(int Save_Grid, double *hist_bin_Content,
160 const std::vector<int> &hitlist, int layer, int axis);
161
162 int m_Ngaps_microSector;
163 double m_gapShift_microSector[3][2];
164 double m_microSector_width[3][2];
165 double m_QinGausSigma[2];
166 std::set<int> m_deadStrip[3][2][2];//layer sheet XVview
167 double m_gap_microSector;
168 double m_ScaleSignalX;
169 bool inMicroSectorGap(double phi, int layer);
170 bool isDeadStrip(int layer, int sheet, int XVview, int strip);
171};
172
173#endif
const Int_t n
TH1D Convolution_Ebranch_fft(const double *Input_Curr_plot_001)
return convolve of Input_Curr_plot_001 and T_Branch2, a function; tries to mimic Convolution_Ebranch ...
std::vector< double > EBranch
ConvolveWithConst * conv
ConvolveWithConst * conv
std::vector< double > TBranch
TH1D Convolution_Tbranch_fft(const double *Input_Curr_plot_001)
return convolve of Input_Curr_plot_001 and T_Branch2, a function; tries to mimic Convolution_Tbranch ...
basically, convolve with fft. convolves 1-d. if size of 2 inputs are fixed, it may yield optimal spee...
Definition G4Svc.h:32
double getVfirstT(int n) const
double getVstripQ_Branch(int n) const
void setStoreFlag(bool flag)
void setGapSizeSect(double size)
int getVstripID(int n) const
int getVstripSheet(int n) const
double getXstripQ_Branch(int n) const
int getXstripID(int n) const
int getNXstrips() const
double getXstripT(int n) const
void setMicroSectorWidthRad(vector< double > width)
void setNgapsSect(int n)
double getVstripT(int n) const
int getXstripSheet(int n) const
void setScaleSignalX(double ScaleSignalX)
double getVstripT_Branch(int n) const
double getXfirstT(int n) const
int getNVstrips() const
void setVsampleDelay(double delay)
void init(ICgemGeomSvc *geomSvc, double magConfig)
void setV2EfineFile(std::string path)
void setMultiElectrons(int layer, int nElectrons, const std::vector< Float_t > &x, const std::vector< Float_t > &y, const std::vector< Float_t > &z, const std::vector< Float_t > &t)
double getVstripQ(int n) const
void setQinGausSigma(vector< double > sigma)
void setSaturation(bool flag)
double getXstripQ(int n) const
void setDebugOutput(bool debugOutput)
void setLUTFilePath(std::string path)
double getXstripT_Branch(int n) const
void setGapShiftSect(vector< double > shift)
int t()
Definition t.c:1