BOSS 7.0.4
BESIII Offline Software System
Loading...
Searching...
No Matches
Mdc2DWire Class Reference

#include <Mdc2DWire.h>

+ Inheritance diagram for Mdc2DWire:

Public Member Functions

 Mdc2DWire ()
 
 Mdc2DWire (const char *name, const char *title, Double_t rmin, Double_t rmax, Double_t dz, Double_t phi, Double_t *center)
 
 Mdc2DWire (const char *name, const char *title, Int_t N, Double_t *P)
 
 ~Mdc2DWire ()
 
virtual void Init ()
 
virtual void SetStyle ()
 
virtual Int_t DistancetoPrimitive (Int_t px, Int_t py)
 
virtual void ExecuteEvent (Int_t event, Int_t px, Int_t py)
 
virtual void SetHighlighted (bool status=true)
 
virtual void SetFired (bool status=true)
 
virtual bool IsHighlighted ()
 
virtual bool IsFired ()
 
virtual void AddInfo (TString info)
 
virtual void CloseInfo ()
 
virtual void ClearInfo ()
 
virtual void Draw (Option_t *option="")
 
virtual void Paint (Option_t *option="")
 
virtual char * GetObjectInfo (Int_t px, Int_t py) const
 
virtual bool HasZRSection ()
 
Double_t Range360 (Double_t input)
 
void SetTime (Double_t time)
 
void SetCharge (Double_t charge)
 
void SetColorfulWire (Bool_t colorfulWire, Bool_t subEvTime)
 
void SetQOverflow (Bool_t qOvfl)
 
void SetEvTime (Double_t time)
 
void SetTimeChannel (UInt_t tc)
 
void SetChargeChannel (UInt_t cc)
 
Double_t GetTime () const
 
Double_t GetCharge () const
 
Double_t GetEvTime () const
 
Bool_t GetQOverflow () const
 
UInt_t GetTimeChannel () const
 
UInt_t GetChargeChannel () const
 
 Mdc2DWire ()
 
 Mdc2DWire (const char *name, const char *title, Double_t rmin, Double_t rmax, Double_t dz, Double_t phi, Double_t *center)
 
 Mdc2DWire (const char *name, const char *title, Int_t N, Double_t *P)
 
 ~Mdc2DWire ()
 
virtual void Init ()
 
virtual void SetStyle ()
 
virtual Int_t DistancetoPrimitive (Int_t px, Int_t py)
 
virtual void ExecuteEvent (Int_t event, Int_t px, Int_t py)
 
virtual void SetHighlighted (bool status=true)
 
virtual void SetFired (bool status=true)
 
virtual bool IsHighlighted ()
 
virtual bool IsFired ()
 
virtual void AddInfo (TString info)
 
virtual void CloseInfo ()
 
virtual void ClearInfo ()
 
virtual void Draw (Option_t *option="")
 
virtual void Paint (Option_t *option="")
 
virtual char * GetObjectInfo (Int_t px, Int_t py) const
 
virtual bool HasZRSection ()
 
Double_t Range360 (Double_t input)
 
void SetTime (Double_t time)
 
void SetCharge (Double_t charge)
 
void SetColorfulWire (Bool_t colorfulWire, Bool_t subEvTime)
 
void SetQOverflow (Bool_t qOvfl)
 
void SetEvTime (Double_t time)
 
void SetTimeChannel (UInt_t tc)
 
void SetChargeChannel (UInt_t cc)
 
Double_t GetTime () const
 
Double_t GetCharge () const
 
Double_t GetEvTime () const
 
Bool_t GetQOverflow () const
 
UInt_t GetTimeChannel () const
 
UInt_t GetChargeChannel () const
 

Detailed Description

Constructor & Destructor Documentation

◆ Mdc2DWire() [1/6]

Mdc2DWire::Mdc2DWire ( )

◆ Mdc2DWire() [2/6]

Mdc2DWire::Mdc2DWire ( const char *  name,
const char *  title,
Double_t  rmin,
Double_t  rmax,
Double_t  dz,
Double_t  phi,
Double_t *  center 
)

Definition at line 24 of file Mdc2DWire.cxx.

