FairRoot/PandaRoot
Public Member Functions | Private Member Functions | Private Attributes | List of all members
PndSdsCalcStrip Class Reference

Class for calculating strip indices from wafer hits. More...

#include <PndSdsCalcStrip.h>

Public Member Functions

 PndSdsCalcStrip ()
 
 PndSdsCalcStrip (Double_t pitch, Double_t orient, Int_t nrStrips, Int_t nrFeChannels, const TVector2 &firstStripAnchor, Double_t threshold, Double_t noise, Double_t csigma)
 
 PndSdsCalcStrip (const PndSdsStripDigiPar *digipar, SensorSide side=kTOP)
 
std::vector< PndSdsStripGetStrips (Double_t inx, Double_t iny, Double_t inz, Double_t outx, Double_t outy, Double_t outz, Double_t eLoss)
 
std::vector< PndSdsStripGetStripsNoDif (Double_t nuIn, Double_t nuOut, Double_t Q)
 
std::vector< PndSdsStripGetStripsDif (Double_t nuIn, Double_t nuOut, Double_t Q)
 
Double_t CalcFk (Double_t strip, Double_t x, Double_t sig)
 
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)
 
Int_t CalcFEfromStrip (Int_t stripNr) const
 
Int_t CalcChannelfromStrip (Int_t stripNr) const
 
void CalcFeChToStrip (Int_t fe, Int_t channel, Int_t &strip, enum SensorSide &side) const
 
void CalcStripPointOnLine (const Double_t strip, TVector2 &point) const
 
const TVector2 GetStripDirection () const
 
void SetVerboseLevel (Int_t level)
 
Double_t GetThreshold () const
 
Double_t GetNoise () const
 
void Print () const
 

Private Member Functions

Double_t CalcStripFromPoint (Double_t x, Double_t y)
 
Double_t ChargeFromEloss (Double_t eloss) const
 
void InjectStripCharge (std::vector< PndSdsStrip > &array, Int_t istrip, Double_t charge)
 
Double_t SmearCharge (Double_t charge)
 

Private Attributes

Double_t fPitch
 
Double_t fOrient
 strip pitch (cm) More...
 
Int_t fNrStrips
 strip orientation angle to x axis More...
 
Int_t fNrFeChannels
 Nr. of strips on active area. More...
 
TVector2 fAnchor
 Nr of Channels per FE. More...
 
Double_t fThreshold
 anchor point on first strip More...
 
Double_t fNoise
 charge threshold More...
 
Double_t fCSigma
 ENC. More...
 
TVector2 fStripDir
 Charge diffusion. More...
 
TVector2 fOrthoDir
 vector perpendicular to strip direction More...
 
Int_t fVerboseLevel
 vector orthogonal to strip direction More...
 

Detailed Description

Class for calculating strip indices from wafer hits.

Author
HG Zaunick hg.za.nosp@m.unic.nosp@m.k@phy.nosp@m.sik..nosp@m.tu-dr.nosp@m.esde.nosp@m.n.de
R Kliemt (TU Dresden, Uni Bonn)

Definition at line 33 of file PndSdsCalcStrip.h.

Constructor & Destructor Documentation

PndSdsCalcStrip::PndSdsCalcStrip ( )

Default constructor No reason to use it

Definition at line 20 of file PndSdsCalcStrip.cxx.

20  :
21  fPitch(0.),
22  fOrient(0.),
23  fNrStrips(0),
24  fNrFeChannels(0),
25  fAnchor(0.,0.),
26  fThreshold(0.),
27  fNoise(0.),
28  fCSigma(0.),
29  fStripDir(0.,0.),
30  fOrthoDir(0.,0.),
31  fVerboseLevel(0)
32 {}
Int_t fNrStrips
strip orientation angle to x axis
Int_t fNrFeChannels
Nr. of strips on active area.
Double_t fCSigma
ENC.
Int_t fVerboseLevel
vector orthogonal to strip direction
TVector2 fOrthoDir
vector perpendicular to strip direction
Double_t fOrient
strip pitch (cm)
TVector2 fStripDir
Charge diffusion.
Double_t fThreshold
anchor point on first strip
Double_t fNoise
charge threshold
TVector2 fAnchor
Nr of Channels per FE.
PndSdsCalcStrip::PndSdsCalcStrip ( Double_t  pitch,
Double_t  orient,
Int_t  nrStrips,
Int_t  nrFeChannels,
const TVector2 &  firstStripAnchor,
Double_t  threshold,
Double_t  noise,
Double_t  csigma = 0 
)

