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 /// \ingroup evaluation
10 /// \class AliMUONDataInterface
11 /// \brief An easy to use interface to MUON data
13 // Author: Artur Szostak
14 // email: artur@alice.phy.uct.ac.za
16 // Updated to MUON module w/o MUONData by Laurent Aphecetche, Subatech
23 class AliMUONVClusterStore;
24 class AliMUONVDigitStore;
26 class AliMUONVTrackStore;
27 class AliMUONVTriggerStore;
28 class AliMUONVTriggerTrackStore;
30 // >>LA should not needed (once we remove deprecated methods)
33 class AliMUONLocalTrigger;
34 class AliMUONGlobalTrigger;
35 class AliMUONRawCluster;
40 class AliMUONDataInterface : public TObject
44 AliMUONDataInterface(const char* filename="galice.root");
45 virtual ~AliMUONDataInterface();
47 Bool_t IsValid() const;
49 void Open(const char* filename);
51 Int_t NumberOfEvents() const;
53 AliMUONVDigitStore* DigitStore(Int_t event);
54 AliMUONVClusterStore* ClusterStore(Int_t event);
55 AliMUONVTrackStore* TrackStore(Int_t event);
56 AliMUONVTriggerStore* TriggerStore(Int_t event, const char* treeLetter="R");
57 AliMUONVTriggerTrackStore* TriggerTrackStore(Int_t event);
59 /// Dump the clusters for a given event, sorted if so required
60 void DumpClusters(Int_t event, Bool_t sorted=kTRUE) { return DumpRecPoints(event,sorted); }
61 void DumpRecPoints(Int_t event, Bool_t sorted=kTRUE);
62 void DumpDigits(Int_t event, Bool_t sorted=kTRUE);
63 void DumpTracks(Int_t event, Bool_t sorted=kFALSE);
64 void DumpTrigger(Int_t event, const char* treeLetter="R");
65 void DumpTriggerTracks(Int_t event, Bool_t sorted=kFALSE);
67 // all the methods below are deprecated.
69 // Sets all internal pointers to NULL without releasing the current runloader.
72 Bool_t UseCurrentRunLoader();
74 Int_t NumberOfEvents(TString filename, TString foldername);
76 Int_t NumberOfParticles(TString filename, TString foldername, Int_t event);
77 TParticle* Particle(TString filename, TString foldername, Int_t event, Int_t particle);
79 Int_t NumberOfTracks(TString filename, TString foldername, Int_t event);
80 Int_t NumberOfHits(TString filename, TString foldername, Int_t event, Int_t track);
81 AliMUONHit* Hit(TString filename, TString foldername, Int_t event, Int_t track, Int_t hit);
83 Int_t NumberOfSDigits(TString filename, TString foldername, Int_t event, Int_t chamber, Int_t cathode);
84 AliMUONDigit* SDigit(TString filename, TString foldername, Int_t event, Int_t chamber, Int_t cathode, Int_t sdigit);
86 Int_t NumberOfDigits(TString filename, TString foldername, Int_t event, Int_t chamber, Int_t cathode);
87 AliMUONDigit* Digit(TString filename, TString foldername, Int_t event, Int_t chamber, Int_t cathode, Int_t digit);
89 Int_t NumberOfRawClusters(TString filename, TString foldername, Int_t event, Int_t chamber);
90 AliMUONRawCluster* RawCluster(TString filename, TString foldername, Int_t event, Int_t chamber, Int_t cluster);
92 Int_t NumberOfLocalTriggers(TString filename, TString foldername, Int_t event);
93 AliMUONLocalTrigger* LocalTrigger(TString filename, TString foldername, Int_t event, Int_t trigger);
95 Bool_t SetFile(TString filename = "galice.root", TString foldername = "MUONFolder");
96 Bool_t GetEvent(Int_t event = 0);
98 Int_t NumberOfParticles();
99 TParticle* Particle(Int_t particle);
101 Int_t NumberOfTracks();
102 Int_t NumberOfHits(Int_t track);
103 AliMUONHit* Hit(Int_t track, Int_t hit);
105 Int_t NumberOfSDigits(Int_t chamber, Int_t cathode);
106 AliMUONDigit* SDigit(Int_t chamber, Int_t cathode, Int_t sdigit);
108 Int_t NumberOfDigits(Int_t chamber, Int_t cathode);
109 AliMUONDigit* Digit(Int_t chamber, Int_t cathode, Int_t digit);
111 Int_t NumberOfRawClusters(Int_t chamber);
112 AliMUONRawCluster* RawCluster(Int_t chamber, Int_t cluster);
114 Int_t NumberOfLocalTriggers();
115 AliMUONLocalTrigger* LocalTrigger(Int_t trigger);
117 Int_t NumberOfGlobalTriggers();
118 AliMUONGlobalTrigger* GlobalTrigger(Int_t trigger);
119 // Returns the name of the currently selected file.
121 Int_t NumberOfRecTracks();
122 AliMUONTrack* RecTrack(Int_t rectrack);
124 /// Returns the file name from which we are fetching data
125 TString CurrentFile() const { return ""; }
127 /// Returns the name of the currently selected folder.
128 TString CurrentFolder() const { return ""; }
130 /// Returns the number of the currently selected event.
131 Int_t CurrentEvent() const { return 0; }
133 /// Returns the currently selected track.
134 Int_t CurrentTrack() const { return 0; }
136 /// Returns the currently selected cathode in TreeS.
137 Int_t CurrentSCathode() const { return 0; }
139 /// Returns the currently selected cathode in TreeD.
140 Int_t CurrentDCathode() const { return 0; }
144 void DumpSorted(const AliMUONVStore& store) const;
146 Int_t LoadEvent(Int_t event);
148 void NtupleTrigger(const char* treeLetter);
151 AliMUONDataInterface(const AliMUONDataInterface& rhs);
153 AliMUONDataInterface& operator=(const AliMUONDataInterface& rhs);
157 AliLoader* fLoader; //!< Tree accessor
158 AliMUONVDigitStore* fDigitStore; //!< current digit store (owner)
159 AliMUONVTriggerStore* fTriggerStore; //!< current trigger store (owner)
160 AliMUONVClusterStore* fClusterStore; //!< current cluster store (owner)
161 AliMUONVTrackStore* fTrackStore; //!< current track store (owner)
162 AliMUONVTriggerTrackStore* fTriggerTrackStore; //!< current trigger track store (owner)
163 Int_t fCurrentEvent; //!< Current event we've read in
164 Bool_t fIsValid; //!< whether we were initialized properly or not
166 static Int_t fgInstanceCounter; //!< To build unique folder name for each instance
168 ClassDef(AliMUONDataInterface, 0) // An easy to use interface to MUON data
172 #endif // ALI_MUON_DATA_INTERFACE_H