BOSS 8.0.0
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
 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/9]

Mdc2DWire::Mdc2DWire ( )

◆ Mdc2DWire() [2/9]

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 23 of file Mdc2DWire.cxx.

24 {
25
26 SetName( name );
27 SetTitle( title );
28 fTip = 0;
29 fTube = 0; // Long Peixun's update: Add fTube initialization
30 fHighlighted = false;
31 fFired = false;
32 fColorfulWire = false;
33 fWireType = 1; // axial wire
34 evTime = 0;
35
36 Double_t r = 0.25 * ( rmax - rmin );
37 fWireCircle = new BesCircle2D( name, title, 0.0, r, &center[0] );
38
39 Double_t dx = fabs( r * cos( phi ) );
40 Double_t dy = fabs( r * sin( phi ) );
41 Double_t P[12] = { center[0] - dx, center[1] - dy, center[2] - dz, center[0] + dx,
42 center[1] + dy, center[2] - dz, center[0] - dx, center[1] - dy,
43 center[2] + dz, center[0] + dx, center[1] + dy, center[2] + dz };
44
45 fWireCone = new BesPolygon2D( name, title, 4, P );
46
47 Init();
48}
double P(RecMdcKalTrack *trk)
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")
titledef title[20]
virtual void Init()

◆ Mdc2DWire() [3/9]

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

Definition at line 52 of file Mdc2DWire.cxx.

52 {
53 SetName( name );
54 SetTitle( title );
55 fTip = 0;
56 fHighlighted = false;
57 fFired = false;
58 fColorfulWire = false;
59 fWireType = 2; // stereo wire
60
61 Double_t* tubeP = &P[3 * N / 2]; // east four points, P4~P7
62 fTube = new BesPolygon2D( name, title, N / 2, tubeP );
63 fWireCircle = 0;
64 fWireCone = 0;
65
66 for ( Int_t i = 0; i < 3; i++ )
67 {
68 fWestHole[i] = ( P[i] + P[3 + i] + P[6 + i] + P[9 + i] ) / 4.0; // (P0+P1+P2+P3)/4
69 fEastHole[i] = ( P[12 + i] + P[15 + i] + P[18 + i] + P[21 + i] ) / 4.0; // (P4+P5+P6+P7)/4
70 }
71 TVector3 westVec( fWestHole[0], fWestHole[1], fWestHole[2] );
72 TVector3 eastVec( fEastHole[0], fEastHole[1], fEastHole[2] );
73 fWestPhi = westVec.Phi() * TMath::RadToDeg();
74 fEastPhi = eastVec.Phi() * TMath::RadToDeg();
75 if ( fWestPhi < 0.0 ) fWestPhi += 360.0;
76 if ( fEastPhi < 0.0 ) fEastPhi += 360.0;
77
78 // ------XY------
79 Double_t rMax = sqrt( ( P[4 * 3] - P[7 * 3] ) * ( P[4 * 3] - P[7 * 3] ) +
80 ( P[4 * 3 + 1] - P[7 * 3 + 1] ) * ( P[4 * 3 + 1] - P[7 * 3 + 1] ) +
81 ( P[4 * 3 + 2] - P[7 * 3 + 2] ) * ( P[4 * 3 + 2] - P[7 * 3 + 2] ) ) /
82 2.0;
83
84 Double_t rMinRatio = 0.0001; // min bubble radius = rMinRatio * rMax;
85 Double_t rMaxRatio = 0.8; // 0.6; // 0.4//yzhang
86
87 Double_t newP[12];
88 Double_t edge = rMaxRatio * 0.0001; //*0.85
89 for ( Int_t i = 0; i < 3; i++ )
90 {
91 newP[i] =
92 ( 0.5 + edge * rMinRatio ) * ( P[i] + P[3 + i] ) * 0.5 +
93 ( 0.5 - edge * rMinRatio ) * ( P[6 + i] + P[9 + i] ) * 0.5; // near center of P0+P1
94 newP[3 + i] =
95 ( 0.5 - edge * rMinRatio ) * ( P[i] + P[3 + i] ) * 0.5 +
96 ( 0.5 + edge * rMinRatio ) * ( P[6 + i] + P[9 + i] ) * 0.5; // near center of P2+P3
97 newP[6 + i] =
98 ( 0.5 + edge * rMaxRatio ) * ( P[12 + i] + P[15 + i] ) * 0.5 +
99 ( 0.5 - edge * rMaxRatio ) * ( P[18 + i] + P[21 + i] ) * 0.5; // near center of P4+P5
100 newP[9 + i] =
101 ( 0.5 - edge * rMaxRatio ) * ( P[12 + i] + P[15 + i] ) * 0.5 +
102 ( 0.5 + edge * rMaxRatio ) * ( P[18 + i] + P[21 + i] ) * 0.5; // near center of P6+P7
103 }
104 fWireCone = new BesPolygon2D( "WireCone", "WireCone", 4, &newP[0] );
105
106 fWireCircle =
107 new BesCircle2D( "WireBubble", "WireBubble", 0.0, rMaxRatio * rMax, &fEastHole[0] );
108
109 // ------ZR------
110 fZRPosMarker2D =
111 new BesMarker2D( "MdcZRPos", "MdcZRPos", fEastHole[0], fEastHole[1], fEastHole[2] );
112
113 Init();
114}

