18#include "TGeoMatrix.h"
20#include <TGeoPhysicalNode.h>
37 , fNofStrips {nStripsF, nStripsB}
38 , fPitch {pitchF, pitchB}
46 Double_t& fracC, Double_t& fracR)
50 assert(side == 0 || side == 1);
54 Double_t aRo = (side == 0 ?
x +
fDx / 2. :
y +
fDy / 2.);
57 Int_t iStrip = TMath::FloorNint(aRo /
fPitch[side]);
60 Double_t aLeftRo = Double_t(iStrip) *
fPitch[side];
61 Double_t aRightRo = aLeftRo +
fPitch[side];
64 Double_t dLeft = aRo - aLeftRo;
65 Double_t dRight = aRightRo - aRo;
70 if (dLeft < 3. * sigma) fracL = 0.5 * (1. - TMath::Erf(0.707107 * dLeft / sigma));
72 if (dRight < 3. * sigma) fracR = 0.5 * (1. - TMath::Erf(0.707107 * dRight / sigma));
73 fracC = 1. - fracL - fracR;
75 LOG(debug4) << GetName() <<
": Distances to next strip " << dLeft <<
" / " << dRight <<
", charge fractions " << fracL
76 <<
" / " << fracC <<
" / " << fracR;
86 assert(side == 0 || side == 1);
89 Int_t channel = strip;
107 assert(side == 0 || side == 1);
110 assert(TMath::Abs(
x) < 0.5 *
fDx);
111 assert(TMath::Abs(
y) < 0.5 *
fDy);
116 Double_t dist = (side == 0 ?
x + 0.5 *
fDx :
y + 0.5 *
fDy);
119 Int_t iStrip = TMath::FloorNint(dist /
fPitch[side]);
132 LOG(error) << GetName() <<
": Parameters are not set!";
140 TGeoBBox*
shape =
dynamic_cast<TGeoBBox*
>(node->GetShape());
199 assert(side == 0 || side == 1);
201 Double_t xCharge =
x;
202 Double_t yCharge =
y;
203 Double_t zCharge = z;
206 LOG(debug4) << GetName() <<
": Propagating charge " << charge <<
" from (" <<
x <<
", " <<
y <<
", " << z
207 <<
") on side " << side <<
" of sensor " << GetName();
212 LOG(debug4) << GetName() <<
": After Lorentz shift: (" << xCharge <<
", " << yCharge <<
", " << zCharge <<
") cm";
217 LOG(debug4) << GetName() <<
": Charge outside active area";
225 LOG(debug4) << GetName() <<
": Adding charge " << charge <<
" to strip " << iStrip;
234 assert(diffusionWidth >= 0.);
235 LOG(debug4) << GetName() <<
": Diffusion width = " << diffusionWidth <<
" cm";
240 Diffusion(xCharge, yCharge, diffusionWidth, side, fracL, fracC, fracR);
247 Int_t iStripL = iStripC - 1;
248 Int_t iStripR = iStripC + 1;
252 LOG(debug4) << GetName() <<
": Adding charge " << charge * fracC <<
" to strip " << iStripC;
254 if (fracL > 0. && iStripL >= 0) {
256 LOG(debug4) << GetName() <<
": Adding charge " << charge * fracL <<
" to strip " << iStripL;
258 if (fracR > 0. && iStripR <
fNofStrips[side]) {
260 LOG(debug4) << GetName() <<
": Adding charge " << charge * fracR <<
" to strip " << iStripR;
274 TGeoBBox*
shape =
dynamic_cast<TGeoBBox*
>(node->GetShape());
277 fDx = Double_t(nStripsF) * pitchF;
281 fDy = Double_t(nStripsB) * pitchB;
314 ss <<
fElement->GetName() <<
" (DssdOrtho): ";
316 if (!node) ss <<
"no node assigned; ";
318 ss <<
"Dimension (" <<
fDx <<
", " <<
fDy <<
", " <<
fDz <<
") cm, ";
320 ss <<
"pitch " <<
fPitch[0] <<
"/" <<
fPitch[1] <<
" cm, ";
ClassImp(CbmConverterManager)
Class representing an element of the STS setup.
TGeoPhysicalNode * GetPnode() const
Bool_t LorentzShift() const
Check whether Lorentz shift is applied.
Bool_t Diffusion() const
Check whether diffusion is applied.
static Double_t DiffusionWidth(Double_t z, Double_t d, Double_t vBias, Double_t vFd, Double_t temperature, Int_t chargeType)
Detector response for DSSD sensors with orthogonal strips.
virtual void ModifyStripPitch(Double_t pitch)
Modify the strip pitch.
virtual void Diffusion(Double_t x, Double_t y, Double_t sigma, Int_t side, Double_t &fracL, Double_t &fracC, Double_t &fracR)
std::string ToString() const
CbmStsSimSensorDssdOrtho(CbmStsElement *element=nullptr)
Standard constructor.
virtual void PropagateCharge(Double_t x, Double_t y, Double_t z, Double_t charge, Double_t bY, Int_t side)
Double_t fPitch[2]
Strip pitch front/back side [cm].
virtual Int_t GetStripNumber(Double_t x, Double_t y, Int_t side) const
Get strip number from point coordinates.
Int_t fNofStrips[2]
Number of strips on front/back side.
virtual Bool_t Init()
Initialisation @value kTRUE if parameters and node are consistent.
Bool_t SetParameters(Int_t nStripsF, Double_t pitchF, Int_t nStripsB, Double_t pitchB)
Set the internal sensor parameters.
virtual Int_t GetModuleChannel(Int_t strip, Int_t side, Int_t sensorId) const
Get the readout channel in the module for a given strip.
Abstract class for the simulation of double-sided silicon strip sensors.
Bool_t IsInside(Double_t x, Double_t y)
Double_t fDz
Thickness in z [cm].
Bool_t fIsSet
Flag whether sensor is properly initialised.
Double_t fDx
Dimension of active area in x [cm].
Double_t fDy
Dimension of active area in y [cm].
Double_t LorentzShift(Double_t z, Int_t chargeType, Double_t bY) const
Lorentz shift in the x coordinate.
Int_t GetSensorId() const
Sensor ID.
const CbmStsParSensorCond * GetConditions() const
Sensor conditions.
const CbmStsParSim * fSettings
Simulation module.