31{
32
33 SetName(name);
35 fTip = 0;
36 fTube = 0; //Long Peixun's update: Add fTube initialization
37 fHighlighted = false;
38 fFired = false;
39 fColorfulWire = false;
40 fWireType = 1; // axial wire
41 evTime = 0;
42
43 Double_t r = 0.25*(rmax-rmin);
44 fWireCircle = new BesCircle2D(name, title, 0.0, r, &center[0]);
45
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
52 };
53
54 fWireCone = new BesPolygon2D(name, title, 4, P);
55
56 Init();
57}
double P(RecMdcKalTrack *trk)
titledef title[20]
double sin(const BesAngle a)
double cos(const BesAngle a)
virtual void Init()
Definition: Mdc2DWire.cxx:133
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")

◆ Mdc2DWire() [3/6]

Mdc2DWire::Mdc2DWire ( const char *  name,
const char *  title,
Int_t  N,
Double_t *  P 
)

Definition at line 61 of file Mdc2DWire.cxx.

62{
63 SetName(name);
65 fTip = 0;
66 fHighlighted = false;
67 fFired = false;
68 fColorfulWire = false;
69 fWireType = 2; // stereo wire
70
71 Double_t *tubeP = &P[3*N/2]; // east four points, P4~P7
72 fTube = new BesPolygon2D(name, title, N/2, tubeP);
73 fWireCircle = 0;
74 fWireCone = 0;
75
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; // (P0+P1+P2+P3)/4
78 fEastHole[i] = (P[12+i] + P[15+i] + P[18+i] + P[21+i])/4.0; // (P4+P5+P6+P7)/4
79 }
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;
86
87 // ------XY------
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;
91
92 Double_t rMinRatio = 0.0001; // min bubble radius = rMinRatio * rMax;
93 Double_t rMaxRatio = 0.8;//0.6; // 0.4//yzhang
94
95 Double_t newP[12];
96 Double_t edge = rMaxRatio*0.0001; //*0.85
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; // near center of P0+P1
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; // near center of P2+P3
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; // near center of P4+P5
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; // near center of P6+P7
106 }
107 fWireCone = new BesPolygon2D("WireCone", "WireCone", 4, &newP[0]);
108
109 fWireCircle =
110 new BesCircle2D("WireBubble", "WireBubble", 0.0, rMaxRatio*rMax, &fEastHole[0]);
111
112 // ------ZR------
113 fZRPosMarker2D =
114 new BesMarker2D("MdcZRPos", "MdcZRPos", fEastHole[0], fEastHole[1], fEastHole[2]);
115
116 Init();
117}

◆ ~Mdc2DWire() [1/2]

Mdc2DWire::~Mdc2DWire ( )

Definition at line 121 of file Mdc2DWire.cxx.

121 {
122
123 //Long Peixun's update: remove "if"
124 delete fTube;
125 delete fWireCircle;
126 delete fWireCone;
127 delete fZRPosMarker2D;
128 delete fTip;
129}

◆ Mdc2DWire() [4/6]

Mdc2DWire::Mdc2DWire ( )

◆ Mdc2DWire() [5/6]

Mdc2DWire::Mdc2DWire ( const char *  name,
const char *  title,
Double_t  rmin,
Double_t  rmax,
Double_t  dz,
Double_t  phi,
Double_t *  center 
)

◆ Mdc2DWire() [6/6]

Mdc2DWire::Mdc2DWire ( const char *  name,
const char *  title,
Int_t  N,
Double_t *  P 
)

◆ ~Mdc2DWire() [2/2]

Mdc2DWire::~Mdc2DWire ( )

Member Function Documentation

◆ AddInfo() [1/2]

virtual void Mdc2DWire::AddInfo ( TString  info)
inlinevirtual

Definition at line 37 of file EventDisplay/BesVisLib/BesVisLib-00-05-04/BesVisLib/Mdc2DWire.h.

37{ fInfoCon.push_back(info); }

Referenced by MdcROOTGeo::SetHits().

◆ AddInfo() [2/2]

virtual void Mdc2DWire::AddInfo ( TString  info)
inlinevirtual

Definition at line 37 of file InstallArea/include/BesVisLib/BesVisLib/Mdc2DWire.h.

37{ fInfoCon.push_back(info); }

◆ ClearInfo() [1/2]

void Mdc2DWire::ClearInfo ( )
virtual

Definition at line 185 of file Mdc2DWire.cxx.

186{
187 fInfoCon.clear();
188 fTip->DeleteText();
189}

Referenced by MdcROOTGeo::SetHits().

◆ ClearInfo() [2/2]