◆ ~Mdc2DWire() [1/3]

Mdc2DWire::~Mdc2DWire ( )

Definition at line 118 of file Mdc2DWire.cxx.

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

◆ Mdc2DWire() [4/9]

Mdc2DWire::Mdc2DWire ( )

◆ Mdc2DWire() [5/9]

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/9]

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

◆ ~Mdc2DWire() [2/3]

Mdc2DWire::~Mdc2DWire ( )

◆ Mdc2DWire() [7/9]

Mdc2DWire::Mdc2DWire ( )

◆ Mdc2DWire() [8/9]

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

◆ Mdc2DWire() [9/9]

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

◆ ~Mdc2DWire() [3/3]

Mdc2DWire::~Mdc2DWire ( )

Member Function Documentation

◆ AddInfo() [1/3]

virtual void Mdc2DWire::AddInfo ( TString info)
inlinevirtual

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

35{ fInfoCon.push_back( info ); }

Referenced by MdcROOTGeo::SetHits().

◆ AddInfo() [2/3]

virtual void Mdc2DWire::AddInfo ( TString info)
inlinevirtual

Definition at line 35 of file InstallArea/x86_64-el9-gcc13-dbg/include/BesVisLib/Mdc2DWire.h.

35{ fInfoCon.push_back( info ); }

◆ AddInfo() [3/3]

virtual void Mdc2DWire::AddInfo ( TString info)
inlinevirtual

Definition at line 35 of file InstallArea/x86_64-el9-gcc13-opt/include/BesVisLib/Mdc2DWire.h.

35{ fInfoCon.push_back( info ); }

◆ ClearInfo() [1/3]

void Mdc2DWire::ClearInfo ( )
virtual

Definition at line 181 of file Mdc2DWire.cxx.

181 {
182 fInfoCon.clear();
183 fTip->DeleteText();
184}

Referenced by MdcROOTGeo::SetHits().

◆ ClearInfo() [2/3]

virtual void Mdc2DWire::ClearInfo ( )
virtual

◆ ClearInfo() [3/3]

virtual void Mdc2DWire::ClearInfo ( )
virtual

◆ CloseInfo() [1/3]

void Mdc2DWire::CloseInfo ( )
virtual

Definition at line 186 of file Mdc2DWire.cxx.

186 {
187 if ( fTip )
188 {
189 fTip->Clear();
190
191 if ( fInfoCon.size() == 0 ) fInfoCon.push_back( GetTitle() );
192 fTip->SetText( fInfoCon );
193 }
194 else cout << "Mdc2DWire::CloseInfo, not initialized" << endl;
195}

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

◆ CloseInfo() [2/3]

virtual void Mdc2DWire::CloseInfo ( )
virtual

◆ CloseInfo() [3/3]

virtual void Mdc2DWire::CloseInfo ( )
virtual

◆ DistancetoPrimitive() [1/3]

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

Definition at line 199 of file Mdc2DWire.cxx.

