40 printf(
"x=%7f y=%7f\n",x,y);
46 for(Int_t i=0; i<8; i++) points[i] = otrap.
points[i];
52 Error(
"operator[]",
"index=%i out of bounds! Set index=0", i);
85 if(rib<0 || rib>11)
return kFALSE;
111 if(fabs(dX) > fabs(dY)) {
112 if(dX == 0.)
return kFALSE;
113 Double_t coeff = dY/dX;
115 for(Int_t k=0;k<8;k++)
if(k!=i && k!=j) {
118 if(yt > 0.0) fl |= 1;
119 else if(yt < 0.0) fl |= 2;
120 if(fl==3)
return kFALSE;
123 if(dY == 0.)
return kFALSE;
124 Double_t coeff = dX/dY;
126 for(Int_t k=0;k<8;k++)
if(k!=i && k!=j) {
128 if(xt > 0.0) fl |= 1;
129 else if(xt < 0.0) fl |= 2;
130 if(fl==3)
return kFALSE;
153 for(Int_t nr=1;nr<nRibs;nr++) if(p1[nr]>=0) {
154 if (p1[nr] == pnt) pnt = p2[nr];
155 else if(p2[nr] == pnt) pnt = p1[nr];
157 if(pnt == pnt0)
break;
169 printf(
"\nTrap. from 8 points:\n");
170 for(Int_t i=0; i<8; i++) {
190 Error(
"operator[]",
"index=%i out of bounds! Set index=0", i);
239 printf(
"\nPolygon on the plane from %i points:\n",
nPoints);
240 for(Int_t i=0; i<
nPoints; i++) {
256 }
else Error(
"addPoint",
"Too many points (>16).");
269 }
else Error(
"addPoint",
"Too many points (>16).");
283 dir = x1 < x2 ? 1 : -1;
288 Int_t& yMin,Int_t& yMax)
const {
318 if(line>=
nPoints)
return kFALSE;
329 if( !
getLineInd(line,ip1,ip2) )
return kFALSE;
332 Double_t y1 = p1.
getY();
333 Double_t y2 = p2.
getY();
334 if((y<y1 && y<y2) || (y>y1 && y>y2))
return kFALSE;
343 Double_t y1 = p1.
getY();
344 Double_t y2 = p2.
getY();
345 Double_t x1 = p1.
getX();
346 Double_t x2 = p2.
getX();
347 return (y-y1)/(y1-y2)*(x1-x2) + x1;
358 if(y <
points[p2].getY())
break;
361 if(y <
points[p2].getY())
break;
367 Double_t& x1,Double_t& x2) {
372 Double_t& y1 = y1i < y2i ? y1i : y2i;
373 Double_t& y2 = y1i < y2i ? y2i : y1i;
391 if(y1 > yp2)
continue;
393 if(y1 >= yp1) x1 = TMath::Min(x1,
calcX(p1,
p2,y1));
395 if(y2 > yp2)
continue;
396 if(y2 >= yp1) x1 = TMath::Min(x1,
calcX(p1,
p2,y2));
403 if(y1 > yp2)
continue;
405 if(y1 >= yp1) x2 = TMath::Max(x2,
calcX(p1,
p2,y1));
407 if(y2 > yp2)
continue;
408 if(y2 >= yp1) x2 = TMath::Max(x2,
calcX(p1,
p2,y2));
418 Double_t c = rt(0)*rt(4)-rt(3)*rt(1);
420 parA = (rt(3)*rt(7)-rt(6)*rt(4))/c;
421 parB = (rt(6)*rt(1)-rt(0)*rt(7))/c;
426 printf(
"Plane equation: %g*x%+g*y+z=%g\n",
parA,
parB,
parD);
438 parB = (p12.
Z()*p13.
X()-p13.
Z()*p12.
X())/(p13.
Y()*p12.
X()-p12.
Y()*p13.
X());
439 if(p12.
X() != 0.)
parA = -(
parB*p12.
Y() + p12.
Z())/p12.
X();
453 parB = (p12.
Z()*p13.
X()-p13.
Z()*p12.
X())/(p13.
Y()*p12.
X()-p12.
Y()*p13.
X());
454 if(p12.
X() != 0.)
parA = -(
parB*p12.
Y() + p12.
Z())/p12.
X();
470 Double_t& err)
const {
505 printf(
"Point x=%7f y=%7f z=%7f on the plane %g*x%+g*y+z=%g\n",
526 if(
sec==-1 || m<0 || m>3)
mod = -1;
533 Double_t cosPhi = TMath::Cos(phi);
534 Double_t sinPhi = TMath::Sin(phi);
535 Double_t
x1 = -r*sinPhi;
536 Double_t
y1 = r*cosPhi;
537 Double_t
dZ = TMath::Cos(theta);
538 Double_t dxy = TMath::Sqrt(1.-dZ*dZ)*100.;
539 Double_t
x2 = dxy*cosPhi+
x1;
540 Double_t
y2 = dxy*sinPhi+
y1;
541 Double_t
z2 = dZ*100.+z;
547 Double_t ph = TMath::ATan2(
dY(),
dX());
548 if(ph >= 0.)
return ph;
549 return TMath::TwoPi()+ph;
Double_t getYMin(void) const
HGeomVector & operator[](Int_t i)
Int_t nextXMaxP(Int_t p) const
Int_t nextP(Int_t p) const
Int_t getXYContour(HMdcTrapPlane &tr)
void getXYMinMax(Int_t &xMin, Int_t &xMax, Int_t &yMin, Int_t &yMax) const
Int_t nextXMinP(Int_t p) const
HGeomVector getNormalUnitVector(void) const
void transTo(const HGeomTransform *tr, Int_t sec=-3, Int_t mod=-3)
TGraph p2(xdim, pgrid, respme)
void transTo(const HGeomTransform *trans)
ClassImp(HDbColumn) HDbColumn
Int_t twoContoursSum(const HMdcTrapPlane &c1i, const HMdcTrapPlane &c2i)
Bool_t getLineInd(Int_t line, Int_t &p1, Int_t &p2) const
void copy(HMdcTrapPlane &otrap)
HMdcPointPlane points[16]
Bool_t getXminXmax(Double_t y, Double_t &x1, Double_t &x2)
void transFrom(const HGeomTransform *trans)
void transTo(const HGeomTransform *trans)
void copy(HMdcTrap &otrap) const
void calcPoint(Double_t x1, Double_t y1, Double_t z1, Double_t x2, Double_t y2, Double_t z2)
Double_t getPhiRad(void) const
Int_t prevXMinP(Int_t p) const
void setPlanePar(const HMdcPlane &p)
void transFrom(const HGeomTransform *tr, Int_t sec=-3, Int_t mod=-3)
Double_t calcMinDistance(Double_t x, Double_t y, Double_t z) const
void transFrom(const HGeomTransform &s)
Double_t normalLength(void) const
void setSegmentLine(Double_t r, Double_t z, Double_t theta, Double_t phi)
Double_t calcX(Int_t ip1, Int_t ip2, Double_t y) const
void set(const HMdcPointPlane &point)
void transTo(const HGeomTransform &s)
Bool_t getRibInXYContour(Int_t rib, Int_t &i, Int_t &j)
TGraph p1(xdim, pgrid, resplo)
void transFrom(const HGeomTransform *trans)
Double_t calcMinDistanceAndErr(const HGeomVector &p, const HGeomVector &dp, Double_t &err) const
void setCoorSys(Int_t s, Int_t m=-1)
HMdcPointPlane & operator[](Int_t i)
void set(const HMdcTrapPlane &otrap)
TCanvas c1("HAFT","HADES Acceptance Filter for Theorists", 100, 100, 700, 700)
Bool_t getRibInd(Int_t rib, Int_t &ind1, Int_t &ind2)
Int_t prevP(Int_t p) const
void set(const HMdcTrap &otrap)
Bool_t getXCross(Int_t line, Double_t y, Double_t &x) const
void addPoint(const HGeomVector &v)
HGeomVector getNormalVector(void) const
TGraph p3(xdim, pgrid, resphi)