virtual void Mdc2DWire::ClearInfo ( )
virtual

◆ CloseInfo() [1/2]

void Mdc2DWire::CloseInfo ( )
virtual

Definition at line 191 of file Mdc2DWire.cxx.

192{
193 if (fTip) {
194 fTip->Clear();
195
196 if (fInfoCon.size() == 0) fInfoCon.push_back(GetTitle());
197 fTip->SetText(fInfoCon);
198 }
199 else
200 cout << "Mdc2DWire::CloseInfo, not initialized" << endl;
201}
virtual void SetText(std::vector< TString > infoCon)

Referenced by Init(), and MdcROOTGeo::SetHits().

◆ CloseInfo() [2/2]

virtual void Mdc2DWire::CloseInfo ( )
virtual

◆ DistancetoPrimitive() [1/2]

Int_t Mdc2DWire::DistancetoPrimitive ( Int_t  px,
Int_t  py 
)
virtual

Definition at line 205 of file Mdc2DWire.cxx.

205 {
206 BesView *view = dynamic_cast<BesView*>(gPad->GetView());
207 if (view->GetViewType() & kXYView) {
208 return fWireCircle->DistancetoPrimitive(px, py);
209 }
210 else if (view->GetViewType() & kZRView) {
211 if (fZRPosMarker2D) {
212 //Long Peixun's update: Remove duplicate code
213
214 //We need to research what damage fZRPoseMarker2D pointers
215 //This bug can be avoid by changing the initialize order of subdetectors
216 // if ((unsigned long long)(fZRPosMarker2D) & 0xFFFFFFFF00000000)
217 // {
218 // cout << this << " " << fZRPosMarker2D << endl;
219 // }
220
221 return fZRPosMarker2D->DistancetoPrimitive(px, py);
222 }
223 }
224
225 return 999;
226}
virtual Int_t DistancetoPrimitive(Int_t px, Int_t py)
Definition: BesCircle2D.cxx:78

◆ DistancetoPrimitive() [2/2]

virtual Int_t Mdc2DWire::DistancetoPrimitive ( Int_t  px,
Int_t  py 
)
virtual

◆ Draw() [1/2]

void Mdc2DWire::Draw ( Option_t *  option = "")
virtual

Definition at line 282 of file Mdc2DWire.cxx.

282 {
283 //
284 // Mdc2DWire draw function
285 TString opt = option;
286 opt.ToUpper();
287
288 AppendPad(option);
289}

Referenced by MdcROOTGeo::Draw(), and MdcROOTGeo::DrawHits().

◆ Draw() [2/2]

virtual void Mdc2DWire::Draw ( Option_t *  option = "")
virtual

◆ ExecuteEvent() [1/2]

void Mdc2DWire::ExecuteEvent ( Int_t  event,
Int_t  px,
Int_t  py 
)
virtual

Definition at line 230 of file Mdc2DWire.cxx.

230 {
231
232 BesView *view = dynamic_cast<BesView*>(gPad->GetView());
233
234 if (gBesCursor->GetType() == kBesHand) {
235 if (view) view->ExecuteEvent(event, px, py);
236 }
237 else if (gBesCursor->GetType() == kBesPick){
238
239 if (gPad) gPad->SetCursor(kPointer);
240
241 Int_t origColor = 1;
242
243 switch (event) {
244
245 case kMouseEnter :
246
247 if ( fWireCircle ) origColor = fWireCircle->GetFillColor();
248 if ( fZRPosMarker2D ) origColor = fZRPosMarker2D->GetMarkerColor();
249 this->SetHighlighted(true);
250
251 if (this->IsFired() || view->GetVisMdcWires()) {
252 Draw("WIRE,SAME");
253
254 fTip->SetPos(px, py);
255 view->UpdateView(0);
256
257 //Long Peixun's update: If ShowInfo is not checked, don't show tip text.
258 if (gBesCursor->GetShowInfo()) fTip->Draw("BR,SAME"); // "BR,ARC,SAME"
259 gPad->Modified();
260 gPad->Update();
261 }
262 break;
263
264 case kMouseLeave:
265
266 if (this->IsHighlighted()) {
267 this->SetHighlighted(false);
268 if (view->GetVisMdcWires()) Draw("WIRE,SAME");
269
270 view->UpdateView(0);
271 gPad->Modified();
272 gPad->Update();
273 }
274 break;
275 }
276
277 }
278}
virtual void SetPos(Int_t px, Int_t py)
Definition: BesPaveText.cxx:86
virtual void UpdateView(Bool_t resetview=kFALSE)
Definition: BesView.cxx:657
virtual void ExecuteEvent(Int_t event, Int_t px, Int_t py)
Definition: BesView.cxx:366
legend Draw()

