37 const TVector2& firstStripAnchor,
39 : fPitch(pitch), fOrient(orient),
40 fNrStrips(nrStrips), fNrFeChannels(nrFeChannels),
41 fAnchor(firstStripAnchor),
42 fThreshold(threshold), fNoise(noise), fCSigma(csigma),
43 fStripDir(0.,0.), fOrthoDir(0.,0.), fVerboseLevel(0)
91 std::vector<PndSdsStrip>
96 if (
fVerboseLevel > 2) std::cout<<
"-I- PndSdsCalcStrip::GetStrips "<<std::endl;
100 TVector2
out(outx,outy);
101 TVector2 path=out-in;
104 std::cout<<
" InPoint: ("<<in.X()<<
","<<in.Y()<<
")"<<std::endl;
105 std::cout<<
" OutPoint: ("<<out.X()<<
","<<out.Y()<<
")"<<std::endl;
114 if (
fVerboseLevel > 1) std::cout<<
" pathlength: "<<path.Mod()<<std::endl;
119 if (
fVerboseLevel > 2) std::cout<<
" nuIn = "<<nuIn<<
" ; nuOut = "<<nuOut<<std::endl;
122 if (
fVerboseLevel > 1) std::cout<<
" integral charge = "<<Q<<std::endl;
136 if (
fVerboseLevel > 2) std::cout<<
"-I- PndSdsCalcStrip::GetStripsNoDif "<<std::endl;
137 std::vector<PndSdsStrip> strips;
139 if (
fVerboseLevel > 2) std::cout<<
" nuIn = "<<nuIn<<
" ; nuOut = "<<nuOut<<std::endl;
140 if (
fVerboseLevel > 1) std::cout<<
" integral charge = "<<Q<<std::endl;
146 if (
fVerboseLevel > 1) std::cout<<
"-W- PndSdsCalcStrip::GetStripsNoDif: Hit outside active area."<<std::endl;
153 Q *= (nuOut)/(nuOut-nuIn);
162 Q *= (nuIn)/(-nuOut+nuIn);
170 if (Int_t(nuIn) == Int_t(nuOut)){
178 Double_t dir = (nuOut>nuIn) ? 1. : -1.;
182 Int_t nextIn = Int_t(nuIn + 0.5+0.5*dir);
185 std::cout<<
" part of first strip : "<<nextIn-nuIn<<std::endl ;
186 std::cout<<
" charge : "<<Q1<<std::endl ;
187 std::cout<<
" next strip : "<<nextIn<<std::endl ;
194 Int_t prevOut = Int_t(nuOut + 0.5-0.5*dir);
197 std::cout<<
" part of last strip : "<<(nuOut-prevOut)<<std::endl ;
198 std::cout<<
" charge : "<<Q2<<std::endl ;
199 std::cout<<
" end of previous strip : "<<prevOut<<std::endl ;
206 nextIn = Int_t(nextIn - 0.5 + 0.5*dir);
207 prevOut = Int_t(prevOut - 0.5 + 0.5*dir);
209 std::cout<<
" dir="<<Int_t(dir)<<std::endl;
210 std::cout<<
" begin="<<nextIn<<
" end="<<prevOut<<std::endl;
213 for (Int_t
n = nextIn ;
n != prevOut;
n += Int_t(dir) )
220 if (
fVerboseLevel > 2)
if (
fabs(Q)>1.) std::cout<<
" charge Q = "<<Q<<
" not detected!"<<std::endl;
221 if (
fVerboseLevel > 1) std::cout<<
" -> "<<nrHits<<
" strips hit."<<std::endl;
234 if(pathend<pathstart){
239 std::vector<PndSdsStrip> array;
245 Int_t xtra = (Int_t)ceil(2.*sigma_str);
246 for(Int_t
i=(Int_t)pathstart-xtra;
i<(Int_t)pathend+1+xtra;
i++)
249 if(
fabs(pathstart-pathend) < 1e-6) {
250 DQ+=TMath::Erf(
i+1-0.5*(pathstart+pathend))/(
sqrt(2)*sigma_str);
251 DQ-=TMath::Erf(
i-0.5*(pathstart+pathend))/(
sqrt(2)*sigma_str);
253 DQ+=
CalcFk(
i,pathend,sigma_str);
254 DQ-=
CalcFk(
i+1,pathend,sigma_str);
255 DQ-=
CalcFk(
i,pathstart,sigma_str);
256 DQ+=
CalcFk(
i+1,pathstart,sigma_str);
257 DQ/=(pathend-pathstart);
275 if(
fVerboseLevel>2)Info(
"GetStripsAlternative()",
"begin with in=%f, out=%f, Q=%f",nuIn,nuOut,Q);
276 std::vector<PndSdsStrip> strips;
279 Int_t nstr=strips.size();
280 for(Int_t
i=0;
i<nstr;
i++)
282 if(
fVerboseLevel>2) Info(
"GetStripsAlternative()",
"pass this strip: i=%i, s=%i, q=%f",
i,strips[
i].GetIndex(),strips[
i].GetCharge());
283 indice.push_back(strips[
i].GetIndex());
284 charges.push_back(strips[
i].GetCharge());
325 if(istrip<0) {
if(
fVerboseLevel>2)Warning(
"InjectStripCharge",
"Invalid strip number: %i < 0",istrip);
return;}
327 if(charge==0)
return;
330 if(
fVerboseLevel>3) Info(
"InjectStripCharge",
"istrip=%i,charge=%f,smearedCharge=%f",istrip,charge,smearedQ);
331 array.push_back(
PndSdsStrip(Int_t(istrip),smearedQ) );
339 if (
fVerboseLevel > 3) Info(
"SmearCharge:",
" charge = %f, smeared = %f",charge,smeared);
346 std::cout<<
"-I- PndSdsCalcStrip Info :"<<std::endl;
347 std::cout<<
" pitch = "<<
fPitch*10000.<<
" um"<<std::endl;
348 std::cout<<
" orientation angle = "<<
fOrient/
TMath::Pi()*180.<<
" deg"<<std::endl;
349 std::cout<<
" nr of strips = "<<
fNrStrips<<std::endl;
350 std::cout<<
" nr of channels per FE = "<<
fNrFeChannels<<std::endl;
352 std::cout<<
" anchor point = ("<<
fAnchor.X()<<
","<<
fAnchor.Y()<<
")"<<std::endl;
353 std::cout<<
" strip-direction vector = ("<<
fStripDir.X()<<
","<<
fStripDir.Y()<<
")"<<std::endl;
Double_t SmearCharge(Double_t charge)
friend F32vec4 cos(const F32vec4 &a)
Int_t fNrStrips
strip orientation angle to x axis
TVector2 GetBotAnchor() const
friend F32vec4 exp(const F32vec4 &a)
Int_t CalcFEfromStrip(Int_t stripNr) const
friend F32vec4 sqrt(const F32vec4 &a)
friend F32vec4 sin(const F32vec4 &a)
Double_t GetNoise() const
Class representing strips on wafer-scale.
Double_t GetThreshold() const
Int_t fNrFeChannels
Nr. of strips on active area.
Double_t GetOrient() const
std::vector< PndSdsStrip > GetStripsDif(Double_t nuIn, Double_t nuOut, Double_t Q)
Int_t fVerboseLevel
vector orthogonal to strip direction
Int_t GetStripsAlternative(Double_t nuIn, Double_t nuOut, Double_t Q, Int_t mode, std::vector< Int_t > &indice, std::vector< Double_t > &charges)
Digitization Parameter Class for MVD-Strip part.
std::vector< PndSdsStrip > GetStripsNoDif(Double_t nuIn, Double_t nuOut, Double_t Q)
Double_t CalcFk(Double_t strip, Double_t x, Double_t sig)
friend F32vec4 fabs(const F32vec4 &a)
Int_t CalcChannelfromStrip(Int_t stripNr) const
TVector2 fOrthoDir
vector perpendicular to strip direction
void InjectStripCharge(std::vector< PndSdsStrip > &array, Int_t istrip, Double_t charge)
void CalcFeChToStrip(Int_t fe, Int_t channel, Int_t &strip, enum SensorSide &side) const
Double_t GetBotPitch() const
Double_t fOrient
strip pitch (cm)
Double_t GetQCloudSigma() const
Double_t CalcStripFromPoint(Double_t x, Double_t y)
TVector2 fStripDir
Charge diffusion.
TVector2 GetTopAnchor() const
Double_t fThreshold
anchor point on first strip
Double_t fNoise
charge threshold
std::vector< PndSdsStrip > GetStrips(Double_t inx, Double_t iny, Double_t inz, Double_t outx, Double_t outy, Double_t outz, Double_t eLoss)
Double_t GetTopPitch() const
TVector2 fAnchor
Nr of Channels per FE.
Double_t ChargeFromEloss(Double_t eloss) const
void CalcStripPointOnLine(const Double_t strip, TVector2 &point) const