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 */
7 // Includes revised 07/05/2004
9 // Author: Artur Szostak
10 // email: artur@alice.phy.uct.ac.za
15 #include "AliMUONData.h"
21 class AliMUONRawCluster;
22 class AliMUONLocalTrigger;
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.
38 class AliMUONDataInterface : public TObject
42 AliMUONDataInterface();
43 ~AliMUONDataInterface();
45 // Sets all internal pointers to NULL without releasing the current runloader.
48 Bool_t UseCurrentRunLoader();
50 Int_t NumberOfEvents(TString filename, TString foldername);
52 Int_t NumberOfParticles(TString filename, TString foldername, Int_t event);
53 TParticle* Particle(TString filename, TString foldername, Int_t event, Int_t particle);
55 Int_t NumberOfTracks(TString filename, TString foldername, Int_t event);
56 Int_t NumberOfHits(TString filename, TString foldername, Int_t event, Int_t track);
57 AliMUONHit* Hit(TString filename, TString foldername, Int_t event, Int_t track, Int_t hit);
59 Int_t NumberOfSDigits(TString filename, TString foldername, Int_t event, Int_t chamber, Int_t cathode);
60 AliMUONDigit* SDigit(TString filename, TString foldername, Int_t event, Int_t chamber, Int_t cathode, Int_t sdigit);
62 Int_t NumberOfDigits(TString filename, TString foldername, Int_t event, Int_t chamber, Int_t cathode);
63 AliMUONDigit* Digit(TString filename, TString foldername, Int_t event, Int_t chamber, Int_t cathode, Int_t digit);
65 Int_t NumberOfRawClusters(TString filename, TString foldername, Int_t event, Int_t chamber);
66 AliMUONRawCluster* RawCluster(TString filename, TString foldername, Int_t event, Int_t chamber, Int_t cluster);
68 Int_t NumberOfLocalTriggers(TString filename, TString foldername, Int_t event);
69 AliMUONLocalTrigger* LocalTrigger(TString filename, TString foldername, Int_t event, Int_t trigger);
71 Bool_t SetFile(TString filename = "galice.root", TString foldername = "MUONFolder");
72 Bool_t GetEvent(Int_t event = 0);
74 Int_t NumberOfEvents();
76 Int_t NumberOfParticles();
77 TParticle* Particle(Int_t particle);
79 Int_t NumberOfTracks();
80 Int_t NumberOfHits(Int_t track);
81 AliMUONHit* Hit(Int_t track, Int_t hit);
83 Int_t NumberOfSDigits(Int_t chamber, Int_t cathode);
84 AliMUONDigit* SDigit(Int_t chamber, Int_t cathode, Int_t sdigit);
86 Int_t NumberOfDigits(Int_t chamber, Int_t cathode);
87 AliMUONDigit* Digit(Int_t chamber, Int_t cathode, Int_t digit);
89 Int_t NumberOfRawClusters(Int_t chamber);
90 AliMUONRawCluster* RawCluster(Int_t chamber, Int_t cluster);
92 Int_t NumberOfLocalTriggers();
93 AliMUONLocalTrigger* LocalTrigger(Int_t trigger);
96 // Returns the name of the currently selected file.
97 TString CurrentFile() const { return fFilename; };
99 // Returns the name of the currently selected folder.
100 TString CurrentFolder() const { return fFoldername; };
102 // Returns the number of the currently selected event.
103 Int_t CurrentEvent() const { return fEventnumber; };
105 // Returns the currently selected track.
106 Int_t CurrentTrack() const { return fTrack; };
108 // Returns the currently selected cathode in TreeS.
109 Int_t CurrentSCathode() const { return fSCathode; };
111 // Returns the currently selected cathode in TreeD.
112 Int_t CurrentDCathode() const { return fCathode; };
115 AliMUONDataInterface(const AliMUONDataInterface& rhs);
116 AliMUONDataInterface& operator=(const AliMUONDataInterface& rhs);
120 Bool_t FetchMuonLoader(TString filename, TString foldername);
121 Bool_t LoadLoaders(TString filename, TString foldername);
122 Bool_t FetchLoaders(TString filename, TString foldername);
123 Bool_t FetchEvent(Int_t event);
130 Bool_t fCreatedRunLoader; //! If this object created the fRunloader then this flag is set.
132 Bool_t fHitAddressSet; //! Flag specifying if the TTree address for the hit tree was set.
133 Bool_t fSDigitAddressSet; //! Flag specifying if the TTree address for the s-digit tree was set.
134 Bool_t fDigitAddressSet; //! Flag specifying if the TTree address for the digit tree was set.
135 Bool_t fClusterAddressSet; //! Flag specifying if the TTree address for the cluster tree was set.
136 Bool_t fTriggerAddressSet; //! Flag specifying if the TTree address for the trigger tree was set.
138 AliRunLoader* fRunloader; //! Pointer to the runloader object used.
139 AliLoader* fMuonloader; //! Pointer to the muon loader object used.
140 AliMUONData fData; //! Pointer to the muon raw data interface.
141 TString fFilename; //! The file name from which we are fetching data.
142 TString fFoldername; //! The folder name from which we are fetching data.
143 Int_t fEventnumber; //! The currently selected event.
144 Int_t fTrack; //! The currently selected track.
145 Int_t fSCathode; //! The currently selected cathode in TreeS.
146 Int_t fCathode; //! The currently selected cathode in TreeD.
148 ClassDef(AliMUONDataInterface, 0) // A easy to use interface to data in the MUON module.
152 #endif // ALI_MUON_DATA_INTERFACE_H