BOSS 6.6.4.p03
BESIII Offline Software System
Loading...
Searching...
No Matches
Emc2DCrystal Class Reference

#include <Emc2DCrystal.h>

+ Inheritance diagram for Emc2DCrystal:

Public Member Functions

 Emc2DCrystal ()
 
 Emc2DCrystal (const char *name, const char *title, Int_t N, Double_t *P, Int_t part, Int_t theta)
 
 ~Emc2DCrystal ()
 
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 SetTime (Double_t time)
 
virtual void SetCharge (Double_t charge)
 
virtual Double_t GetTime ()
 
virtual Double_t GetCharge ()
 
virtual void ResetTimeCharge ()
 
virtual void Draw (Option_t *option="")
 
virtual void Paint (Option_t *option="")
 
virtual char * GetObjectInfo (Int_t px, Int_t py) const
 
virtual Int_t GetPart ()
 
virtual Int_t GetTheta ()
 
virtual bool HasZRSection ()
 
Double_t GetAngle (Double_t x, Double_t y)
 
Double_t Range360 (Double_t input)
 
virtual bool IsXYVisible ()
 
virtual bool IsSideVisible ()
 
virtual void SetXYPoint (Double_t *p1, Double_t *p2, Double_t *newP, Double_t z)
 
virtual void SetZRPoint (Double_t *p1, Double_t *p2, Double_t *newP, Double_t r)
 
virtual void ProjectECToSide (Double_t *p1, Double_t *newP)
 

Detailed Description

Definition at line 18 of file Emc2DCrystal.h.

Constructor & Destructor Documentation

◆ Emc2DCrystal() [1/2]

Emc2DCrystal::Emc2DCrystal ( )

◆ Emc2DCrystal() [2/2]

Emc2DCrystal::Emc2DCrystal ( const char *  name,
const char *  title,
Int_t  N,
Double_t *  P,
Int_t  part,
Int_t  theta 
)

Definition at line 25 of file Emc2DCrystal.cxx.

