]> git.uio.no Git - u/mrichter/AliRoot.git/blob - MUON/AliMUONDataInterface.h
Complete rewriting (old interface is still there but not functional and highly deprec...
[u/mrichter/AliRoot.git] / MUON / AliMUONDataInterface.h
1 #ifndef ALI_MUON_DATA_INTERFACE_H
2 #define ALI_MUON_DATA_INTERFACE_H
3 /*  Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
4  * See cxx source for full Copyright notice                               */
5
6 /* $Id$ */
7 // Includes revised 07/05/2004
8 //
9 /// \ingroup evaluation
10 /// \class AliMUONDataInterface
11 /// \brief An easy to use interface to MUON data
12
13 // Author: Artur Szostak
14 //  email: artur@alice.phy.uct.ac.za
15 //
16 // Updated to MUON module w/o MUONData by Laurent Aphecetche, Subatech
17 //
18
19 #include <TObject.h>
20
21 class AliMUONDataManager;
22 class AliMUONVDigitStore;
23 class AliMUONVTriggerStore;
24 class AliMUONVTriggerTrackStore;
25 class AliMUONVClusterStore;
26 class AliMUONVTrackStore;
27
28 // >>LA should not needed (once we remove deprecated methods)
29 class AliMUONHit; 
30 class AliMUONDigit;
31 class AliMUONLocalTrigger;
32 class AliMUONGlobalTrigger;
33 class AliMUONRawCluster;
34 class AliMUONTrack;
35 class TParticle;
36 // <<LA
37 class TList;
38
39 class AliMUONDataInterface : public TObject
40 {
41  public:
42   
43   AliMUONDataInterface(const char* filename="galice.root");
44   virtual ~AliMUONDataInterface();
45   
46   Bool_t IsValid() const;
47
48   AliMUONVClusterStore* ClusterStore(Int_t event) const;
49   void DumpRecPoints(Int_t event, Bool_t sorted=kFALSE) const;
50
51   /** Return the digit store for one event. The returned pointer should be
52     deleted by the client.
53     */
54   AliMUONVDigitStore* DigitStore(Int_t event) const;  
55   void DumpDigits(Int_t event, Bool_t sorted=kFALSE) const;
56   TList* DigitStoreAsList(Int_t event) const;
57   
58   Int_t NumberOfEvents() const;
59
60   AliMUONVDigitStore* SDigitStore(Int_t event) const;
61   void DumpSDigits(Int_t event, Bool_t sorted=kFALSE) const;
62   
63   AliMUONVTrackStore* TrackStore(Int_t event) const;
64   void DumpTracks(Int_t event, Bool_t sorted=kFALSE) const;
65   
66   /// Get the triggerStore from the given tree (can be "D" or "R").
67   AliMUONVTriggerStore* TriggerStore(Int_t event, const char* treeLetter) const;
68   void DumpTrigger(Int_t event, const char* treeLetter="R") const;
69   
70   AliMUONVTriggerTrackStore* TriggerTrackStore(Int_t event) const;
71   void DumpTriggerTracks(Int_t event, Bool_t sorted=kFALSE) const;
72   
73   // all the methods below are deprecated.
74   
75   // Sets all internal pointers to NULL without releasing the current runloader.
76   void Reset();
77   
78   Bool_t UseCurrentRunLoader();
79   
80   Int_t NumberOfEvents(TString filename, TString foldername);
81   
82   Int_t NumberOfParticles(TString filename, TString foldername, Int_t event);
83   TParticle* Particle(TString filename, TString foldername, Int_t event, Int_t particle);
84   
85   Int_t NumberOfTracks(TString filename, TString foldername, Int_t event);
86   Int_t NumberOfHits(TString filename, TString foldername, Int_t event, Int_t track);
87   AliMUONHit* Hit(TString filename, TString foldername, Int_t event, Int_t track, Int_t hit);
88   
89   Int_t NumberOfSDigits(TString filename, TString foldername, Int_t event, Int_t chamber, Int_t cathode);
90   AliMUONDigit* SDigit(TString filename, TString foldername, Int_t event, Int_t chamber, Int_t cathode, Int_t sdigit);
91   
92   Int_t NumberOfDigits(TString filename, TString foldername, Int_t event, Int_t chamber, Int_t cathode);
93   AliMUONDigit* Digit(TString filename, TString foldername, Int_t event, Int_t chamber, Int_t cathode, Int_t digit);
94   
95   Int_t NumberOfRawClusters(TString filename, TString foldername, Int_t event, Int_t chamber);
96   AliMUONRawCluster* RawCluster(TString filename, TString foldername, Int_t event, Int_t chamber, Int_t cluster);
97   
98   Int_t NumberOfLocalTriggers(TString filename, TString foldername, Int_t event);
99   AliMUONLocalTrigger* LocalTrigger(TString filename, TString foldername, Int_t event, Int_t trigger);
100   
101   Bool_t SetFile(TString filename = "galice.root", TString foldername = "MUONFolder");
102   Bool_t GetEvent(Int_t event = 0);
103   
104   Int_t NumberOfParticles();
105   TParticle* Particle(Int_t particle);
106   
107   Int_t NumberOfTracks();
108   Int_t NumberOfHits(Int_t track);
109   AliMUONHit* Hit(Int_t track, Int_t hit);
110   
111   Int_t NumberOfSDigits(Int_t chamber, Int_t cathode);
112   AliMUONDigit* SDigit(Int_t chamber, Int_t cathode, Int_t sdigit);
113   
114   Int_t NumberOfDigits(Int_t chamber, Int_t cathode);
115   AliMUONDigit* Digit(Int_t chamber, Int_t cathode, Int_t digit);
116   
117   Int_t NumberOfRawClusters(Int_t chamber);
118   AliMUONRawCluster* RawCluster(Int_t chamber, Int_t cluster);
119   
120   Int_t NumberOfLocalTriggers();
121   AliMUONLocalTrigger* LocalTrigger(Int_t trigger);
122   
123   Int_t NumberOfGlobalTriggers();
124   AliMUONGlobalTrigger* GlobalTrigger(Int_t trigger);
125   // Returns the name of the currently selected file.
126   
127   Int_t NumberOfRecTracks();
128   AliMUONTrack* RecTrack(Int_t rectrack);
129   
130   /// Returns the file name from which we are fetching data
131   TString CurrentFile() const { return ""; }
132   
133   /// Returns the name of the currently selected folder.
134   TString CurrentFolder() const { return ""; }
135   
136   /// Returns the number of the currently selected event.
137   Int_t   CurrentEvent() const { return 0; }
138   
139   /// Returns the currently selected track.
140   Int_t   CurrentTrack() const { return 0; }
141   
142   /// Returns the currently selected cathode in TreeS.
143   Int_t   CurrentSCathode() const { return 0; }
144   
145   /// Returns the currently selected cathode in TreeD.
146   Int_t   CurrentDCathode() const { return 0; }
147   
148  private:
149     
150   void DumpIt(const char* treeLetter, const char* what, Int_t event, Bool_t sorted) const;
151   
152   /// Not implemented
153   AliMUONDataInterface(const AliMUONDataInterface& rhs);
154   /// Not implemented
155   AliMUONDataInterface& operator=(const AliMUONDataInterface& rhs);
156
157   AliMUONDataManager* fDataManager; //!< Internal data accessor
158   
159   ClassDef(AliMUONDataInterface, 0)  // An easy to use interface to MUON data
160 };
161     
162
163 #endif // ALI_MUON_DATA_INTERFACE_H