CGEM BOSS 6.6.5.g
BESIII Offline Software System
Loading...
Searching...
No Matches
Cgem2DXStrip Class Reference

#include <Cgem2DStrip.h>

+ Inheritance diagram for Cgem2DXStrip:

Public Member Functions

 Cgem2DXStrip (const char *name, const char *title, Double_t len, Double_t wid, Double_t phi, Double_t zmin, Double_t r, Double_t size, Double_t thick, Int_t layer, Int_t sheet, Int_t strip, Double_t rUF)
 
virtual ~Cgem2DXStrip ()
 
virtual void CloseInfo ()
 
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 Draw (Option_t *option="")
 
virtual void Paint (Option_t *option="")
 
virtual ECgemStripType GetType () const
 
- Public Member Functions inherited from Cgem2DStripBase
 Cgem2DStripBase (const char *name, const char *title, Int_t layer, Int_t sheet, Int_t strip)
 
virtual ~Cgem2DStripBase ()
 
virtual void SetStyle ()
 
virtual Int_t DistancetoPrimitive (Int_t px, Int_t py)=0
 
virtual void ExecuteEvent (Int_t event, Int_t px, Int_t py)=0
 
virtual void SetHighlighted (bool status=true)
 
virtual void SetFired (bool status=true)
 
virtual bool IsHighlighted () const
 
virtual bool IsFired () const
 
virtual void AddInfo (TString info)
 
virtual void CloseInfo ()=0
 
virtual void ClearInfo ()
 
virtual void Draw (Option_t *option="")=0
 
virtual void Paint (Option_t *option="")=0
 
virtual ECgemStripType GetType () const =0
 
virtual char * GetObjectInfo (Int_t px, Int_t py) const
 
virtual Int_t GetLayer () const
 
virtual Int_t GetSheet () const
 
virtual Int_t GetStrip () const
 

Protected Attributes

BesPolygon2DfXStripXY
 
BesPolygon2DfXStripZR
 
BesPolygon2DfXStripUF
 
BesMarker2DfXYHighlight
 
Int_t cHLMarker
 
Double_t fFiredSizeFactor
 
- Protected Attributes inherited from Cgem2DStripBase
std::vector< TString > fInfoCon
 
BesPaveTextfTip
 
Int_t fLayer
 
Int_t fSheet
 
Int_t fStrip
 
bool fHighlighted
 
bool fFired
 
Int_t lcStrip
 
Int_t lwStrip
 
Int_t fcStrip
 
Int_t fsStrip
 
Int_t lcStripFired
 
Int_t lwStripFired
 
Int_t fcStripFired
 
Int_t fsStripFired
 
Int_t lcStripHL
 
Int_t lwStripHL
 
Int_t fcStripHL
 
Int_t fsStripHL
 

Detailed Description

Definition at line 85 of file Cgem2DStrip.h.

Constructor & Destructor Documentation

◆ Cgem2DXStrip()

Cgem2DXStrip::Cgem2DXStrip ( const char *  name,
const char *  title,
Double_t  len,
Double_t  wid,
Double_t  phi,
Double_t  zmin,
Double_t  r,
Double_t  size,
Double_t  thick,
Int_t  layer,
Int_t  sheet,
Int_t  strip,
Double_t  rUF 
)

Definition at line 61 of file Cgem2DStrip.cxx.