26{
27 SetName(name);
28 SetTitle(title);
29 fTip = 0;
30 fHighlighted = false;
31 fFired = false;
32 fPart = part;
33 fTheta = theta;
34
35 fTime = 0.0;
36 fCharge = 0.0;
37
38 fZRSectionTolerance[1] = 0.1; // degree
39 fZRSectionTolerance[2] = fZRSectionTolerance[0] = 1.2; // degree
40
41 // ------XY------
42
43 Double_t Pxy[3*5]; // 4 side and 5 side shape in Emc End crystal
44 if (N == 8) { // 4 side
45 Int_t iXYSeq[4] = {0,2,6,4};
46 for (Int_t i = 0; i < 4; i++) {
47 if (part == 1) {
48 for (Int_t j = 0; j < 3; j++) {
49 Pxy[3*i+j] = ( P[3*iXYSeq[i]+j] + P[3*(iXYSeq[i]+1)+j] )/2.0;
50 }
51 }
52 else if (part == 0) {
53 SetXYPoint(&P[3*i], &P[3*(i+4)], &Pxy[3*i], ecXYPointZ);
54 //for (Int_t j = 0; j < 3; j++) Pxy[3*i+j] = P[3*i+j];
55 }
56 else if (part == 2) {
57 SetXYPoint(&P[3*i], &P[3*(i+4)], &Pxy[3*i], -ecXYPointZ);
58 //for (Int_t j = 0; j < 3; j++) Pxy[3*i+j] = P[3*i+j];
59 }
60 //cout << GetName() << endl;
61 //if (GetName() == TString("EastEcTheta5Phi0")) cout << Pxy[3*i] << " " << Pxy[3*i+1] << " " << Pxy[3*i+2] << endl;
62 }
63
64 fCrystalXY = new BesPolygon2D(name, title, 4, &Pxy[0]);
65 fCrystalXYFired = new BesPolygon2D(name, title, 4, &Pxy[0]);
66 }
67 if (N == 16) { // 5 side
68 Int_t iXYSeq[5] = {8,9,1,2,3}; // 9 10,1 2
69 for (Int_t i = 0; i < 5; i++) { // 8 11,0 3
70 if (part == 0) {
71 SetXYPoint(&P[3*iXYSeq[i]], &P[3*(iXYSeq[i]+4)], &Pxy[3*i], ecXYPointZ);
72 }
73 else if (part == 2) {
74 SetXYPoint(&P[3*iXYSeq[i]], &P[3*(iXYSeq[i]+4)], &Pxy[3*i], -ecXYPointZ);
75 }
76 //for (Int_t j = 0; j < 3; j++) Pxy[3*i+j] = P[3*iXYSeq[i]+j];
77 }
78
79 fCrystalXY = new BesPolygon2D(name, title, 5, &Pxy[0]);
80 fCrystalXYFired = new BesPolygon2D(name, title, 5, &Pxy[0]);
81 }
82
83 // ------ZR------
84
85 Double_t Pzr[3*4];
86 Int_t iSeq[8] = {0,3,1,2,5,6,4,7}; // center of 0+3, 1+2, 5+6, 4+7
87 for (Int_t i = 0; i < 4; i++) {
88 for (Int_t j = 0; j < 3; j++) {
89 Pzr[3*i+j] = (P[3*iSeq[2*i]+j] + P[3*iSeq[2*i+1]+j])/2.0;
90 }
91 //if (GetName() == TString("EastEcCrystal0")) cout << Pxy[i] << endl;
92 }
93
94
95 fCrystalZR = new BesPolygon2D(TString(name)+TString("zr"), title, 4, &Pzr[0]);
96 fCrystalZRFired = new BesPolygon2D(TString(name)+TString("zr"), title, 4, &Pzr[0]);
97
98 if (N == 8) {
99 if (GetPart() == 1) {
100 fPhiMin = GetAngle( P[3*0], P[3*0+1] );
101 fPhiMax = GetAngle( P[3*3], P[3*3+1] );
102 }
103 else {
104 fPhiMin = GetAngle( P[3*3], P[3*3+1] );
105 fPhiMax = GetAngle( P[3*0], P[3*0+1] );
106 }
107 }
108 else if (N == 16) {
109 fPhiMin = GetAngle( P[3*3], P[3*3+1] );
110 fPhiMax = GetAngle( P[3*8], P[3*8+1] );
111 }
112
113 if (fPhiMin > fPhiMax && fabs(fPhiMax-fPhiMin) < 180.0) { // not cross 0 degree
114 Double_t phiTemp = fPhiMin;
115 fPhiMin = fPhiMax;
116 fPhiMax = phiTemp;
117 }
118 //cout << GetName() << " min "<< fPhiMin << " max " << fPhiMax << endl;
119
120 // ------Side------
121
122 Double_t Pside[3*5]; // 4 side and 5 side shape in Emc End crystal
123 if (N == 8) { // 4 side
124 //Int_t iSideSeq[4] = {0,1,2,3};
125 for (Int_t i = 0; i < 4; i++) {
126 if (part == 1) {
127 SetZRPoint(&P[3*i], &P[3*(i+4)], &Pside[3*i], brZRPointR);
128 }
129 else {
130 ProjectECToSide(&Pxy[3*i], &Pside[3*i]);
131 }
132 }
133
134 fCrystalSide = new BesPolygon2D(name, title, 4, &Pside[0]);
135 fCrystalSideFired = new BesPolygon2D(name, title, 4, &Pside[0]);
136 }
137 if (N == 16) { // 5 side
138 for (Int_t i = 0; i < 5; i++) {
139 ProjectECToSide(&Pxy[3*i], &Pside[3*i]);
140 }
141
142 fCrystalSide = new BesPolygon2D(name, title, 5, &Pside[0]);
143 fCrystalSideFired = new BesPolygon2D(name, title, 5, &Pside[0]);
144 }
145
146 // Init
147
148 SetStyle();
149
150 fTip = new BesPaveText(0, 0, 0.45, 0.08);
151 CloseInfo();
152}
double P(RecMdcKalTrack *trk)
gr SetTitle("BbLum_000XXXX")
virtual void ProjectECToSide(Double_t *p1, Double_t *newP)
virtual void SetZRPoint(Double_t *p1, Double_t *p2, Double_t *newP, Double_t r)
virtual void SetStyle()
virtual void CloseInfo()
Double_t GetAngle(Double_t x, Double_t y)
virtual Int_t GetPart()
Definition: Emc2DCrystal.h:49
virtual void SetXYPoint(Double_t *p1, Double_t *p2, Double_t *newP, Double_t z)