Constructor Create Object with all necessary parameters

Parameters
pitchPitch between Strips (=width of strips)
orientOrientation Angle of Strips in x-y-Plane from x-Axis
nrStripsNumber of Strips in the active area
nrFeChannelsNumber of Channels per Frontend
firstStripAnchorCoordinate in x-y-Plane which belongs to the first Strip (Index 0). Usually this is the readout point of the strip
thresholdCharge-Threshold applied to the signal (electrons)
noiseNoise superimposed to the signal (electrons)

Definition at line 35 of file PndSdsCalcStrip.cxx.

References cos(), fOrient, fOrthoDir, fStripDir, and sin().

39 : fPitch(pitch), fOrient(orient),
41 fAnchor(firstStripAnchor),
43 fStripDir(0.,0.), fOrthoDir(0.,0.), fVerboseLevel(0)
44 {
47  //Print();
48 }
friend F32vec4 cos(const F32vec4 &a)
Definition: P4_F32vec4.h:112
Int_t fNrStrips
strip orientation angle to x axis
friend F32vec4 sin(const F32vec4 &a)
Definition: P4_F32vec4.h:111
int nrStrips
Definition: anaLmdDigi.C:76
Int_t fNrFeChannels
Nr. of strips on active area.
Double_t fCSigma
ENC.
Int_t fVerboseLevel
vector orthogonal to strip direction
int nrFeChannels
Definition: anaLmdDigi.C:75
double threshold
TVector2 fOrthoDir
vector perpendicular to strip direction
Double_t fOrient
strip pitch (cm)
double orient
TVector2 fStripDir
Charge diffusion.
Double_t fThreshold
anchor point on first strip
Double_t fNoise
charge threshold
double noise
TVector2 fAnchor
Nr of Channels per FE.
PndSdsCalcStrip::PndSdsCalcStrip ( const PndSdsStripDigiPar digipar,
SensorSide  side = kTOP 
)

Definition at line 51 of file PndSdsCalcStrip.cxx.

References cos(), fAnchor, fCSigma, fNoise, fNrFeChannels, fNrStrips, fOrient, fOrthoDir, fPitch, fStripDir, fThreshold, fVerboseLevel, PndSdsStripDigiPar::GetBotAnchor(), PndSdsStripDigiPar::GetBotPitch(), PndSdsStripDigiPar::GetNoise(), PndSdsStripDigiPar::GetNrBotFE(), PndSdsStripDigiPar::GetNrFECh(), PndSdsStripDigiPar::GetNrTopFE(), PndSdsStripDigiPar::GetOrient(), PndSdsStripDigiPar::GetQCloudSigma(), PndSdsStripDigiPar::GetSkew(), PndSdsStripDigiPar::GetThreshold(), PndSdsStripDigiPar::GetTopAnchor(), PndSdsStripDigiPar::GetTopPitch(), kBOTTOM, kTOP, Print(), and sin().