65 : Cgem2DStripBase(name, title, layer, sheet, strip)
66{
67 double cosphi = TMath::Cos(phi);
68 double sinphi = TMath::Sin(phi);
69 double rplust = r + 0.5 * thick;
70 double rsubt = r - 0.5 * thick;
71 Double_t coorStrip[12];
72
73 //Construct XY view projection shape
74 coorStrip[0] = cosphi * rsubt - sinphi * 0.5 * size;
75 coorStrip[1] = sinphi * rsubt + cosphi * 0.5 * size;
76 coorStrip[2] = -zmin;
77 coorStrip[3] = cosphi * rplust - sinphi * 0.5 * size;
78 coorStrip[4] = sinphi * rplust + cosphi * 0.5 * size;
79 coorStrip[5] = -zmin;
80 coorStrip[6] = cosphi * rplust + sinphi * 0.5 * size;
81 coorStrip[7] = sinphi * rplust - cosphi * 0.5 * size;
82 coorStrip[8] = -zmin;
83 coorStrip[9] = cosphi * rsubt + sinphi * 0.5 * size;
84 coorStrip[10] = sinphi * rsubt - cosphi * 0.5 * size;
85 coorStrip[11] = -zmin;
86 fXStripXY = new BesPolygon2D(name, title, 4, coorStrip);
87
88 TString shapename = name;
89 TString shapetitle = title;
90 shapename += " Highlight";
91 shapetitle += " Highlight";
92 fXYHighlight = new BesMarker2D(shapename, shapetitle, r * cosphi, r * sinphi, -zmin);
93 fXYHighlight->SetMarkerStyle(27);
95 fXYHighlight->SetMarkerColor(cHLMarker);
96
97 //Construct ZR view shape
98 coorStrip[0] = coorStrip[3] = cosphi * r;
99 coorStrip[1] = coorStrip[4] = sinphi * r;
100 //coorStrip[2] = -zmin;
101 //coorStrip[5] = zmin;
102 coorStrip[2] = zmin; //New Geom
103 coorStrip[5] = zmin + len; //New Geom
104
105 shapename = name;
106 shapetitle = title;
107 shapename += " ZR";
108 shapetitle += " ZR";
109 fXStripZR = new BesPolygon2D(shapename, shapetitle, 2, coorStrip);
110
111 //Construct UF view shape
112 //while(phi>TMath::Pi()) phi-=2*TMath::Pi();
113 double x = phi * rUF;
114 //if (fLayer == 0) x -= 0.5 * wid;
115 //else x -= wid;
116 coorStrip[0] = x - 0.5 * size;
117 //coorStrip[1] = -zmin;
118 coorStrip[1] = zmin; //New Geom
119 coorStrip[2] = 0;
120 coorStrip[3] = x + 0.5 * size;
121 //coorStrip[4] = -zmin;
122 coorStrip[4] = zmin; //New Geom
123 coorStrip[5] = 0;
124 coorStrip[6] = coorStrip[3];
125 //coorStrip[7] = zmin;
126 coorStrip[7] = zmin + len; //New Geom
127 coorStrip[8] = 0;
128 coorStrip[9] = coorStrip[0];
129 //coorStrip[10] = zmin;
130 coorStrip[10] = zmin + len; //New Geom
131 coorStrip[11] = 0;
132
133 shapename = name;
134 shapetitle = title;
135 shapename += " Unfolded";
136 shapetitle += " Unfolded";
137 fXStripUF = new BesPolygon2D(name, title, 4, coorStrip);
138
139 fFiredSizeFactor = 50;
140 SetStyle();
141 CloseInfo();
142}
Double_t x[10]
virtual void SetMarkerSizeMultiple(Int_t input)
Definition: BesMarker2D.h:34
virtual void SetStyle()
Int_t cHLMarker
Definition: Cgem2DStrip.h:109
BesPolygon2D * fXStripXY
Definition: Cgem2DStrip.h:104
virtual void CloseInfo()
BesPolygon2D * fXStripZR
Definition: Cgem2DStrip.h:105
BesMarker2D * fXYHighlight
Definition: Cgem2DStrip.h:108
BesPolygon2D * fXStripUF
Definition: Cgem2DStrip.h:106
Double_t fFiredSizeFactor
Definition: Cgem2DStrip.h:111

◆ ~Cgem2DXStrip()

Cgem2DXStrip::~Cgem2DXStrip ( )
virtual

Definition at line 144 of file Cgem2DStrip.cxx.

145{
146 delete fXStripXY;
147 delete fXStripZR;
148 delete fXStripUF;
149 delete fXYHighlight;
150}

Member Function Documentation

◆ CloseInfo()

void Cgem2DXStrip::CloseInfo ( )
virtual

Implements Cgem2DStripBase.

Definition at line 152 of file Cgem2DStrip.cxx.

153{
154 if (fTip)
155 {
156 fTip->Clear();
157 if (fInfoCon.size() == 0) fInfoCon.push_back(GetTitle());
159 }
160 else cout << "Cgem2DXStrip::CloseInfo, not initialized" << endl;
161}
virtual void SetText(std::vector< TString > infoCon)
Definition: BesPaveText.cxx:35
BesPaveText * fTip
Definition: Cgem2DStrip.h:55
std::vector< TString > fInfoCon
Definition: Cgem2DStrip.h:54

Referenced by Cgem2DXStrip().

◆ DistancetoPrimitive()

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

Implements Cgem2DStripBase.

Definition at line 183 of file Cgem2DStrip.cxx.

