CGEM BOSS 6.6.5.f
BESIII Offline Software System
Loading...
Searching...
No Matches
Cgem2DVStrip Class Reference

#include <Cgem2DStrip.h>

+ Inheritance diagram for Cgem2DVStrip:

Public Member Functions

 Cgem2DVStrip (const char *name, const char *title, double v, double r, double len, double wid, double ang, double xmin, double zmin, double pit, Double_t size, Double_t thick, Int_t layer, Int_t sheet, Int_t strip, Double_t rUF)
 
virtual ~Cgem2DVStrip ()
 
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
 
 Cgem2DVStrip (const char *name, const char *title, double v, double r, double len, double wid, double ang, double xmin, double zmin, double pit, Double_t size, Double_t thick, Int_t layer, Int_t sheet, Int_t strip, Double_t rUF)
 
virtual ~Cgem2DVStrip ()
 
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

BesPolygon2DfVStripXY
 
BesPolygon2DfVStripZR
 
BesPolygon2DfVStripUF
 
- 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

◆ Cgem2DVStrip() [1/2]

Cgem2DVStrip::Cgem2DVStrip ( const char *  name,
const char *  title,
double  v,
double  r,
double  len,
double  wid,
double  ang,
double  xmin,
double  zmin,
double  pit,
Double_t  size,
Double_t  thick,
Int_t  layer,
Int_t  sheet,
Int_t  strip,
Double_t  rUF 
)

Definition at line 611 of file Cgem2DStrip.cxx.

615 : Cgem2DStripBase(name, title, layer, sheet, strip)
616{
617 CgemVStripCalculator calc(rUF, len, wid, ang, xmin, zmin, pit);
618 int N = calc.getPointNumberFromV(v);
619
620 if (N > 0)
621 {
622 //Construct XY and ZR view shape
623 double* pxy = new double[6 * N];
624 double* pzr = new double[6 * N];
625 double tphi = 0, tz = 0;
626 double vuf = v / r * rUF; //vuf is v transformed to unfolded view
627 TString shapename = name;
628 TString shapetitle = title;
629 shapename += " XY";
630 shapetitle += " XY";
631
632 for (int i = 0; i < N; ++i)
633 {
634 calc.getNthPointFromV(v, i, tphi, tz);
635 double cosphi = TMath::Cos(tphi);
636 double sinphi = TMath::Sin(tphi);
637 double rplust = r + 0.5 * thick;
638 double rsubt = r - 0.5 * thick;
639
640 pxy[3 * i] = rsubt * cosphi;
641 pxy[3 * i + 1] = rsubt * sinphi;
642 pxy[3 * i + 2] = tz;
643 pxy[6 * N - 3 * i - 3] = rplust * cosphi;
644 pxy[6 * N - 3 * i - 2] = rplust * sinphi;
645 pxy[6 * N - 3 * i - 1] = tz;
646 pzr[3 * i] = r * cosphi;
647 pzr[3 * i + 1] = r * sinphi;
648 pzr[3 * i + 2] = tz - 0.5 * size;
649 pzr[6 * N - 3 * i - 3] = r * cosphi;
650 pzr[6 * N - 3 * i - 2] = r * sinphi;
651 pzr[6 * N - 3 * i - 1] = tz + 0.5 * size;
652 }
653
654 fVStripXY = new BesPolygon2D(shapename, shapetitle, 2 * N, pxy);
655 fVStripZR = new BesPolygon2D(name, title, 2 * N, pzr);
656
657 //Construct UF view shape
658 Double_t coorStrip[12];
659 calc.getStartPointFromV(vuf, tphi, tz);
660 double size_cosang = 0.5 * size * TMath::Cos(-ang);
661 double size_sinang = 0.5 * size * TMath::Sin(-ang);
662 //double subwid = 0;
663 //if (fLayer == 0) subwid = wid / 2;
664 //else subwid = wid;
665
666 //coorStrip[0] = tphi * r - subwid - size_cosang;
667 coorStrip[0] = tphi * rUF - size_cosang; //New Geom
668 coorStrip[1] = tz - size_sinang;
669 coorStrip[2] = 0;
670 //coorStrip[3] = tphi * r - subwid + size_cosang;
671 coorStrip[3] = tphi * rUF + size_cosang; //New Geom
672 coorStrip[4] = tz + size_sinang;
673 coorStrip[5] = 0;
674 calc.getEndPointFromV(vuf, tphi, tz);
675 //coorStrip[6] = tphi * r - subwid + size_cosang;
676 coorStrip[6] = tphi * rUF + size_cosang; //New Geom
677 coorStrip[7] = tz + size_sinang;
678 coorStrip[8] = 0;
679 //coorStrip[9] = tphi * r - subwid - size_cosang;
680 coorStrip[9] = tphi * rUF - size_cosang; //New Geom
681 coorStrip[10] = tz - size_sinang;
682 coorStrip[11] = 0;
683
684 shapename = name;
685 shapetitle = title;
686 shapename += " Unfolded";
687 shapetitle += " Unfolded";
688 fVStripUF = new BesPolygon2D(name, title, 4, coorStrip);
689
690 delete[] pxy;
691 delete[] pzr;
692 }
693 else
694 {
695 fVStripXY = 0;
696 fVStripZR = 0;
697 fVStripUF = 0;
698 }
699
700 SetStyle();
701 CloseInfo();
702}
**********Class see also m_nmax DOUBLE PRECISION m_amel DOUBLE PRECISION m_x2 DOUBLE PRECISION m_alfinv DOUBLE PRECISION m_Xenph INTEGER m_KeyWtm INTEGER m_idyfs DOUBLE PRECISION m_zini DOUBLE PRECISION m_q2 DOUBLE PRECISION m_Wt_KF DOUBLE PRECISION m_WtCut INTEGER m_KFfin *COMMON c_KarLud $ !Input CMS energy[GeV] $ !CMS energy after beam spread beam strahlung[GeV] $ !Beam energy spread[GeV] $ !z boost due to beam spread $ !electron beam mass *ff pair spectrum $ !minimum v
Definition: KarLud.h:35
virtual void SetStyle()
virtual void CloseInfo()

