BOSS 8.0.0
BESIII Offline Software System
Loading...
Searching...
No Matches
Simulation/BOOST/TofSim/include/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 "Gaudi/Property.h"
15#include "TFile.h"
16#include "TTree.h"
17#include "globals.hh"
18#include <vector>
19
20#include "BesTofDigi.hh"
21#include "BesTofDigitizerV.hh"
22#include "BesTofGeoParameter.hh"
23#include "ScintSingle.hh"
24
25using namespace std;
26
27typedef std::map<int, double> AVALANCH;
28
30public:
33
34 void initial();
36 int calStrip( double locZ );
37 bool underStrip( double locX, double locZ );
38 double calTdcRes_charge( double charge_fC );
39 double charge2Time( double charge_fC );
40 double calAdcRes_charge( double charge_fC );
41 double calTdcRes_charge1( double charge_fC );
42 double charge2Time1( double charge_fC );
43 double calAdcRes_charge1( double charge_fC );
44
45 struct Param {
47 void print();
48 void setPar( int nstep, double E_weight, double E );
49 double getAlpha( double E );
50 double getEta( double E );
51 double getV( double E );
52
53 // parameters fixed
55 int nstrip;
56 int nmodule;
57 double strip_x[12];
58 double strip_z;
59 double strip_gap;
60 int deadChannel[72][12];
61 double ngap;
62 double gapWidth;
63 int nstep;
64 double stepWidth;
65 double E_weight;
66 double eCharge;
67 double E;
68 double alpha;
69 double eta;
70 double v_drift;
71 };
72
73 struct HitStruct {
75 void initial();
76 void print();
78 double calAvaLength();
79
81 int trkIndex;
82 int pdgCode;
83 int ions;
84 int strip;
85 int underStrip;
86 int gap;
87 double glbTime;
88 double locx;
89 double locy;
90 double locz;
91 double x;
92 double y;
93 double z;
94 double px;
95 double py;
96 double pz;
97 double v_propagate;
98 double tPropagate_sphi;
99 double tPropagate_xphi;
100
103 };
104
105 struct StripStruct {
107 void initial();
108 void print();
109 void avalanche();
111 long int calNextN( int num );
112 long int multiply( double rdm );
113 double calSigma();
114 void setPar( double alpha_n, double eta_n, double drift_n, double threshold,
115 bool saturationFlag = true );
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
138private:
139 Param m_param;
140 int partId;
141 int module;
142
143 DoubleProperty tdcRes_const;
144 DoubleProperty adcRes_const;
145
146 double tdc_sphi;
147 double tdc_xphi;
148 double tdcRes;
149 double adc;
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 BooleanProperty m_rootFlag;
158 StringProperty m_fileName;
159 DoubleProperty m_V;
160 DoubleProperty m_threshold;
161
162 TFile* m_file;
163 TTree* m_tree;
164
165 IntegerProperty m_nstep;
166 DoubleProperty m_E_weight;
167 BooleanProperty m_saturationFlag;
168 IntegerProperty m_calTdcRes_charge_flag;
169 IntegerProperty m_charge2Time_flag;
170 IntegerProperty m_calAdcRes_charge_flag;
171
172 double m_event;
173 double m_partId;
174 double m_module;
175 double m_time_leading_sphi;
176 double m_time_leading_xphi;
177 double m_time_trailing_sphi;
178 double m_time_trailing_xphi;
179 double m_tdcRes;
180 double m_tdcRes_charge;
181 double m_adc;
182 double m_adcRes;
183 double m_adcRes_charge;
184 double m_strip;
185 double m_trkIndex;
186 double m_tStart;
187 double m_tPropagate_sphi;
188 double m_tPropagate_xphi;
189 double m_tThreshold;
190 double m_charge;
191 int m_nhit;
192 double m_ions_hit[10000];
193 double m_trkIndex_hit[10000];
194 double m_pdgCode_hit[10000];
195 double m_gap_hit[10000];
196 double m_underStrip_hit[10000];
197 double m_locx_hit[10000];
198 double m_locy_hit[10000];
199 double m_locz_hit[10000];
200 double m_x_hit[10000];
201 double m_y_hit[10000];
202 double m_z_hit[10000];
203 double m_px_hit[10000];
204 double m_py_hit[10000];
205 double m_pz_hit[10000];
206};
207
208#endif
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)
double getEta(double E)
double getAlpha(double E)
void setPar(int nstep, double E_weight, double E)
void setPar(double alpha_n, double eta_n, double drift_n, double threshold, bool saturationFlag=true)
long int multiply(double rdm)