Coverity
[u/mrichter/AliRoot.git] / EVE / EveDet / AliEveTRDLoader.h
CommitLineData
d810d0de 1// $Id$
2// Main authors: Matevz Tadel & Alja Mrak-Tadel: 2006, 2007
3
4/**************************************************************************
5 * Copyright(c) 1998-2008, ALICE Experiment at CERN, all rights reserved. *
6 * See http://aliceinfo.cern.ch/Offline/AliRoot/License.html for *
51346b82 7 * full copyright notice. *
d810d0de 8 **************************************************************************/
a15e6d7d 9#ifndef AliEveTRDLoader_H
10#define AliEveTRDLoader_H
a282bf09 11
12////////////////////////////////////////////////////////////////////////
a15e6d7d 13// - ALIEVE implementation -
51346b82 14// Loader for the TRD detector - base class
d810d0de 15// - AliEveTRDLoader - loader of TRD data (simulation + measured)
16// - AliEveTRDLoaderEditor - UI
a282bf09 17//
18// by A.Bercuci (A.Bercuci@gsi.de) Fri Oct 27 2006
19////////////////////////////////////////////////////////////////////////
20
84aff7a4 21#include <TEveElement.h>
a282bf09 22#include <TGedFrame.h>
84aff7a4 23#include <TString.h>
a282bf09 24
a282bf09 25class AliTRDv1;
14217b5f 26class AliTRDgeometry;
a282bf09 27
a282bf09 28class TGNumberEntry;
29class TGColorSelect;
30class TGTextEntry;
31class TTree;
84aff7a4 32
33class TEveGValuator;
34
fd31e9de 35class AliEveTRDChamber;
36class AliEveTRDLoaderManager;
37
38class AliEveTRDLoader : public TEveElementList
39{
40 friend class AliEveTRDLoaderEditor;
41
fd31e9de 42public:
43 enum TRDDataTypes {
6983e87a 44 kTRDHits = BIT(0),
45 kTRDDigits = BIT(1),
46 kTRDClusters = BIT(2),
47 kTRDTracklets= BIT(3),
48 kTRDRawRoot = BIT(4),
49 kTRDRawDate = BIT(5)
fd31e9de 50 };
51
fd31e9de 52 AliEveTRDLoader(const Text_t* n="AliEveTRDLoader", const Text_t* t=0);
a15e6d7d 53 virtual ~AliEveTRDLoader() {}
54
6983e87a 55 virtual void AddChambers(int sm=-1, int stk=-1, int ly=-1);
56 virtual AliEveTRDChamber* GetChamber(int d);
1f9e7dfb 57 virtual Int_t GetDataType() const {return fDataType;}
58 virtual Int_t GetEvent() const {return fEvent;}
6983e87a 59 virtual Bool_t GoToEvent(int ev);
60 Bool_t IsDataLinked() const {return TestBit(1);}
61
62 virtual Bool_t Open(const char *file, const char *dir = ".");
63 inline virtual Bool_t NextEvent(Bool_t rewind = kTRUE);
fd31e9de 64 virtual void Paint(Option_t *option="");
6983e87a 65
66 virtual void SetDataType(UChar_t type = 0){fDataType = type;}
fd31e9de 67
4b456ebb 68
fd31e9de 69protected:
6983e87a 70 virtual Bool_t LoadHits(TTree *tH);
fd31e9de 71 virtual Bool_t LoadClusters(TTree *tC);
72 virtual Bool_t LoadDigits(TTree *tD);
a879a24a 73 virtual Bool_t LoadTracklets(TTree *trklTree);
6983e87a 74 void SetDataLinked(Bool_t linked = kTRUE) {SetBit(1, linked);}
75
fd31e9de 76 virtual void Unload();
77
6983e87a 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
fd31e9de 83 TString fFilename; // name of data file
84 TString fDir; // data directory
fd31e9de 85
4b456ebb 86private:
87 AliEveTRDLoader(const AliEveTRDLoader&); // Not implemented
88 AliEveTRDLoader& operator=(const AliEveTRDLoader&); // Not implemented
89
90 ClassDef(AliEveTRDLoader, 0); // Alieve Loader class for the TRD detector.
fd31e9de 91};
92
6983e87a 93Bool_t AliEveTRDLoader::NextEvent(Bool_t)
94{
95 fEvent++;
96 return GoToEvent(fEvent);
97}
fd31e9de 98
99class AliEveTRDLoaderEditor : public TGedFrame
100{
fd31e9de 101public:
102 AliEveTRDLoaderEditor(const TGWindow* p=0, Int_t width=170, Int_t height=30,
103 UInt_t options=kChildFrame, Pixel_t back=GetDefaultFrameBackground());
a15e6d7d 104 virtual ~AliEveTRDLoaderEditor() {}
fd31e9de 105
106 virtual void AddChambers();
107 virtual void FileOpen();
6983e87a 108 virtual void GoTo();
109 virtual void Next();
fd31e9de 110 virtual void SetEvent(Double_t ev){fM->fEvent = (Int_t)ev;}
111 virtual void SetModel(TObject* obj);
112
113protected:
a15e6d7d 114 AliEveTRDLoader *fM; // Model object.
6983e87a 115 TGTextEntry *fFile; // File name weed.
116 TGTextButton *fBrowse; // browse button
a15e6d7d 117 TEveGValuator *fEvent; // Event no weed.
118 TEveGValuator *fSMNumber, *fStackNumber, *fPlaneNumber; // Detector id weeds.
fd31e9de 119
4b456ebb 120private:
121 AliEveTRDLoaderEditor(const AliEveTRDLoaderEditor&); // Not implemented
122 AliEveTRDLoaderEditor& operator=(const AliEveTRDLoaderEditor&); // Not implemented
123
124 ClassDef(AliEveTRDLoaderEditor, 0); // Editor for AliEveTRDLoader.
fd31e9de 125};
51346b82 126
a282bf09 127#endif