BOSS 7.0.2
BESIII Offline Software System
Loading...
Searching...
No Matches
Simulation/BOOST/TofSim/TofSim-00-02-33/TofSim/BesTofDigitizerEcV4.hh
Go to the documentation of this file.
1//---------------------------------------------------------------------------//
2// BOOST --- BESIII Object_Oriented Simulation Tool //
3//---------------------------------------------------------------------------//
4//Description:
5//Author: An Fenfen
6//Created: Nov, 2015
7
8//---------------------------------------------------------------------------//
9// $Id: BesTofDigitizerEcV4.hh
10
11#ifndef BesTofDigitizerEcV4_h
12#define BesTofDigitizerEcV4_h 1
13
14#include "BesTofDigitizerV.hh"
15#include "BesTofDigi.hh"
16#include "BesTofGeoParameter.hh"
17#include "globals.hh"
18#include "TFile.h"
19#include "TTree.h"
20#include "ScintSingle.hh"
21#include <vector>
22
23using namespace std;
24
25typedef std::map<int, double> AVALANCH;
26
28{
29 public:
32
33 void initial();
35 int calStrip(double locZ);
36 bool underStrip(double locX, double locZ);
37 double calTdcRes_charge(double charge_fC);
38 double charge2Time(double charge_fC);
39 double calAdcRes_charge(double charge_fC);
40 double calTdcRes_charge1(double charge_fC);
41 double charge2Time1(double charge_fC);
42 double calAdcRes_charge1(double charge_fC);
43
44 struct Param
45 {
47 void print();
48 void setPar(int nstep, double E_weight);
49
50 //parameters fixed
52 int nstrip;
53 int nmodule;
54 double strip_x[12];
55 double strip_z;
56 double strip_gap;
57 int deadChannel[72][12];
58 double ngap;
59 double gapWidth;
60 int nstep;
61 double stepWidth;
62 double E_weight;
63 double eCharge;
64 };
65
66 struct HitStruct
67 {
68 //HitStruct(const Param&);
70 void initial();
71 void print();
73 double calAvaLength();
74
76 int trkIndex;
77 int pdgCode;
78 int ions;
79 int strip;
80 int underStrip;
81 int gap;
82 double glbTime;
83 double locx;
84 double locy;
85 double locz;
86 double x;
87 double y;
88 double z;
89 double px;
90 double py;
91 double pz;
92 double v_propagate;
93 double tPropagate_sphi;
94 double tPropagate_xphi;
95
96
99 };
100
101 struct StripStruct
102 {
103 //StripStruct(const Param&);
105 void initial();
106 void print();
107 void avalanche();
109 long int calNextN(int num);
110 long int multiply(double rdm);
111 double calSigma();
112 void setPar(double V, double threshold, bool saturationFlag=true);
113 double getAlpha(double E);
114 double getEta(double E);
115 double getV(double E);
116
118 vector<HitStruct> hitStructCol;
119
120 //properties to get
121 int strip;
122 int trkIndex;
123 double tStart;
124 double tPropagate_sphi;
125 double tPropagate_xphi;
126 double tThreshold;
127 double charge;
128
129 //parameters to tune
130 double E;
131 double alpha;
132 double eta;
133 long int threshold;
134 double v_drift;
135 bool saturationFlag;
136 };
137
138
139 private:
140 Param m_param;
141 int partId;
142 int module;
143
144 double tdc_sphi;
145 double tdc_xphi;
146 double tdcRes_const;
147 double tdcRes;
148 double adc;
149 double adcRes_const;
150 double adcRes;
151
152 double time_leading_sphi;
153 double time_leading_xphi;
154 double time_trailing_sphi;
155 double time_trailing_xphi;
156
157 bool m_rootFlag;
158 string m_fileName;
159 double m_V;
160 double m_threshold;
161 TFile* m_file;
162 TTree* m_tree;
163
164 int m_nstep;
165 double m_E_weight;
166 bool m_saturationFlag;
167 int m_calTdcRes_charge_flag;
168 int m_charge2Time_flag;
169 int m_calAdcRes_charge_flag;
170
171 double m_event;
172 double m_partId;
173 double m_module;
174 double m_time_leading_sphi;
175 double m_time_leading_xphi;
176 double m_time_trailing_sphi;
177 double m_time_trailing_xphi;
178 double m_tdcRes;
179 double m_tdcRes_charge;
180 double m_adc;
181 double m_adcRes;
182 double m_adcRes_charge;
183 double m_strip;
184 double m_trkIndex;
185 double m_tStart;
186 double m_tPropagate_sphi;
187 double m_tPropagate_xphi;
188 double m_tThreshold;
189 double m_charge;
190 int m_nhit;
191 double m_ions_hit[10000];
192 double m_trkIndex_hit[10000];
193 double m_pdgCode_hit[10000];
194 double m_gap_hit[10000];
195 double m_underStrip_hit[10000];
196 double m_locx_hit[10000];
197 double m_locy_hit[10000];
198 double m_locz_hit[10000];
199 double m_x_hit[10000];
200 double m_y_hit[10000];
201 double m_z_hit[10000];
202 double m_px_hit[10000];
203 double m_py_hit[10000];
204 double m_pz_hit[10000];
205};
206
207
208#endif
209
G4TDigiCollection< BesTofDigi > BesTofDigitsCollection
double calTdcRes_charge1(double charge_fC)
double calAdcRes_charge(double charge_fC)
double calAdcRes_charge1(double charge_fC)
bool underStrip(double locX, double locZ)
int calStrip(double locZ)
double charge2Time1(double charge_fC)
virtual void Digitize(ScintSingle *, BesTofDigitsCollection *)
double charge2Time(double charge_fC)
double calTdcRes_charge(double charge_fC)
void setPar(int nstep, double E_weight)
long int multiply(double rdm)
void setPar(double V, double threshold, bool saturationFlag=true)