184{
185 BesView *view = dynamic_cast<BesView*>(gPad->GetView());
186
187#ifdef CGEM_X_STRIP_TEST_CONDITIONAL_DISPLAY
188 if (!(CGEM_X_STRIP_DISPLAY_CONDITION)) return 9999;
189#endif
190
191/* if ( view->GetViewType() & kXYView && fStripXY &&
192 ( view->GetVisMucStrips() || (view->GetVisMucHitsGlobal() && this->IsFired()) ) ) {
193 return fStripXY->DistancetoPrimitive(px, py);
194 }
195 else if ( view->GetViewType() & kZRView && fStripZR &&
196 ( (view->GetVisMucStrips() && this->IsZRVisible()) ||
197 (view->GetVisMucHitsGlobal() && this->IsFired() && this->IsZRVisible()) ) ) {
198 return fStripZR->DistancetoPrimitive(px, py);
199 } */
200
201 if ( (view->GetViewType() & kXYView) && fXStripXY &&
202 ( view->GetVisCgemXStrips() || this->IsFired() ))
203 {
204 if (fFired && view->GetVisCgemHitsFiredHL()) return fXYHighlight->DistancetoPrimitive(px, py);
205 else return fXStripXY->DistancetoPrimitive(px, py);
206 }
207
208 if ((view->GetViewType() & kZRView) && fXStripZR &&
209 ( view->GetVisCgemXStrips() || this->IsFired() ))
210 return fXStripZR->DistancetoPrimitive(px, py);
211
212 if ((view->GetViewType() & kCgemUFView0) && fLayer == 0 && fXStripUF &&
213 ( view->GetVisCgemXStrips() || this->IsFired() ))
214 return fXStripUF->DistancetoPrimitive(px, py);
215
216 if ((view->GetViewType() & kCgemUFView1) && fLayer == 1 && fXStripUF &&
217 ( view->GetVisCgemXStrips() || this->IsFired() ))
218 return fXStripUF->DistancetoPrimitive(px, py);
219
220 if ((view->GetViewType() & kCgemUFView2) && fLayer == 2 && fXStripUF &&
221 ( view->GetVisCgemXStrips() || this->IsFired() ))
222 return fXStripUF->DistancetoPrimitive(px, py);
223
224 return 9999;
225}
@ kCgemUFView2
Definition: BesStatus.h:20
@ kCgemUFView0
Definition: BesStatus.h:18
@ kXYView
Definition: BesStatus.h:15
@ kCgemUFView1
Definition: BesStatus.h:19
@ kZRView
Definition: BesStatus.h:16
#define CGEM_X_STRIP_DISPLAY_CONDITION
virtual Int_t DistancetoPrimitive(Int_t px, Int_t py)
Bool_t GetVisCgemXStrips()
Definition: BesView.h:122
Bool_t GetVisCgemHitsFiredHL()
Definition: BesView.h:205
EBESViewType GetViewType()
Definition: BesView.h:74
virtual bool IsFired() const
Definition: Cgem2DStrip.h:38

◆ Draw()

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

Implements Cgem2DStripBase.

Definition at line 276 of file Cgem2DStrip.cxx.

277{
278 TString opt = option;
279 opt.ToUpper();
280 AppendPad(option);
281}

Referenced by CgemROOTGeo::Draw(), and CgemROOTGeo::DrawUF().

◆ ExecuteEvent()

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

Implements Cgem2DStripBase.

Definition at line 227 of file Cgem2DStrip.cxx.

