CGEM BOSS 6.6.5.g
BESIII Offline Software System
Loading...
Searching...
No Matches
SamplingGar2.h
Go to the documentation of this file.
1#ifndef SAMPLINGGAR2_H
2#define SAMPLINGGAR2_H
3
7
8#include <string>
9#include <vector>
10
11#include "TF1.h"
12
13class G4Svc;
14//typedef std::map<Index, vector<int> > HitHistMap;
15// maybe dont need to inherit from that? especially as the method to use this class has drastically changed
16
18public:
19
22
23 void init(ICgemGeomSvc *geomSvc, double magConfig);
24
25 void setIonElectrons(int layer, int nElectrons, std::vector<double> x, std::vector<double> y, std::vector<double> z, std::vector<double> t);
26
27 /* output info of multiplied eletrons */
28 int getNelectrons() const { return m_nMulElec; }
29 Float_t getX(int n) const { return m_eX[n]; }
30 Float_t getY(int n) const { return m_eY[n]; }
31 Float_t getZ(int n) const { return m_eZ[n]; }
32 Float_t getT(int n) const { return m_eT[n]; }
33 const std::vector<Float_t> &getXContainer() const { return m_eX; }
34 const std::vector<Float_t> &getYContainer() const { return m_eY; }
35 const std::vector<Float_t> &getZContainer() const { return m_eZ; }
36 const std::vector<Float_t> &getTContainer() const { return m_eT; }
37 void setDebugging(bool debugging) {m_debugging = debugging;}
38
39 void setGainMultiplier(vector<double> GainMultiplier)
40 {
41 m_GainMultiplier[0] = GainMultiplier[0];
42 m_GainMultiplier[1] = GainMultiplier[1];
43 m_GainMultiplier[2] = GainMultiplier[2];
44 }
45 void setTransMultiplier(double TransMultiplier) {m_TransMultiplier = TransMultiplier;}
46 void setDiffuMultiplier(double DiffuMultiplier) {m_DiffuMultiplier = DiffuMultiplier;}
47
48 //const std::map<Index, vector<int> > & getMultiElectronMap() const {return m_multiElectronMap;}
49 void setMultiElectronMapAddr(HitHistMap *address) { m_pMultiElectronMap = address; } // OK since Wangll said this type feels better.
50 //it will be cleared everytime setIonElectrons() is called.
51
52 //begin migrate from IndGar1
53 void setNgapsSect(int n) {m_Ngaps_microSector=n;}
54 void setGapSizeSect(double size) {m_gap_microSector=size;}
55 void setGapShiftSect(vector<double> shift)
56 {
57 m_gapShift_microSector[0][0]=shift[0];
58 m_gapShift_microSector[0][1]=shift[1];
59 m_gapShift_microSector[1][0]=shift[2];
60 m_gapShift_microSector[1][1]=shift[3];
61 m_gapShift_microSector[2][0]=shift[4];
62 m_gapShift_microSector[2][1]=shift[5];
63 }
64 void setMicroSectorWidthRad(vector<double> width)
65 {
66 m_microSector_width[0][0]=width[0];
67 m_microSector_width[0][1]=width[1];
68 m_microSector_width[1][0]=width[2];
69 m_microSector_width[1][1]=width[3];
70 m_microSector_width[2][0]=width[4];
71 m_microSector_width[2][1]=width[5];
72 }
73 //end migrate from IndGar1
74
75private:
76 void clear();
77
78 /* /\* region = 0,1,2,3 (drift/transfer1/transfer2/induction) *\/ */
79 /* void smearDrift(int layer, int region, double driftD, double& dphi, double& dz, double& dt) const; */
80 IndexGar pos2Index(double X, double Y, double Z);
81 bool readSmearPar();
82 bool samplingDrift(int layer, double driftD, int idIon);
83 bool samplingTransfer(int layer, int region, int idLastStep); /* region = 1,2 (Transfer1/Transfer2) */
84 int samplingGain(int layer, int region); /* region = 0,1,2 (Drift/Transfer1/Transfer2 */
85 bool calMultiE(int layer);// not used
86 void saveElectron(double phi, double z, double t); //post Sampling processing phase: SAVE and fill to hist.
87 /* void getDriftPar(int layer, int region, double driftD, double& meanPhi, double& sigmaPhi, */
88 /* double& meanZ, double& sigmaZ, double& meanT, double& sigmaT) const; */
89
90 bool m_debugging;
91 TF1 *m_funPolya[3][3]; /* Polya functions */
92
93 ICgemGeomSvc *m_geomSvc;
94 double m_magConfig; /* magnetic field */
95
96 /* electrons from ionization in drift region */
97 int m_nIonE; /* number of electrons from ionization in drift region */
98 std::vector<Float_t> m_vecIonR;
99 std::vector<Float_t> m_vecIonPhi;
100 std::vector<Float_t> m_vecIonZ;
101 std::vector<Float_t> m_vecIonT;
102
103 /* electrons after gem foil1 */
104 int m_nEgem1;
105 std::vector<int> m_idIon;
106 std::vector<Float_t> m_vecGem1dX;
107 std::vector<Float_t> m_vecGem1dZ;
108 std::vector<Float_t> m_vecGem1dT;
109
110 /* electrons after gem foil2 */
111 int m_nEgem2;
112 std::vector<int> m_idGem1;
113 std::vector<Float_t> m_vecGem2dX;
114 std::vector<Float_t> m_vecGem2dZ;
115 std::vector<Float_t> m_vecGem2dT;
116
117 /* electrons after gem foil3 */
118 int m_nEgem3;
119 std::vector<int> m_idGem2;
120 std::vector<Float_t> m_vecGem3dX;
121 std::vector<Float_t> m_vecGem3dZ;
122 std::vector<Float_t> m_vecGem3dT;
123
124 /* info of multiplied electrons */
125 int m_nMulElec;
126 std::vector<Float_t> m_eX;
127 std::vector<Float_t> m_eY;
128 std::vector<Float_t> m_eZ;
129 std::vector<Float_t> m_eT;
130
131 /* gain of each gem foil */
132 double m_gain_gem[3][3];
133 double m_GainMultiplier[3];
134 double m_TransMultiplier;
135 double m_DiffuMultiplier;
136
137 /* smear parameters */
138 /* drift region & Gem-1 */
139 double m_meanXpar[2];
140 double m_sigmaXpar[4];
141 double m_meanZpar;
142 double m_sigmaZpar[4];
143 double m_meanTpar[2];
144 double m_sigmaTpar[4];
145 double m_transparency_gem1;
146
147 /* Transfer1/Gem2 & Transfer2/Gem3 */
148 double m_meanX_transf[2];
149 double m_sigmaX_transf[2];
150 double m_meanZ_transf[2];
151 double m_sigmaZ_transf[2];
152 double m_meanT_transf[2];
153 double m_sigmaT_transf[2];
154 double m_transparency_gem2;
155 double m_transparency_gem3;
156
157 /* Induction */
158 double m_meanX_induc;
159 double m_sigmaX_induc;
160 double m_meanZ_induc;
161 double m_sigmaZ_induc;
162 double m_meanT_induc;
163 double m_sigmaT_induc;
164
165 HitHistMap *m_pMultiElectronMap;
166 int m_layer;
167
168 //begin migrate from indGar1
169 int m_Ngaps_microSector;
170 double m_gapShift_microSector[3][2];
171 double m_microSector_width[3][2];
172 double m_gap_microSector;
173 bool inMicroSectorGap(double phi, int layer);
174 //end migrate from IndGar1
175};
176
177
178
179#endif
float Float_t
const Int_t n
Double_t x[10]
std::map< IndexGar, std::vector< int > > HitHistMap
Definition: IndexGar.h:41
Definition: G4Svc.h:32
void setTransMultiplier(double TransMultiplier)
Definition: SamplingGar2.h:45
void setGapSizeSect(double size)
Definition: SamplingGar2.h:54
void setGapShiftSect(vector< double > shift)
Definition: SamplingGar2.h:55
int getNelectrons() const
Definition: SamplingGar2.h:28
void setNgapsSect(int n)
Definition: SamplingGar2.h:53
void setGainMultiplier(vector< double > GainMultiplier)
Definition: SamplingGar2.h:39
const std::vector< Float_t > & getXContainer() const
Definition: SamplingGar2.h:33
void setIonElectrons(int layer, int nElectrons, std::vector< double > x, std::vector< double > y, std::vector< double > z, std::vector< double > t)
Float_t getY(int n) const
Definition: SamplingGar2.h:30
const std::vector< Float_t > & getYContainer() const
Definition: SamplingGar2.h:34
Float_t getZ(int n) const
Definition: SamplingGar2.h:31
Float_t getX(int n) const
Definition: SamplingGar2.h:29
Float_t getT(int n) const
Definition: SamplingGar2.h:32
void setDiffuMultiplier(double DiffuMultiplier)
Definition: SamplingGar2.h:46
void setMultiElectronMapAddr(HitHistMap *address)
Definition: SamplingGar2.h:49
const std::vector< Float_t > & getTContainer() const
Definition: SamplingGar2.h:36
const std::vector< Float_t > & getZContainer() const
Definition: SamplingGar2.h:35
void setDebugging(bool debugging)
Definition: SamplingGar2.h:37
void init(ICgemGeomSvc *geomSvc, double magConfig)
void setMicroSectorWidthRad(vector< double > width)
Definition: SamplingGar2.h:64
int t()
Definition: t.c:1