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++ ) {
124 TString opt = option;
135 TString opt = option;
140 if (view == 0) cout <<
"no view found" << endl;
153 f_xx =
new Double_t[
fN+1];
154 f_yy =
new Double_t[
fN+1];
157 for ( Int_t i = 0; i <
fN; i++ ) {
183 const Int_t inaxis = 7;
188 Int_t puxmin = gPad->XtoAbsPixel(gPad->GetUxmin());
189 Int_t puymin = gPad->YtoAbsPixel(gPad->GetUymin());
190 Int_t puxmax = gPad->XtoAbsPixel(gPad->GetUxmax());
191 Int_t puymax = gPad->YtoAbsPixel(gPad->GetUymax());
194 if (px < puxmin - inaxis)
return dist;
195 if (py > puymin + inaxis)
return dist;
196 if (px > puxmax + inaxis)
return dist;
197 if (py < puymax - inaxis)
return dist;
203 if (!view)
return dist;
205 Bool_t inPolygon =
true;
206 Int_t x1, y1, x2, y2, cx, cy;
207 Double_t Pndc[3], k, b, pb, cb;
210 cx = gPad->XtoAbsPixel(Pndc[0]);
211 cy = gPad->YtoAbsPixel(Pndc[1]);
216 for (Int_t i = 0; i <
fN; i++) {
218 x1 = gPad->XtoAbsPixel(Pndc[0]);
219 y1 = gPad->YtoAbsPixel(Pndc[1]);
227 x2 = gPad->XtoAbsPixel(Pndc[0]);
228 y2 = gPad->YtoAbsPixel(Pndc[1]);
233 if ((px-x1)*(cx-x1) <= 0) {
239 k = Double_t(y2-y1)/(x2-x1);
243 if ((pb-b)*(cb-b) <= 0) {
250 if (inPolygon ==
true) {
275 TView *view =
dynamic_cast<TView*
>(gPad->GetView());
277 view->WCtoNDC(&
fP[0], Pndc);
283 fInfoBox =
new TPaveText(Pndc[0], Pndc[1],
284 Pndc[0]+0.4, Pndc[1]+0.1);
298 else return TObject::GetObjectInfo(px, py);
307 for ( Int_t i = 0; i <
fN; i++ ) {
309 fP[(i*3)+1] = TMath::Sign(1.,Double_t(
fP[(i*3)+1])) *
fP[(i*3)+1];
312 fP[(i*3)+1] = TMath::Sign(1,sign) *
fP[(i*3)+1];
328 for ( Int_t i = 0; i < 3; i++ ) {
329 for ( Int_t j = 0; j <
fN; j++ ) {
330 fP[3*j+i] =
C[i] + ScaleFactor*(
fP[3*j+i]-
C[i]);
340 for ( Int_t i = 0; i < 3; i++ ) {
342 for ( Int_t j = 0; j <
fN; j++ ) Center[i] +=
fP[3*j+i];
352 for (Int_t i = 0; i <
fN; i++) {
353 TVector3
vec(
fP[i*3],
fP[i*3+1],
fP[i*3+2]);
354 Double_t r =
vec.Pt();
355 Double_t newPhi =
vec.Phi() + phi*TMath::DegToRad();
356 fP[i*3] = r *
cos(newPhi);
357 fP[i*3+1] = r *
sin(newPhi);
365 for (Int_t i = 0; i <
fN*3; i++) {
374 if (size > 0.95) size = 0.98;
375 if (size < 0.15) size = 0.2;
377 for (Int_t i = 0; i < 3; i++) {
378 for (Int_t j = 0; j <
fN; j++) {
379 fP[3*j+i] = size *
fP[3*j+i] + (1.0-size) *
fCenter[i];
391 Double_t
s = TMath::Sqrt(sx * sx + sy * sy + sz * sz);
397 for (Int_t i = 0; i <
fN; ++i)
399 Double_t dot = (
fP[3*i] -
C[0]) * V[0] + (
fP[3*i+1] -
C[1]) * V[1] + (
fP[3*i+2] -
C[2]) * V[2];
400 for (Int_t j = 0; j < 3; ++j)
402 fP[3*i+j] += dot * (factor - 1) * V[j];
double sin(const BesAngle a)
double cos(const BesAngle a)
double P(RecMdcKalTrack *trk)
***************************************************************************************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 Stretch(Double_t sx, Double_t sy, Double_t sz, Double_t factor)
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)