46 fN = n * (2 *
NR + 1);
47 Double_t epsilon(1.e-3 * W), dw(2 *
fdW), dh(2 *
fdH);
49 Double_t bx0((-
NC - 0.5) * W), by0, xv, yv;
50 for (Int_t jcol(-
NC); jcol <=
NC; jcol++) {
51 for (Int_t jx(0); jx < n; jx++, bx0 += dw) {
55 by0 = (-
NR - 0.5) * H;
56 for (Int_t jrow(-
NR); jrow <=
NR; jrow++) {
57 for (Int_t jy(0); jy < n; jy++, by0 += dh) {
64 Int_t up1 =
GetSide(bx0 - jcol * W + dw - epsilon, by0 - jrow * H + epsilon),
65 up2 =
GetSide(bx0 - jcol * W + epsilon, by0 - jrow * H + dh - epsilon);
67 if (up1 != up2)
fUp.push_back(0);
76 fPRFx =
new TF1(
"prfx",
"gaus", -(
NC + .5) *
fW, (
NC + .5) *
fW);
77 fPRFx->SetParameters(1, 0., 0.46 *
fW);
78 fPRFy =
new TF1(
"prfy",
"gaus", -(
NR + .5) *
fH, (
NR + .5) *
fH);
79 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;
172 col = TMath::Nint(
fX[bin] /
fW) +
NC;
173 row = TMath::Nint(
fY[bin] /
fH) +
NR;
186 printf(
"x[%f] outside range\n",
x);
191 printf(
"y[%f] outside range\n",
y);
205 if ((
fBinx + 1) *
fN >=
static_cast<Int_t
>(
fX.size()))
return kFALSE;
216 if (
fBiny + 1 >=
fN)
return kFALSE;
225 if (strcmp(opt,
"all") != 0)
return;
226 for (UInt_t i(0); i <
fX.size(); i++) {
227 if (i && i %
fN == 0) printf(
"\n\n");
228 printf(
"%2d(%5.2f %5.2f) ",
fUp[i],
fX[i],
fY[i]);
239 if ((
fBinx - 1) *
fN < 0)
return kFALSE;
250 if (
fBiny - 1 < 0)
return kFALSE;
ClassImp(CbmConverterManager)
Utility for converting energy to signal over the triangular pad geometry (Bucharest prototype)
Double_t fNorm
normalization factor for the 2D Gauss distribution
Bool_t NextBinX()
Move current bin to the right.
Bool_t PrevBinX()
Move current bin to the left.
std::vector< Double_t > fX
position of bin center along wires
TF1 * fPRFy
PRF model across wires.
Bool_t SetOrigin(Double_t x, Double_t y)
Set map offset @ point (x,y)
Double_t fdH
bin half height
@ NC
no. of neighbor columns (except the hit) to be considered in cluster definition
@ NR
no. of neighbor rows (except the hit) to be considered in cluster definition
CbmTrdTrianglePRF(Float_t W, Float_t H, Int_t n=20)
Build map.
Double_t fSlope
slope of triangle H/W
void Print(Option_t *opt="") const
TF1 * fPRFx
PRF model along wires.
Double_t GetChargeFraction() const
Compute charge fraction on the current bin.
Double_t fX0
Index of bin in the map corresponding to cluster center - y direction.
void GetCurrentPad(Int_t &col, Int_t &row, Int_t &u) const
Compute the pad corresponding to current bin.
Bool_t NextBinY()
Move current bin up.
Double_t fY0
y coordinate of cluster
Int_t fBiny
Current bin in the map - y direction.
Int_t fBinx
Current bin in the map - x direction.
std::vector< Double_t > fY
position of bin center across wires
Int_t GetSide(const Float_t x, const Float_t y) const
Define triangular pad type.
virtual ~CbmTrdTrianglePRF()
std::vector< Char_t > fUp
1 for the upper pad, -1 for the bottom pad and 0 on the boundary
Bool_t PrevBinY()
Move current bin down.
Bool_t GetBin(Double_t x, Double_t y, Int_t &binx, Int_t &biny) const
Find bin for point (x,y)
Double_t fdW
bin half width
Int_t fBiny0
Offset bin in the map - y direction.
Int_t fBinx0
Offset bin in the map - x direction.