TRestEventViewer.h 2.92 KB
Newer Older
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
///______________________________________________________________________________
///______________________________________________________________________________
///______________________________________________________________________________
///             
///
///             RESTSoft : Software for Rare Event Searches with TPCs
///
///             TRestEventViewer.h
///
///             A geometry class to store detector geometry 
///
///             jul 2015:   First concept
///                 J. Galan
///_______________________________________________________________________________


#ifndef RestCore_TRestEventViewer
#define RestCore_TRestEventViewer

#include <iostream>
using namespace std;

#include <TObject.h>
#include <TVector3.h>
#include <TGeoMaterial.h>
#include <TGeoManager.h>
#include <TPad.h>
#include <TGLViewer.h>

#include "TRestEvent.h"

#include <TNamed.h>
#include <TEveManager.h>
#include <TEveEventManager.h>
#include <TEveProjectionManager.h>
#include <TEveProjectionAxes.h>
#include <TEveViewer.h>
#include <TEveArrow.h>
#include <TGeoNode.h>
#include <TEveLine.h>
#include <TEveText.h>
#include <TEveTrans.h>
#include <TEveGeoNode.h>
#include <TEveScene.h>
#include <TEveBrowser.h>
#include <TGTab.h>

#define GEOM_SCALE 0.1

class TRestEventViewer:public TNamed {

    private:
    TEveManager *gEve;
    
    TEveWindowSlot  *slot;
    TEveWindowPack *pack;
    
    TEveViewer *viewer3D;
    TEveViewer *rphiViewer;
    TEveViewer *rhozViewer;
    
    TEveScene *rphiScene;
    TEveScene *rhozScene;
    
    TEveProjectionManager* rphi;
    TEveProjectionManager* rhoz;
    
    TEveProjectionAxes* rphiAxes;
    TEveProjectionAxes* rhozAxes;
    
    Bool_t isMultiView;
    
    char pointName[256];
 
    vector <TEveLine *> fHitConnectors;
    
    protected:
        
    Int_t nDeposits;
    
    void AddMarker( TVector3 at, TString name );

    public:


    virtual void Initialize();

    virtual void AddEvent( TRestEvent *ev ) = 0;
    
    void DeleteCurrentEvent(  );

    virtual void Draw(  );
        
    void AddGeometry( TGeoManager *geo );
    void AddGeometry( TString fName );
    
    void DeleteGeometry( );
    
    void AddSphericalHit( double x, double y, double z, double radius );
    void AddSphericalHit( double x, double y, double z, double radius, double en );
    void NextTrackVertex( Int_t trkID, TVector3 to );
    void AddTrack( Int_t trkID, Int_t parentID, TVector3 from, TString name );
    void AddParentTrack( Int_t trkID, TVector3 from, TString name );

    void AddText( TString text, TVector3 at );
    void AddMarker( Int_t trkID, TVector3 at, TString name );
    
    void AddPoints( Int_t npoints, TVector3 at[ ] , Double_t radius);
    
    void MultiView( );
    void AddProjectedEvent( );
    
    void Update( );
    
    //Construtor
    TRestEventViewer();
    //Destructor
    virtual ~ TRestEventViewer();

    ClassDef(TRestEventViewer, 1);     // REST event superclass
};
#endif