CGEM BOSS 6.6.5.f
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
 
 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
 
 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

Constructor & Destructor Documentation

◆ Cgem2DXStrip() [1/2]

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 double x = phi * rUF;
113 //if (fLayer == 0) x -= 0.5 * wid;
114 //else x -= wid;
115 coorStrip[0] = x - 0.5 * size;
116 //coorStrip[1] = -zmin;
117 coorStrip[1] = zmin; //New Geom
118 coorStrip[2] = 0;
119 coorStrip[3] = x + 0.5 * size;
120 //coorStrip[4] = -zmin;
121 coorStrip[4] = zmin; //New Geom
122 coorStrip[5] = 0;
123 coorStrip[6] = coorStrip[3];
124 //coorStrip[7] = zmin;
125 coorStrip[7] = zmin + len; //New Geom
126 coorStrip[8] = 0;
127 coorStrip[9] = coorStrip[0];
128 //coorStrip[10] = zmin;
129 coorStrip[10] = zmin + len; //New Geom
130 coorStrip[11] = 0;
131
132 shapename = name;
133 shapetitle = title;
134 shapename += " Unfolded";
135 shapetitle += " Unfolded";
136 fXStripUF = new BesPolygon2D(name, title, 4, coorStrip);
137
138 fFiredSizeFactor = 50;
139 SetStyle();
140 CloseInfo();
141}
Double_t x[10]
virtual void SetStyle()
virtual void CloseInfo()

◆ ~Cgem2DXStrip() [1/2]

Cgem2DXStrip::~Cgem2DXStrip ( )
virtual

Definition at line 143 of file Cgem2DStrip.cxx.

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

◆ Cgem2DXStrip() [2/2]

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 
)

◆ ~Cgem2DXStrip() [2/2]

virtual Cgem2DXStrip::~Cgem2DXStrip ( )
virtual

Member Function Documentation

◆ CloseInfo() [1/2]

void Cgem2DXStrip::CloseInfo ( )
virtual

Implements Cgem2DStripBase.

Definition at line 151 of file Cgem2DStrip.cxx.

152{
153 if (fTip)
154 {
155 fTip->Clear();
156 if (fInfoCon.size() == 0) fInfoCon.push_back(GetTitle());
158 }
159 else cout << "Cgem2DXStrip::CloseInfo, not initialized" << endl;
160}
virtual void SetText(std::vector< TString > infoCon)

Referenced by Cgem2DXStrip().

◆ CloseInfo() [2/2]

virtual void Cgem2DXStrip::CloseInfo ( )
virtual

Implements Cgem2DStripBase.

◆ DistancetoPrimitive() [1/2]

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

Implements Cgem2DStripBase.

Definition at line 182 of file Cgem2DStrip.cxx.

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

◆ DistancetoPrimitive() [2/2]

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

Implements Cgem2DStripBase.

◆ Draw() [1/2]

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

Implements Cgem2DStripBase.

Definition at line 275 of file Cgem2DStrip.cxx.

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

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

◆ Draw() [2/2]

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

Implements Cgem2DStripBase.

◆ ExecuteEvent() [1/2]

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

Implements Cgem2DStripBase.

Definition at line 226 of file Cgem2DStrip.cxx.

227{
228 BesView *view = dynamic_cast<BesView*>(gPad->GetView());
229 //cout << "Cgem2DXStrip::ExecuteEvent()" << endl;
230 if (gBesCursor->GetType() == kBesHand)
231 {
232 if (view) view->ExecuteEvent(event, px, py);
233 }
234
235 else if (gBesCursor->GetType() == kBesPick)
236 {
237 if (gPad) gPad->SetCursor(kPointer);
238
239 switch (event)
240 {
241 case kMouseEnter:
242 SetHighlighted(true);
243 if (view->GetViewType() & kXYView) Draw("XY");
244 if (view->GetViewType() & kZRView) Draw("ZR");
245 if ((view->GetViewType() & kCgemUFView0) || (view->GetViewType() & kCgemUFView1) || (view->GetViewType() & kCgemUFView2))
246 Draw("UF");
247
248 fTip->SetPos(px, py);
249 view->UpdateView(0);
250
251 //Long Peixun's update: If ShowInfo is not checked, don't show tip text.
252 if (gBesCursor->GetShowInfo()) fTip->Draw("BR,SAME");
253 gPad->Modified();
254 gPad->Update();
255 break;
256
257 case kMouseLeave:
258 if (IsHighlighted())
259 {
260 SetHighlighted(false);
261 if (view->GetViewType() & kXYView) Draw("XY");
262 if (view->GetViewType() & kZRView) Draw("ZR");
263 if ((view->GetViewType() & kCgemUFView0) || (view->GetViewType() & kCgemUFView1) || (view->GetViewType() & kCgemUFView2))
264 Draw("UF");
265
266 view->UpdateView(0);
267 gPad->Modified();
268 gPad->Update();
269 }
270 break;
271 }
272 }
273}
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
c1_1 Draw()

◆ ExecuteEvent() [2/2]

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

Implements Cgem2DStripBase.

◆ GetType() [1/2]

virtual ECgemStripType Cgem2DXStrip::GetType ( ) const
inlinevirtual

◆ GetType() [2/2]

virtual ECgemStripType Cgem2DXStrip::GetType ( ) const
inlinevirtual

Implements Cgem2DStripBase.

Definition at line 101 of file InstallArea/include/BesVisLib/BesVisLib/Cgem2DStrip.h.

101{ return CGEM_X_STRIP; }

◆ Paint() [1/2]

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

Implements Cgem2DStripBase.

Definition at line 282 of file Cgem2DStrip.cxx.

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

◆ Paint() [2/2]

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

Implements Cgem2DStripBase.

◆ SetStyle() [1/2]

void Cgem2DXStrip::SetStyle ( )
virtual

Reimplemented from Cgem2DStripBase.

Definition at line 162 of file Cgem2DStrip.cxx.

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

Referenced by Cgem2DXStrip().

◆ SetStyle() [2/2]

virtual void Cgem2DXStrip::SetStyle ( )
virtual

Reimplemented from Cgem2DStripBase.

Member Data Documentation

◆ cHLMarker

Int_t Cgem2DXStrip::cHLMarker
protected

◆ fFiredSizeFactor

Double_t Cgem2DXStrip::fFiredSizeFactor
protected

◆ fXStripUF

BesPolygon2D * Cgem2DXStrip::fXStripUF
protected

◆ fXStripXY

BesPolygon2D * Cgem2DXStrip::fXStripXY
protected

◆ fXStripZR

BesPolygon2D * Cgem2DXStrip::fXStripZR
protected

◆ fXYHighlight

BesMarker2D * Cgem2DXStrip::fXYHighlight
protected

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