AliRoot Core  d69033e (d69033e)
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
AliMUONDataInterface.h
Go to the documentation of this file.
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 */
5 
6 /* $Id$ */
7 // Includes revised 07/05/2004
8 //
12 
13 // Author: Artur Szostak (University of Cape Town)
14 // email: artursz@iafrica.com
15 //
16 // Updated to MUON module w/o MUONData by Laurent Aphecetche, Subatech
17 //
18 
19 #include <TObject.h>
20 #include <TString.h>
21 
22 class TIterator;
23 class AliLoader;
24 class AliMUONVStore;
25 class AliMUONVDigitStore;
28 class AliMUONVDigit;
29 class AliMUONVCluster;
33 
34 
35 class AliMUONDataInterface : public TObject
36 {
37 public:
38 
39  AliMUONDataInterface(const char* filename="galice.root");
40  virtual ~AliMUONDataInterface();
41 
43  Bool_t IsValid() const { return fIsValid; };
44 
45  void Open(const char* filename);
46 
47  Int_t NumberOfEvents() const;
48 
52  Int_t CurrentEvent() const { return fCurrentEvent; }
53 
54  AliMUONVDigitStore* DigitStore(Int_t event);
55  AliMUONVClusterStore* ClusterStore(Int_t event);
56  AliMUONVTriggerStore* TriggerStore(Int_t event, const char* treeLetter="R");
57 
59  void DumpClusters(Int_t event, Bool_t sorted=kTRUE) { return DumpRecPoints(event,sorted); }
60  void DumpRecPoints(Int_t event, Bool_t sorted=kTRUE);
61  void DumpDigits(Int_t event, Bool_t sorted=kTRUE);
62  void DumpTrigger(Int_t event, const char* treeLetter="R");
63 
64  Bool_t GetEvent(Int_t event = 0);
65 
66  // Note the following methods can be extremely slow. Remember they are only
67  // here for end user convenience for his/her small tests and macros.
68  // If you want speed then don't use these methods. If you really want peak
69  // performance then you should be talking to the AliRunLoader and Store
70  // objects directly.
71  Int_t NumberOfDigits(Int_t detElemId);
72  AliMUONVDigit* Digit(Int_t detElemId, Int_t index);
73  Int_t NumberOfDigits(Int_t chamber, Int_t cathode);
74  AliMUONVDigit* Digit(Int_t chamber, Int_t cathode, Int_t index);
75  Int_t NumberOfRawClusters(Int_t chamber);
76  AliMUONVCluster* RawCluster(Int_t chamber, Int_t index);
77  Int_t NumberOfLocalTriggers();
78  AliMUONLocalTrigger* LocalTrigger(Int_t index);
82 
83 private:
84 
87  {
94  };
95 
96  void DumpSorted(const AliMUONVStore& store) const;
97 
98  Bool_t LoadEvent(Int_t event);
99 
100  void NtupleTrigger(const char* treeLetter);
101 
102  void ResetStores();
103 
104  TIterator* GetIterator(IteratorType type, Int_t x = 0, Int_t y = 0);
105  void ResetIterator();
106 
107  Int_t CountObjects(TIterator* iter);
108  TObject* FetchObject(TIterator* iter, Int_t index);
109 
114 
115 
116  AliLoader* fLoader;
121  TString fTreeLetter;
122  Bool_t fIsValid;
123 
126  Int_t fDataX;
127  Int_t fDataY;
128  TIterator* fIterator;
129 
130  static Int_t fgInstanceCounter;
131 
132  ClassDef(AliMUONDataInterface, 0) // An easy to use interface to MUON reconstructed data
133 };
134 
135 
136 #endif // ALIMUONDATAINTERFACE_H
Int_t fCurrentIndex
! A current index number maintained for certain iteration operations.
Int_t NumberOfDigits(Int_t detElemId)
TObject * FetchObject(TIterator *iter, Int_t index)
void DumpTrigger(Int_t event, const char *treeLetter="R")
Int_t NumberOfRawClusters(Int_t chamber)
Int_t CountObjects(TIterator *iter)
Interface for a digit container.
Bool_t IsValid() const
Returns true if the data interface was able to open the root file correctly.
Int_t fCurrentEvent
! Current event we've read in
An easy to use interface to MUON data.
void DumpDigits(Int_t event, Bool_t sorted=kTRUE)
AliMUONVDigitStore * fDigitStore
! current digit store (owner)
AliMUONGlobalTrigger * GlobalTrigger()
AliMUONRegionalTrigger * RegionalTrigger(Int_t index)
A digit iterator for iterating over detector elements.
AliMUONVDigitStore * DigitStore(Int_t event)
IteratorType fCurrentIteratorType
! The type of iterator that is currently set.
Bool_t GetEvent(Int_t event=0)
A digit iterator for iterating over chambers and cathodes.
void Open(const char *filename)
No iterator was constructed.
Base class of a trigger information store.
AliMUONVClusterStore * fClusterStore
! current cluster store (owner)
Reconstructed regional Trigger object.
AliMUONVTriggerStore * fTriggerStore
! current trigger store (owner)
abstract base class for clusters
IteratorType
The various identifiers for the type of iterator constructed.
AliLoader * fLoader
! Tree accessor
Reconstructed Local Trigger object.
AliMUONVTriggerStore * TriggerStore(Int_t event, const char *treeLetter="R")
An iterator for iterating over reconstructed regional triggers.
TIterator * fIterator
! Iterator for various iteration operations.
TString fTreeLetter
! The tree letter used in the last call to TriggerStore().
static Int_t fgInstanceCounter
! To build unique folder name for each instance
Bool_t LoadEvent(Int_t event)
AliMUONDataInterface(const char *filename="galice.root")
Interface of a cluster container.
AliMUONLocalTrigger * LocalTrigger(Int_t index)
void DumpSorted(const AliMUONVStore &store) const
An iterator for iterating over reconstructed local triggers.
Int_t fDataX
! Extra data parameter about the iterator, can be the chamber number or detector element.
void DumpClusters(Int_t event, Bool_t sorted=kTRUE)
Dump the clusters for a given event, sorted if so required.
void DumpRecPoints(Int_t event, Bool_t sorted=kTRUE)
Bool_t fIsValid
! whether we were initialized properly or not
Global trigger object.
ABC of a MUON digit.
Definition: AliMUONVDigit.h:18
AliMUONDataInterface & operator=(const AliMUONDataInterface &rhs)
Not implemented.
AliMUONVDigit * Digit(Int_t detElemId, Int_t index)
TIterator * GetIterator(IteratorType type, Int_t x=0, Int_t y=0)
Int_t fDataY
! Extra data parameter about the iterator, can be the cathode number.
Base class for MUON data stores.
Definition: AliMUONVStore.h:22
AliMUONVClusterStore * ClusterStore(Int_t event)
void NtupleTrigger(const char *treeLetter)
AliMUONVCluster * RawCluster(Int_t chamber, Int_t index)