199 {
200 BesView* view = dynamic_cast<BesView*>( gPad->GetView() );
201 if ( view->GetViewType() & kXYView ) { return fWireCircle->DistancetoPrimitive( px, py ); }
202 else if ( view->GetViewType() & kZRView )
203 {
204 if ( fZRPosMarker2D )
205 {
206 // Long Peixun's update: Remove duplicate code
207
208 // We need to research what damage fZRPoseMarker2D pointers
209 // This bug can be avoid by changing the initialize order of subdetectors
210 // if ((unsigned long long)(fZRPosMarker2D) & 0xFFFFFFFF00000000)
211 // {
212 // cout << this << " " << fZRPosMarker2D << endl;
213 // }
214
215 // Mingrun Li's answer:
216 // Because fZRPoseMarker2D is not initialized with `nullptr`.
217 // I initialized it with `nullptr` and the bug seems to be gone.
218
219 return fZRPosMarker2D->DistancetoPrimitive( px, py );
220 }
221 }
222
223 return 999;
224}

◆ DistancetoPrimitive() [2/3]

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

◆ DistancetoPrimitive() [3/3]

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

◆ Draw() [1/3]

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

Definition at line 284 of file Mdc2DWire.cxx.

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

Referenced by MdcROOTGeo::DrawHits().

◆ Draw() [2/3]

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

◆ Draw() [3/3]

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

◆ ExecuteEvent() [1/3]

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

Definition at line 228 of file Mdc2DWire.cxx.

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

◆ ExecuteEvent() [2/3]

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

◆ ExecuteEvent() [3/3]

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

◆ GetCharge() [1/3]

Double_t Mdc2DWire::GetCharge ( ) const
inline

Definition at line 56 of file EventDisplay/BesVisLib/include/BesVisLib/Mdc2DWire.h.

56{ return mdcCharge; }

◆ GetCharge() [2/3]

Double_t Mdc2DWire::GetCharge ( ) const
inline

Definition at line 56 of file InstallArea/x86_64-el9-gcc13-dbg/include/BesVisLib/Mdc2DWire.h.

56{ return mdcCharge; }

◆ GetCharge() [3/3]

Double_t Mdc2DWire::GetCharge ( ) const
inline

Definition at line 56 of file InstallArea/x86_64-el9-gcc13-opt/include/BesVisLib/Mdc2DWire.h.

56{ return mdcCharge; }

◆ GetChargeChannel() [1/3]

UInt_t Mdc2DWire::GetChargeChannel ( ) const
inline

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

60{ return chargeChannel; }

Referenced by MdcROOTGeo::DrawHits().

◆ GetChargeChannel() [2/3]

UInt_t Mdc2DWire::GetChargeChannel ( ) const
inline

Definition at line 60 of file InstallArea/x86_64-el9-gcc13-dbg/include/BesVisLib/Mdc2DWire.h.

60{ return chargeChannel; }

◆ GetChargeChannel() [3/3]

UInt_t Mdc2DWire::GetChargeChannel ( ) const
inline

Definition at line 60 of file InstallArea/x86_64-el9-gcc13-opt/include/BesVisLib/Mdc2DWire.h.

60{ return chargeChannel; }

◆ GetEvTime() [1/3]

Double_t Mdc2DWire::GetEvTime ( ) const
inline

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

57{ return evTime; }

◆ GetEvTime() [2/3]

Double_t Mdc2DWire::GetEvTime ( ) const
inline

Definition at line 57 of file InstallArea/x86_64-el9-gcc13-dbg/include/BesVisLib/Mdc2DWire.h.

57{ return evTime; }

◆ GetEvTime() [3/3]

Double_t Mdc2DWire::GetEvTime ( ) const
inline

Definition at line 57 of file InstallArea/x86_64-el9-gcc13-opt/include/BesVisLib/Mdc2DWire.h.

57{ return evTime; }

◆ GetObjectInfo() [1/3]

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

Definition at line 435 of file Mdc2DWire.cxx.

435 {
436
437 BesView* view = dynamic_cast<BesView*>( gPad->GetView() );
438 if ( view ) return view->GetObjectInfo( px, py );
439 else return TObject::GetObjectInfo( px, py );
440}
virtual char * GetObjectInfo(Int_t px, Int_t py) const
Definition BesView.cxx:871

◆ GetObjectInfo() [2/3]

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

◆ GetObjectInfo() [3/3]

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

◆ GetQOverflow() [1/3]

Bool_t Mdc2DWire::GetQOverflow ( ) const
inline

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

58{ return qOverflow; }

Referenced by MdcROOTGeo::DrawHits().