◆ ~Emc2DCrystal()

Emc2DCrystal::~Emc2DCrystal ( )

Definition at line 156 of file Emc2DCrystal.cxx.

156 {
157
158 if (fCrystalXY) delete fCrystalXY;
159 if (fCrystalZR) delete fCrystalZR;
160 if (fCrystalXYFired) delete fCrystalXYFired;
161 if (fCrystalZRFired) delete fCrystalZRFired;
162}

Member Function Documentation

◆ AddInfo()

virtual void Emc2DCrystal::AddInfo ( TString  info)
inlinevirtual

Definition at line 35 of file Emc2DCrystal.h.

35{ fInfoCon.push_back(info); }

Referenced by EmcROOTGeo::SetHits().

◆ ClearInfo()

void Emc2DCrystal::ClearInfo ( )
virtual

Definition at line 188 of file Emc2DCrystal.cxx.

189{
190 fInfoCon.clear();
191 fTip->DeleteText();
192}

Referenced by EmcROOTGeo::SetHits().

◆ CloseInfo()

void Emc2DCrystal::CloseInfo ( )
virtual

Definition at line 194 of file Emc2DCrystal.cxx.

195{
196 if (fTip) {
197 fTip->Clear();
198
199 if (fInfoCon.size() == 0) fInfoCon.push_back(GetTitle());
200 fTip->SetText(fInfoCon);
201 }
202 else
203 cout << "Emc2DCrystal::CloseInfo, not initialized" << endl;
204}
virtual void SetText(std::vector< TString > infoCon)
Definition: BesPaveText.cxx:35

Referenced by Emc2DCrystal(), and EmcROOTGeo::SetHits().

◆ DistancetoPrimitive()

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

Definition at line 208 of file Emc2DCrystal.cxx.

208 {
209
210 BesView *view = (BesView*)gPad->GetView();
211 if ( view->GetViewType() & kXYView ) {
212 if ( fCrystalXY && IsXYVisible() ) {
213 return fCrystalXY->DistancetoPrimitive(px, py);
214 }
215 }
216 else if ( view->GetViewType() & kZRView && fCrystalZR && fCrystalSide ) {
217 if (HasZRSection())
218 return fCrystalZR->DistancetoPrimitive(px, py);
219 else if ( IsSideVisible() &&
220 (view->GetVisEmcSide() || (view->GetVisEmcHitsSide() && IsFired())) )
221 return fCrystalSide->DistancetoPrimitive(px, py);
222 }
223
224 return 9999;
225}
@ kXYView
Definition: BesStatus.h:15
@ kZRView
Definition: BesStatus.h:16
virtual Int_t DistancetoPrimitive(Int_t px, Int_t py)
Bool_t GetVisEmcHitsSide()
Definition: BesView.h:184
EBESViewType GetViewType()
Definition: BesView.h:65
Bool_t GetVisEmcSide()
Definition: BesView.h:120
virtual bool IsSideVisible()
virtual bool HasZRSection()
virtual bool IsXYVisible()
virtual bool IsFired()
Definition: Emc2DCrystal.h:33

◆ Draw()

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

Definition at line 284 of file Emc2DCrystal.cxx.

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

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

◆ ExecuteEvent()

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

Definition at line 229 of file Emc2DCrystal.cxx.