228{
229 BesView *view = dynamic_cast<BesView*>(gPad->GetView());
230 //cout << "Cgem2DXStrip::ExecuteEvent()" << endl;
231 if (gBesCursor->GetType() == kBesHand)
232 {
233 if (view) view->ExecuteEvent(event, px, py);
234 }
235
236 else if (gBesCursor->GetType() == kBesPick)
237 {
238 if (gPad) gPad->SetCursor(kPointer);
239
240 switch (event)
241 {
242 case kMouseEnter:
243 SetHighlighted(true);
244 if (view->GetViewType() & kXYView) Draw("XY");
245 if (view->GetViewType() & kZRView) Draw("ZR");
246 if ((view->GetViewType() & kCgemUFView0) || (view->GetViewType() & kCgemUFView1) || (view->GetViewType() & kCgemUFView2))
247 Draw("UF");
248
249 fTip->SetPos(px, py);
250 view->UpdateView(0);
251
252 //Long Peixun's update: If ShowInfo is not checked, don't show tip text.
253 if (gBesCursor->GetShowInfo()) fTip->Draw("BR,SAME");
254 gPad->Modified();
255 gPad->Update();
256 break;
257
258 case kMouseLeave:
259 if (IsHighlighted())
260 {
261 SetHighlighted(false);
262 if (view->GetViewType() & kXYView) Draw("XY");
263 if (view->GetViewType() & kZRView) Draw("ZR");
264 if ((view->GetViewType() & kCgemUFView0) || (view->GetViewType() & kCgemUFView1) || (view->GetViewType() & kCgemUFView2))
265 Draw("UF");
266
267 view->UpdateView(0);
268 gPad->Modified();
269 gPad->Update();
270 }
271 break;
272 }
273 }
274}
@ kBesHand
Definition: BesCursor.h:15
@ kBesPick
Definition: BesCursor.h:14
R__EXTERN BesCursor * gBesCursor
Definition: BesCursor.h:40
Bool_t GetShowInfo()
Definition: BesCursor.h:35
EBESCursorType GetType()
Definition: BesCursor.h:32
virtual void SetPos(Int_t px, Int_t py)
Definition: BesPaveText.cxx:86
virtual void UpdateView(Bool_t resetview=kFALSE)
Definition: BesView.cxx:753
virtual void ExecuteEvent(Int_t event, Int_t px, Int_t py)
Definition: BesView.cxx:451
virtual void SetHighlighted(bool status=true)
Definition: Cgem2DStrip.h:35
virtual bool IsHighlighted() const
Definition: Cgem2DStrip.h:37
c1_1 Draw()

◆ GetType()

virtual ECgemStripType Cgem2DXStrip::GetType ( ) const
inlinevirtual

Implements Cgem2DStripBase.

Definition at line 101 of file Cgem2DStrip.h.

101{ return CGEM_X_STRIP; }
@ CGEM_X_STRIP
Definition: Cgem2DStrip.h:20

◆ Paint()

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

Implements Cgem2DStripBase.

Definition at line 283 of file Cgem2DStrip.cxx.

284{
285 //TString opt = option;
286 //opt.ToUpper();
287 BesView *view = dynamic_cast<BesView*>(gPad->GetView());
288
289#ifdef CGEM_X_STRIP_TEST_CONDITIONAL_DISPLAY
290 if (!(CGEM_X_STRIP_DISPLAY_CONDITION)) return;
291#endif
292
293 if (view->GetViewType() & kXYView)
294 {
295 if (IsFired())
296 {
297 fXStripXY->SetLineColor(lcStripFired);
298 fXStripXY->SetLineWidth(lwStripFired);
299 fXStripXY->SetFillColor(fcStripFired);
300 fXStripXY->SetFillStyle(fsStripFired);
301
302 //fired X-strip will be drawn larger in XY view
304 Double_t C[3];
306 fXStripXY->Stretch(C[0], C[1], C[2], fFiredSizeFactor);
307 if (view->GetVisCgemHitsFiredHL())
308 {
309 if (IsHighlighted()) fXYHighlight->SetMarkerColor(fcStripHL);
310 else fXYHighlight->SetMarkerColor(cHLMarker);
312 }
313 }
314 else
315 {
316 fXStripXY->SetLineColor(lcStrip);
317 fXStripXY->SetLineWidth(lwStrip);
318 fXStripXY->SetFillColor(fcStrip);
319 fXStripXY->SetFillStyle(fsStrip);
320 fXStripXY->Restore(); //restore normal size
321 }
322
323 if (IsHighlighted())
324 {
325 fXStripXY->SetLineColor(lcStripHL);
326 fXStripXY->SetLineWidth(lwStripHL);
327 fXStripXY->SetFillColor(fcStripHL);
328 fXStripXY->SetFillStyle(fsStripHL);
329 }
330
331 fXStripXY->Paint(); //Cannot use Draw()
332 }
333
334 if (view->GetViewType() & kZRView)
335 {
336 if (IsFired())
337 {
338 fXStripZR->SetLineColor(lcStripFired);
339 fXStripZR->SetLineWidth(lwStripFired);
340 fXStripZR->SetFillColor(fcStripFired);
341 fXStripZR->SetFillStyle(fsStripFired);
342 }
343 else
344 {
345 fXStripZR->SetLineColor(lcStrip);
346 fXStripZR->SetLineWidth(lwStrip);
347 fXStripZR->SetFillColor(fcStrip);
348 fXStripZR->SetFillStyle(fsStrip);
349 }
350
351 if (IsHighlighted())
352 {
353 fXStripZR->SetLineColor(lcStripHL);
354 fXStripZR->SetLineWidth(lwStripHL);
355 fXStripZR->SetFillColor(fcStripHL);
356 fXStripZR->SetFillStyle(fsStripHL);
357 }
358
359 fXStripZR->Paint();
360 }
361
362 if (((view->GetViewType() & kCgemUFView0) && fLayer == 0) ||
363 ((view->GetViewType() & kCgemUFView1) && fLayer == 1) ||
364 ((view->GetViewType() & kCgemUFView2) && fLayer == 2) )
365 {
366 if (IsFired())
367 {
368 fXStripUF->SetLineColor(lcStripFired);
369 fXStripUF->SetLineWidth(lwStripFired);
370 fXStripUF->SetFillColor(fcStripFired);
371 fXStripUF->SetFillStyle(fsStripFired);
372 }
373 else
374 {
375 fXStripUF->SetLineColor(lcStrip);
376 fXStripUF->SetLineWidth(lwStrip);
377 fXStripUF->SetFillColor(fcStrip);
378 fXStripUF->SetFillStyle(fsStrip);
379 }
380
381 if (IsHighlighted())
382 {
383 fXStripUF->SetLineColor(lcStripHL);
384 fXStripUF->SetLineWidth(lwStripHL);
385 fXStripUF->SetFillColor(fcStripHL);
386 fXStripUF->SetFillStyle(fsStripHL);
387 }
388
389 fXStripUF->Paint();
390 }
391}
***************************************************************************************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
Definition: RRes.h:29
virtual void Paint(Option_t *option="")
virtual void Paint(Option_t *option="")
virtual void Stretch(Double_t sx, Double_t sy, Double_t sz, Double_t factor)
virtual void Restore()
virtual void GetCenter(Double_t *Center) const
Int_t fcStripFired
Definition: Cgem2DStrip.h:71
Int_t fsStripFired
Definition: Cgem2DStrip.h:72
Int_t lcStripFired
Definition: Cgem2DStrip.h:69
Int_t lwStripFired
Definition: Cgem2DStrip.h:70