◆ ExecuteEvent() [2/2]

virtual void Mdc2DWire::ExecuteEvent ( Int_t  event,
Int_t  px,
Int_t  py 
)
virtual

◆ GetCharge() [1/2]

Double_t Mdc2DWire::GetCharge ( ) const
inline

Definition at line 58 of file EventDisplay/BesVisLib/BesVisLib-00-05-04/BesVisLib/Mdc2DWire.h.

58{ return mdcCharge; }

◆ GetCharge() [2/2]

Double_t Mdc2DWire::GetCharge ( ) const
inline

Definition at line 58 of file InstallArea/include/BesVisLib/BesVisLib/Mdc2DWire.h.

58{ return mdcCharge; }

◆ GetChargeChannel() [1/2]

UInt_t Mdc2DWire::GetChargeChannel ( ) const
inline

Definition at line 62 of file EventDisplay/BesVisLib/BesVisLib-00-05-04/BesVisLib/Mdc2DWire.h.

62{ return chargeChannel; }

Referenced by MdcROOTGeo::DrawHits().

◆ GetChargeChannel() [2/2]

UInt_t Mdc2DWire::GetChargeChannel ( ) const
inline

Definition at line 62 of file InstallArea/include/BesVisLib/BesVisLib/Mdc2DWire.h.

62{ return chargeChannel; }

◆ GetEvTime() [1/2]

Double_t Mdc2DWire::GetEvTime ( ) const
inline

Definition at line 59 of file EventDisplay/BesVisLib/BesVisLib-00-05-04/BesVisLib/Mdc2DWire.h.

59{ return evTime; }

◆ GetEvTime() [2/2]

Double_t Mdc2DWire::GetEvTime ( ) const
inline

Definition at line 59 of file InstallArea/include/BesVisLib/BesVisLib/Mdc2DWire.h.

59{ return evTime; }

◆ GetObjectInfo() [1/2]

char * Mdc2DWire::GetObjectInfo ( Int_t  px,
Int_t  py 
) const
virtual

Definition at line 411 of file Mdc2DWire.cxx.

411 {
412
413 BesView *view = dynamic_cast<BesView*>(gPad->GetView());
414 if (view) return view->GetObjectInfo(px, py);
415 else return TObject::GetObjectInfo(px, py);
416}
virtual char * GetObjectInfo(Int_t px, Int_t py) const
Definition: BesView.cxx:869

◆ GetObjectInfo() [2/2]

virtual char * Mdc2DWire::GetObjectInfo ( Int_t  px,
Int_t  py 
) const
virtual

◆ GetQOverflow() [1/2]

Bool_t Mdc2DWire::GetQOverflow ( ) const
inline

Definition at line 60 of file EventDisplay/BesVisLib/BesVisLib-00-05-04/BesVisLib/Mdc2DWire.h.

60{ return qOverflow; }

Referenced by MdcROOTGeo::DrawHits().

◆ GetQOverflow() [2/2]

Bool_t Mdc2DWire::GetQOverflow ( ) const
inline

Definition at line 60 of file InstallArea/include/BesVisLib/BesVisLib/Mdc2DWire.h.

60{ return qOverflow; }

◆ GetTime() [1/2]

Double_t Mdc2DWire::GetTime ( ) const
inline

Definition at line 57 of file EventDisplay/BesVisLib/BesVisLib-00-05-04/BesVisLib/Mdc2DWire.h.

57{ return mdcTime; }

◆ GetTime() [2/2]

Double_t Mdc2DWire::GetTime ( ) const
inline

Definition at line 57 of file InstallArea/include/BesVisLib/BesVisLib/Mdc2DWire.h.

57{ return mdcTime; }

◆ GetTimeChannel() [1/2]

UInt_t Mdc2DWire::GetTimeChannel ( ) const
inline

Definition at line 61 of file EventDisplay/BesVisLib/BesVisLib-00-05-04/BesVisLib/Mdc2DWire.h.

61{ return timeChannel; }

Referenced by MdcROOTGeo::DrawHits().

◆ GetTimeChannel() [2/2]