229 {
230
231 //if (fWireType == 2 && fWireBubble[0] ) {
232 //if (fWireCone->GetLineWidth() > 1) // FIRED
233 //cout << GetName() << endl;
234
235 BesView *view = (BesView*)gPad->GetView();
236
237 if (gBesCursor->GetType() == kBesHand) {
238 if (view) view->ExecuteEvent(event, px, py);
239 }
240 else if (gBesCursor->GetType() == kBesPick){
241
242 if (gPad) gPad->SetCursor(kPointer);
243
244 switch (event) {
245
246 case kMouseEnter :
247 this->SetHighlighted(true);
248
249 //if (this->IsFired() || view->GetVisEmcHitsGlobal()) {
250 Draw();
251
252 fTip->SetPos(px, py);
253 view->UpdateView(0);
254
255 fTip->Draw("BR,SAME"); // "BR,ARC,SAME"
256 gPad->Modified();
257 gPad->Update();
258 break;
259
260 case kMouseLeave:
261 if (this->IsHighlighted()) {
262 this->SetHighlighted(false);
263 //if (view->GetVisEmcHitsGlobal())
264 Draw();
265
266 /*
267 if (fTip) {
268 delete fTip;
269 fTip = 0;
270 }
271 */
272
273 view->UpdateView(0);
274 gPad->Modified();
275 gPad->Update();
276 break;
277 }
278 }
279 }
280}
@ kBesHand
Definition: BesCursor.h:15
@ kBesPick
Definition: BesCursor.h:14
R__EXTERN BesCursor * gBesCursor
Definition: BesCursor.h:40
EBESCursorType GetType()
Definition: BesCursor.h:32
virtual void SetPos(Int_t px, Int_t py)
Definition: BesPaveText.cxx:76
virtual void UpdateView(Bool_t resetview=kFALSE)
Definition: BesView.cxx:598
virtual void ExecuteEvent(Int_t event, Int_t px, Int_t py)
Definition: BesView.cxx:365
virtual void SetHighlighted(bool status=true)
Definition: Emc2DCrystal.h:30
virtual bool IsHighlighted()
Definition: Emc2DCrystal.h:32
c1_1 Draw()

◆ GetAngle()

Double_t Emc2DCrystal::GetAngle ( Double_t  x,
Double_t  y 
)

Definition at line 501 of file Emc2DCrystal.cxx.

502{
503 Double_t angle = TMath::ACos( x/TMath::Sqrt(x*x+y*y) ) * TMath::RadToDeg();
504 if ( y<0.0 ) angle *= -1;
505 angle = Range360(angle);
506
507 return angle;
508}
Double_t Range360(Double_t input)

Referenced by Emc2DCrystal().

◆ GetCharge()

virtual Double_t Emc2DCrystal::GetCharge ( )
inlinevirtual

Definition at line 42 of file Emc2DCrystal.h.

42{ return fCharge; }

◆ GetObjectInfo()

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

Definition at line 454 of file Emc2DCrystal.cxx.

454 {
455
456 BesView *view = (BesView*)gPad->GetView();
457 if (view) return view->GetObjectInfo(px, py);
458 else return TObject::GetObjectInfo(px, py);
459}
virtual char * GetObjectInfo(Int_t px, Int_t py) const
Definition: BesView.cxx:800

◆ GetPart()

virtual Int_t Emc2DCrystal::GetPart ( )
inlinevirtual

Definition at line 49 of file Emc2DCrystal.h.

49{ return fPart; }

Referenced by Emc2DCrystal(), BesGeoTrack::ExecuteEvent(), HasZRSection(), and IsXYVisible().

◆ GetTheta()

virtual Int_t Emc2DCrystal::GetTheta ( )
inlinevirtual

Definition at line 50 of file Emc2DCrystal.h.

50{ return fTheta; }

Referenced by IsXYVisible().

◆ GetTime()

virtual Double_t Emc2DCrystal::GetTime ( )
inlinevirtual

Definition at line 41 of file Emc2DCrystal.h.

41{ return fTime; }

◆ HasZRSection()

bool Emc2DCrystal::HasZRSection ( )
virtual

Definition at line 463 of file Emc2DCrystal.cxx.