◆ GetQOverflow() [2/3]

Bool_t Mdc2DWire::GetQOverflow ( ) const
inline

Definition at line 58 of file InstallArea/x86_64-el9-gcc13-dbg/include/BesVisLib/Mdc2DWire.h.

58{ return qOverflow; }

◆ GetQOverflow() [3/3]

Bool_t Mdc2DWire::GetQOverflow ( ) const
inline

Definition at line 58 of file InstallArea/x86_64-el9-gcc13-opt/include/BesVisLib/Mdc2DWire.h.

58{ return qOverflow; }

◆ GetTime() [1/3]

Double_t Mdc2DWire::GetTime ( ) const
inline

Definition at line 55 of file EventDisplay/BesVisLib/include/BesVisLib/Mdc2DWire.h.

55{ return mdcTime; }

◆ GetTime() [2/3]

Double_t Mdc2DWire::GetTime ( ) const
inline

Definition at line 55 of file InstallArea/x86_64-el9-gcc13-dbg/include/BesVisLib/Mdc2DWire.h.

55{ return mdcTime; }

◆ GetTime() [3/3]

Double_t Mdc2DWire::GetTime ( ) const
inline

Definition at line 55 of file InstallArea/x86_64-el9-gcc13-opt/include/BesVisLib/Mdc2DWire.h.

55{ return mdcTime; }

◆ GetTimeChannel() [1/3]

UInt_t Mdc2DWire::GetTimeChannel ( ) const
inline

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

59{ return timeChannel; }

Referenced by MdcROOTGeo::DrawHits().

◆ GetTimeChannel() [2/3]

UInt_t Mdc2DWire::GetTimeChannel ( ) const
inline

Definition at line 59 of file InstallArea/x86_64-el9-gcc13-dbg/include/BesVisLib/Mdc2DWire.h.

59{ return timeChannel; }

◆ GetTimeChannel() [3/3]

UInt_t Mdc2DWire::GetTimeChannel ( ) const
inline

Definition at line 59 of file InstallArea/x86_64-el9-gcc13-opt/include/BesVisLib/Mdc2DWire.h.

59{ return timeChannel; }

◆ HasZRSection() [1/3]

bool Mdc2DWire::HasZRSection ( )
virtual

Definition at line 444 of file Mdc2DWire.cxx.

444 {
445 if ( fWireType != 2 ) return false;
446
447 bool flag = false;
448 BesView* view = dynamic_cast<BesView*>( gPad->GetView() );
449 Double_t viewPhi = view->GetLongitude();
450 viewPhi = Range360( viewPhi );
451 // if (GetName() == TString("Layer0Wire0")) cout << "view " << viewPhi << endl;
452
453 Double_t zrPhi = viewPhi - 90.0;
454 zrPhi = Range360( zrPhi );
455 // if (GetName() == TString("Layer0Wire0")) cout << zrPhi << endl;
456
457 for ( Int_t i = 0; i < 2; i++ )
458 {
459 if ( i == 1 )
460 {
461 zrPhi += 180.0;
462 zrPhi = Range360( zrPhi );
463 }
464
465 if ( fabs( fEastPhi - fWestPhi ) < 180.0 )
466 { // no cross phi=0.0
467 if ( ( fEastPhi - zrPhi ) * ( fWestPhi - zrPhi ) > 0.0 ) flag = false;
468 else
469 {
470 Double_t factor = fabs( ( fEastPhi - zrPhi ) / ( fEastPhi - fWestPhi ) );
471 for ( Int_t i = 0; i < 3; i++ )
472 { fZRSectionPos[i] = factor * fWestHole[i] + ( 1.0 - factor ) * fEastHole[i]; }
473 flag = true;
474 break;
475 }
476 }
477 else
478 { // cross phi=0.0
479 if ( ( fEastPhi - zrPhi ) * ( fWestPhi - zrPhi ) < 0.0 ) flag = false;
480 else
481 { // range 0~360 -> -180~180
482 Double_t tempEastPhi = fEastPhi;
483 if ( tempEastPhi >= 180.0 ) tempEastPhi -= 360.0;
484 Double_t tempWestPhi = fWestPhi;
485 if ( tempWestPhi >= 180.0 ) tempWestPhi -= 360.0;
486 Double_t tempZRPhi = zrPhi;
487 if ( tempZRPhi >= 180.0 ) tempZRPhi -= 360.0;
488
489 Double_t factor = fabs( ( tempEastPhi - tempZRPhi ) / ( tempEastPhi - tempWestPhi ) );
490 for ( Int_t i = 0; i < 3; i++ )
491 { fZRSectionPos[i] = factor * fWestHole[i] + ( 1.0 - factor ) * fEastHole[i]; }
492 flag = true;
493 break;
494 }
495 }
496 }
497
498 return flag;
499}
Double_t Range360(Double_t input)