52 : fPitch(0.),
53  fOrient(0.),
54  fNrStrips(0),
55  fNrFeChannels(0),
56  fAnchor(0.,0.),
57  fThreshold(0.),
58  fNoise(0.),
59  fCSigma(0.),
60  fStripDir(0.,0.),
61  fOrthoDir(0.,0.),
62  fVerboseLevel(0)
63 {
64  if(side == kTOP)
65  {
66  fPitch = digipar->GetTopPitch();
67  fOrient = digipar->GetOrient();
68  fAnchor = digipar->GetTopAnchor();
69  fNrStrips = digipar->GetNrTopFE()*digipar->GetNrFECh();
70  }
71  else if(side == kBOTTOM)
72  {
73  fPitch = digipar->GetBotPitch();
74  fOrient = digipar->GetOrient() + digipar->GetSkew();
75  fAnchor = digipar->GetBotAnchor();
76  fNrStrips = digipar->GetNrBotFE()*digipar->GetNrFECh();
77  }
78  fNrFeChannels = digipar->GetNrFECh();
79  fThreshold = digipar->GetThreshold();
80  fNoise = digipar->GetNoise();
81  fCSigma = digipar->GetQCloudSigma();
82 
85  fVerboseLevel = 0;
86  if (fVerboseLevel > 0) Print();
87 }
friend F32vec4 cos(const F32vec4 &a)
Definition: P4_F32vec4.h:112
Int_t fNrStrips
strip orientation angle to x axis
TVector2 GetBotAnchor() const
void Print() const
friend F32vec4 sin(const F32vec4 &a)
Definition: P4_F32vec4.h:111
Double_t GetNoise() const
Double_t GetThreshold() const
Int_t fNrFeChannels
Nr. of strips on active area.
Double_t GetOrient() const
Double_t fCSigma
ENC.
Int_t fVerboseLevel
vector orthogonal to strip direction
Double_t GetSkew() const
TVector2 fOrthoDir
vector perpendicular to strip direction
Int_t GetNrFECh() const
Double_t GetBotPitch() const
Double_t fOrient
strip pitch (cm)
Double_t GetQCloudSigma() const
Int_t GetNrTopFE() const
Int_t GetNrBotFE() const
TVector2 fStripDir
Charge diffusion.
TVector2 GetTopAnchor() const
Double_t fThreshold
anchor point on first strip
Double_t fNoise
charge threshold
Double_t GetTopPitch() const
TVector2 fAnchor
Nr of Channels per FE.

Member Function Documentation

Int_t PndSdsCalcStrip::CalcChannelfromStrip ( Int_t  stripNr) const

Calculate Channel index (on Frontend) from strip-index

Parameters
stripNrstrip index
Returns
channel on frontend

Definition at line 306 of file PndSdsCalcStrip.cxx.

References fNrFeChannels.

Referenced by PndSdsStripHitProducer::Exec().

306 { return (stripNr%fNrFeChannels); }
Int_t fNrFeChannels
Nr. of strips on active area.
void PndSdsCalcStrip::CalcFeChToStrip ( Int_t  fe,
Int_t  channel,
Int_t &  strip,
enum SensorSide side 
) const

Calculate global strip index from Frontend number and -channel

Parameters
fefrontend number
channelfrontend channel
stripglobal strip index
side

Definition at line 309 of file PndSdsCalcStrip.cxx.

References fNrFeChannels, fNrStrips, kBOTTOM, and kTOP.

Referenced by PndSdsChargeWeightingAlgorithms::DigiStripno(), and PndSdsStripClusterTask::FillClusterFinders().

310 {
311  //Caution! The top side s always the reference side!
312  Int_t nr = fe * fNrFeChannels + channel;
313  if (nr < fNrStrips) {
314  side = kTOP;
315  } else {
316  nr -= fNrStrips;
317  side = kBOTTOM;
318  }
319  strip = nr;
320 }
Int_t fNrStrips
strip orientation angle to x axis
Int_t fNrFeChannels
Nr. of strips on active area.
int strip
Definition: anaMvdDigi.C:135
int fe
Definition: anaLmdDigi.C:67
Int_t PndSdsCalcStrip::CalcFEfromStrip ( Int_t  stripNr) const

Calculate Frontend number from strip-index

Parameters
stripNrstrip index
Returns
Frontend number

Definition at line 303 of file PndSdsCalcStrip.cxx.

References fNrFeChannels.

Referenced by PndSdsStripHitProducer::Exec().

303 { return (stripNr/fNrFeChannels); }
Int_t fNrFeChannels
Nr. of strips on active area.
Double_t PndSdsCalcStrip::CalcFk ( Double_t  strip,
Double_t  x,
Double_t  sig 
)

Definition at line 266 of file PndSdsCalcStrip.cxx.

References Double_t, exp(), Pi, sqrt(), t, and x.

