/home/bes3soft/bes3soft/Boss/7.0.2/dist/7.0.2/EventDisplay/BesVisLib/BesVisLib-00-04-04/BesVisLib/BesVisDisplay.h

Go to the documentation of this file.
00001 #ifndef BesVisDisplay_H
00002 #define BesVisDisplay_H
00003 
00005 //                                                                      //
00006 // BesVisDisplay                                                          //
00007 //                                                                      //
00008 // Utility class to display ATLAS outline, tracks, clusters, jets,..    //
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;          // Flag for display mode, 0: 2D XY+ZR, 1: 2D XY, 2: 2D ZR, 3: 3D, 4: 2D+3D
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   //TImage          *fMdcPaletteImage;
00053 
00054   Double_t         fLatticeWidth;  // Lattice Width
00055   Double_t         fTextSizeTitle; // Text Size: Title
00056   Double_t         fTextSizeTime;  // Text Size: Time
00057   Double_t         fTextSizeData;  // Text Size: Data
00058   Double_t         fTextSizeFlt;   // Text Size: FLT
00059   Double_t         fCoordx;        // x coordinate of text
00060   Double_t         fCoordy;        // y coordinate of text
00061   Double_t         fDistanceOfRows;// Distance between rows
00062   
00063   Bool_t           fMdcOn;
00064   Bool_t           fTofOn;
00065   Bool_t           fEmcOn;
00066 
00067   BesGeometry     *fBesGeometry;
00068   
00069   Bool_t            fDrawAllViews;         //Flag True if AllViews selected
00070   Bool_t            fDrawParticles;        //Flag True if particles to be drawn
00071    
00072   Bool_t            fDrawParticles2;  
00073   
00074   Bool_t            fDrawClusters;         //Flag True if clusters to be drawn
00075   Float_t           fPTcut;                //PT cut to display objects
00076   Float_t           fPTcutEGMUNU;          //PT cut for Electrons, Gammas, MUons, Neutrinos
00077   Float_t           fRin;                  //Inner ATLAS radius
00078   Float_t           fRout;                 //Outer ATLAS radius
00079   Float_t           fZin;                  //Inner ATLAS length along Z
00080   Float_t           fZout;                 //Outer ATLAS length along Z
00081   Float_t           fTheta;                //Viewing angle theta
00082   Float_t           fPhi;                  //Viewing angle phi
00083   Float_t           fBesR;                 //BesR
00084   Float_t           fBesZ;                 //BesZ
00085   TCanvas          *fCanvas;               //Pointer to the display canvas
00086   TPad             *fTrigPad;              //Pointer to the trigger pad 
00087   TPad             *fButtons;              //Pointer to the buttons pad
00088   TPad             *fPad;                  //Pointer to the event display main pad
00089   TArc             *fEM1;                  //Pointer to arc showing ON/OFF trigger EM1
00090   TArc             *fPH1;                  //Pointer to arc showing ON/OFF trigger PH1
00091   TArc             *fEM2;                  //Pointer to arc showing ON/OFF trigger EM2
00092   TArc             *fMU1;                  //Pointer to arc showing ON/OFF trigger MU1
00093   TArc             *fMU2;                  //Pointer to arc showing ON/OFF trigger MU2
00094   TArc             *fEMU;                  //Pointer to arc showing ON/OFF trigger EMU
00095   TArc             *fJT1;                  //Pointer to arc showing ON/OFF trigger JT1
00096   TArc             *fJT3;                  //Pointer to arc showing ON/OFF trigger JT3
00097   TArc             *fJT4;                  //Pointer to arc showing ON/OFF trigger JT4
00098   TArc             *fALL;                  //Pointer to arc showing ON/OFF trigger ALL
00099   TGeoVolume       *fBes;                  //Bes world volume
00100   Int_t             fRayPicCount;          //Counter of picture
00101   
00102   MdcROOTGeo       *fMdcROOTGeo;           //MdcROOTGeo
00103   TofROOTGeo       *fTofROOTGeo;           //TofROOTGeo
00104   EmcROOTGeo       *fEmcROOTGeo;           //EmcROOTGeo
00105   MucROOTGeo       *fMucROOTGeo;           //MucROOTGeo
00106   Int_t             fMdcCon;               //Mdc Construction flag
00107   Int_t             fTofCon;               //Tof Construction flag
00108   Int_t             fEmcCon;               //Emc Construction flag
00109   Int_t             fMucCon;               //Muc Construction flag
00110   Int_t             fAllVis;               //All node visible flag
00111   Int_t             fQuarterVis;           //Quarter  visible flag
00112   Int_t             fHalfVis;              //Half     visible flag
00113   Int_t             fNoEndVis;              //NoEnd    visible flag
00114   BesView          *fxyView;               // XY View pointer;
00115   BesView          *fzrView;               // ZR View pointer;
00116   BesView          *f3DView;               // 3D View pointer;
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);  // *TOGGLE*
00142    inline Bool_t     GetMdcOn() { return fMdcOn; }
00143    virtual void      SetTofOn(Bool_t TofOn);  // *TOGGLE*
00144    inline Bool_t     GetTofOn() { return fTofOn; }
00145    virtual void      SetEmcOn(Bool_t EmcOn);  // *TOGGLE*
00146    inline Bool_t     GetEmcOn() { return fEmcOn; }
00147 
00148    virtual Bool_t    AllViews() {return fDrawAllViews;}
00149    virtual void      Clear(Option_t *option="");
00150    //virtual void      DisplayButtons();
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); // *MENU*
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    //TNode            *Nodin() {return fNodin;}
00181    //TTUBE            *Tubin() {return fTubin;}
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;}   // *MENU*
00192    virtual void      SetDrawParticles(Bool_t draw=kTRUE) {fDrawParticles=draw;} // *MENU*
00193    
00194    virtual void      SetPTcut(Float_t ptcut=0.4); // *MENU*
00195    virtual void      SetPTcutEGMUNU(Float_t ptcut=5); // *MENU*
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)   //Utility class to display ATLAS outline, tracks, clusters, jets,..
00217 };
00218 
00219 R__EXTERN BesVisDisplay *gDisplay;
00220 
00221 #endif

Generated on Tue Nov 29 23:12:01 2016 for BOSS_7.0.2 by  doxygen 1.4.7