11 #include "TGeoMatrix.h"
13 #include <TGeoPhysicalNode.h>
37 , fNofStrips {nStripsF, nStripsB}
38 , fPitch {pitchF, pitchB} {}
52 assert(side == 0 || side == 1);
56 Double_t aRo = (side == 0 ?
x +
fDx / 2. :
y +
fDy / 2.);
59 Int_t iStrip = TMath::FloorNint(aRo /
fPitch[side]);
62 Double_t aLeftRo = Double_t(iStrip) *
fPitch[side];
63 Double_t aRightRo = aLeftRo +
fPitch[side];
66 Double_t dLeft = aRo - aLeftRo;
67 Double_t dRight = aRightRo - aRo;
72 if (dLeft < 3. * sigma)
73 fracL = 0.5 * (1. - TMath::Erf(0.707107 * dLeft / sigma));
75 if (dRight < 3. * sigma)
76 fracR = 0.5 * (1. - TMath::Erf(0.707107 * dRight / sigma));
77 fracC = 1. - fracL - fracR;
79 LOG(debug4) << GetName() <<
": Distances to next strip " << dLeft <<
" / "
80 << dRight <<
", charge fractions " << fracL <<
" / " << fracC
92 assert(side == 0 || side == 1);
95 Int_t channel = strip;
114 assert(side == 0 || side == 1);
117 assert(TMath::Abs(
x) < 0.5 *
fDx);
118 assert(TMath::Abs(
y) < 0.5 *
fDy);
123 Double_t dist = (side == 0 ?
x + 0.5 *
fDx :
y + 0.5 *
fDy);
126 Int_t iStrip = TMath::FloorNint(dist /
fPitch[side]);
138 LOG(error) << GetName() <<
": Parameters are not set!";
146 TGeoBBox*
shape =
dynamic_cast<TGeoBBox*
>(node->GetShape());
151 assert(fDx < 2. * shape->GetDX());
155 assert(fDy < 2. * shape->GetDY());
207 assert(side == 0 || side == 1);
209 Double_t xCharge =
x;
210 Double_t yCharge =
y;
211 Double_t zCharge = z;
214 LOG(debug4) << GetName() <<
": Propagating charge " << charge <<
" from ("
215 <<
x <<
", " <<
y <<
", " << z <<
") on side " << side
216 <<
" of sensor " << GetName();
221 LOG(debug4) << GetName() <<
": After Lorentz shift: (" << xCharge <<
", "
222 << yCharge <<
", " << zCharge <<
") cm";
227 LOG(debug4) << GetName() <<
": Charge outside active area";
235 LOG(debug4) << GetName() <<
": Adding charge " << charge <<
" to strip "
242 Double_t diffusionWidth =
249 assert(diffusionWidth >= 0.);
250 LOG(debug4) << GetName() <<
": Diffusion width = " << diffusionWidth
256 Diffusion(xCharge, yCharge, diffusionWidth, side, fracL, fracC, fracR);
263 Int_t iStripL = iStripC - 1;
264 Int_t iStripR = iStripC + 1;
268 LOG(debug4) << GetName() <<
": Adding charge " << charge * fracC
269 <<
" to strip " << iStripC;
271 if (fracL > 0. && iStripL >= 0) {
273 LOG(debug4) << GetName() <<
": Adding charge " << charge * fracL
274 <<
" to strip " << iStripL;
276 if (fracR > 0. && iStripR <
fNofStrips[side]) {
278 LOG(debug4) << GetName() <<
": Adding charge " << charge * fracR
279 <<
" to strip " << iStripR;
295 TGeoBBox*
shape =
dynamic_cast<TGeoBBox*
>(node->GetShape());
298 fDx = Double_t(nStripsF) * pitchF;
299 assert(fDx < 2. * shape->GetDX());
302 fDy = Double_t(nStripsB) * pitchB;
303 assert(fDy < 2. * shape->GetDY());
334 ss <<
fElement->GetName() <<
" (DssdOrtho): ";
337 ss <<
"no node assigned; ";
339 ss <<
"Dimension (" <<
fDx <<
", " <<
fDy <<
", " <<
fDz <<
") cm, ";
341 ss <<
"pitch " <<
fPitch[0] <<
"/" <<
fPitch[1] <<
" cm, ";