Avoid two copies of the ESD friend track (Yuri)
[u/mrichter/AliRoot.git] / MUON / AliMUONDataInterface.h
CommitLineData
e8636ba0 1#ifndef ALIMUONDATAINTERFACE_H
2#define ALIMUONDATAINTERFACE_H
30178c30 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
692de412 8//
3455463a 9/// \ingroup evaluation
692de412 10/// \class AliMUONDataInterface
a202c2d2 11/// \brief An easy to use interface to MUON data
48b32e42 12
e8636ba0 13// Author: Artur Szostak (University of Cape Town)
14// email: artursz@iafrica.com
a202c2d2 15//
16// Updated to MUON module w/o MUONData by Laurent Aphecetche, Subatech
17//
48b32e42 18
19#include <TObject.h>
48b32e42 20
e8636ba0 21class TIterator;
e9bef706 22class AliLoader;
e9bef706 23class AliMUONVStore;
e8636ba0 24class AliMUONVDigitStore;
25class AliMUONVClusterStore;
e9bef706 26class AliMUONVTrackStore;
a202c2d2 27class AliMUONVTriggerStore;
28class AliMUONVTriggerTrackStore;
e8636ba0 29class AliMUONVDigit;
a202c2d2 30class AliMUONRawCluster;
554b38a6 31class AliMUONTrack;
e8636ba0 32class AliMUONLocalTrigger;
33class AliMUONRegionalTrigger;
34class AliMUONGlobalTrigger;
35class AliMUONTriggerTrack;
36
48b32e42 37
48b32e42 38class AliMUONDataInterface : public TObject
39{
e8636ba0 40public:
554b38a6 41
a202c2d2 42 AliMUONDataInterface(const char* filename="galice.root");
43 virtual ~AliMUONDataInterface();
44
e8636ba0 45 /// Returns true if the data interface was able to open the root file correctly.
46 Bool_t IsValid() const { return fIsValid; };
a202c2d2 47
e9bef706 48 void Open(const char* filename);
a202c2d2 49
a202c2d2 50 Int_t NumberOfEvents() const;
e8636ba0 51
52 /// Returns the index number of the current event as used int GetEvent(Int_t).
53 Int_t CurrentEvent() const { return fCurrentEvent; }
a202c2d2 54
e9bef706 55 AliMUONVDigitStore* DigitStore(Int_t event);
56 AliMUONVClusterStore* ClusterStore(Int_t event);
57 AliMUONVTrackStore* TrackStore(Int_t event);
58 AliMUONVTriggerStore* TriggerStore(Int_t event, const char* treeLetter="R");
59 AliMUONVTriggerTrackStore* TriggerTrackStore(Int_t event);
60
61 /// Dump the clusters for a given event, sorted if so required
62 void DumpClusters(Int_t event, Bool_t sorted=kTRUE) { return DumpRecPoints(event,sorted); }
63 void DumpRecPoints(Int_t event, Bool_t sorted=kTRUE);
64 void DumpDigits(Int_t event, Bool_t sorted=kTRUE);
65 void DumpTracks(Int_t event, Bool_t sorted=kFALSE);
66 void DumpTrigger(Int_t event, const char* treeLetter="R");
67 void DumpTriggerTracks(Int_t event, Bool_t sorted=kFALSE);
a202c2d2 68
554b38a6 69 Bool_t GetEvent(Int_t event = 0);
70
e8636ba0 71 // Note the following methods can be extremely slow. Remember they are only
72 // here for end user convenience for his/her small tests and macros.
73 // If you want speed then don't use these methods. If you really want peak
74 // performance then you should be talking to the AliRunLoader and Store
75 // objects directly.
76 Int_t NumberOfDigits(Int_t detElemId);
77 AliMUONVDigit* Digit(Int_t detElemId, Int_t index);
554b38a6 78 Int_t NumberOfDigits(Int_t chamber, Int_t cathode);
e8636ba0 79 AliMUONVDigit* Digit(Int_t chamber, Int_t cathode, Int_t index);
554b38a6 80 Int_t NumberOfRawClusters(Int_t chamber);
e8636ba0 81 AliMUONRawCluster* RawCluster(Int_t chamber, Int_t index);
82 Int_t NumberOfTracks();
83 AliMUONTrack* Track(Int_t index);
554b38a6 84 Int_t NumberOfLocalTriggers();
e8636ba0 85 AliMUONLocalTrigger* LocalTrigger(Int_t index);
86 Int_t NumberOfRegionalTriggers();
87 AliMUONRegionalTrigger* RegionalTrigger(Int_t index);
88 AliMUONGlobalTrigger* GlobalTrigger();
89 Int_t NumberOfTriggerTracks();
90 AliMUONTriggerTrack* TriggerTrack(Int_t index);
554b38a6 91
e8636ba0 92private:
93
94 enum IteratorType
95 {
96 kNoIterator,
97 kDigitIteratorByDetectorElement,
98 kDigitIteratorByChamberAndCathode,
99 kRawClusterIterator,
100 kTrackIterator,
101 kLocalTriggerIterator,
102 kRegionalTriggerIterator,
103 kTriggerTrackIterator
104 };
a202c2d2 105
e9bef706 106 void DumpSorted(const AliMUONVStore& store) const;
107
e8636ba0 108 Bool_t LoadEvent(Int_t event);
e9bef706 109
110 void NtupleTrigger(const char* treeLetter);
a202c2d2 111
e8636ba0 112 void ResetStores();
113
114 TIterator* GetIterator(IteratorType type, Int_t x = 0, Int_t y = 0);
115 void ResetIterator();
116
117 Int_t CountObjects(TIterator* iter);
118 TObject* FetchObject(TIterator* iter, Int_t index);
119
71a2d3aa 120 /// Not implemented
554b38a6 121 AliMUONDataInterface(const AliMUONDataInterface& rhs);
71a2d3aa 122 /// Not implemented
554b38a6 123 AliMUONDataInterface& operator=(const AliMUONDataInterface& rhs);
e8636ba0 124
e9bef706 125
126 AliLoader* fLoader; //!< Tree accessor
127 AliMUONVDigitStore* fDigitStore; //!< current digit store (owner)
128 AliMUONVTriggerStore* fTriggerStore; //!< current trigger store (owner)
129 AliMUONVClusterStore* fClusterStore; //!< current cluster store (owner)
130 AliMUONVTrackStore* fTrackStore; //!< current track store (owner)
131 AliMUONVTriggerTrackStore* fTriggerTrackStore; //!< current trigger track store (owner)
132 Int_t fCurrentEvent; //!< Current event we've read in
133 Bool_t fIsValid; //!< whether we were initialized properly or not
134
e8636ba0 135 IteratorType fCurrentIteratorType; //!< The type of iterator that is currently set.
136 Int_t fCurrentIndex; //!< A current index number maintained for certain iteration operations.
137 Int_t fDataX; //!< Extra data parameter about the iterator, can be the chamber number or detector element.
138 Int_t fDataY; //!< Extra data parameter about the iterator, can be the cathode number.
139 TIterator* fIterator; //!< Iterator for various iteration operations.
140
e9bef706 141 static Int_t fgInstanceCounter; //!< To build unique folder name for each instance
554b38a6 142
e8636ba0 143 ClassDef(AliMUONDataInterface, 0) // An easy to use interface to MUON reconstructed data
a202c2d2 144};
554b38a6 145
48b32e42 146
e8636ba0 147#endif // ALIMUONDATAINTERFACE_H