◆ ~Cgem2DVStrip() [1/2]

Cgem2DVStrip::~Cgem2DVStrip ( )
virtual

Definition at line 704 of file Cgem2DStrip.cxx.

705{
706 delete fVStripXY;
707 delete fVStripZR;
708 delete fVStripUF;
709}

◆ Cgem2DVStrip() [2/2]

Cgem2DVStrip::Cgem2DVStrip ( const char *  name,
const char *  title,
double  v,
double  r,
double  len,
double  wid,
double  ang,
double  xmin,
double  zmin,
double  pit,
Double_t  size,
Double_t  thick,
Int_t  layer,
Int_t  sheet,
Int_t  strip,
Double_t  rUF 
)

◆ ~Cgem2DVStrip() [2/2]

virtual Cgem2DVStrip::~Cgem2DVStrip ( )
virtual

Member Function Documentation

◆ CloseInfo() [1/2]

void Cgem2DVStrip::CloseInfo ( )
virtual

Implements Cgem2DStripBase.

Definition at line 711 of file Cgem2DStrip.cxx.

712{
713 if (fTip)
714 {
715 fTip->Clear();
716 if (fInfoCon.size() == 0) fInfoCon.push_back(GetTitle());
718 }
719 else cout << "Cgem2DVStrip::CloseInfo, not initialized" << endl;
720}
virtual void SetText(std::vector< TString > infoCon)

Referenced by Cgem2DVStrip().

◆ CloseInfo() [2/2]

virtual void Cgem2DVStrip::CloseInfo ( )
virtual

Implements Cgem2DStripBase.

◆ DistancetoPrimitive() [1/2]

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

Implements Cgem2DStripBase.

Definition at line 740 of file Cgem2DStrip.cxx.

