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