464{
465 bool flag = false;
466 BesView *view = (BesView*)gPad->GetView();
467 Double_t viewPhi = view->GetLongitude();
468 viewPhi = Range360(viewPhi);
469 //if (GetName() == TString("Layer0Wire0")) cout << "view " << viewPhi << endl;
470
471 Double_t zrPhi = viewPhi-90.0;
472 zrPhi = Range360(zrPhi);
473 //if (GetName() == TString("Layer0Wire0")) cout << zrPhi << endl;
474
475 for (Int_t i = 0; i < 2; i++) {
476 if (i==1) {
477 zrPhi += 180.0;
478 zrPhi = Range360(zrPhi);
479 }
480
481 if (zrPhi >= fPhiMin-fZRSectionTolerance[GetPart()] &&
482 zrPhi <= fPhiMax+fZRSectionTolerance[GetPart()]) {
483 flag = true;
484 break;
485 }
486 else if (fPhiMin > fPhiMax) { // cross 0 degree
487 //cout << GetName() << " zrPhi " << zrPhi << " min " << fPhiMin << " max " << fPhiMax << endl;
488 if (zrPhi >= fPhiMin-fZRSectionTolerance[GetPart()] ||
489 zrPhi <= fPhiMax+fZRSectionTolerance[GetPart()]) {
490 flag = true;
491 break;
492 }
493 }
494 }
495
496 return flag;
497}
Double_t GetLongitude()
Definition: BesTView.h:95

Referenced by DistancetoPrimitive(), and Paint().

◆ IsFired()

virtual bool Emc2DCrystal::IsFired ( )
inlinevirtual

Definition at line 33 of file Emc2DCrystal.h.

33{ return fFired; }

Referenced by DistancetoPrimitive(), IsXYVisible(), and Paint().

◆ IsHighlighted()

virtual bool Emc2DCrystal::IsHighlighted ( )
inlinevirtual

Definition at line 32 of file Emc2DCrystal.h.

32{ return fHighlighted; }

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

◆ IsSideVisible()

bool Emc2DCrystal::IsSideVisible ( )
virtual

Definition at line 538 of file Emc2DCrystal.cxx.

539{
540 BesView *view = (BesView*)gPad->GetView();
541 Double_t viewPhi = view->GetLongitude();
542 Double_t viewPhiMin = viewPhi - sideDeltaPhi;
543 Double_t viewPhiMax = viewPhi + sideDeltaPhi;
544
545 viewPhi = Range360(viewPhi);
546 viewPhiMin = Range360(viewPhiMin);
547 viewPhiMax = Range360(viewPhiMax);
548 //if (GetName() == TString("Layer0Wire0")) cout << "view " << viewPhi << endl;
549
550 if (viewPhiMin < viewPhiMax) { // not cross 0 degree
551 if (fPhiMax > viewPhiMin && fPhiMax < viewPhiMax) return true;
552 }
553 else { // cross 0 degree
554 if (fPhiMax > viewPhiMin || fPhiMax < viewPhiMax) return true;
555 }
556
557 return false;
558}

Referenced by DistancetoPrimitive(), and Paint().

◆ IsXYVisible()

bool Emc2DCrystal::IsXYVisible ( )
virtual

Definition at line 530 of file Emc2DCrystal.cxx.

531{
532 if ( GetPart() != 1 || GetTheta() == 0 || IsFired() )
533 return true;
534 else
535 return false;
536}
virtual Int_t GetTheta()
Definition: Emc2DCrystal.h:50

Referenced by DistancetoPrimitive(), and Paint().

◆ Paint()

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

Definition at line 295 of file Emc2DCrystal.cxx.

