1 #ifndef ALIMUONDATAINTERFACE_H
2 #define ALIMUONDATAINTERFACE_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 (University of Cape Town)
14 // email: artursz@iafrica.com
16 // Updated to MUON module w/o MUONData by Laurent Aphecetche, Subatech
24 class AliMUONVDigitStore;
25 class AliMUONVClusterStore;
26 class AliMUONVTriggerStore;
28 class AliMUONVCluster;
29 class AliMUONLocalTrigger;
30 class AliMUONRegionalTrigger;
31 class AliMUONGlobalTrigger;
34 class AliMUONDataInterface : public TObject
38 AliMUONDataInterface(const char* filename="galice.root");
39 virtual ~AliMUONDataInterface();
41 /// Returns true if the data interface was able to open the root file correctly.
42 Bool_t IsValid() const { return fIsValid; };
44 void Open(const char* filename);
46 Int_t NumberOfEvents() const;
48 /// Returns the index number of the current event as used int GetEvent(Int_t).
49 Int_t CurrentEvent() const { return fCurrentEvent; }
51 AliMUONVDigitStore* DigitStore(Int_t event);
52 AliMUONVClusterStore* ClusterStore(Int_t event);
53 AliMUONVTriggerStore* TriggerStore(Int_t event, const char* treeLetter="R");
55 /// Dump the clusters for a given event, sorted if so required
56 void DumpClusters(Int_t event, Bool_t sorted=kTRUE) { return DumpRecPoints(event,sorted); }
57 void DumpRecPoints(Int_t event, Bool_t sorted=kTRUE);
58 void DumpDigits(Int_t event, Bool_t sorted=kTRUE);
59 void DumpTrigger(Int_t event, const char* treeLetter="R");
61 Bool_t GetEvent(Int_t event = 0);
63 // Note the following methods can be extremely slow. Remember they are only
64 // here for end user convenience for his/her small tests and macros.
65 // If you want speed then don't use these methods. If you really want peak
66 // performance then you should be talking to the AliRunLoader and Store
68 Int_t NumberOfDigits(Int_t detElemId);
69 AliMUONVDigit* Digit(Int_t detElemId, Int_t index);
70 Int_t NumberOfDigits(Int_t chamber, Int_t cathode);
71 AliMUONVDigit* Digit(Int_t chamber, Int_t cathode, Int_t index);
72 Int_t NumberOfRawClusters(Int_t chamber);
73 AliMUONVCluster* RawCluster(Int_t chamber, Int_t index);
74 Int_t NumberOfLocalTriggers();
75 AliMUONLocalTrigger* LocalTrigger(Int_t index);
76 Int_t NumberOfRegionalTriggers();
77 AliMUONRegionalTrigger* RegionalTrigger(Int_t index);
78 AliMUONGlobalTrigger* GlobalTrigger();
82 /// The various identifiers for the type of iterator constructed.
85 kNoIterator, ///< No iterator was constructed.
86 kDigitIteratorByDetectorElement, ///< A digit iterator for iterating over detector elements.
87 kDigitIteratorByChamberAndCathode, ///< A digit iterator for iterating over chambers and cathodes.
88 kRawClusterIterator, ///< A raw cluster iterator.
89 kLocalTriggerIterator, ///< An iterator for iterating over reconstructed local triggers.
90 kRegionalTriggerIterator ///< An iterator for iterating over reconstructed regional triggers.
93 void DumpSorted(const AliMUONVStore& store) const;
95 Bool_t LoadEvent(Int_t event);
97 void NtupleTrigger(const char* treeLetter);
101 TIterator* GetIterator(IteratorType type, Int_t x = 0, Int_t y = 0);
102 void ResetIterator();
104 Int_t CountObjects(TIterator* iter);
105 TObject* FetchObject(TIterator* iter, Int_t index);
108 AliMUONDataInterface(const AliMUONDataInterface& rhs);
110 AliMUONDataInterface& operator=(const AliMUONDataInterface& rhs);
113 AliLoader* fLoader; //!< Tree accessor
114 AliMUONVDigitStore* fDigitStore; //!< current digit store (owner)
115 AliMUONVTriggerStore* fTriggerStore; //!< current trigger store (owner)
116 AliMUONVClusterStore* fClusterStore; //!< current cluster store (owner)
117 Int_t fCurrentEvent; //!< Current event we've read in
118 Bool_t fIsValid; //!< whether we were initialized properly or not
120 IteratorType fCurrentIteratorType; //!< The type of iterator that is currently set.
121 Int_t fCurrentIndex; //!< A current index number maintained for certain iteration operations.
122 Int_t fDataX; //!< Extra data parameter about the iterator, can be the chamber number or detector element.
123 Int_t fDataY; //!< Extra data parameter about the iterator, can be the cathode number.
124 TIterator* fIterator; //!< Iterator for various iteration operations.
126 static Int_t fgInstanceCounter; //!< To build unique folder name for each instance
128 ClassDef(AliMUONDataInterface, 0) // An easy to use interface to MUON reconstructed data
132 #endif // ALIMUONDATAINTERFACE_H