00001 #ifndef BesVisDisplay_H
00002 #define BesVisDisplay_H
00003
00005
00006
00007
00008
00009
00011
00012
00013 #include <TQObject.h>
00014 #include <TCanvas.h>
00015 #include <TArc.h>
00016 #include <TWbox.h>
00017 #include <TString.h>
00018 #include <TGeoVolume.h>
00019 #include <TView.h>
00020 #include <TImage.h>
00021 #include <TPaveText.h>
00022
00023 #include "MdcROOTGeo.h"
00024 #include "TofROOTGeo.h"
00025 #include "EmcROOTGeo.h"
00026 #include "MucROOTGeo.h"
00027 #include "BesView.h"
00028 #include "Bes2DView.h"
00029 #include "BesGeometry.h"
00030 #include "BesHeader.h"
00031 #include <vector>
00032
00033 using std::vector;
00034
00035 class TPolyLine3D;
00036
00037 class BesVisDisplay : public TQObject {
00038
00039 private:
00040
00041 Int_t fDisplayMode;
00042
00043 TPad *fPadHeader;
00044 TPad *fPadXY;
00045 TPad *fPadZR;
00046 TPad *fPad3D;
00047
00048 BesHeader *fBesHeader;
00049 TImage *fHeaderImage;
00050 TImage *fHeaderHImage;
00051 TImage *fHeaderVImage;
00052
00053
00054 Double_t fLatticeWidth;
00055 Double_t fTextSizeTitle;
00056 Double_t fTextSizeTime;
00057 Double_t fTextSizeData;
00058 Double_t fTextSizeFlt;
00059 Double_t fCoordx;
00060 Double_t fCoordy;
00061 Double_t fDistanceOfRows;
00062
00063 Bool_t fMdcOn;
00064 Bool_t fTofOn;
00065 Bool_t fEmcOn;
00066
00067 BesGeometry *fBesGeometry;
00068
00069 Bool_t fDrawAllViews;
00070 Bool_t fDrawParticles;
00071
00072 Bool_t fDrawParticles2;
00073
00074 Bool_t fDrawClusters;
00075 Float_t fPTcut;
00076 Float_t fPTcutEGMUNU;
00077 Float_t fRin;
00078 Float_t fRout;
00079 Float_t fZin;
00080 Float_t fZout;
00081 Float_t fTheta;
00082 Float_t fPhi;
00083 Float_t fBesR;
00084 Float_t fBesZ;
00085 TCanvas *fCanvas;
00086 TPad *fTrigPad;
00087 TPad *fButtons;
00088 TPad *fPad;
00089 TArc *fEM1;
00090 TArc *fPH1;
00091 TArc *fEM2;
00092 TArc *fMU1;
00093 TArc *fMU2;
00094 TArc *fEMU;
00095 TArc *fJT1;
00096 TArc *fJT3;
00097 TArc *fJT4;
00098 TArc *fALL;
00099 TGeoVolume *fBes;
00100 Int_t fRayPicCount;
00101
00102 MdcROOTGeo *fMdcROOTGeo;
00103 TofROOTGeo *fTofROOTGeo;
00104 EmcROOTGeo *fEmcROOTGeo;
00105 MucROOTGeo *fMucROOTGeo;
00106 Int_t fMdcCon;
00107 Int_t fTofCon;
00108 Int_t fEmcCon;
00109 Int_t fMucCon;
00110 Int_t fAllVis;
00111 Int_t fQuarterVis;
00112 Int_t fHalfVis;
00113 Int_t fNoEndVis;
00114 BesView *fxyView;
00115 BesView *fzrView;
00116 BesView *f3DView;
00117
00118 public:
00119 BesVisDisplay();
00120 BesVisDisplay(const char *title);
00121 virtual ~BesVisDisplay();
00122
00123 virtual void SetCanvas(TCanvas *c=0);
00124
00125 inline void SetDisplayMode(Int_t mode) { fDisplayMode = mode; }
00126 inline Int_t GetDisplayMode() { return fDisplayMode; }
00127 inline Bool_t IsVHeader() { if (fDisplayMode == 0 || fDisplayMode == 4) return false; else return true; }
00128 virtual void SwitchDisplayMode(Int_t mode);
00129 virtual void ResizePad();
00130 virtual void SwitchPad();
00131 TPad * GetPadXY() { return fPadXY; }
00132 TPad * GetPadZR() { return fPadZR; }
00133 TPad * GetPad3D() { return fPad3D; }
00134 virtual void DrawHeader();
00135 virtual void Reset();
00136
00137 virtual void InitGeometryFromGDML(const TString fPath);
00138 virtual void InitGeometryFromROOT(TGeoVolume *bes);
00139 BesGeometry* GetBesGeometry() { return fBesGeometry; }
00140
00141 virtual void SetMdcOn(Bool_t MdcOn);
00142 inline Bool_t GetMdcOn() { return fMdcOn; }
00143 virtual void SetTofOn(Bool_t TofOn);
00144 inline Bool_t GetTofOn() { return fTofOn; }
00145 virtual void SetEmcOn(Bool_t EmcOn);
00146 inline Bool_t GetEmcOn() { return fEmcOn; }
00147
00148 virtual Bool_t AllViews() {return fDrawAllViews;}
00149 virtual void Clear(Option_t *option="");
00150
00151 virtual void DisplayTrigger(Int_t trig);
00152 virtual Int_t DistancetoPrimitive(Int_t px, Int_t py);
00153 virtual void Draw(Option_t *option="");
00154 void Draw2D(Option_t *option="");
00155 void Draw3D(Option_t *option="");
00156 void Draw2DXY(Option_t *option="");
00157 void Draw2DZR(Option_t *option="");
00158 virtual void DrawAllViews();
00159 Bool_t DrawClusters() {return fDrawClusters;}
00160 Bool_t DrawParticles() {return fDrawParticles;}
00161
00162 Bool_t DrawParticles2() {return fDrawParticles2;}
00163
00164 virtual void DrawTitle(Option_t *option="");
00165 virtual void DrawView(Float_t theta, Float_t phi);
00166 void DrawViewRange(Double_t x0, Double_t y0, Double_t z0, Double_t zoomSize);
00167 virtual void DrawViewGL();
00168 virtual void DrawViewX3D();
00169 virtual void DrawViewRaytracer(Float_t theta, Float_t phi, Float_t psi);
00170 virtual void DrawViewX3D(char option);
00171 void DrawImageSequence(Int_t thetaStart, Int_t thetaStep);
00172 virtual void ExecuteEvent(Int_t event, Int_t px, Int_t py);
00173 virtual void GetEvent(Long64_t event);
00174 TGeoVolume *GetVolBes() {return fBes;}
00175 MdcROOTGeo *GetMdcROOTGeo() {return fMdcROOTGeo;}
00176 TofROOTGeo *GetTofROOTGeo() {return fTofROOTGeo;}
00177 EmcROOTGeo *GetEmcROOTGeo() {return fEmcROOTGeo;}
00178 MucROOTGeo *GetMucROOTGeo() {return fMucROOTGeo;}
00179 void Init();
00180
00181
00182 TPad *Pad() {return fPad;}
00183 virtual void Paint(Option_t *option="");
00184 virtual void PaintFruit(TObject *obj, Float_t eta, Float_t phi, Float_t pt, Int_t type, Option_t *option="");
00185 virtual void PaintParticles(Option_t *option="");
00186
00187 Float_t PTcut() {return fPTcut;}
00188 Float_t PTcutEGMUNU() {return fPTcutEGMUNU;}
00189 Float_t Rin() {return fRin;}
00190 Float_t Rout() {return fRout;}
00191 virtual void SetDrawClusters(Bool_t draw=kTRUE) {fDrawClusters=draw;}
00192 virtual void SetDrawParticles(Bool_t draw=kTRUE) {fDrawParticles=draw;}
00193
00194 virtual void SetPTcut(Float_t ptcut=0.4);
00195 virtual void SetPTcutEGMUNU(Float_t ptcut=5);
00196 virtual void SetView(Float_t theta, Float_t phi);
00197 virtual void ShowNextEvent(Int_t delta=1);
00198 void SetMdcCon(Int_t mdcCon) {fMdcCon=mdcCon;}
00199 void SetTofCon(Int_t tofCon) {fTofCon=tofCon;}
00200 void SetEmcCon(Int_t emcCon) {fEmcCon=emcCon;}
00201 void SetMucCon(Int_t mucCon) {fMucCon=mucCon;}
00202 void SetAllVisible(Int_t vis) {fAllVis = vis;}
00203 void SetQuarterVisible(Int_t vis) {fQuarterVis = vis;}
00204 void SetHalfVisible(Int_t vis) {fHalfVis = vis;}
00205 void SetNoEndVisible(Int_t vis) {fNoEndVis = vis;}
00206 void SetMdcFiredCell();
00207 void SetTofFiredCell();
00208 void SetEmcFiredCell();
00209 void SetMucFiredCell();
00210 virtual void SizeFruit() const;
00211 virtual void SizeParticles() const;
00212
00213 Float_t Zin() {return fZin;}
00214 Float_t Zout() {return fZout;}
00215
00216 ClassDef(BesVisDisplay, 1)
00217 };
00218
00219 R__EXTERN BesVisDisplay *gDisplay;
00220
00221 #endif