UInt_t Mdc2DWire::GetTimeChannel ( ) const
inline

Definition at line 61 of file InstallArea/include/BesVisLib/BesVisLib/Mdc2DWire.h.

61{ return timeChannel; }

◆ HasZRSection() [1/2]

bool Mdc2DWire::HasZRSection ( )
virtual

Definition at line 420 of file Mdc2DWire.cxx.

421{
422 if (fWireType != 2) return false;
423
424 bool flag = false;
425 BesView *view = dynamic_cast<BesView*>(gPad->GetView());
426 Double_t viewPhi = view->GetLongitude();
427 viewPhi = Range360(viewPhi);
428 //if (GetName() == TString("Layer0Wire0")) cout << "view " << viewPhi << endl;
429
430 Double_t zrPhi = viewPhi-90.0;
431 zrPhi = Range360(zrPhi);
432 //if (GetName() == TString("Layer0Wire0")) cout << zrPhi << endl;
433
434 for (Int_t i = 0; i < 2; i++) {
435 if (i==1) {
436 zrPhi += 180.0;
437 zrPhi = Range360(zrPhi);
438 }
439
440 if ( fabs(fEastPhi-fWestPhi) < 180.0 ) { // no cross phi=0.0
441 if ( (fEastPhi-zrPhi)*(fWestPhi-zrPhi) > 0.0 ) flag = false;
442 else {
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];
446 }
447 flag = true;
448 break;
449 }
450 }
451 else { // cross phi=0.0
452 if ( (fEastPhi-zrPhi)*(fWestPhi-zrPhi) < 0.0 ) flag = false;
453 else { // range 0~360 -> -180~180
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;
460
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];
464 }
465 flag = true;
466 break;
467 }
468 }
469 }
470
471 return flag;
472}
Double_t Range360(Double_t input)
Definition: Mdc2DWire.cxx:476

Referenced by Paint().

◆ HasZRSection() [2/2]

virtual bool Mdc2DWire::HasZRSection ( )
virtual

◆ Init() [1/2]

void Mdc2DWire::Init ( )
virtual

Definition at line 133 of file Mdc2DWire.cxx.

133 {
134
135 SetStyle();
136
137 fTip = new BesPaveText(0, 0, 0.1, 0.1);
138 CloseInfo();
139}
virtual void CloseInfo()
Definition: Mdc2DWire.cxx:191
virtual void SetStyle()
Definition: Mdc2DWire.cxx:143

Referenced by Mdc2DWire().

◆ Init() [2/2]

virtual void Mdc2DWire::Init ( )
virtual

◆ IsFired() [1/2]

virtual bool Mdc2DWire::IsFired ( )
inlinevirtual

Definition at line 35 of file EventDisplay/BesVisLib/BesVisLib-00-05-04/BesVisLib/Mdc2DWire.h.

35{ return fFired; }

Referenced by ExecuteEvent(), and Paint().

◆ IsFired() [2/2]

virtual bool Mdc2DWire::IsFired ( )
inlinevirtual

Definition at line 35 of file InstallArea/include/BesVisLib/BesVisLib/Mdc2DWire.h.

35{ return fFired; }

◆ IsHighlighted() [1/2]

virtual bool Mdc2DWire::IsHighlighted ( )
inlinevirtual

Definition at line 34 of file EventDisplay/BesVisLib/BesVisLib-00-05-04/BesVisLib/Mdc2DWire.h.

34{ return fHighlighted; }

Referenced by BesGeoTrack::ExecuteEvent(), ExecuteEvent(), and Paint().

◆ IsHighlighted() [2/2]

virtual bool Mdc2DWire::IsHighlighted ( )
inlinevirtual

Definition at line 34 of file InstallArea/include/BesVisLib/BesVisLib/Mdc2DWire.h.

34{ return fHighlighted; }

◆ Paint() [1/2]

void Mdc2DWire::Paint ( Option_t *  option = "")
virtual

Definition at line 293 of file Mdc2DWire.cxx.