Referenced by Paint().

◆ HasZRSection() [2/3]

virtual bool Mdc2DWire::HasZRSection ( )
virtual

◆ HasZRSection() [3/3]

virtual bool Mdc2DWire::HasZRSection ( )
virtual

◆ Init() [1/3]

void Mdc2DWire::Init ( )
virtual

Definition at line 130 of file Mdc2DWire.cxx.

130 {
131
132 SetStyle();
133
134 fTip = new BesPaveText( 0, 0, 0.1, 0.1 );
135 CloseInfo();
136}
virtual void CloseInfo()
virtual void SetStyle()

Referenced by Mdc2DWire(), and Mdc2DWire().

◆ Init() [2/3]

virtual void Mdc2DWire::Init ( )
virtual

◆ Init() [3/3]

virtual void Mdc2DWire::Init ( )
virtual

◆ IsFired() [1/3]

virtual bool Mdc2DWire::IsFired ( )
inlinevirtual

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

33{ return fFired; }

Referenced by ExecuteEvent(), and Paint().

◆ IsFired() [2/3]

virtual bool Mdc2DWire::IsFired ( )
inlinevirtual

Definition at line 33 of file InstallArea/x86_64-el9-gcc13-dbg/include/BesVisLib/Mdc2DWire.h.

33{ return fFired; }

◆ IsFired() [3/3]

virtual bool Mdc2DWire::IsFired ( )
inlinevirtual

Definition at line 33 of file InstallArea/x86_64-el9-gcc13-opt/include/BesVisLib/Mdc2DWire.h.

33{ return fFired; }

◆ IsHighlighted() [1/3]

virtual bool Mdc2DWire::IsHighlighted ( )
inlinevirtual

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

32{ return fHighlighted; }

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

◆ IsHighlighted() [2/3]

virtual bool Mdc2DWire::IsHighlighted ( )
inlinevirtual

Definition at line 32 of file InstallArea/x86_64-el9-gcc13-dbg/include/BesVisLib/Mdc2DWire.h.

32{ return fHighlighted; }

◆ IsHighlighted() [3/3]

virtual bool Mdc2DWire::IsHighlighted ( )
inlinevirtual

Definition at line 32 of file InstallArea/x86_64-el9-gcc13-opt/include/BesVisLib/Mdc2DWire.h.

32{ return fHighlighted; }

◆ Paint() [1/3]

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

Definition at line 295 of file Mdc2DWire.cxx.

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

◆ Paint() [2/3]

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

◆ Paint() [3/3]

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

◆ Range360() [1/3]

Double_t Mdc2DWire::Range360 ( Double_t input)

Definition at line 503 of file Mdc2DWire.cxx.

503 {
504 if ( input >= 360.0 )
505 {
506 do {
507 input -= 360.0;
508 } while ( input >= 360.0 );
509 }
510 else if ( input < 0.0 )
511 {
512 do {
513 input += 360.0;
514 } while ( input < 0.0 );
515 }
516
517 return input;
518}

Referenced by HasZRSection().

◆ Range360() [2/3]

Double_t Mdc2DWire::Range360 ( Double_t input)

◆ Range360() [3/3]

Double_t Mdc2DWire::Range360 ( Double_t input)

◆ SetCharge() [1/3]

void Mdc2DWire::SetCharge ( Double_t charge)

Definition at line 526 of file Mdc2DWire.cxx.

526{ mdcCharge = charge; }

Referenced by MdcROOTGeo::SetHits().

◆ SetCharge() [2/3]

void Mdc2DWire::SetCharge ( Double_t charge)

◆ SetCharge() [3/3]

void Mdc2DWire::SetCharge ( Double_t charge)

◆ SetChargeChannel() [1/3]

