6#include "BesVisLib/Mdc2DWire.h"
7#include "BesVisLib/BesView.h"
8#include "BesVisLib/BesCursor.h"
39 fColorfulWire =
false;
43 Double_t r = 0.25*(rmax-rmin);
46 Double_t dx = fabs(r*
cos(phi));
47 Double_t dy = fabs(r*
sin(phi));
48 Double_t
P[12] = { center[0] - dx, center[1] - dy, center[2] - dz,
49 center[0] + dx, center[1] + dy, center[2] - dz,
50 center[0] - dx, center[1] - dy, center[2] + dz,
51 center[0] + dx, center[1] + dy, center[2] + dz
68 fColorfulWire =
false;
71 Double_t *tubeP = &
P[3*N/2];
76 for (Int_t i = 0; i < 3; i++) {
77 fWestHole[i] = (
P[i] +
P[3+i] +
P[6+i] +
P[9+i] )/4.0;
78 fEastHole[i] = (
P[12+i] +
P[15+i] +
P[18+i] +
P[21+i])/4.0;
80 TVector3 westVec(fWestHole[0], fWestHole[1], fWestHole[2]);
81 TVector3 eastVec(fEastHole[0], fEastHole[1], fEastHole[2]);
82 fWestPhi = westVec.Phi() * TMath::RadToDeg();
83 fEastPhi = eastVec.Phi() * TMath::RadToDeg();
84 if (fWestPhi < 0.0) fWestPhi += 360.0;
85 if (fEastPhi < 0.0) fEastPhi += 360.0;
88 Double_t rMax = sqrt( (
P[4*3] -
P[7*3]) * (
P[4*3]-
P[7*3]) +
89 (
P[4*3+1]-
P[7*3+1]) * (
P[4*3+1]-
P[7*3+1]) +
90 (
P[4*3+2]-
P[7*3+2]) * (
P[4*3+2]-
P[7*3+2]) ) / 2.0;
92 Double_t rMinRatio = 0.0001;
93 Double_t rMaxRatio = 0.8;
96 Double_t edge = rMaxRatio*0.0001;
97 for (Int_t i = 0; i < 3; i++) {
98 newP[i] = (0.5+edge*rMinRatio)*(
P[i]+
P[3+i])*0.5
99 + (0.5-edge*rMinRatio)*(
P[6+i]+
P[9+i])*0.5;
100 newP[3+i] = (0.5-edge*rMinRatio)*(
P[i]+
P[3+i])*0.5
101 + (0.5+edge*rMinRatio)*(
P[6+i]+
P[9+i])*0.5;
102 newP[6+i] = (0.5+edge*rMaxRatio)*(
P[12+i]+
P[15+i])*0.5
103 + (0.5-edge*rMaxRatio)*(
P[18+i]+
P[21+i])*0.5;
104 newP[9+i] = (0.5-edge*rMaxRatio)*(
P[12+i]+
P[15+i])*0.5
105 + (0.5+edge*rMaxRatio)*(
P[18+i]+
P[21+i])*0.5;
107 fWireCone =
new BesPolygon2D(
"WireCone",
"WireCone", 4, &newP[0]);
110 new BesCircle2D(
"WireBubble",
"WireBubble", 0.0, rMaxRatio*rMax, &fEastHole[0]);
114 new BesMarker2D(
"MdcZRPos",
"MdcZRPos", fEastHole[0], fEastHole[1], fEastHole[2]);
127 delete fZRPosMarker2D;
151 if (fWireType == 1) lcWire = kGreen;
152 if (fWireType == 2) lcWire = kBlue;
163 fcCircleFired = 1004;
164 fcConeFired = kBlack;
165 fsCircleFired = 1001;
171 fcCircleHL = kMagenta;
196 if (fInfoCon.size() == 0) fInfoCon.push_back(GetTitle());
200 cout <<
"Mdc2DWire::CloseInfo, not initialized" << endl;
211 if (fZRPosMarker2D) {
221 return fZRPosMarker2D->DistancetoPrimitive(px, py);
239 if (gPad) gPad->SetCursor(kPointer);
247 if ( fWireCircle ) origColor = fWireCircle->GetFillColor();
248 if ( fZRPosMarker2D ) origColor = fZRPosMarker2D->GetMarkerColor();
285 TString opt = option;
295 TString opt = option;
303 Double_t wcCenter[3], ncCenter[3];
305 view->
WCtoNDC(wcCenter, &ncCenter[0]);
306 Double_t x1, y1, x2, y2;
308 gPad->GetRange(x1, y1, x2, y2);
311 if (ncCenter[0] > x1-d && ncCenter[0] < x2+d &&
312 ncCenter[1] > y1-d && ncCenter[1] < y2+d) {
313 if (opt.Contains(
"TUBE") && fTube ) {
314 fTube->SetLineColor(lcTube);
315 fTube->SetLineWidth(lwTube);
316 fTube->SetFillColor(fcTube);
317 fTube->SetFillStyle(fsTube);
324 fWireCircle->SetLineColor(lcWireFired);
325 fWireCircle->SetLineWidth(lwCircleFired);
326 fWireCircle->SetFillColor(fcCircleFired);
327 fWireCircle->SetFillStyle(fsCircleFired);
330 fWireCone->SetLineColor(lcWireFired);
331 fWireCone->SetLineWidth(lwConeFired);
332 fWireCone->SetFillColor(fcConeFired);
333 fWireCone->SetFillStyle(fsConeFired);
338 fWireCone->SetLineColor(lcWire);
339 fWireCone->SetLineWidth(lwCone);
340 fWireCone->SetFillColor(fcCone);
341 fWireCone->SetFillStyle(fsCone);
344 fWireCircle->SetLineColor(lcWire);
345 fWireCircle->SetLineWidth(lwCircle);
346 fWireCircle->SetFillColor(fcCircle);
347 fWireCircle->SetFillStyle(fsCircle);
353 fWireCircle->SetLineColor(lcWireHL);
354 fWireCircle->SetLineWidth(lwCircleHL);
355 fWireCircle->SetFillColor(fcCircleHL);
356 fWireCircle->SetFillStyle(fsCircleHL);
359 fWireCone->SetLineColor(lcWireHL);
360 fWireCone->SetLineWidth(lwConeHL);
361 fWireCone->SetFillColor(fcConeHL);
362 fWireCone->SetFillStyle(fsConeHL);
365 if (opt.Contains(
"WIRE")) {
368 if (fWireCircle) fWireCircle->
Paint();
375 fZRPosMarker2D->
SetWCX(fZRSectionPos[0]);
376 fZRPosMarker2D->
SetWCY(fZRSectionPos[1]);
377 fZRPosMarker2D->
SetWCZ(fZRSectionPos[2]);
378 fZRPosMarker2D->SetMarkerColor(cMarker);
379 fZRPosMarker2D->SetMarkerStyle(sMarker);
383 if (fZRPosMarker2D) {
384 fZRPosMarker2D->SetMarkerColor(cMarkerFired);
385 fZRPosMarker2D->SetMarkerStyle(sMarkerFired);
389 if (fZRPosMarker2D) {
390 fZRPosMarker2D->SetMarkerColor(cMarker);
391 fZRPosMarker2D->SetMarkerStyle(sMarker);
396 if (fZRPosMarker2D) {
397 fZRPosMarker2D->SetMarkerColor(cMarkerHL);
398 fZRPosMarker2D->SetMarkerStyle(sMarkerHL);
402 if (opt.Contains(
"WIRE")) {
403 if (fZRPosMarker2D) fZRPosMarker2D->
Paint();
415 else return TObject::GetObjectInfo(px, py);
422 if (fWireType != 2)
return false;
430 Double_t zrPhi = viewPhi-90.0;
434 for (Int_t i = 0; i < 2; i++) {
440 if ( fabs(fEastPhi-fWestPhi) < 180.0 ) {
441 if ( (fEastPhi-zrPhi)*(fWestPhi-zrPhi) > 0.0 )
flag =
false;
443 Double_t factor = fabs( (fEastPhi-zrPhi)/(fEastPhi-fWestPhi) );
444 for (Int_t i = 0; i < 3; i++) {
445 fZRSectionPos[i] = factor*fWestHole[i] + (1.0-factor)*fEastHole[i];
452 if ( (fEastPhi-zrPhi)*(fWestPhi-zrPhi) < 0.0 )
flag =
false;
454 Double_t tempEastPhi = fEastPhi;
455 if (tempEastPhi >= 180.0) tempEastPhi -= 360.0;
456 Double_t tempWestPhi = fWestPhi;
457 if (tempWestPhi >= 180.0) tempWestPhi -= 360.0;
458 Double_t tempZRPhi = zrPhi;
459 if (tempZRPhi >= 180.0) tempZRPhi -= 360.0;
461 Double_t factor = fabs( (tempEastPhi-tempZRPhi)/(tempEastPhi-tempWestPhi) );
462 for (Int_t i = 0; i < 3; i++) {
463 fZRSectionPos[i] = factor*fWestHole[i] + (1.0-factor)*fEastHole[i];
478 if (input >= 360.0) {
482 while (input >= 360.0);
484 else if (input < 0.0) {
537 fColorfulWire = colorfulWire;
547 double tempMdcTime = mdcTime - evTime;
548 if(fabs(evTime)>0.0001) tempMdcTime += 230;
549 if(tempMdcTime>10000) {
551 }
else if(tempMdcTime>2000&&tempMdcTime<=10000){
553 }
else if(tempMdcTime<-10){
556 tempColor = 51 + (int) (tempMdcTime/40);
562 }
else if(mdcTime>2000&&mdcTime<=10000){
565 tempColor = 51 + (int) (mdcTime/40);
568 lcWireFired = tempColor;
578 }
else if(mdcCharge>2000&&mdcCharge<=30000){
581 tempColor = 51 + (int) (mdcCharge/40);
583 if(qOverflow) { tempColor = kBlack; }
584 fcCircleFired = tempColor;
588 fcCircleFired = 1004;
double P(RecMdcKalTrack *trk)
R__EXTERN BesCursor * gBesCursor
double sin(const BesAngle a)
double cos(const BesAngle a)
ClassImp(Mdc2DWire) Mdc2DWire
virtual void Paint(Option_t *option="")
virtual Int_t DistancetoPrimitive(Int_t px, Int_t py)
virtual void GetCenter(Double_t *center)
virtual void SetWCY(Float_t input)
virtual void SetMarkerSizeMultiple(Int_t input)
virtual void Paint(Option_t *option="")
virtual void SetWCZ(Float_t input)
virtual void SetWCX(Float_t input)
virtual void SetText(std::vector< TString > infoCon)
virtual void SetPos(Int_t px, Int_t py)
virtual void Paint(Option_t *option="")
virtual void WCtoNDC(const Float_t *pw, Float_t *pn)
virtual void UpdateView(Bool_t resetview=kFALSE)
virtual char * GetObjectInfo(Int_t px, Int_t py) const
EBESViewType GetViewType()
virtual void ExecuteEvent(Int_t event, Int_t px, Int_t py)
void SetChargeChannel(UInt_t cc)
void SetQOverflow(Bool_t qOvfl)
virtual void SetHighlighted(bool status=true)
virtual char * GetObjectInfo(Int_t px, Int_t py) const
virtual bool IsHighlighted()
virtual bool HasZRSection()
void SetTime(Double_t time)
void SetColorfulWire(Bool_t colorfulWire, Bool_t subEvTime)
Double_t Range360(Double_t input)
void SetEvTime(Double_t time)
virtual void Paint(Option_t *option="")
void SetTimeChannel(UInt_t tc)
virtual Int_t DistancetoPrimitive(Int_t px, Int_t py)
virtual void Draw(Option_t *option="")
void SetCharge(Double_t charge)
virtual void ExecuteEvent(Int_t event, Int_t px, Int_t py)
cout<<"end eff5"<< endl;TGraph *gr1=new TGraphErrors(15, x, eff_ep, errx, err_ep);TGraph *gr2=new TGraphErrors(15, x, eff_em, errx, err_em);TGraph *gr3=new TGraphErrors(15, x, eff_ep2, errx, err_ep2);TGraph *gr4=new TGraphErrors(15, x, eff_em2, errx, err_em2);TGraph *gr5=new TGraphErrors(15, x, eff_ep3, errx, err_ep3);TGraph *gr6=new TGraphErrors(15, x, eff_em3, errx, err_em3);TGraph *gr7=new TGraphErrors(15, x, eff_ep4, errx, err_ep4);TGraph *gr8=new TGraphErrors(15, x, eff_em4, errx, err_em4);TGraph *gr9=new TGraphErrors(15, x, eff_ep5, errx, err_ep5);TGraph *gr10=new TGraphErrors(15, x, eff_em5, errx, err_em5);TCanvas *c1=new TCanvas("c1","bhabha_eff", 100, 10, 600, 400);TMultiGraph *mg=new TMultiGraph();mg-> SetTitle("bhabha_eff")