]> git.uio.no Git - u/mrichter/AliRoot.git/blob - EVE/Alieve/TRDLoader.h
First big commit of the mchview program and its accompanying library,
[u/mrichter/AliRoot.git] / EVE / Alieve / TRDLoader.h
1 #ifndef ALIEVE_TRDLoader_H
2 #define ALIEVE_TRDLoader_H
3
4 ////////////////////////////////////////////////////////////////////////
5 //                                                                      // - ALIEVE implementation -
6 // Loader for the TRD detector - base class 
7 //    - TRDLoader - loader of TRD data (simulation + measured)
8 //    - TRDLoaderEditor - UI
9 //
10 // by A.Bercuci (A.Bercuci@gsi.de)   Fri Oct 27 2006
11 ////////////////////////////////////////////////////////////////////////
12
13 #ifndef REVE_RenderElement_H
14 #include <Reve/RenderElement.h>
15 #endif
16
17 #ifndef ROOT_TString
18 #include <TString.h>
19 #endif
20
21 #ifndef ROOT_TGedFrame
22 #include <TGedFrame.h>
23 #endif
24
25 class AliTRDv1;
26 class AliTRDgeometry;
27
28 class TGNumberEntry;
29 class TGColorSelect;
30 class TGTextEntry;
31 class TTree;
32 namespace Reve {
33         class RGValuator;
34 }
35 namespace Alieve {
36         class TRDChamber;
37         class TRDLoaderManager;
38         enum TRDDataTypes{
39                 kHits = 0,
40                 kDigits = 1,
41                 kClusters = 2,
42                 kTracks = 3,
43                 kRawRoot = 4,
44                 kRawData = 5
45         };
46         class TRDLoader : public Reve::RenderElementList
47         {
48         friend class TRDLoaderEditor;
49         public:
50                 TRDLoader(const Text_t* n="TRDLoader", const Text_t* t=0x0);
51                 ~TRDLoader();
52                 virtual void            Paint(Option_t *option="");
53                 virtual void            SetDataType(TRDDataTypes type);
54         protected:
55                 virtual void            AddChambers(int sm=-1, int stk=-1, int ly=-1);
56                 virtual TRDChamber*     GetChamber(int d);
57                 virtual Bool_t  GoToEvent(int ev);
58                 virtual Bool_t  LoadClusters(TTree *tC);
59                 virtual Bool_t  LoadDigits(TTree *tD);
60                 virtual Bool_t  LoadTracklets(TTree *tT);
61                 virtual Bool_t  Open(const char *file, const char *dir = ".");
62                 virtual void            Unload();
63
64         protected:
65                 Bool_t  kLoadHits, kLoadDigits, kLoadClusters, kLoadTracks;
66                 Int_t           fSM, fStack, fLy; // supermodule, stack, layer
67                 TString fFilename; // name of data file 
68                 TString fDir; // data directory
69                 Int_t           fEvent; // current event to be displayed
70                         
71
72                 AliTRDv1                                        *fTRD; // the TRD detector
73                 AliTRDgeometry          *fGeo; // the TRD geometry
74                 
75                 ClassDef(TRDLoader, 1) // Alieve Loader class for the TRD detector
76         };
77
78
79         
80         class TRDLoaderEditor : public TGedFrame
81         {
82         public:
83                 TRDLoaderEditor(const TGWindow* p=0, Int_t width = 170, Int_t height = 30, UInt_t options = kChildFrame, Pixel_t back = GetDefaultFrameBackground());
84                 ~TRDLoaderEditor();
85
86                 virtual void    AddChambers();
87                 virtual void    FileOpen();
88                 virtual void    Load();
89                 virtual void    SetEvent(Double_t ev){fM->fEvent = (Int_t)ev;}
90                 virtual void    SetModel(TObject* obj);
91                 
92         protected:
93                 TRDLoader                                       *fM;
94         TGTextEntry                             *fFile;
95                 Reve::RGValuator        *fEvent;
96                 Reve::RGValuator        *fSMNumber, *fStackNumber, *fPlaneNumber;
97                 
98                 ClassDef(TRDLoaderEditor,1) // Editor for TRDLoader
99         };
100         
101 }
102 #endif