295 {
296
297 TString opt = option;
298 opt.ToUpper();
299
300 BesView *view = (BesView*)gPad->GetView();
301 if (view->GetViewType() & kXYView) {
302
303 if (fCrystalXY) {
304 fCrystalXY->SetLineColor(lcCrystal);
305 fCrystalXY->SetLineWidth(lwCrystal);
306 fCrystalXY->SetFillColor(fcCrystal);
307 fCrystalXY->SetFillStyle(fsCrystal);
308 }
309
310 if (this->IsFired()) {
311 if (fCrystalXY) {
312 fCrystalXY->SetFillStyle(fsCrystalTrans);
313 }
314 if (fCrystalXYFired) {
315 fCrystalXYFired->SetLineColor(lcCrystalFired);
316 fCrystalXYFired->SetLineWidth(lwCrystalFired);
317 fCrystalXYFired->SetFillColor(fcCrystalFired);
318 fCrystalXYFired->SetFillStyle(fsCrystalFired);
319 }
320 }
321
322 if (this->IsHighlighted()) {
323 if (fCrystalXY) {
324 fCrystalXY->SetLineColor(lcCrystalHL);
325 fCrystalXY->SetLineWidth(lwCrystalHL);
326 fCrystalXY->SetFillColor(fcCrystalHL);
327 fCrystalXY->SetFillStyle(fsCrystalHL);
328 }
329 if (fCrystalXYFired) {
330 fCrystalXYFired->SetLineColor(lcCrystalFiredHL);
331 fCrystalXYFired->SetLineWidth(lwCrystalFiredHL);
332 fCrystalXYFired->SetFillColor(fcCrystalFiredHL);
333 fCrystalXYFired->SetFillStyle(fsCrystalFiredHL);
334 }
335 }
336
337 if ( fCrystalXY && IsXYVisible() ) fCrystalXY->Paint();
338 if (this->IsFired()) {
339 if (view->GetVisEmcHitsGlobal() &&
340 ( (fPart == 0 && view->GetVisEmcHitsEast()) ||
341 (fPart == 1 && view->GetVisEmcHitsBarrel()) ||
342 (fPart == 2 && view->GetVisEmcHitsWest()) )) {
343 if (fCrystalXYFired) {
344 fCrystalXY->Paint();
345 //if (this->IsHighlighted()) cout << GetName() << " is highlighted " << endl;
346 //cout << "Emc fired Crystal size " << fCharge/fChargeMax << endl;
347 fCrystalXYFired->Restore(); // restore default size
348 fCrystalXYFired->SetSize(fCharge/fChargeMax);
349 fCrystalXYFired->Paint();
350 }
351 }
352 }
353 }
354
355 if (view->GetViewType() & kZRView) {
356 if (HasZRSection()) {
357 if (this->IsFired()) {
358 if (fCrystalZRFired) {
359 fCrystalZRFired->SetLineColor(lcCrystalFired);
360 fCrystalZRFired->SetLineWidth(lwCrystalFired);
361 fCrystalZRFired->SetFillColor(fcCrystalFired);
362 fCrystalZRFired->SetFillStyle(fsCrystalFired);
363 }
364 }
365
366 if (fCrystalZR) {
367 fCrystalZR->SetLineColor(lcCrystal);
368 fCrystalZR->SetLineWidth(lwCrystal);
369 fCrystalZR->SetFillColor(fcCrystal);
370 fCrystalZR->SetFillStyle(fsCrystal);
371 }
372
373 if (this->IsHighlighted()) {
374 if (fCrystalZR) {
375 fCrystalZR->SetLineColor(lcCrystalHL);
376 fCrystalZR->SetLineWidth(lwCrystalHL);
377 fCrystalZR->SetFillColor(fcCrystalHL);
378 fCrystalZR->SetFillStyle(fsCrystalHL);
379 }
380 if (fCrystalZRFired) {
381 fCrystalZRFired->SetLineColor(lcCrystalFiredHL);
382 fCrystalZRFired->SetLineWidth(lwCrystalFiredHL);
383 fCrystalZRFired->SetFillColor(fcCrystalFiredHL);
384 fCrystalZRFired->SetFillStyle(fsCrystalFiredHL);
385 }
386 }
387
388 if ( fCrystalZR ) fCrystalZR->Paint();
389 if (this->IsFired()) {
390 if (view->GetVisEmcHitsGlobal() &&
391 ( (fPart == 0 && view->GetVisEmcHitsEast()) ||
392 (fPart == 1 && view->GetVisEmcHitsBarrel()) ||
393 (fPart == 2 && view->GetVisEmcHitsWest()) )) {
394 if (fCrystalZRFired) {
395 //cout << "Emc fired Crystal size " << fCharge/fChargeMax << endl;
396 fCrystalZRFired->Restore(); // restore default size
397 fCrystalZRFired->SetSize(fCharge/fChargeMax);
398 fCrystalZRFired->Paint();
399 }
400 }
401 }
402 }
403
404 // side
405 if (this->IsFired()) {
406 if (fCrystalSideFired) {
407 fCrystalSideFired->SetLineColor(lcCrystalFired);
408 fCrystalSideFired->SetLineWidth(lwCrystalFired);
409 fCrystalSideFired->SetFillColor(fcCrystalFired);
410 fCrystalSideFired->SetFillStyle(fsCrystalFired);
411 }
412 }
413
414 if (fCrystalSide) {
415 fCrystalSide->SetLineColor(lcCrystal);
416 fCrystalSide->SetLineWidth(lwCrystal);
417 fCrystalSide->SetFillColor(fcCrystal);
418 fCrystalSide->SetFillStyle(fsCrystal);
419 }
420
421 if (this->IsHighlighted()) {
422 if (fCrystalSide) {
423 fCrystalSide->SetLineColor(lcCrystalHL);
424 fCrystalSide->SetLineWidth(lwCrystalHL);
425 fCrystalSide->SetFillColor(fcCrystalHL);
426 fCrystalSide->SetFillStyle(fsCrystalHL);
427 }
428 if (fCrystalSideFired) {
429 fCrystalSideFired->SetLineColor(lcCrystalFiredHL);
430 fCrystalSideFired->SetLineWidth(lwCrystalFiredHL);
431 fCrystalSideFired->SetFillColor(fcCrystalFiredHL);
432 fCrystalSideFired->SetFillStyle(fsCrystalFiredHL);
433 }
434 }
435
436 if ( IsSideVisible() ) {
437 if ( (view->GetVisEmcSide() || view->GetVisEmcHitsSide() && this->IsFired()) && fCrystalSide ) fCrystalSide->Paint();
438 if ( this->IsFired() ) {
439 if (view->GetVisEmcHitsGlobal() && view->GetVisEmcHitsSide()) {
440 if (fCrystalSideFired) {
441 //cout << "Emc fired Crystal size " << fCharge/fChargeMax << endl;
442 fCrystalSideFired->Restore(); // restore default size
443 fCrystalSideFired->SetSize(fCharge/fChargeMax);
444 fCrystalSideFired->Paint();
445 }
446 }
447 }
448 }
449 }
450}
virtual void SetSize(Double_t size)
virtual void Paint(Option_t *option="")
virtual void Restore()
Bool_t GetVisEmcHitsBarrel()
Definition: BesView.h:182
Bool_t GetVisEmcHitsGlobal()
Definition: BesView.h:180
Bool_t GetVisEmcHitsWest()
Definition: BesView.h:183
Bool_t GetVisEmcHitsEast()
Definition: BesView.h:181

