CGEM BOSS 6.6.5.h
BESIII Offline Software System
Loading...
Searching...
No Matches
Cgem2DStrip.h
Go to the documentation of this file.
1#ifndef CGEM_2D_STRIP_H
2#define CGEM_2D_STRIP_H
3//Author: Long Peixun
4
5#include <TNamed.h>
6#include <TAttLine.h>
7#include <TAttFill.h>
8#include <TPaveLabel.h>
9#include <TPaveText.h>
10#include <TVector3.h>
11
12#include "BesCircle2D.h"
13#include "BesPolygon2D.h"
14#include "BesMarker2D.h"
15#include "BesPaveText.h"
16
17//Enum of CGEM strip type
23
24//Cgem 2D Strip base class
25class Cgem2DStripBase : public TNamed, public TAttLine, public TAttFill
26{
27public:
28 Cgem2DStripBase(const char* name, const char* title, Int_t layer, Int_t sheet, Int_t strip);
29 virtual ~Cgem2DStripBase();
30
31 virtual void SetStyle() {}
32 virtual Int_t DistancetoPrimitive(Int_t px, Int_t py) = 0; //pure virtual
33 virtual void ExecuteEvent(Int_t event, Int_t px, Int_t py) = 0; //pure virtual
34
35 virtual void SetHighlighted(bool status = true) { fHighlighted = status; }
36 virtual void SetFired(bool status = true) { fFired = status; }
37 virtual bool IsHighlighted() const { return fHighlighted; }
38 virtual bool IsFired() const { return fFired; }
39
40 virtual void AddInfo(TString info) { fInfoCon.push_back(info); }
41 virtual void CloseInfo() = 0; //pure virtual
42 virtual void ClearInfo();
43
44 virtual void Draw(Option_t *option = "") = 0; //pure virtual
45 virtual void Paint(Option_t *option = "") = 0; //pure virtual
46 virtual ECgemStripType GetType() const = 0; //pure virtual
47 virtual char* GetObjectInfo(Int_t px, Int_t py) const;
48
49 virtual Int_t GetLayer() const { return fLayer; }
50 virtual Int_t GetSheet() const { return fSheet; }
51 virtual Int_t GetStrip() const { return fStrip; }
52
53protected:
54 std::vector<TString> fInfoCon;
56
57 Int_t fLayer;
58 Int_t fSheet;
59 Int_t fStrip;
61 bool fFired;
62
63 //style
64 Int_t lcStrip; //line color
65 Int_t lwStrip; //line width
66 Int_t fcStrip; //fill color
67 Int_t fsStrip; //fill style
68
73
74 Int_t lcStripHL;
75 Int_t lwStripHL;
76 Int_t fcStripHL;
77 Int_t fsStripHL;
78
79 ClassDef(Cgem2DStripBase, 1)
80};
81
82
83//----------------------------------------------------------------
84//Cgem X-strip class
86{
87public:
88 Cgem2DXStrip(const char* name, const char* title,
89 Double_t len, Double_t wid, Double_t phi, Double_t zmin, Double_t r,
90 Double_t size, Double_t thick, Int_t layer, Int_t sheet, Int_t strip,
91 Double_t rUF); //rUF: radius in unfolded view
92 virtual ~Cgem2DXStrip();
93
94 virtual void CloseInfo();
95 virtual void SetStyle();
96 virtual Int_t DistancetoPrimitive(Int_t px, Int_t py);
97 virtual void ExecuteEvent(Int_t event, Int_t px, Int_t py);
98
99 virtual void Draw(Option_t *option = "");
100 virtual void Paint(Option_t *option = "");
101 virtual ECgemStripType GetType() const { return CGEM_X_STRIP; }
102
103protected:
107
110 //fired X-strip will be drawn larger in XY view
111 Double_t fFiredSizeFactor; //fired X-strip size factor
112
113 ClassDef(Cgem2DXStrip, 1)
114};
115
116
117//-----------------------------------------------------------------
118//This class is used to calculate points of V-strip
120{
121private:
122 double m_RV; //Radius of V-strip
123 double m_Length; //Length of sheet
124 double m_Width; //Width of sheet
125 double m_Angle; //Stereo angle of V-strip
126 double m_Xmin; //Start X of sheet
127 double m_Zmin; //Start Z of sheet
128 double m_Pitch; //Pitch of V-strip
129
130 double delta; //Distance of neighbor points in drawing
131public:
132 //Return status code
133 static const int NORMAL = 0;
134 static const int INVALID_VID = -1;
135 static const int ADJUST_TO_END = 1;
136 static const int ADJUST_TO_START = 2;
137
138 CgemVStripCalculator(double r, double len, double wid, double ang, double xmin, double zmin, double pit);
139 void setDelta(double sd) { delta = sd; }
140 double getPointPhi(double* pos) const;
141 bool isPointInSheet(double phi, double z) const;
142 double getZFromVPhi(double v, double phi) const;
143
144 //Calculating by VID
145 // int getStartVID() const;
146 // int getStartPointFromVID(int VID, double& phi, double& z) const;
147 // int getEndPointFromVID(int VID, double& phi, double& z) const;
148 // double getStripLengthFromVID(int VID) const;
149 // int getPointNumberFromVID(int VID) const;
150 // int getNthPointFromVID(int VID, int i, double& phi, double& z) const;
151
152 //Calculating by V
153 int getStartPointFromV(double v, double& phi, double& z) const;
154 int getEndPointFromV(double v, double& phi, double& z) const;
155 double getStripLengthFromV(double v) const;
156 int getPointNumberFromV(double v) const;
157 int getNthPointFromV(double v, int i, double& phi, double& z) const;
158};
159
160
161//-----------------------------------------------------------------
162//Cgem V-strip class
164{
165public:
166 Cgem2DVStrip(const char* name, const char* title, double v,
167 double r, double len, double wid, double ang, double xmin, double zmin, double pit,
168 Double_t size, Double_t thick, Int_t layer, Int_t sheet, Int_t strip,
169 Double_t rUF); //rUF: radius in unfolded view
170 virtual ~Cgem2DVStrip();
171
172 virtual void CloseInfo();
173 virtual void SetStyle();
174 virtual Int_t DistancetoPrimitive(Int_t px, Int_t py);
175 virtual void ExecuteEvent(Int_t event, Int_t px, Int_t py);
176
177 virtual void Draw(Option_t *option = "");
178 virtual void Paint(Option_t *option = "");
179 virtual ECgemStripType GetType() const { return CGEM_V_STRIP; }
180
181protected:
185
186 ClassDef(Cgem2DVStrip, 1)
187};
188
189#endif
ECgemStripType
Definition Cgem2DStrip.h:19
@ CGEM_X_STRIP
Definition Cgem2DStrip.h:20
@ CGEM_V_STRIP
Definition Cgem2DStrip.h:21
**********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 char * GetObjectInfo(Int_t px, Int_t py) const
virtual void ClearInfo()
virtual void Draw(Option_t *option="")=0
BesPaveText * fTip
Definition Cgem2DStrip.h:55
virtual Int_t DistancetoPrimitive(Int_t px, Int_t py)=0
virtual ECgemStripType GetType() const =0
Cgem2DStripBase(const char *name, const char *title, Int_t layer, Int_t sheet, Int_t strip)
virtual void AddInfo(TString info)
Definition Cgem2DStrip.h:40
virtual bool IsFired() const
Definition Cgem2DStrip.h:38
virtual ~Cgem2DStripBase()
virtual void SetFired(bool status=true)
Definition Cgem2DStrip.h:36
std::vector< TString > fInfoCon
Definition Cgem2DStrip.h:54
virtual Int_t GetStrip() const
Definition Cgem2DStrip.h:51
virtual Int_t GetSheet() const
Definition Cgem2DStrip.h:50
virtual void SetHighlighted(bool status=true)
Definition Cgem2DStrip.h:35
virtual void ExecuteEvent(Int_t event, Int_t px, Int_t py)=0
virtual Int_t GetLayer() const
Definition Cgem2DStrip.h:49
virtual void Paint(Option_t *option="")=0
virtual void SetStyle()
Definition Cgem2DStrip.h:31
virtual void CloseInfo()=0
virtual bool IsHighlighted() const
Definition Cgem2DStrip.h:37
virtual ~Cgem2DVStrip()
virtual void SetStyle()
virtual Int_t DistancetoPrimitive(Int_t px, Int_t py)
virtual void CloseInfo()
virtual void ExecuteEvent(Int_t event, Int_t px, Int_t py)
BesPolygon2D * fVStripZR
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 ECgemStripType GetType() const
virtual void Paint(Option_t *option="")
BesPolygon2D * fVStripUF
BesPolygon2D * fVStripXY
virtual void SetStyle()
BesPolygon2D * fXStripXY
virtual void ExecuteEvent(Int_t event, Int_t px, Int_t py)
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 void CloseInfo()
BesPolygon2D * fXStripZR
virtual Int_t DistancetoPrimitive(Int_t px, Int_t py)
virtual ECgemStripType GetType() const
virtual ~Cgem2DXStrip()
BesMarker2D * fXYHighlight
BesPolygon2D * fXStripUF
virtual void Paint(Option_t *option="")
Double_t fFiredSizeFactor
static const int ADJUST_TO_END
static const int NORMAL
double getStripLengthFromV(double v) const
double getPointPhi(double *pos) const
int getStartPointFromV(double v, double &phi, double &z) const
int getPointNumberFromV(double v) const
int getNthPointFromV(double v, int i, double &phi, double &z) const
bool isPointInSheet(double phi, double z) const
double getZFromVPhi(double v, double phi) const
void setDelta(double sd)
static const int ADJUST_TO_START
CgemVStripCalculator(double r, double len, double wid, double ang, double xmin, double zmin, double pit)
static const int INVALID_VID
int getEndPointFromV(double v, double &phi, double &z) const
c1_1 Draw()