◆ SetStyle()

void Cgem2DXStrip::SetStyle ( )
virtual

Reimplemented from Cgem2DStripBase.

Definition at line 163 of file Cgem2DStrip.cxx.

164{
165 lcStrip = 41; //line color: khaki
166 lwStrip = 1; //line width
167 fcStrip = 41; //fill color: khaki
168 fsStrip = 1001; //fill style
169
170 lcStripFired = kRed;
171 lwStripFired = 1;
172 fcStripFired = kRed;
173 fsStripFired = 1001;
174
175 lcStripHL = kBlue;
176 lwStripHL = 1;
177 fcStripHL = kBlue;
178 fsStripHL = 1001;
179
180 cHLMarker = 46;
181}

Referenced by Cgem2DXStrip().

Member Data Documentation

◆ cHLMarker

Int_t Cgem2DXStrip::cHLMarker
protected

Definition at line 109 of file Cgem2DStrip.h.

Referenced by Cgem2DXStrip(), Paint(), and SetStyle().

◆ fFiredSizeFactor

Double_t Cgem2DXStrip::fFiredSizeFactor
protected

Definition at line 111 of file Cgem2DStrip.h.

Referenced by Cgem2DXStrip(), and Paint().

◆ fXStripUF

BesPolygon2D* Cgem2DXStrip::fXStripUF
protected

Definition at line 106 of file Cgem2DStrip.h.

Referenced by Cgem2DXStrip(), DistancetoPrimitive(), Paint(), and ~Cgem2DXStrip().

◆ fXStripXY

BesPolygon2D* Cgem2DXStrip::fXStripXY
protected

Definition at line 104 of file Cgem2DStrip.h.

Referenced by Cgem2DXStrip(), DistancetoPrimitive(), Paint(), and ~Cgem2DXStrip().

◆ fXStripZR

BesPolygon2D* Cgem2DXStrip::fXStripZR
protected

Definition at line 105 of file Cgem2DStrip.h.

Referenced by Cgem2DXStrip(), DistancetoPrimitive(), Paint(), and ~Cgem2DXStrip().

◆ fXYHighlight

BesMarker2D* Cgem2DXStrip::fXYHighlight
protected

Definition at line 108 of file Cgem2DStrip.h.

Referenced by Cgem2DXStrip(), DistancetoPrimitive(), Paint(), and ~Cgem2DXStrip().


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