1 #ifndef ALI_MUON_DATA_INTERFACE_H
2 #define ALI_MUON_DATA_INTERFACE_H
4 // Author: Artur Szostak
5 // email: artur@alice.phy.uct.ac.za
11 #include "AliRunLoader.h"
12 #include "AliLoader.h"
13 #include "AliMUONData.h"
15 #include "AliMUONHit.h"
16 #include "AliMUONDigit.h"
17 #include "AliMUONRawCluster.h"
18 #include "AliMUONLocalTrigger.h"
21 // An easy to use interface to the MUON module data stored in TreeK, TreeH, TreeS, TreeD and TreeR
22 // One can fetch any of the data objects with all the calls to runloader, muon loader and AliMUONData
23 // done behind the scenes and automatically.
24 // This interface in not necessarily the fastest way to fetch the data but it is the easiest.
25 // Note: If independant calls to the run loader, muon loader or AliMUONData objects are interspersed
26 // with calls to the AliMUONDataInterface to fetch data, one might need to call the Reset method
27 // between these method calls at some point to prevent AliMUONDataInterface from getting confused.
28 // This is necessary since this object assumes the state of runloader, muon loader nor AliMUONData
29 // has not changed between calls. If the state has changes then one must call Reset so that
30 // AliMUONDataInterface refreshes what it knows about the state of the loader and AliMUONData objects.
32 class AliMUONDataInterface : public TObject
36 AliMUONDataInterface();
37 ~AliMUONDataInterface();
39 // Sets all internal pointers to NULL without releasing the current runloader.
42 Int_t NumberOfEvents(TString filename, TString foldername);
44 Int_t NumberOfParticles(TString filename, TString foldername, Int_t event);
45 TParticle* Particle(TString filename, TString foldername, Int_t event, Int_t particle);
47 Int_t NumberOfTracks(TString filename, TString foldername, Int_t event);
48 Int_t NumberOfHits(TString filename, TString foldername, Int_t event, Int_t track);
49 AliMUONHit* Hit(TString filename, TString foldername, Int_t event, Int_t track, Int_t hit);
51 Int_t NumberOfSDigits(TString filename, TString foldername, Int_t event, Int_t chamber, Int_t cathode);
52 AliMUONDigit* SDigit(TString filename, TString foldername, Int_t event, Int_t chamber, Int_t cathode, Int_t sdigit);
54 Int_t NumberOfDigits(TString filename, TString foldername, Int_t event, Int_t chamber, Int_t cathode);
55 AliMUONDigit* Digit(TString filename, TString foldername, Int_t event, Int_t chamber, Int_t cathode, Int_t digit);
57 Int_t NumberOfRawClusters(TString filename, TString foldername, Int_t event, Int_t chamber);
58 AliMUONRawCluster* RawCluster(TString filename, TString foldername, Int_t event, Int_t chamber, Int_t cluster);
60 Int_t NumberOfLocalTriggers(TString filename, TString foldername, Int_t event);
61 AliMUONLocalTrigger* LocalTrigger(TString filename, TString foldername, Int_t event, Int_t trigger);
63 Bool_t SetFile(TString filename = "galice.root", TString foldername = "MUONFolder");
64 Bool_t GetEvent(Int_t event = 0);
66 Int_t NumberOfEvents();
68 Int_t NumberOfParticles();
69 TParticle* Particle(Int_t particle);
71 Int_t NumberOfTracks();
72 Int_t NumberOfHits(Int_t track);
73 AliMUONHit* Hit(Int_t track, Int_t hit);
75 Int_t NumberOfSDigits(Int_t chamber, Int_t cathode);
76 AliMUONDigit* SDigit(Int_t chamber, Int_t cathode, Int_t sdigit);
78 Int_t NumberOfDigits(Int_t chamber, Int_t cathode);
79 AliMUONDigit* Digit(Int_t chamber, Int_t cathode, Int_t digit);
81 Int_t NumberOfRawClusters(Int_t chamber);
82 AliMUONRawCluster* RawCluster(Int_t chamber, Int_t cluster);
84 Int_t NumberOfLocalTriggers();
85 AliMUONLocalTrigger* LocalTrigger(Int_t trigger);
88 // Returns the name of the currently selected file.
89 TString CurrentFile() { return fFilename; };
91 // Returns the name of the currently selected folder.
92 TString CurrentFolder() { return fFoldername; };
94 // Returns the number of the currently selected event.
95 Int_t CurrentEvent() { return fEventnumber; };
97 // Returns the currently selected track.
98 Int_t CurrentTrack() { return fTrack; };
100 // Returns the currently selected cathode in TreeS.
101 Int_t CurrentSCathode() { return fSCathode; };
103 // Returns the currently selected cathode in TreeD.
104 Int_t CurrentDCathode() { return fCathode; };
108 Bool_t LoadLoaders(TString filename, TString foldername);
109 Bool_t FetchLoaders(TString filename, TString foldername);
110 Bool_t FetchEvent(Int_t event);
118 Bool_t fHitAddressSet; //! Flag specifying if the TTree address for the hit tree was set.
119 Bool_t fSDigitAddressSet; //! Flag specifying if the TTree address for the s-digit tree was set.
120 Bool_t fDigitAddressSet; //! Flag specifying if the TTree address for the digit tree was set.
121 Bool_t fClusterAddressSet; //! Flag specifying if the TTree address for the cluster tree was set.
122 Bool_t fTriggerAddressSet; //! Flag specifying if the TTree address for the trigger tree was set.
124 AliRunLoader* fRunloader; //! Pointer to the runloader object used.
125 AliLoader* fMuonloader; //! Pointer to the muon loader object used.
126 AliMUONData fData; //! Pointer to the muon raw data interface.
127 TString fFilename; //! The file name from which we are fetching data.
128 TString fFoldername; //! The folder name from which we are fetching data.
129 Int_t fEventnumber; //! The currently selected event.
130 Int_t fTrack; //! The currently selected track.
131 Int_t fSCathode; //! The currently selected cathode in TreeS.
132 Int_t fCathode; //! The currently selected cathode in TreeD.
134 ClassDef(AliMUONDataInterface, 0) // A easy to use interface to data in the MUON module.
138 #endif // ALI_MUON_DATA_INTERFACE_H