293 {
294
295 TString opt = option;
296 opt.ToUpper();
297
298 BesView *view = dynamic_cast<BesView*>(gPad->GetView());
299
300 //gStyle->SetPalette(1);
301 if (view->GetViewType() & kXYView) {
302
303 Double_t wcCenter[3], ncCenter[3];
304 fWireCircle->GetCenter(&wcCenter[0]);
305 view->WCtoNDC(wcCenter, &ncCenter[0]);
306 Double_t x1, y1, x2, y2;
307 Double_t d = 0.05;
308 gPad->GetRange(x1, y1, x2, y2);
309
310 // Only draw wire in pad range
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);
318
319 fTube->Paint();
320 }
321
322 if (this->IsFired()) {
323 if (fWireCircle) {
324 fWireCircle->SetLineColor(lcWireFired);
325 fWireCircle->SetLineWidth(lwCircleFired);
326 fWireCircle->SetFillColor(fcCircleFired);
327 fWireCircle->SetFillStyle(fsCircleFired);
328 }
329 if (fWireCone) {
330 fWireCone->SetLineColor(lcWireFired);
331 fWireCone->SetLineWidth(lwConeFired);
332 fWireCone->SetFillColor(fcConeFired);
333 fWireCone->SetFillStyle(fsConeFired);
334 }
335 }
336 else {
337 if (fWireCone) {
338 fWireCone->SetLineColor(lcWire);
339 fWireCone->SetLineWidth(lwCone);
340 fWireCone->SetFillColor(fcCone);
341 fWireCone->SetFillStyle(fsCone);
342 }
343 if (fWireCircle) {
344 fWireCircle->SetLineColor(lcWire);
345 fWireCircle->SetLineWidth(lwCircle);
346 fWireCircle->SetFillColor(fcCircle);
347 fWireCircle->SetFillStyle(fsCircle);
348 }
349 }
350
351 if (this->IsHighlighted()) {
352 if (fWireCircle) {
353 fWireCircle->SetLineColor(lcWireHL);
354 fWireCircle->SetLineWidth(lwCircleHL);
355 fWireCircle->SetFillColor(fcCircleHL);
356 fWireCircle->SetFillStyle(fsCircleHL);
357 }
358 if (fWireCone) {
359 fWireCone->SetLineColor(lcWireHL);
360 fWireCone->SetLineWidth(lwConeHL);
361 fWireCone->SetFillColor(fcConeHL);
362 fWireCone->SetFillStyle(fsConeHL);
363 }
364 }
365 if (opt.Contains("WIRE")) {
366 //Long Peixun's update: Only draw fired wires' cone
367 if (IsFired()) fWireCone->Paint(); //Long Peixun's update: Draw colorful wires' cone
368 if (fWireCircle) fWireCircle->Paint();
369 }
370 }
371 }
372
373 if (view->GetViewType() & kZRView) {
374 if (HasZRSection()) {
375 fZRPosMarker2D->SetWCX(fZRSectionPos[0]);
376 fZRPosMarker2D->SetWCY(fZRSectionPos[1]);
377 fZRPosMarker2D->SetWCZ(fZRSectionPos[2]);
378 fZRPosMarker2D->SetMarkerColor(cMarker);
379 fZRPosMarker2D->SetMarkerStyle(sMarker);
380 fZRPosMarker2D->SetMarkerSizeMultiple(sizeMarker);
381
382 if (this->IsFired()) {
383 if (fZRPosMarker2D) {
384 fZRPosMarker2D->SetMarkerColor(cMarkerFired);
385 fZRPosMarker2D->SetMarkerStyle(sMarkerFired);
386 }
387 }
388 else {
389 if (fZRPosMarker2D) {
390 fZRPosMarker2D->SetMarkerColor(cMarker);
391 fZRPosMarker2D->SetMarkerStyle(sMarker);
392 }
393 }
394
395 if (this->IsHighlighted()) {
396 if (fZRPosMarker2D) {
397 fZRPosMarker2D->SetMarkerColor(cMarkerHL);
398 fZRPosMarker2D->SetMarkerStyle(sMarkerHL);
399 }
400 }
401
402 if (opt.Contains("WIRE")) {
403 if (fZRPosMarker2D) fZRPosMarker2D->Paint();
404 }
405 }
406 }
407}
virtual void Paint(Option_t *option="")
virtual void GetCenter(Double_t *center)
virtual void Paint(Option_t *option="")
virtual void Paint(Option_t *option="")
virtual void WCtoNDC(const Float_t *pw, Float_t *pn)
Definition: BesView.cxx:728
virtual bool HasZRSection()
Definition: Mdc2DWire.cxx:420

◆ Paint() [2/2]

virtual void Mdc2DWire::Paint ( Option_t *  option = "")
virtual

