23 #define CBOLTZ (1.38E-23)
24 #define e_SI (1.6E-19)
30 float in,
float ild,
float ildx,
float ildy,
float in0,
float in2,
float in3,
int verbosity) {
39 double ldriftX = ildx;
40 double ldriftY = ildy;
48 depletionVoltage = 20.0;
49 appliedVoltage = 25.0;
54 chargeMobility = 1350.0;
65 diffusionConstant *= 1.0e-3;
67 chargeDistributionRMS = 6.5e-10;
70 tanLorentzAnglePerTesla = 0.;
76 double timeNormalisation =
pow(ldrift, 2) / (2. * depletionVoltage * chargeMobility);
79 timeNormalisation = timeNormalisation * 0.01;
88 double clusterWidth = 5.;
89 gevperelectron = 3.61e-09;
93 std::cout <<
"HitDigitizerFP420: constructor ldrift= " << ldrift << std::endl;
94 std::cout <<
"ldriftY= " << ldriftY <<
"ldriftX= " << ldriftX << std::endl;
95 std::cout <<
"depletionVoltage" << depletionVoltage <<
"appliedVoltage" << appliedVoltage <<
"chargeMobility"
96 << chargeMobility <<
"temperature" <<
temperature <<
"diffusionConstant" << diffusionConstant
97 <<
"chargeDistributionRMS" << chargeDistributionRMS <<
"moduleThickness" << moduleThickness
98 <<
"timeNormalisation" << timeNormalisation <<
"gevperelectron" << gevperelectron << std::endl;
106 chargeDistributionRMS,
119 delete theCDividerFP420;
120 delete theCDrifterFP420;
121 delete theIChargeFP420;
127 const G4ThreeVector &bfield,
133 double moduleThickness,
138 float middlex = (
hit.exitPoint().
x() +
hit.entryPoint().
x()) / 2.;
139 float middley = (
hit.exitPoint().
y() +
hit.entryPoint().
y()) / 2.;
141 float chargePosition = -100.;
153 chargePosition = 0.5 * (numStrips) + middlex / pitch;
157 else if (xytype == 2) {
166 chargePosition = 0.5 * (numStrips) + middley / pitch;
171 std::cout <<
"================================================================" << std::endl;
172 std::cout <<
"**** HitDigitizerFP420: !!! ERROR: you have not to be "
174 << xytype << std::endl;
181 if (chargePosition > numStrips || chargePosition < 0) {
182 std::cout <<
"**** HitDigitizerFP420: !!! ERROR: check correspondence of XY "
183 "detector dimensions in XML and here !!! chargePosition = "
184 << chargePosition << std::endl;
189 std::cout <<
" ====== **** HitDigitizerFP420: !!! processHit !!! : "
191 << xytype <<
" numStrips= " << numStrips <<
" pitch= " << pitch
192 <<
" Calculated chargePosition= " << chargePosition << std::endl;
193 std::cout <<
"The middle of hit point on input was: middlex = " << middlex << std::endl;
194 std::cout <<
"The middle of hit point on input was: middley = " << middley << std::endl;
197 std::cout <<
" ====== **** HitDigitizerFP420:processHit: start "
198 "CDrifterFP420 divide"
212 G4ThreeVector driftDir = DriftDirection(bfield, xytype,
verbosity);
214 std::cout <<
" ====== **** HitDigitizerFP420:processHit: driftDir= " << driftDir << std::endl;
215 std::cout <<
" ====== **** HitDigitizerFP420:processHit: start "
216 "induce , CDrifterFP420 drift "
225 return theIChargeFP420->induce(
226 theCDrifterFP420->drift(ion, driftDir, xytype), numStrips, pitch, numStripsW, pitchW, xytype,
verbosity);
236 const G4ThreeVector &Bfield = _bfield;
237 float dir_x, dir_y, dir_z;
252 dir_y = +tanLorentzAnglePerTesla * Bfield.z();
253 dir_z = -tanLorentzAnglePerTesla * Bfield.y();
257 else if (xytype == 1) {
258 dir_x = +tanLorentzAnglePerTesla * Bfield.z();
260 dir_z = -tanLorentzAnglePerTesla * Bfield.x();
265 std::cout <<
"HitDigitizerFP420: ERROR - wrong xytype=" << xytype << std::endl;
269 G4ThreeVector theDriftDirection(dir_x, dir_y, dir_z);
273 std::cout <<
"HitDigitizerFP420:DriftDirection tanLorentzAnglePerTesla= " << tanLorentzAnglePerTesla << std::endl;
274 std::cout <<
"HitDigitizerFP420:DriftDirection The drift direction in "
275 "local coordinate is "
276 << theDriftDirection << std::endl;
279 return theDriftDirection;