void Mdc2DWire::SetChargeChannel ( UInt_t cc)

Definition at line 539 of file Mdc2DWire.cxx.

539{ chargeChannel = cc; }

Referenced by MdcROOTGeo::SetHits().

◆ SetChargeChannel() [2/3]

void Mdc2DWire::SetChargeChannel ( UInt_t cc)

◆ SetChargeChannel() [3/3]

void Mdc2DWire::SetChargeChannel ( UInt_t cc)

◆ SetColorfulWire() [1/3]

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

Definition at line 543 of file Mdc2DWire.cxx.

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

Referenced by MdcROOTGeo::DrawHits().

◆ SetColorfulWire() [2/3]

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

◆ SetColorfulWire() [3/3]

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

◆ SetEvTime() [1/3]

void Mdc2DWire::SetEvTime ( Double_t time)

Definition at line 534 of file Mdc2DWire.cxx.

534{ evTime = time; }
Double_t time

Referenced by MdcROOTGeo::SetHits().

◆ SetEvTime() [2/3]

void Mdc2DWire::SetEvTime ( Double_t time)

◆ SetEvTime() [3/3]

void Mdc2DWire::SetEvTime ( Double_t time)

◆ SetFired() [1/3]

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

Definition at line 31 of file EventDisplay/BesVisLib/include/BesVisLib/Mdc2DWire.h.

31{ fFired = status; }

Referenced by MdcROOTGeo::DrawHits().

◆ SetFired() [2/3]

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

Definition at line 31 of file InstallArea/x86_64-el9-gcc13-dbg/include/BesVisLib/Mdc2DWire.h.

31{ fFired = status; }

◆ SetFired() [3/3]

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

Definition at line 31 of file InstallArea/x86_64-el9-gcc13-opt/include/BesVisLib/Mdc2DWire.h.

31{ fFired = status; }

◆ SetHighlighted() [1/3]

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

Definition at line 30 of file EventDisplay/BesVisLib/include/BesVisLib/Mdc2DWire.h.

30{ fHighlighted = status; }

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

◆ SetHighlighted() [2/3]

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

Definition at line 30 of file InstallArea/x86_64-el9-gcc13-dbg/include/BesVisLib/Mdc2DWire.h.

30{ fHighlighted = status; }

◆ SetHighlighted() [3/3]

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

Definition at line 30 of file InstallArea/x86_64-el9-gcc13-opt/include/BesVisLib/Mdc2DWire.h.

30{ fHighlighted = status; }

◆ SetQOverflow() [1/3]

void Mdc2DWire::SetQOverflow ( Bool_t qOvfl)

Definition at line 530 of file Mdc2DWire.cxx.

530{ qOverflow = qOvfl; }

Referenced by MdcROOTGeo::SetHits().

◆ SetQOverflow() [2/3]

void Mdc2DWire::SetQOverflow ( Bool_t qOvfl)

◆ SetQOverflow() [3/3]

void Mdc2DWire::SetQOverflow ( Bool_t qOvfl)

◆ SetStyle() [1/3]

void Mdc2DWire::SetStyle ( )
virtual

Definition at line 140 of file Mdc2DWire.cxx.

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

Referenced by Init().

◆ SetStyle() [2/3]

virtual void Mdc2DWire::SetStyle ( )
virtual

◆ SetStyle() [3/3]

virtual void Mdc2DWire::SetStyle ( )
virtual

◆ SetTime() [1/3]

void Mdc2DWire::SetTime ( Double_t time)

Definition at line 522 of file Mdc2DWire.cxx.

522{ mdcTime = time; }

Referenced by MdcROOTGeo::SetHits().

◆ SetTime() [2/3]

void Mdc2DWire::SetTime ( Double_t time)

◆ SetTime() [3/3]

void Mdc2DWire::SetTime ( Double_t time)

◆ SetTimeChannel() [1/3]

void Mdc2DWire::SetTimeChannel ( UInt_t tc)

Definition at line 538 of file Mdc2DWire.cxx.

538{ timeChannel = tc; }

Referenced by MdcROOTGeo::SetHits().

◆ SetTimeChannel() [2/3]

void Mdc2DWire::SetTimeChannel ( UInt_t tc)

◆ SetTimeChannel() [3/3]

void Mdc2DWire::SetTimeChannel ( UInt_t tc)

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