◆ ProjectECToSide()

void Emc2DCrystal::ProjectECToSide ( Double_t *  p1,
Double_t *  newP 
)
virtual

Definition at line 583 of file Emc2DCrystal.cxx.

584{
585 // ------ R ---------
586 // | --> |
587 // | r |
588
589 Double_t r1 = sqrt(p1[0]*p1[0] + p1[1]*p1[1]);
590 newP[0] = p1[0] * (brZRPointR/r1);
591 newP[1] = p1[1] * (brZRPointR/r1);
592
593 Double_t drToR = brZRPointR - r1;
594 newP[2] = fabs(ecXYPointZ + drToR) * (p1[2]/fabs(p1[2]));
595
596
597 //if (GetName() == TString("EastEcTheta0Phi0")) {
598 //cout << p1[0] << " " << p1[1] << " " << p1[2] << endl;
599 //cout << newP[0] << " " << newP[1] << " " << newP[2] << endl;
600 //}
601
602}

Referenced by Emc2DCrystal().

◆ Range360()

Double_t Emc2DCrystal::Range360 ( Double_t  input)

Definition at line 512 of file Emc2DCrystal.cxx.

513{
514 if (input >= 360.0) {
515 do {
516 input -= 360.0;
517 }
518 while (input >= 360.0);
519 }
520 else if (input < 0.0) {
521 do {
522 input += 360.0;
523 }
524 while (input < 0.0);
525 }
526
527 return input;
528}