741{
742 BesView *view = dynamic_cast<BesView*>(gPad->GetView());
743#ifdef CGEM_V_STRIP_TEST_CONDITIONAL_DISPLAY
744 if (!(CGEM_V_STRIP_DISPLAY_CONDITION)) return 9999;
745#endif
746
747 if ( (view->GetViewType() & kXYView) && fVStripXY &&
748 ( view->GetVisCgemVStrips() || this->IsFired() ))
749 {
750 return fVStripXY->DistancetoPrimitive(px, py);
751 }
752
753 if ((view->GetViewType() & kZRView) && fVStripZR &&
754 ( view->GetVisCgemVStrips() || this->IsFired() ))
755 return fVStripZR->DistancetoPrimitive(px, py);
756
757 if ((view->GetViewType() & kCgemUFView0) && fLayer == 0 && fVStripUF &&
758 ( view->GetVisCgemVStrips() || this->IsFired() ))
759 return fVStripUF->DistancetoPrimitive(px, py);
760
761 if ((view->GetViewType() & kCgemUFView1) && fLayer == 1 && fVStripUF &&
762 ( view->GetVisCgemVStrips() || this->IsFired() ))
763 return fVStripUF->DistancetoPrimitive(px, py);
764
765 if ((view->GetViewType() & kCgemUFView2) && fLayer == 2 && fVStripUF &&
766 ( view->GetVisCgemVStrips() || this->IsFired() ))
767 return fVStripUF->DistancetoPrimitive(px, py);
768
769 return 9999;
770}
#define CGEM_V_STRIP_DISPLAY_CONDITION
virtual Int_t DistancetoPrimitive(Int_t px, Int_t py)

◆ DistancetoPrimitive() [2/2]

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

Implements Cgem2DStripBase.

◆ Draw() [1/2]

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

Implements Cgem2DStripBase.

Definition at line 821 of file Cgem2DStrip.cxx.

822{
823 TString opt = option;
824 opt.ToUpper();
825 AppendPad(option);
826}

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

◆ Draw() [2/2]

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

Implements Cgem2DStripBase.

◆ ExecuteEvent() [1/2]

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

Implements Cgem2DStripBase.

Definition at line 772 of file Cgem2DStrip.cxx.

773{
774 BesView *view = dynamic_cast<BesView*>(gPad->GetView());
775 //cout << "Cgem2DXStrip::ExecuteEvent()" << endl;
776 if (gBesCursor->GetType() == kBesHand)
777 {
778 if (view) view->ExecuteEvent(event, px, py);
779 }
780
781 else if (gBesCursor->GetType() == kBesPick)
782 {
783 if (gPad) gPad->SetCursor(kPointer);
784
785 switch (event)
786 {
787 case kMouseEnter:
788 SetHighlighted(true);
789 if (view->GetViewType() & kXYView) Draw("XY");
790 if (view->GetViewType() & kZRView) Draw("ZR");
791 if ((view->GetViewType() & kCgemUFView0) || (view->GetViewType() & kCgemUFView1) || (view->GetViewType() & kCgemUFView2))
792 Draw("UF");
793
794 fTip->SetPos(px, py);
795 view->UpdateView(0);
796
797 //Long Peixun's update: If ShowInfo is not checked, don't show tip text.
798 if (gBesCursor->GetShowInfo()) fTip->Draw("BR,SAME");
799 gPad->Modified();
800 gPad->Update();
801 break;
802
803 case kMouseLeave:
804 if (IsHighlighted())
805 {
806 SetHighlighted(false);
807 if (view->GetViewType() & kXYView) Draw("XY");
808 if (view->GetViewType() & kZRView) Draw("ZR");
809 if ((view->GetViewType() & kCgemUFView0) || (view->GetViewType() & kCgemUFView1) || (view->GetViewType() & kCgemUFView2))
810 Draw("UF");
811
812 view->UpdateView(0);
813 gPad->Modified();
814 gPad->Update();
815 }
816 break;
817 }
818 }
819}
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 Cgem2DVStrip::ExecuteEvent ( Int_t  event,
Int_t  px,
Int_t  py 
)
virtual

Implements Cgem2DStripBase.

◆ GetType() [1/2]

virtual ECgemStripType Cgem2DVStrip::GetType ( ) const
inlinevirtual

◆ GetType() [2/2]

virtual ECgemStripType Cgem2DVStrip::GetType ( ) const
inlinevirtual

Implements Cgem2DStripBase.

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

179{ return CGEM_V_STRIP; }

◆ Paint() [1/2]

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

Implements Cgem2DStripBase.

Definition at line 828 of file Cgem2DStrip.cxx.

