]> git.uio.no Git - u/mrichter/AliRoot.git/blob - MUON/AliMUONDataInterface.h
Updated list of MUON libraries
[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 data in the MUON module
12
13 // Author: Artur Szostak
14 //  email: artur@alice.phy.uct.ac.za
15
16 #include <TObject.h>
17 #include <TString.h>
18
19 #include "AliMUONRecData.h"
20 #include "AliMUONSimData.h"
21
22 class TParticle;
23
24 class AliRunLoader;
25 class AliLoader;
26 class AliMUONRawCluster;
27 class AliMUONLocalTrigger;
28 class AliMUONHit;
29 class AliMUONDigit;
30 class AliMUONTrack;
31
32 class AliMUONDataInterface : public TObject
33 {
34  public:
35   
36   AliMUONDataInterface();
37   ~AliMUONDataInterface();
38   
39   // Sets all internal pointers to NULL without releasing the current runloader.
40   void Reset();
41   
42   Bool_t UseCurrentRunLoader();
43   
44   Int_t NumberOfEvents(TString filename, TString foldername);
45   
46   Int_t NumberOfParticles(TString filename, TString foldername, Int_t event);
47   TParticle* Particle(TString filename, TString foldername, Int_t event, Int_t particle);
48   
49   Int_t NumberOfTracks(TString filename, TString foldername, Int_t event);
50   Int_t NumberOfHits(TString filename, TString foldername, Int_t event, Int_t track);
51   AliMUONHit* Hit(TString filename, TString foldername, Int_t event, Int_t track, Int_t hit);
52   
53   Int_t NumberOfSDigits(TString filename, TString foldername, Int_t event, Int_t chamber, Int_t cathode);
54   AliMUONDigit* SDigit(TString filename, TString foldername, Int_t event, Int_t chamber, Int_t cathode, Int_t sdigit);
55   
56   Int_t NumberOfDigits(TString filename, TString foldername, Int_t event, Int_t chamber, Int_t cathode);
57   AliMUONDigit* Digit(TString filename, TString foldername, Int_t event, Int_t chamber, Int_t cathode, Int_t digit);
58   
59   Int_t NumberOfRawClusters(TString filename, TString foldername, Int_t event, Int_t chamber);
60   AliMUONRawCluster* RawCluster(TString filename, TString foldername, Int_t event, Int_t chamber, Int_t cluster);
61   
62   Int_t NumberOfLocalTriggers(TString filename, TString foldername, Int_t event);
63   AliMUONLocalTrigger* LocalTrigger(TString filename, TString foldername, Int_t event, Int_t trigger);
64   
65   Bool_t SetFile(TString filename = "galice.root", TString foldername = "MUONFolder");
66   Bool_t GetEvent(Int_t event = 0);
67   
68   Int_t NumberOfEvents();
69   
70   Int_t NumberOfParticles();
71   TParticle* Particle(Int_t particle);
72   
73   Int_t NumberOfTracks();
74   Int_t NumberOfHits(Int_t track);
75   AliMUONHit* Hit(Int_t track, Int_t hit);
76   
77   Int_t NumberOfSDigits(Int_t chamber, Int_t cathode);
78   AliMUONDigit* SDigit(Int_t chamber, Int_t cathode, Int_t sdigit);
79   
80   Int_t NumberOfDigits(Int_t chamber, Int_t cathode);
81   AliMUONDigit* Digit(Int_t chamber, Int_t cathode, Int_t digit);
82   
83   Int_t NumberOfRawClusters(Int_t chamber);
84   AliMUONRawCluster* RawCluster(Int_t chamber, Int_t cluster);
85   
86   Int_t NumberOfLocalTriggers();
87   AliMUONLocalTrigger* LocalTrigger(Int_t trigger);
88   
89   Int_t NumberOfGlobalTriggers();
90   AliMUONGlobalTrigger* GlobalTrigger(Int_t trigger);
91   // Returns the name of the currently selected file.
92   
93   Int_t NumberOfRecTracks();
94   AliMUONTrack* RecTrack(Int_t rectrack);
95   
96   /// Returns the file name from which we are fetching data
97   TString CurrentFile() const    { return fFilename;    };
98   
99   /// Returns the name of the currently selected folder.
100   TString CurrentFolder() const   { return fFoldername;  };
101   
102   /// Returns the number of the currently selected event.
103   Int_t   CurrentEvent() const    { return fEventnumber; };
104   
105   /// Returns the currently selected track.
106   Int_t   CurrentTrack() const    { return fTrack;       };
107   
108   /// Returns the currently selected cathode in TreeS.
109   Int_t   CurrentSCathode() const { return fSCathode;    };
110   
111   /// Returns the currently selected cathode in TreeD.
112   Int_t   CurrentDCathode() const { return fCathode;     };
113   
114  private:
115   /// Not implemented
116   AliMUONDataInterface(const AliMUONDataInterface& rhs);
117   /// Not implemented
118   AliMUONDataInterface& operator=(const AliMUONDataInterface& rhs);
119   
120   Bool_t FetchMuonLoader(TString filename);
121   Bool_t LoadLoaders(TString filename);
122   Bool_t FetchLoaders(TString filename);
123   Bool_t FetchEvent(Int_t event);
124   Bool_t FetchTreeK();
125   Bool_t FetchTreeH();
126   Bool_t FetchTreeS();
127   Bool_t FetchTreeD();
128   Bool_t FetchTreeR();
129   Bool_t FetchTreeT();
130   
131   Bool_t fCreatedRunLoader;   //!< If this object created the fRunloader then this flag is set. 
132   Bool_t fCreatedRunLoaderSim;//!< If this object created the fRunloader then this flag is set. 
133   
134   Bool_t fHitAddressSet;     //!< Flag specifying if the TTree address for the hit tree was set.
135   Bool_t fSDigitAddressSet;  //!< Flag specifying if the TTree address for the s-digit tree was set.
136   Bool_t fDigitAddressSet;   //!< Flag specifying if the TTree address for the digit tree was set.
137   Bool_t fClusterAddressSet; //!< Flag specifying if the TTree address for the cluster tree was set.
138   Bool_t fTriggerAddressSet; //!< Flag specifying if the TTree address for the trigger tree was set.
139   Bool_t fRecTracksAddressSet; //!< Flag specifying if the TTree address for the rec tracks tree was set.
140   
141   AliRunLoader* fRunloader;  //!< Pointer to the runloader object used.
142   AliRunLoader* fRunloaderSim; //!< Pointer to the runloader object used.
143   AliLoader* fRecLoader;    //!< Pointer to the muon loader object used.
144   AliLoader* fSimLoader;    //!< Pointer to the muon loader object used.
145   AliMUONRecData fRecData;  //!< Pointer to the muon raw data interface.
146   AliMUONSimData fSimData;  //!< Pointer to the muon raw data interface.
147   TString fFilename;         //!< The file name from which we are fetching data.
148   TString fFoldername;       //!< The folder name from which we are fetching data.
149   TString fFoldernameSim;    //!< The folder name from which we are fetching data.
150   Int_t fEventnumber;        //!< The currently selected event.
151   Int_t fTrack;              //!< The currently selected track.
152   Int_t fSCathode;           //!< The currently selected cathode in TreeS.
153   Int_t fCathode;            //!< The currently selected cathode in TreeD.
154   
155   ClassDef(AliMUONDataInterface, 0)  // A easy to use interface to data in the MUON module.
156     };
157     
158
159 #endif // ALI_MUON_DATA_INTERFACE_H