Referenced by GetAngle(), HasZRSection(), and IsSideVisible().

◆ ResetTimeCharge()

virtual void Emc2DCrystal::ResetTimeCharge ( )
inlinevirtual

Definition at line 43 of file Emc2DCrystal.h.

43{ fTime = 0.0; fCharge = 0.0; }

Referenced by EmcROOTGeo::DrawHits().

◆ SetCharge()

virtual void Emc2DCrystal::SetCharge ( Double_t  charge)
inlinevirtual

Definition at line 40 of file Emc2DCrystal.h.

40{ fCharge = charge; }

Referenced by EmcROOTGeo::DrawHits().

◆ SetFired()

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

Definition at line 31 of file Emc2DCrystal.h.

31{ fFired = status; }

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

◆ SetHighlighted()

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

Definition at line 30 of file Emc2DCrystal.h.

30{ fHighlighted = status; }

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

◆ SetStyle()

void Emc2DCrystal::SetStyle ( )
virtual

Definition at line 164 of file Emc2DCrystal.cxx.

165{
166 lcCrystal = 15;
167 lwCrystal = 1;
168 fcCrystal = 1005; // lightBlue
169 fsCrystal = 1001;
170 fsCrystalTrans = 4000;
171
172 lcCrystalFired = kRed;
173 lwCrystalFired = 1;
174 fcCrystalFired = kRed;
175 fsCrystalFired = 1001;
176
177 lcCrystalHL = lcCrystal;
178 lwCrystalHL = 1;
179 fcCrystalHL = kBlue;
180 fsCrystalHL = 1001;
181
182 lcCrystalFiredHL = kRed;
183 lwCrystalFiredHL = 2;
184 fcCrystalFiredHL = kWhite;
185 fsCrystalFiredHL = 4000;
186}

Referenced by Emc2DCrystal().

◆ SetTime()

virtual void Emc2DCrystal::SetTime ( Double_t  time)
inlinevirtual

Definition at line 39 of file Emc2DCrystal.h.

39{ fTime = time; }
Double_t time

◆ SetXYPoint()

void Emc2DCrystal::SetXYPoint ( Double_t *  p1,
Double_t *  p2,
Double_t *  newP,
Double_t  z 
)
virtual

Definition at line 562 of file Emc2DCrystal.cxx.

563{
564 Double_t ratio = fabs( (z-p1[2]) / (p2[2]-p1[2]) );
565 for (Int_t i = 0; i < 3; i++) {
566 newP[i] = p1[i] * (1.0-ratio) + p2[i] * ratio;
567 }
568}

Referenced by Emc2DCrystal().

◆ SetZRPoint()

void Emc2DCrystal::SetZRPoint ( Double_t *  p1,
Double_t *  p2,
Double_t *  newP,
Double_t  r 
)
virtual

Definition at line 572 of file Emc2DCrystal.cxx.

573{
574 Double_t r1 = sqrt(p1[0]*p1[0] + p1[1]*p1[1]);
575 Double_t r2 = sqrt(p2[0]*p2[0] + p2[1]*p2[1]);
576
577 Double_t ratio = fabs( (r-r1) / (r2-r1) );
578 for (Int_t i = 0; i < 3; i++) {
579 newP[i] = p1[i] * (1.0-ratio) + p2[i] * ratio;
580 }
581}

Referenced by Emc2DCrystal().


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