829{
830 //TString opt = option;
831 //opt.ToUpper();
832 BesView *view = dynamic_cast<BesView*>(gPad->GetView());
833
834#ifdef CGEM_V_STRIP_TEST_CONDITIONAL_DISPLAY
835 if (!(CGEM_V_STRIP_DISPLAY_CONDITION)) return;
836#endif
837
838 if ((view->GetViewType() & kXYView) && fVStripXY)
839 {
840 if (IsFired())
841 {
842 fVStripXY->SetLineColor(lcStripFired);
843 fVStripXY->SetLineWidth(lwStripFired);
844 fVStripXY->SetFillColor(fcStripFired);
845 fVStripXY->SetFillStyle(fsStripFired);
846 }
847 else
848 {
849 fVStripXY->SetLineColor(lcStrip);
850 fVStripXY->SetLineWidth(lwStrip);
851 fVStripXY->SetFillColor(fcStrip);
852 fVStripXY->SetFillStyle(fsStrip);
853 }
854
855 if (IsHighlighted())
856 {
857 fVStripXY->SetLineColor(lcStripHL);
858 fVStripXY->SetLineWidth(lwStripHL);
859 fVStripXY->SetFillColor(fcStripHL);
860 fVStripXY->SetFillStyle(fsStripHL);
861 }
862
863 fVStripXY->Paint(); //Cannot use Draw()
864 }
865
866 if ((view->GetViewType() & kZRView) && fVStripZR)
867 {
868 if (IsFired())
869 {
870 fVStripZR->SetLineColor(lcStripFired);
871 fVStripZR->SetLineWidth(lwStripFired);
872 fVStripZR->SetFillColor(fcStripFired);
873 fVStripZR->SetFillStyle(fsStripFired);
874 }
875 else
876 {
877 fVStripZR->SetLineColor(lcStrip);
878 fVStripZR->SetLineWidth(lwStrip);
879 fVStripZR->SetFillColor(fcStrip);
880 fVStripZR->SetFillStyle(fsStrip);
881 }
882
883 if (IsHighlighted())
884 {
885 fVStripZR->SetLineColor(lcStripHL);
886 fVStripZR->SetLineWidth(lwStripHL);
887 fVStripZR->SetFillColor(fcStripHL);
888 fVStripZR->SetFillStyle(fsStripHL);
889 }
890
891 fVStripZR->Paint();
892 }
893
894 if ( fVStripUF && (
895 ((view->GetViewType() & kCgemUFView0) && fLayer == 0) ||
896 ((view->GetViewType() & kCgemUFView1) && fLayer == 1) ||
897 ((view->GetViewType() & kCgemUFView2) && fLayer == 2) )
898 )
899 {
900 if (IsFired())
901 {
902 fVStripUF->SetLineColor(lcStripFired);
903 fVStripUF->SetLineWidth(lwStripFired);
904 fVStripUF->SetFillColor(fcStripFired);
905 fVStripUF->SetFillStyle(fsStripFired);
906 }
907 else
908 {
909 fVStripUF->SetLineColor(lcStrip);
910 fVStripUF->SetLineWidth(lwStrip);
911 fVStripUF->SetFillColor(fcStrip);
912 fVStripUF->SetFillStyle(fsStrip);
913 }
914
915 if (IsHighlighted())
916 {
917 fVStripUF->SetLineColor(lcStripHL);
918 fVStripUF->SetLineWidth(lwStripHL);
919 fVStripUF->SetFillColor(fcStripHL);
920 fVStripUF->SetFillStyle(fsStripHL);
921 }
922
923 fVStripUF->Paint();
924 }
925}
virtual void Paint(Option_t *option="")

◆ Paint() [2/2]

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

Implements Cgem2DStripBase.

◆ SetStyle() [1/2]

void Cgem2DVStrip::SetStyle ( )
virtual

Reimplemented from Cgem2DStripBase.

Definition at line 722 of file Cgem2DStrip.cxx.

723{
724 lcStrip = 30; //line color: grey green
725 lwStrip = 1; //line width
726 fcStrip = 30; //fill color: grey green
727 fsStrip = 1001; //fill style
728
729 lcStripFired = kRed;
730 lwStripFired = 1;
731 fcStripFired = kRed;
732 fsStripFired = 1001;
733
734 lcStripHL = kBlue;
735 lwStripHL = 1;
736 fcStripHL = kBlue;
737 fsStripHL = 1001;
738}

Referenced by Cgem2DVStrip().

◆ SetStyle() [2/2]

virtual void Cgem2DVStrip::SetStyle ( )
virtual

Reimplemented from Cgem2DStripBase.

Member Data Documentation

◆ fVStripUF

BesPolygon2D * Cgem2DVStrip::fVStripUF
protected

◆ fVStripXY

BesPolygon2D * Cgem2DVStrip::fVStripXY
protected

◆ fVStripZR

BesPolygon2D * Cgem2DVStrip::fVStripZR
protected

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