9#include "BesVisLib/BesView.h"
10#include "BesVisLib/BesPolygon2D.h"
47int BesPolygon2D::num = 0;
68 Int_t N, Double_t *
P) :
69 TNamed(name, title), TAttLine(), TAttFill() {
77 fP =
new Double_t[
fN*3];
87 for ( Int_t i = 0; i <
fN*3; i++ ) {
91 for (Int_t j = 0; j < 3; j++) {
93 for ( Int_t i = 0; i <
fN; i++) {
99 for ( Int_t i = 0; i <
fN; i++ ) {
114 if (
fP)
delete []
fP;
123 TString opt = option;
134 TString opt = option;
139 if (view == 0) cout <<
"no view found" << endl;
152 f_xx =
new Double_t[
fN+1];
153 f_yy =
new Double_t[
fN+1];
156 for ( Int_t i = 0; i <
fN; i++ ) {
182 const Int_t inaxis = 7;
187 Int_t puxmin = gPad->XtoAbsPixel(gPad->GetUxmin());
188 Int_t puymin = gPad->YtoAbsPixel(gPad->GetUymin());
189 Int_t puxmax = gPad->XtoAbsPixel(gPad->GetUxmax());
190 Int_t puymax = gPad->YtoAbsPixel(gPad->GetUymax());
193 if (px < puxmin - inaxis)
return dist;
194 if (py > puymin + inaxis)
return dist;
195 if (px > puxmax + inaxis)
return dist;
196 if (py < puymax - inaxis)
return dist;
202 if (!view)
return dist;
204 Bool_t inPolygon =
true;
205 Int_t x1, y1, x2, y2, cx, cy;
206 Double_t Pndc[3], k, b, pb, cb;
209 cx = gPad->XtoAbsPixel(Pndc[0]);
210 cy = gPad->YtoAbsPixel(Pndc[1]);
215 for (Int_t i = 0; i <
fN; i++) {
217 x1 = gPad->XtoAbsPixel(Pndc[0]);
218 y1 = gPad->YtoAbsPixel(Pndc[1]);
226 x2 = gPad->XtoAbsPixel(Pndc[0]);
227 y2 = gPad->YtoAbsPixel(Pndc[1]);
232 if ((px-x1)*(cx-x1) <= 0) {
238 k = Double_t(y2-y1)/(x2-x1);
242 if ((pb-b)*(cb-b) <= 0) {
249 if (inPolygon ==
true) {
274 TView *view = (TView*)gPad->GetView();
276 view->WCtoNDC(&
fP[0], Pndc);
282 fInfoBox =
new TPaveText(Pndc[0], Pndc[1],
283 Pndc[0]+0.4, Pndc[1]+0.1);
297 else return TObject::GetObjectInfo(px, py);
306 for ( Int_t i = 0; i <
fN; i++ ) {
308 fP[(i*3)+1] = TMath::Sign(1.,Double_t(
fP[(i*3)+1])) *
fP[(i*3)+1];
311 fP[(i*3)+1] = TMath::Sign(1,sign) *
fP[(i*3)+1];
327 for ( Int_t i = 0; i < 3; i++ ) {
328 for ( Int_t j = 0; j <
fN; j++ ) {
329 fP[3*j+i] =
C[i] + ScaleFactor*(
fP[3*j+i]-
C[i]);
339 for ( Int_t i = 0; i < 3; i++ ) {
341 for ( Int_t j = 0; j <
fN; j++ ) Center[i] +=
fP[3*j+i];
351 for (Int_t i = 0; i <
fN; i++) {
352 TVector3
vec(
fP[i*3],
fP[i*3+1],
fP[i*3+2]);
353 Double_t r =
vec.Pt();
354 Double_t newPhi =
vec.Phi() + phi*TMath::DegToRad();
355 fP[i*3] = r *
cos(newPhi);
356 fP[i*3+1] = r *
sin(newPhi);
364 for (Int_t i = 0; i <
fN*3; i++) {
373 if (size > 0.95) size = 0.98;
374 if (size < 0.15) size = 0.2;
376 for (Int_t i = 0; i < 3; i++) {
377 for (Int_t j = 0; j <
fN; j++) {
378 fP[3*j+i] = size *
fP[3*j+i] + (1.0-size) *
fCenter[i];
double P(RecMdcKalTrack *trk)
double sin(const BesAngle a)
double cos(const BesAngle a)
***************************************************************************************Pseudo Class RRes *****************************************************************************************Parameters and physical constants **Maarten sept ************************************************************************DOUBLE PRECISION xsmu **************************************************************************PARTICLE DATA all others are from PDG *Only resonances with known widths into electron pairs are sept ************************************************************************C Declarations C
ClassImp(TBossFullEvent) TBossFullEvent
virtual void SetZRSign(Int_t sign)
virtual void SetSize(Double_t size)
virtual void Paint(Option_t *option="")
virtual Int_t DistancetoPrimitive(Int_t px, Int_t py)
virtual void SetInfoBox()
void SetPoints(Double_t *P)
virtual void Resize(Double_t ScaleFactor)
virtual void ExecuteEvent(Int_t event, Int_t px, Int_t py)
virtual void GetCenter(Double_t *Center) const
virtual char * GetObjectInfo(Int_t px, Int_t py) const
virtual void RotatePhi(Double_t phi)
virtual void Draw(Option_t *option="")
virtual void WCtoNDC(const Float_t *pw, Float_t *pn)
virtual char * GetObjectInfo(Int_t px, Int_t py) const
virtual void ExecuteEvent(Int_t event, Int_t px, Int_t py)