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