Go to the documentation of this file.
41 fN = n * (2 *
NR + 1);
42 Double_t epsilon(1.e-3 * W), dw(2 *
fdW), dh(2 *
fdH);
44 Double_t bx0((-
NC - 0.5) * W), by0, xv, yv;
45 for (Int_t jcol(-
NC); jcol <=
NC; jcol++) {
46 for (Int_t jx(0); jx < n; jx++, bx0 += dw) {
50 by0 = (-
NR - 0.5) * H;
51 for (Int_t jrow(-
NR); jrow <=
NR; jrow++) {
52 for (Int_t jy(0); jy < n; jy++, by0 += dh) {
59 Int_t up1 =
GetSide(bx0 - jcol * W + dw - epsilon,
60 by0 - jrow * H + epsilon),
61 up2 =
GetSide(bx0 - jcol * W + epsilon,
62 by0 - jrow * H + dh - epsilon);
74 fPRFx =
new TF1(
"prfx",
"gaus", -(
NC + .5) *
fW, (
NC + .5) *
fW);
75 fPRFx->SetParameters(1, 0., 0.46 *
fW);
76 fPRFy =
new TF1(
"prfy",
"gaus", -(
NR + .5) *
fH, (
NR + .5) *
fH);
77 fPRFy->SetParameters(1, 0., 0.46 *
fW);
98 Int_t nbinx(
fX.size() /
fN / 2);
100 for (Int_t ix(nbinx); ix < 2 * nbinx; ix++) {
102 if (
x >
fX[ix *
fN] +
fdW)
continue;
104 if (TMath::Abs(
fX[ix *
fN] -
x) <=
fdW) {
110 for (Int_t ix(nbinx); ix--;) {
112 if (
x <
fX[ix *
fN] -
fdW)
continue;
114 if (TMath::Abs(
fX[ix *
fN] -
x) <=
fdW) {
120 if (binx < 0)
return kFALSE;
125 for (Int_t iy(nbiny); iy <
fN; iy++) {
126 if (
y <
fY[iy] -
fdH)
break;
127 if (
y >
fY[iy] +
fdH)
continue;
129 if (TMath::Abs(
fY[iy] -
y) <=
fdH) {
135 for (Int_t iy(nbiny); iy--;) {
136 if (
y >
fY[iy] +
fdH)
break;
137 if (
y <
fY[iy] -
fdH)
continue;
139 if (TMath::Abs(
fY[iy] -
y) <=
fdH) {
145 if (biny < 0)
return kFALSE;
171 col = TMath::Nint(
fX[bin] /
fW) +
NC;
172 row = TMath::Nint(
fY[bin] /
fH) +
NR;
183 if (x < -0.5 * fW || x > 0.5 *
fW) {
184 printf(
"x[%f] outside range\n",
x);
188 if (y < -0.5 * fH || y > 0.5 *
fH) {
189 printf(
"y[%f] outside range\n",
y);
202 if ((
fBinx + 1) *
fN >=
static_cast<Int_t
>(
fX.size()))
return kFALSE;
212 if (
fBiny + 1 >=
fN)
return kFALSE;
220 if (strcmp(opt,
"all") != 0)
return;
221 for (UInt_t
i(0);
i <
fX.size();
i++) {
222 if (
i &&
i %
fN == 0) printf(
"\n\n");
223 printf(
"%2d(%5.2f %5.2f) ",
fUp[
i],
fX[
i],
fY[
i]);
233 if ((
fBinx - 1) *
fN < 0)
return kFALSE;
243 if (
fBiny - 1 < 0)
return kFALSE;
std::vector< Char_t > fUp
1 for the upper pad, -1 for the bottom pad and 0 on the boundary
std::vector< Double_t > fY
position of bin center across wires
Double_t fdW
bin half width
Bool_t PrevBinY()
Move current bin down.
Double_t fSlope
slope of triangle H/W
Int_t fBinx0
Offset bin in the map - x direction.
Int_t fBiny0
Offset bin in the map - y direction.
Double_t fY0
y coordinate of cluster
Int_t fBinx
Current bin in the map - x direction.
Int_t fBiny
Current bin in the map - y direction.
TF1 * fPRFx
PRF model along wires.
Bool_t NextBinX()
Move current bin to the right.
Bool_t PrevBinX()
Move current bin to the left.
virtual ~CbmTrdTrianglePRF()
Bool_t SetOrigin(Double_t x, Double_t y)
Set map offset @ point (x,y)
void Print(Option_t *opt="") const
void GetCurrentPad(Int_t &col, Int_t &row, Int_t &u) const
Compute the pad corresponding to current bin.
@ NR
no. of neighbor rows (except the hit) to be considered in cluster definition
ClassImp(CbmConverterManager) InitStatus CbmConverterManager
CbmTrdTrianglePRF(Float_t W, Float_t H, Int_t n=20)
Build map.
std::vector< Double_t > fX
position of bin center along wires
Bool_t GetBin(Double_t x, Double_t y, Int_t &binx, Int_t &biny) const
Find bin for point (x,y)
Double_t GetChargeFraction() const
Compute charge fraction on the current bin.
@ NC
no. of neighbor columns (except the hit) to be considered in cluster definition
Double_t fdH
bin half height
TF1 * fPRFy
PRF model across wires.
Bool_t NextBinY()
Move current bin up.
Double_t fX0
Index of bin in the map corresponding to cluster center - y direction.
Double_t fNorm
normalization factor for the 2D Gauss distribution
Utility for converting energy to signal over the triangular pad geometry (Bucharest prototype)
Int_t GetSide(const Float_t x, const Float_t y) const
Define triangular pad type.