53 int nel =
int(edepos * 1.e9 / 27.4);
58 for (
int i = 1;
i <= nel;
i++) {
61 arg = gRandom->Rndm();
63 charge -= mChargeSlope * TMath::Log(arg);
72 ? std::round(
x / mPitch) * mPitch
73 : (std::floor(
x / mPitch) + 0.5f) * mPitch;
79 return TMath::Exp(gRandom->Gaus(0.0, mChargeCorr / 2.0));
88 double signalParam[3] = {14., 13., 1.5};
89 return std::round(std::pow(
charge / signalParam[1], 1. / signalParam[2]) + signalParam[0]);
94 float yAngleEffect = 0;
96 float eLossParticleElossMip = 0.0;
97 float sigmaEffect10degrees = 0.0;
98 float sigmaEffectThetadegrees = 0.0;
102 thetawire = abs(thetawire);
103 if ((betagamma > 3.2) && (thetawire * TMath::RadToDeg() <= 15.)) {
104 betagamma = log(betagamma);
105 eLossParticleElossMip = eLossRatio(betagamma);
106 sigmaEffect10degrees = angleEffect10(eLossParticleElossMip);
107 sigmaEffectThetadegrees = sigmaEffect10degrees / angleEffectNorma(thetawire * TMath::RadToDeg());
109 sigmaEffectThetadegrees /= 1.09833 + 0.017 * (thetawire * TMath::RadToDeg());
111 yAngleEffect = 0.0001 * gRandom->Gaus(0, sigmaEffectThetadegrees);
114 if ((betagamma > 3.2) && (abs(thetawire * TMath::RadToDeg()) <= 15.)) {
115 betagamma = log(betagamma);
116 eLossParticleElossMip = eLossRatio(betagamma);
117 sigmaEffect10degrees = angleEffect10(eLossParticleElossMip);
118 sigmaEffectThetadegrees = sigmaEffect10degrees / magAngleEffectNorma(thetawire * TMath::RadToDeg(), bx / 10.);
120 sigmaEffectThetadegrees /= 1.09833 + 0.017 * (thetawire * TMath::RadToDeg());
122 yAngleEffect = 0.0001 * gRandom->Gaus(0, sigmaEffectThetadegrees);
129float Response::eLossRatio(
float logbetagamma)
const
133 float eLossRatioParam[5] = {1.02138, -9.54149e-02, +7.83433e-02, -9.98208e-03, +3.83279e-04};
134 return eLossRatioParam[0] + eLossRatioParam[1] * logbetagamma + eLossRatioParam[2] * logbetagamma * logbetagamma + eLossRatioParam[3] * logbetagamma * logbetagamma * logbetagamma + eLossRatioParam[4] * logbetagamma * logbetagamma * logbetagamma * logbetagamma;
137float Response::angleEffect10(
float elossratio)
const
141 float angleEffectParam[3] = {1.90691e+02, -6.62258e+01, 1.28247e+01};
142 return angleEffectParam[0] + angleEffectParam[1] * elossratio + angleEffectParam[2] * elossratio * elossratio;
145float Response::angleEffectNorma(
float angle)
const
150 float angleEffectParam[4] = {4.148, -6.809e-01, 5.151e-02, -1.490e-03};
154float Response::magAngleEffectNorma(
float angle,
float bfield)
const
159 float angleEffectParam[7] = {8.6995, 25.4022, 13.8822, 2.4717, 1.1551, -0.0624, 0.0012};
160 float aux = std::abs(
angle - angleEffectParam[0] * bfield);
161 return 121.24 / ((angleEffectParam[1] + angleEffectParam[2] * std::abs(bfield)) + angleEffectParam[3] * aux + angleEffectParam[4] * aux * aux + angleEffectParam[5] * aux * aux * aux + angleEffectParam[6] * aux * aux * aux * aux);
Configurable parameters for MCH charge induction and signal generation.
static const ResponseParam & Instance()
void setSqrtKy3AndDeriveKy2Ky4(float sqrtKy3)
void setSqrtKx3AndDeriveKx2Kx4(float sqrtKx3)
void setPitch(float pitch)
set the inverse of the anode-cathode pitch
uint32_t nSamples(float charge) const
compute the number of samples corresponding to the charge in ADC units
float inclandbfield(float thetawire, float betagamma, float bx) const
compute deteriation of y-resolution due to track inclination and B-field
float getAnod(float x) const
return wire coordinate closest to x
bool isMagnetEffect() const
bool isAngleEffect() const
float chargeCorr() const
return a randomized charge correlation between cathodes
Response(Station station)
float etocharge(float edepos) const
float chargeCorrelation
amplitude of charge correlation between cathodes (= RMS of ln(q1/q2))
float chargeSpreadSt2345
width of the charge distribution for station 2 to 5
float pitchSt1
anode-cathode pitch (cm) for station 1
float chargeSlopeSt1
charge slope used in E to charge conversion for station 1
float chargeSpreadSt1
width of the charge distribution for station 1
float chargeSlopeSt2345
charge slope used in E to charge conversion for station 2 to 5
float chargeThreshold
minimum fraction of charge added to a pad
float pitchSt2345
anode-cathode pitch (cm) for station 2 to 5
float chargeSigmaIntegration
number of sigmas used for charge distribution