]>
Commit | Line | Data |
---|---|---|
37b3f607 | 1 | #ifndef ALI_MUON_DATA_INTERFACE_H |
2 | #define ALI_MUON_DATA_INTERFACE_H | |
30178c30 | 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 | |
48b32e42 | 8 | |
9 | // Author: Artur Szostak | |
10 | // email: artur@alice.phy.uct.ac.za | |
11 | ||
12 | #include <TObject.h> | |
13 | #include <TString.h> | |
48b32e42 | 14 | |
48b32e42 | 15 | #include "AliMUONData.h" |
16 | ||
30178c30 | 17 | class TParticle; |
18 | ||
19 | class AliRunLoader; | |
20 | class AliLoader; | |
21 | class AliMUONRawCluster; | |
22 | class AliMUONLocalTrigger; | |
23 | class AliMUONHit; | |
24 | class AliMUONDigit; | |
48b32e42 | 25 | |
26 | ||
27 | // An easy to use interface to the MUON module data stored in TreeK, TreeH, TreeS, TreeD and TreeR | |
28 | // One can fetch any of the data objects with all the calls to runloader, muon loader and AliMUONData | |
29 | // done behind the scenes and automatically. | |
30 | // This interface in not necessarily the fastest way to fetch the data but it is the easiest. | |
31 | // Note: If independant calls to the run loader, muon loader or AliMUONData objects are interspersed | |
32 | // with calls to the AliMUONDataInterface to fetch data, one might need to call the Reset method | |
33 | // between these method calls at some point to prevent AliMUONDataInterface from getting confused. | |
34 | // This is necessary since this object assumes the state of runloader, muon loader nor AliMUONData | |
35 | // has not changed between calls. If the state has changes then one must call Reset so that | |
36 | // AliMUONDataInterface refreshes what it knows about the state of the loader and AliMUONData objects. | |
37 | // | |
38 | class AliMUONDataInterface : public TObject | |
39 | { | |
40 | public: | |
41 | ||
42 | AliMUONDataInterface(); | |
43 | ~AliMUONDataInterface(); | |
44 | ||
45 | // Sets all internal pointers to NULL without releasing the current runloader. | |
46 | void Reset(); | |
47 | ||
48 | Int_t NumberOfEvents(TString filename, TString foldername); | |
49 | ||
50 | Int_t NumberOfParticles(TString filename, TString foldername, Int_t event); | |
51 | TParticle* Particle(TString filename, TString foldername, Int_t event, Int_t particle); | |
52 | ||
53 | Int_t NumberOfTracks(TString filename, TString foldername, Int_t event); | |
54 | Int_t NumberOfHits(TString filename, TString foldername, Int_t event, Int_t track); | |
55 | AliMUONHit* Hit(TString filename, TString foldername, Int_t event, Int_t track, Int_t hit); | |
56 | ||
57 | Int_t NumberOfSDigits(TString filename, TString foldername, Int_t event, Int_t chamber, Int_t cathode); | |
58 | AliMUONDigit* SDigit(TString filename, TString foldername, Int_t event, Int_t chamber, Int_t cathode, Int_t sdigit); | |
59 | ||
60 | Int_t NumberOfDigits(TString filename, TString foldername, Int_t event, Int_t chamber, Int_t cathode); | |
61 | AliMUONDigit* Digit(TString filename, TString foldername, Int_t event, Int_t chamber, Int_t cathode, Int_t digit); | |
62 | ||
63 | Int_t NumberOfRawClusters(TString filename, TString foldername, Int_t event, Int_t chamber); | |
64 | AliMUONRawCluster* RawCluster(TString filename, TString foldername, Int_t event, Int_t chamber, Int_t cluster); | |
65 | ||
66 | Int_t NumberOfLocalTriggers(TString filename, TString foldername, Int_t event); | |
67 | AliMUONLocalTrigger* LocalTrigger(TString filename, TString foldername, Int_t event, Int_t trigger); | |
68 | ||
69 | Bool_t SetFile(TString filename = "galice.root", TString foldername = "MUONFolder"); | |
70 | Bool_t GetEvent(Int_t event = 0); | |
71 | ||
72 | Int_t NumberOfEvents(); | |
73 | ||
74 | Int_t NumberOfParticles(); | |
75 | TParticle* Particle(Int_t particle); | |
76 | ||
77 | Int_t NumberOfTracks(); | |
78 | Int_t NumberOfHits(Int_t track); | |
79 | AliMUONHit* Hit(Int_t track, Int_t hit); | |
80 | ||
81 | Int_t NumberOfSDigits(Int_t chamber, Int_t cathode); | |
82 | AliMUONDigit* SDigit(Int_t chamber, Int_t cathode, Int_t sdigit); | |
83 | ||
84 | Int_t NumberOfDigits(Int_t chamber, Int_t cathode); | |
85 | AliMUONDigit* Digit(Int_t chamber, Int_t cathode, Int_t digit); | |
86 | ||
87 | Int_t NumberOfRawClusters(Int_t chamber); | |
88 | AliMUONRawCluster* RawCluster(Int_t chamber, Int_t cluster); | |
89 | ||
90 | Int_t NumberOfLocalTriggers(); | |
91 | AliMUONLocalTrigger* LocalTrigger(Int_t trigger); | |
92 | ||
93 | ||
94 | // Returns the name of the currently selected file. | |
30178c30 | 95 | TString CurrentFile() const { return fFilename; }; |
48b32e42 | 96 | |
97 | // Returns the name of the currently selected folder. | |
30178c30 | 98 | TString CurrentFolder() const { return fFoldername; }; |
48b32e42 | 99 | |
100 | // Returns the number of the currently selected event. | |
30178c30 | 101 | Int_t CurrentEvent() const { return fEventnumber; }; |
48b32e42 | 102 | |
103 | // Returns the currently selected track. | |
30178c30 | 104 | Int_t CurrentTrack() const { return fTrack; }; |
48b32e42 | 105 | |
106 | // Returns the currently selected cathode in TreeS. | |
30178c30 | 107 | Int_t CurrentSCathode() const { return fSCathode; }; |
48b32e42 | 108 | |
109 | // Returns the currently selected cathode in TreeD. | |
30178c30 | 110 | Int_t CurrentDCathode() const { return fCathode; }; |
48b32e42 | 111 | |
11ca64ac | 112 | protected: |
113 | AliMUONDataInterface(const AliMUONDataInterface& rhs); | |
114 | AliMUONDataInterface& operator=(const AliMUONDataInterface& rhs); | |
48b32e42 | 115 | private: |
116 | ||
117 | Bool_t LoadLoaders(TString filename, TString foldername); | |
118 | Bool_t FetchLoaders(TString filename, TString foldername); | |
119 | Bool_t FetchEvent(Int_t event); | |
120 | Bool_t FetchTreeK(); | |
121 | Bool_t FetchTreeH(); | |
122 | Bool_t FetchTreeS(); | |
123 | Bool_t FetchTreeD(); | |
124 | Bool_t FetchTreeR(); | |
125 | ||
126 | ||
127 | Bool_t fHitAddressSet; //! Flag specifying if the TTree address for the hit tree was set. | |
128 | Bool_t fSDigitAddressSet; //! Flag specifying if the TTree address for the s-digit tree was set. | |
129 | Bool_t fDigitAddressSet; //! Flag specifying if the TTree address for the digit tree was set. | |
130 | Bool_t fClusterAddressSet; //! Flag specifying if the TTree address for the cluster tree was set. | |
131 | Bool_t fTriggerAddressSet; //! Flag specifying if the TTree address for the trigger tree was set. | |
132 | ||
133 | AliRunLoader* fRunloader; //! Pointer to the runloader object used. | |
134 | AliLoader* fMuonloader; //! Pointer to the muon loader object used. | |
135 | AliMUONData fData; //! Pointer to the muon raw data interface. | |
136 | TString fFilename; //! The file name from which we are fetching data. | |
137 | TString fFoldername; //! The folder name from which we are fetching data. | |
138 | Int_t fEventnumber; //! The currently selected event. | |
139 | Int_t fTrack; //! The currently selected track. | |
140 | Int_t fSCathode; //! The currently selected cathode in TreeS. | |
141 | Int_t fCathode; //! The currently selected cathode in TreeD. | |
142 | ||
143 | ClassDef(AliMUONDataInterface, 0) // A easy to use interface to data in the MUON module. | |
144 | }; | |
145 | ||
146 | ||
37b3f607 | 147 | #endif // ALI_MUON_DATA_INTERFACE_H |