Referenced by GetStripsDif().

267 {
268  const Double_t t=(strip-x)/(sqrt(2)*sig);
269  return ( (strip-x)*TMath::Erf(t) + sqrt(2/TMath::Pi())*sig*exp(-t*t) );
270 }
friend F32vec4 exp(const F32vec4 &a)
Definition: P4_F32vec4.h:109
friend F32vec4 sqrt(const F32vec4 &a)
Definition: P4_F32vec4.h:29
int strip
Definition: anaMvdDigi.C:135
Double_t
Double_t x
TTree * t
Definition: bump_analys.C:13
Double_t Pi
Double_t PndSdsCalcStrip::CalcStripFromPoint ( Double_t  x,
Double_t  y 
)
private

Calculate continuous strip-number parameter from given Point in local system

Parameters
xx-coordinate
yy-coordinate
Returns
strip-parameter nu

Definition at line 290 of file PndSdsCalcStrip.cxx.

References fAnchor, fOrthoDir, and fPitch.

Referenced by GetStrips().

291 {
292  // fOrthoDir is already set to magnitude == 1., makes it cheaper here.
293  return ((x-fAnchor.X())*fOrthoDir.X() + (y-fAnchor.Y())*fOrthoDir.Y())/fPitch;
294 }
TVector2 fOrthoDir
vector perpendicular to strip direction
Double_t x
Double_t y
TVector2 fAnchor
Nr of Channels per FE.
void PndSdsCalcStrip::CalcStripPointOnLine ( const Double_t  strip,
TVector2 &  point 
) const

Definition at line 297 of file PndSdsCalcStrip.cxx.

References fAnchor, fOrthoDir, and fPitch.

Referenced by PndLmdStripClusterTask::Exec(), and PndSdsStripClusterTask::Exec().

298 {
299  point = fPitch*(strip+0.5)*fOrthoDir + fAnchor;
300 }
int strip
Definition: anaMvdDigi.C:135
TVector2 fOrthoDir
vector perpendicular to strip direction
TVector2 fAnchor
Nr of Channels per FE.
PndSdsMCPoint * point
Definition: anaLmdCluster.C:72
Double_t PndSdsCalcStrip::ChargeFromEloss ( Double_t  eloss) const
inlineprivate

Definition at line 143 of file PndSdsCalcStrip.h.

Referenced by GetStrips().

143 {return eloss/(3.61e-9);}
double eloss
Definition: anaLmdSim.C:34
Double_t PndSdsCalcStrip::GetNoise ( ) const
inline
const TVector2 PndSdsCalcStrip::GetStripDirection ( ) const
inline

Get Strip Direction (strip orientation angle)

Definition at line 113 of file PndSdsCalcStrip.h.

References fStripDir.

Referenced by PndLmdStripClusterTask::Backmap(), and PndSdsStripClusterTask::Backmap().

113 {return fStripDir;}
TVector2 fStripDir
Charge diffusion.
std::vector< PndSdsStrip > PndSdsCalcStrip::GetStrips ( Double_t  inx,
Double_t  iny,
Double_t  inz,
Double_t  outx,
Double_t  outy,
Double_t  outz,
Double_t  eLoss 
)

Get List of hit channels from given Wafer hit.

Parameters
inxx-coordinate of entry point
inyy-coordinate of entry point
inzz-coordinate of entry point
outxx-coordinate of exit point
outyy-coordinate of exit point
outzz-coordinate of exit point
eLossEnergy Loss inside the detector element (GeV)
Returns
List of fired strips

Definition at line 92 of file PndSdsCalcStrip.cxx.

References CalcStripFromPoint(), ChargeFromEloss(), Double_t, fCSigma, fVerboseLevel, GetStripsDif(), GetStripsNoDif(), and out.

Referenced by PndSdsStripHitProducer::Exec().

95 {
96  if (fVerboseLevel > 2) std::cout<<"-I- PndSdsCalcStrip::GetStrips "<<std::endl;
97 
98  // 2d-Projection of trajectory
99  TVector2 in(inx,iny);
100  TVector2 out(outx,outy);
101  TVector2 path=out-in;
102 
103  if (fVerboseLevel > 2){
104  std::cout<<" InPoint: ("<<in.X()<<","<<in.Y()<<")"<<std::endl;
105  std::cout<<" OutPoint: ("<<out.X()<<","<<out.Y()<<")"<<std::endl;
106  }
107 
108  //if (path.Mod()<1E-18) {
109  //std::cout<<"-W- PndSdsCalcStrip::GetStrips : No Trajectory inside Sensor! (out-in).Mod() = "<<path.Mod()<<std::endl;
110  //std::vector<PndSdsStrip> strips;
111  //return strips;
112  //}
113 
114  if (fVerboseLevel > 1) std::cout<<" pathlength: "<<path.Mod()<<std::endl;
115 
116  Double_t nuIn = CalcStripFromPoint(inx,iny);
117  Double_t nuOut = CalcStripFromPoint(outx,outy);
118 
119  if (fVerboseLevel > 2) std::cout<<" nuIn = "<<nuIn<<" ; nuOut = "<<nuOut<<std::endl;
120 
121  Double_t Q = ChargeFromEloss(eLoss);//*1E9/3.61; // 3.6 eV/Electron in Silicon
122  if (fVerboseLevel > 1) std::cout<<" integral charge = "<<Q<<std::endl;
123  if (fVerboseLevel > 1) std::cout<<"Charge cloud sigma="<<fCSigma<<std::endl;
124  // Do charge distribution
125  if(fCSigma>0) return GetStripsDif(nuIn,nuOut,Q);
126  else return GetStripsNoDif(nuIn,nuOut,Q);
127 
128 }
Double_t fCSigma
ENC.
std::vector< PndSdsStrip > GetStripsDif(Double_t nuIn, Double_t nuOut, Double_t Q)
Int_t fVerboseLevel
vector orthogonal to strip direction
Double_t
std::vector< PndSdsStrip > GetStripsNoDif(Double_t nuIn, Double_t nuOut, Double_t Q)
TFile * out
Definition: reco_muo.C:20
Double_t CalcStripFromPoint(Double_t x, Double_t y)
Double_t ChargeFromEloss(Double_t eloss) const
Int_t PndSdsCalcStrip::GetStripsAlternative ( Double_t  nuIn,
Double_t  nuOut,
Double_t  Q,
Int_t  mode,
std::vector< Int_t > &  indice,
std::vector< Double_t > &  charges 
)

Definition at line 273 of file PndSdsCalcStrip.cxx.

References fVerboseLevel, GetStripsDif(), GetStripsNoDif(), and i.

274 {
275  if(fVerboseLevel>2)Info("GetStripsAlternative()","begin with in=%f, out=%f, Q=%f",nuIn,nuOut,Q);
276  std::vector<PndSdsStrip> strips;
277  if(mode == 0) strips = GetStripsNoDif(nuIn,nuOut,Q);
278  if(mode == 1) strips = GetStripsDif(nuIn,nuOut,Q);
279  Int_t nstr=strips.size();
280  for(Int_t i=0;i<nstr;i++)
281  {
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());
285  }
286  return nstr;
287 }
Int_t i
Definition: run_full.C:25
std::vector< PndSdsStrip > GetStripsDif(Double_t nuIn, Double_t nuOut, Double_t Q)
Int_t fVerboseLevel
vector orthogonal to strip direction
Int_t mode
Definition: autocutx.C:47
std::vector< PndSdsStrip > GetStripsNoDif(Double_t nuIn, Double_t nuOut, Double_t Q)
std::vector< PndSdsStrip > PndSdsCalcStrip::GetStripsDif ( Double_t  nuIn,
Double_t  nuOut,
Double_t  Q 
)

Definition at line 228 of file PndSdsCalcStrip.cxx.

References CalcFk(), Double_t, fabs(), fCSigma, fPitch, i, InjectStripCharge(), and sqrt().

Referenced by GetStrips(), and GetStripsAlternative().

229 {
230  // Do charge diffusion integrated analytically over a path length
231  // 0.5*(1+erf(x)) is the integral over a gauss from -inf to x
232  // factor 0.5 is applied last, the +1 terms cancel in the difference
233 
234  if(pathend<pathstart){ // sort for direction
235  Double_t tmp=pathstart;
236  pathstart=pathend;
237  pathend=tmp;
238  }
239  std::vector<PndSdsStrip> array;
240  Double_t DQ = 0.;
241  // sigma_str = sigma_um/pitch_str-per-um
242  Double_t sigma_str=fCSigma/fPitch;
243  // TODO how much extra bins to fill?, minimum 1...
244  // how about 2sigma? shall be collected
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++)
247  {
248  DQ=0;
249  if(fabs(pathstart-pathend) < 1e-6) { // too small path, don't integrate over path
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);
252  } else {
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);
258  }
259  DQ*=0.5*Q;
260  InjectStripCharge(array,i,DQ);
261  }
262  return array;
263 }
Int_t i
Definition: run_full.C:25
friend F32vec4 sqrt(const F32vec4 &a)
Definition: P4_F32vec4.h:29
Double_t fCSigma
ENC.
Double_t
Double_t CalcFk(Double_t strip, Double_t x, Double_t sig)
friend F32vec4 fabs(const F32vec4 &a)
Definition: P4_F32vec4.h:47
void InjectStripCharge(std::vector< PndSdsStrip > &array, Int_t istrip, Double_t charge)
std::vector< PndSdsStrip > PndSdsCalcStrip::GetStripsNoDif ( Double_t  nuIn,
Double_t  nuOut,
Double_t  Q 
)

Definition at line 132 of file PndSdsCalcStrip.cxx.

References Double_t, fabs(), fNrStrips, fVerboseLevel, InjectStripCharge(), and n.

Referenced by GetStrips(), and GetStripsAlternative().

133 {
134  // Charge distributed equally along a path.
135 
136  if (fVerboseLevel > 2) std::cout<<"-I- PndSdsCalcStrip::GetStripsNoDif "<<std::endl;
137  std::vector<PndSdsStrip> strips;
138 
139  if (fVerboseLevel > 2) std::cout<<" nuIn = "<<nuIn<<" ; nuOut = "<<nuOut<<std::endl;
140  if (fVerboseLevel > 1) std::cout<<" integral charge = "<<Q<<std::endl;
141 
142  // did we hit the active area ?
143  // if ( (nuIn<0.5 && nuOut<0.5) || (((nuIn+0.5) > Double_t(fNrStrips-1)) && ((nuOut+0.5) > Double_t(fNrStrips-1)))){
144  if ( (nuIn<0. && nuOut<0.) || ((nuIn > Double_t(fNrStrips)) && (nuOut > Double_t(fNrStrips))) )
145  {
146  if (fVerboseLevel > 1) std::cout<<"-W- PndSdsCalcStrip::GetStripsNoDif: Hit outside active area."<<std::endl;
147  return strips;
148  }
149 
150  // is the In-Point inside active area ?
151  // only charge fraction inside active area taken
152  if (nuIn<0.){
153  Q *= (nuOut)/(nuOut-nuIn);
154  nuIn = 0.;
155  } else if (nuIn > (Double_t(fNrStrips))){
156  Q *= ((Double_t)fNrStrips-nuOut)/(-nuOut+nuIn);
157  nuIn = Double_t(fNrStrips);
158  }
159 
160  // is the Out-Point inside active area ?
161  if (nuOut<0.){
162  Q *= (nuIn)/(-nuOut+nuIn);
163  nuOut = 0.;
164  } else if (nuOut > (Double_t(fNrStrips))){
165  Q *= ((Double_t)fNrStrips-nuIn)/(nuOut-nuIn);
166  nuOut = Double_t(fNrStrips);
167  }
168 
169  // only one strip hit ?
170  if (Int_t(nuIn) == Int_t(nuOut)){
171  // this strip collected the entire charge
172  InjectStripCharge(strips,(Int_t)nuOut,Q);
173  return strips;
174 
175  } else
176  { // more than one strip is hit
177  Double_t dQ=Q/std::fabs(nuOut-nuIn);
178  Double_t dir = (nuOut>nuIn) ? 1. : -1.;
179  Int_t nrHits = 0;
180 
181  // calculate portion of track in first strip
182  Int_t nextIn = Int_t(nuIn + 0.5+0.5*dir);
183  Double_t Q1 = dQ*std::fabs(nextIn-nuIn);
184  if (fVerboseLevel > 2){
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 ;
188  }
189  InjectStripCharge(strips,(Int_t)nuIn,Q1);
190  nrHits++;
191  Q -= Q1;
192 
193  // calculate portion of track in last strip
194  Int_t prevOut = Int_t(nuOut + 0.5-0.5*dir);
195  Double_t Q2 = dQ*std::fabs(nuOut-prevOut);
196  if (fVerboseLevel > 2){
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 ;
200  }
201  InjectStripCharge(strips,(Int_t)nuOut,Q2);
202  nrHits++;
203  Q -= Q2;
204 
205  // Distribute the charge amongst the intermediate strips
206  nextIn = Int_t(nextIn - 0.5 + 0.5*dir);
207  prevOut = Int_t(prevOut - 0.5 + 0.5*dir);
208  if (fVerboseLevel > 2) {
209  std::cout<<" dir="<<Int_t(dir)<<std::endl;
210  std::cout<<" begin="<<nextIn<<" end="<<prevOut<<std::endl;
211  }
212 
213  for (Int_t n = nextIn ; n != prevOut; n += Int_t(dir) )
214  {
215  if (fVerboseLevel > 2) std::cout<<" n = "<<n<<std::endl;
216  InjectStripCharge(strips,n,dQ);
217  nrHits++;
218  Q -= dQ;
219  }
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;
222  }
223 
224  return strips;
225 }
Int_t fNrStrips
strip orientation angle to x axis
int n
Int_t fVerboseLevel
vector orthogonal to strip direction
Double_t
friend F32vec4 fabs(const F32vec4 &a)
Definition: P4_F32vec4.h:47
void InjectStripCharge(std::vector< PndSdsStrip > &array, Int_t istrip, Double_t charge)
Double_t PndSdsCalcStrip::GetThreshold ( ) const
inline

Definition at line 117 of file PndSdsCalcStrip.h.

References fThreshold.

Referenced by PndSdsChargeWeightingAlgorithms::CenterOfGravity().

117 {return fThreshold;}
Double_t fThreshold
anchor point on first strip
void PndSdsCalcStrip::InjectStripCharge ( std::vector< PndSdsStrip > &  array,
Int_t  istrip,
Double_t  charge 
)
private

Definition at line 323 of file PndSdsCalcStrip.cxx.

References Double_t, fNrStrips, fThreshold, fVerboseLevel, and SmearCharge().

Referenced by GetStripsDif(), and GetStripsNoDif().

324 {
325  if(istrip<0) {if(fVerboseLevel>2)Warning("InjectStripCharge","Invalid strip number: %i < 0",istrip); return;}
326  if(istrip>fNrStrips) {if(fVerboseLevel>2)Warning("InjectStripCharge","Invalid strip number: %i > %i",istrip,fNrStrips); return;}
327  if(charge==0) return; // cut zero electron charge now, real threshold later
328  Double_t smearedQ = SmearCharge(charge);
329  if(smearedQ < fThreshold) {if(fVerboseLevel>3)Info("InjectStripCharge","Strip %i, charge %f below threshold %f",istrip,smearedQ,fThreshold); 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) );
332  return;
333 }
Double_t SmearCharge(Double_t charge)
Int_t fNrStrips
strip orientation angle to x axis
Class representing strips on wafer-scale.
Definition: PndSdsStrip.h:15
Int_t fVerboseLevel
vector orthogonal to strip direction
Double_t
Double_t fThreshold
anchor point on first strip
void PndSdsCalcStrip::Print ( ) const

Definition at line 344 of file PndSdsCalcStrip.cxx.

References fAnchor, fNrFeChannels, fNrStrips, fOrient, fPitch, fStripDir, and Pi.

Referenced by PndSdsCalcStrip().

345 {
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;
351  std::cout<<" nr of frontends = "<<fNrStrips/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;
354 }
Int_t fNrStrips
strip orientation angle to x axis
Int_t fNrFeChannels
Nr. of strips on active area.
Double_t fOrient
strip pitch (cm)
TVector2 fStripDir
Charge diffusion.
Double_t Pi
TVector2 fAnchor
Nr of Channels per FE.
void PndSdsCalcStrip::SetVerboseLevel ( Int_t  level)
inline

Definition at line 115 of file PndSdsCalcStrip.h.

References fVerboseLevel.

115 { fVerboseLevel = level;}
Int_t fVerboseLevel
vector orthogonal to strip direction
Double_t PndSdsCalcStrip::SmearCharge ( Double_t  charge)
private

Definition at line 336 of file PndSdsCalcStrip.cxx.

References Double_t, fNoise, and fVerboseLevel.

Referenced by InjectStripCharge().

337 {
338  Double_t smeared = gRandom->Gaus(charge,fNoise);
339  if (fVerboseLevel > 3) Info("SmearCharge:"," charge = %f, smeared = %f",charge,smeared);
340  return smeared;
341 }
Int_t fVerboseLevel
vector orthogonal to strip direction
Double_t
Double_t fNoise
charge threshold

Member Data Documentation

TVector2 PndSdsCalcStrip::fAnchor
private

Nr of Channels per FE.

Definition at line 127 of file PndSdsCalcStrip.h.

Referenced by CalcStripFromPoint(), CalcStripPointOnLine(), PndSdsCalcStrip(), and Print().

Double_t PndSdsCalcStrip::fCSigma
private

ENC.

Definition at line 130 of file PndSdsCalcStrip.h.

Referenced by GetStrips(), GetStripsDif(), and PndSdsCalcStrip().

Double_t PndSdsCalcStrip::fNoise
private

charge threshold

Definition at line 129 of file PndSdsCalcStrip.h.

Referenced by GetNoise(), PndSdsCalcStrip(), and SmearCharge().

Int_t PndSdsCalcStrip::fNrFeChannels
private

Nr. of strips on active area.

Definition at line 126 of file PndSdsCalcStrip.h.

Referenced by CalcChannelfromStrip(), CalcFeChToStrip(), CalcFEfromStrip(), PndSdsCalcStrip(), and Print().

Int_t PndSdsCalcStrip::fNrStrips
private

strip orientation angle to x axis

Definition at line 125 of file PndSdsCalcStrip.h.

Referenced by CalcFeChToStrip(), GetStripsNoDif(), InjectStripCharge(), PndSdsCalcStrip(), and Print().

Double_t PndSdsCalcStrip::fOrient
private

strip pitch (cm)

Definition at line 124 of file PndSdsCalcStrip.h.

Referenced by PndSdsCalcStrip(), and Print().

TVector2 PndSdsCalcStrip::fOrthoDir
private

vector perpendicular to strip direction

Definition at line 132 of file PndSdsCalcStrip.h.

Referenced by CalcStripFromPoint(), CalcStripPointOnLine(), and PndSdsCalcStrip().

Double_t PndSdsCalcStrip::fPitch
private
TVector2 PndSdsCalcStrip::fStripDir
private

Charge diffusion.

Definition at line 131 of file PndSdsCalcStrip.h.

Referenced by GetStripDirection(), PndSdsCalcStrip(), and Print().

Double_t PndSdsCalcStrip::fThreshold
private

anchor point on first strip

Definition at line 128 of file PndSdsCalcStrip.h.

Referenced by GetThreshold(), InjectStripCharge(), and PndSdsCalcStrip().

Int_t PndSdsCalcStrip::fVerboseLevel
private

vector orthogonal to strip direction

Definition at line 133 of file PndSdsCalcStrip.h.

Referenced by GetStrips(), GetStripsAlternative(), GetStripsNoDif(), InjectStripCharge(), PndSdsCalcStrip(), SetVerboseLevel(), and SmearCharge().


The documentation for this class was generated from the following files: