2 // Main authors: Matevz Tadel & Alja Mrak-Tadel: 2006, 2007
4 /**************************************************************************
5 * Copyright(c) 1998-2008, ALICE Experiment at CERN, all rights reserved. *
6 * See http://aliceinfo.cern.ch/Offline/AliRoot/License.html for *
7 * full copyright notice. *
8 **************************************************************************/
9 #ifndef AliEveTRDLoader_H
10 #define AliEveTRDLoader_H
12 ////////////////////////////////////////////////////////////////////////
13 // - ALIEVE implementation -
14 // Loader for the TRD detector - base class
15 // - AliEveTRDLoader - loader of TRD data (simulation + measured)
16 // - AliEveTRDLoaderEditor - UI
18 // by A.Bercuci (A.Bercuci@gsi.de) Fri Oct 27 2006
19 ////////////////////////////////////////////////////////////////////////
21 #include <TEveElement.h>
22 #include <TGedFrame.h>
35 class AliEveTRDChamber;
36 class AliEveTRDLoaderManager;
38 class AliEveTRDLoader : public TEveElementList
40 friend class AliEveTRDLoaderEditor;
46 kTRDClusters = BIT(2),
47 kTRDTracklets= BIT(3),
52 AliEveTRDLoader(const Text_t* n="AliEveTRDLoader", const Text_t* t=0);
53 virtual ~AliEveTRDLoader() {}
55 virtual void AddChambers(int sm=-1, int stk=-1, int ly=-1);
56 virtual AliEveTRDChamber* GetChamber(int d);
57 virtual Int_t GetDataType() const {return fDataType;}
58 virtual Int_t GetEvent() const {return fEvent;}
59 virtual Bool_t GoToEvent(int ev);
60 Bool_t IsDataLinked() const {return TestBit(1);}
62 virtual Bool_t Open(const char *file, const char *dir = ".");
63 inline virtual Bool_t NextEvent(Bool_t rewind = kTRUE);
64 virtual void Paint(Option_t *option="");
66 virtual void SetDataType(UChar_t type = 0){fDataType = type;}
70 virtual Bool_t LoadHits(TTree *tH);
71 virtual Bool_t LoadClusters(TTree *tC);
72 virtual Bool_t LoadDigits(TTree *tD);
73 virtual Bool_t LoadTracklets(TTree *trklTree);
74 void SetDataLinked(Bool_t linked = kTRUE) {SetBit(1, linked);}
76 virtual void Unload();
78 UChar_t fDataType; // data type
79 //Bool_t fLoadHits, fLoadDigits, fLoadClusters, fLoadTracks; // flags for data-loading
80 Char_t fSM, fStack, fLy; // supermodule, stack, layer
81 Short_t fEvent; // current event to be displayed
82 AliTRDgeometry *fGeo; // the TRD geometry
83 TString fFilename; // name of data file
84 TString fDir; // data directory
87 AliEveTRDLoader(const AliEveTRDLoader&); // Not implemented
88 AliEveTRDLoader& operator=(const AliEveTRDLoader&); // Not implemented
90 ClassDef(AliEveTRDLoader, 0); // Alieve Loader class for the TRD detector.
93 Bool_t AliEveTRDLoader::NextEvent(Bool_t)
96 return GoToEvent(fEvent);
99 class AliEveTRDLoaderEditor : public TGedFrame
102 AliEveTRDLoaderEditor(const TGWindow* p=0, Int_t width=170, Int_t height=30,
103 UInt_t options=kChildFrame, Pixel_t back=GetDefaultFrameBackground());
104 virtual ~AliEveTRDLoaderEditor() {}
106 virtual void AddChambers();
107 virtual void FileOpen();
110 virtual void SetEvent(Double_t ev){fM->fEvent = (Int_t)ev;}
111 virtual void SetModel(TObject* obj);
114 AliEveTRDLoader *fM; // Model object.
115 TGTextEntry *fFile; // File name weed.
116 TGTextButton *fBrowse; // browse button
117 TEveGValuator *fEvent; // Event no weed.
118 TEveGValuator *fSMNumber, *fStackNumber, *fPlaneNumber; // Detector id weeds.
121 AliEveTRDLoaderEditor(const AliEveTRDLoaderEditor&); // Not implemented
122 AliEveTRDLoaderEditor& operator=(const AliEveTRDLoaderEditor&); // Not implemented
124 ClassDef(AliEveTRDLoaderEditor, 0); // Editor for AliEveTRDLoader.