◆ Range360() [1/2]

Double_t Mdc2DWire::Range360 ( Double_t  input)

Definition at line 476 of file Mdc2DWire.cxx.

477{
478 if (input >= 360.0) {
479 do {
480 input -= 360.0;
481 }
482 while (input >= 360.0);
483 }
484 else if (input < 0.0) {
485 do {
486 input += 360.0;
487 }
488 while (input < 0.0);
489 }
490
491 return input;
492}

Referenced by HasZRSection().

◆ Range360() [2/2]

Double_t Mdc2DWire::Range360 ( Double_t  input)

◆ SetCharge() [1/2]

void Mdc2DWire::SetCharge ( Double_t  charge)

Definition at line 503 of file Mdc2DWire.cxx.

504{
505 mdcCharge = charge;
506}

Referenced by MdcROOTGeo::SetHits().

◆ SetCharge() [2/2]

void Mdc2DWire::SetCharge ( Double_t  charge)

◆ SetChargeChannel() [1/2]

void Mdc2DWire::SetChargeChannel ( UInt_t  cc)

Definition at line 528 of file Mdc2DWire.cxx.

529{
530 chargeChannel = cc;
531}

Referenced by MdcROOTGeo::SetHits().

◆ SetChargeChannel() [2/2]

void Mdc2DWire::SetChargeChannel ( UInt_t  cc)

◆ SetColorfulWire() [1/2]

void Mdc2DWire::SetColorfulWire ( Bool_t  colorfulWire,
Bool_t  subEvTime 
)

Definition at line 535 of file Mdc2DWire.cxx.

536{
537 fColorfulWire = colorfulWire;
538 if(fColorfulWire){
539 //yzhang change LINE COLOR of fired mdc wires
540 //n color bin = 50, time of max bin is 2000
541 //time max value = 1943.8125 ~ 2000 ns
542 //no time info color is kGray
543 //time > 2000 && time <=10000, color is kBlack
544 int tempColor;
545 if(subEvTime){
546 // raw time - event start time
547 double tempMdcTime = mdcTime - evTime;
548 if(fabs(evTime)>0.0001) tempMdcTime += 230;
549 if(tempMdcTime>10000) {
550 tempColor = kGray;
551 }else if(tempMdcTime>2000&&tempMdcTime<=10000){
552 tempColor = kRed;
553 }else if(tempMdcTime<-10){
554 tempColor = kWhite;
555 }else{
556 tempColor = 51 + (int) (tempMdcTime/40);
557 }
558 }else{
559 //raw time
560 if(mdcTime>10000) {
561 tempColor= kGray;
562 }else if(mdcTime>2000&&mdcTime<=10000){
563 tempColor = kRed;
564 }else{
565 tempColor = 51 + (int) (mdcTime/40);
566 }
567 }
568 lcWireFired = tempColor;
569 //std::cout<< " mdcTime "<<mdcTime <<" evTime "<< evTime << " t-t0 "<< mdcTime - evTime +230<< " lcWireFired " << lcWireFired <<std::endl;
570
571 //yzhang change FILL COLOR of fired mdc wires
572 //n color bin = 50, charge of max bin is 2000
573 //charge max value = 29783 ~ 30000
574 //adc> 2000&&<=30000 color is kBlack
575 //no adc color is kGray
576 if(mdcCharge>30000){
577 tempColor = kGray;
578 }else if(mdcCharge>2000&&mdcCharge<=30000){
579 tempColor = kRed;
580 }else {
581 tempColor = 51 + (int) (mdcCharge/40);
582 }
583 if(qOverflow) { tempColor = kBlack; }
584 fcCircleFired = tempColor;
585 //std::cout<< " mdcCharge "<<mdcCharge<<" ovfl "<<qOverflow<<" fcCircleFired " << fcCircleFired<< std::endl;
586 }else{
587 lcWireFired = kRed;
588 fcCircleFired = 1004;
589 }
590}

Referenced by MdcROOTGeo::DrawHits().

◆ SetColorfulWire() [2/2]

void Mdc2DWire::SetColorfulWire ( Bool_t  colorfulWire,
Bool_t  subEvTime 
)

◆ SetEvTime() [1/2]

void Mdc2DWire::SetEvTime ( Double_t  time)

Definition at line 517 of file Mdc2DWire.cxx.

518{
519 evTime = time;
520}
Double_t time

Referenced by MdcROOTGeo::SetHits().

◆ SetEvTime() [2/2]

void Mdc2DWire::SetEvTime ( Double_t  time)

◆ SetFired() [1/2]

virtual void Mdc2DWire::SetFired ( bool  status = true)
inlinevirtual

Definition at line 33 of file EventDisplay/BesVisLib/BesVisLib-00-05-04/BesVisLib/Mdc2DWire.h.

33{ fFired = status; }

Referenced by MdcROOTGeo::Draw(), and MdcROOTGeo::DrawHits().

◆ SetFired() [2/2]

virtual void Mdc2DWire::SetFired ( bool  status = true)
inlinevirtual

Definition at line 33 of file InstallArea/include/BesVisLib/BesVisLib/Mdc2DWire.h.

33{ fFired = status; }

◆ SetHighlighted() [1/2]

virtual void Mdc2DWire::SetHighlighted ( bool  status = true)
inlinevirtual

Definition at line 32 of file EventDisplay/BesVisLib/BesVisLib-00-05-04/BesVisLib/Mdc2DWire.h.

32{ fHighlighted = status; }

Referenced by BesGeoTrack::ExecuteEvent(), and ExecuteEvent().

◆ SetHighlighted() [2/2]

virtual void Mdc2DWire::SetHighlighted ( bool  status = true)
inlinevirtual

Definition at line 32 of file InstallArea/include/BesVisLib/BesVisLib/Mdc2DWire.h.

32{ fHighlighted = status; }

◆ SetQOverflow() [1/2]

void Mdc2DWire::SetQOverflow ( Bool_t  qOvfl)

Definition at line 510 of file Mdc2DWire.cxx.

511{
512 qOverflow = qOvfl;
513}

Referenced by MdcROOTGeo::SetHits().

◆ SetQOverflow() [2/2]

void Mdc2DWire::SetQOverflow ( Bool_t  qOvfl)

◆ SetStyle() [1/2]

void Mdc2DWire::SetStyle ( )
virtual

Definition at line 143 of file Mdc2DWire.cxx.

144{
145 lcTube = kBlack; // grey;
146 lwTube = 1;
147 fcTube = kBlack; // grey 15;
148 fsTube = 4000;
149
150 lcWire = 15;
151 if (fWireType == 1) lcWire = kGreen;
152 if (fWireType == 2) lcWire = kBlue;
153 lwCircle = 1;
154 lwCone = 1;
155 fcCircle = kWhite;
156 fcCone = 0;
157 fsCircle = 1001;
158 fsCone = 0;
159
160 lcWireFired = kRed;
161 lwCircleFired = 2;//yzhang 2;
162 lwConeFired = 2;
163 fcCircleFired = 1004; //kBlack;
164 fcConeFired = kBlack;
165 fsCircleFired = 1001;//solid
166 fsConeFired = 3001;
167
168 lcWireHL = kMagenta;//yzhang lcWire;
169 lwCircleHL = 2;
170 lwConeHL = 2;
171 fcCircleHL = kMagenta;//yzhang kBlack;
172 fcConeHL = kRed;
173 fsCircleHL = 1001;
174 fsConeHL = 4000;
175
176 sizeMarker = 4;
177 cMarker = kBlue;
178 cMarkerFired = kRed; // color of fired marker
179 cMarkerHL = cMarker; // cMarkerFired;
180 sMarker = 24;
181 sMarkerFired = 20; // style of fired marker
182 sMarkerHL = 25; // style of highlighted marker
183}

Referenced by Init().

◆ SetStyle() [2/2]

virtual void Mdc2DWire::SetStyle ( )
virtual

◆ SetTime() [1/2]

void Mdc2DWire::SetTime ( Double_t  time)

Definition at line 496 of file Mdc2DWire.cxx.

497{
498 mdcTime = time;
499}

Referenced by MdcROOTGeo::SetHits().

◆ SetTime() [2/2]

void Mdc2DWire::SetTime ( Double_t  time)

◆ SetTimeChannel() [1/2]

void Mdc2DWire::SetTimeChannel ( UInt_t  tc)

Definition at line 524 of file Mdc2DWire.cxx.

525{
526 timeChannel = tc;
527}

Referenced by MdcROOTGeo::SetHits().

◆ SetTimeChannel() [2/2]

void Mdc2DWire::SetTimeChannel ( UInt_t  tc)

The documentation for this class was generated from the following files: