]> git.uio.no Git - u/mrichter/AliRoot.git/blame - MUON/AliMUONDataInterface.h
Coding conventions: adding copy constructor and assignment operator
[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;
a202c2d2 26class AliMUONVTriggerStore;
e8636ba0 27class AliMUONVDigit;
2060b217 28class AliMUONVCluster;
e8636ba0 29class AliMUONLocalTrigger;
30class AliMUONRegionalTrigger;
31class AliMUONGlobalTrigger;
e8636ba0 32
48b32e42 33
48b32e42 34class AliMUONDataInterface : public TObject
35{
e8636ba0 36public:
554b38a6 37
a202c2d2 38 AliMUONDataInterface(const char* filename="galice.root");
39 virtual ~AliMUONDataInterface();
40
e8636ba0 41 /// Returns true if the data interface was able to open the root file correctly.
42 Bool_t IsValid() const { return fIsValid; };
a202c2d2 43
e9bef706 44 void Open(const char* filename);
a202c2d2 45
a202c2d2 46 Int_t NumberOfEvents() const;
e8636ba0 47
48 /// Returns the index number of the current event as used int GetEvent(Int_t).
49 Int_t CurrentEvent() const { return fCurrentEvent; }
a202c2d2 50
e9bef706 51 AliMUONVDigitStore* DigitStore(Int_t event);
52 AliMUONVClusterStore* ClusterStore(Int_t event);
e9bef706 53 AliMUONVTriggerStore* TriggerStore(Int_t event, const char* treeLetter="R");
e9bef706 54
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);
e9bef706 59 void DumpTrigger(Int_t event, const char* treeLetter="R");
a202c2d2 60
554b38a6 61 Bool_t GetEvent(Int_t event = 0);
62
e8636ba0 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
67 // objects directly.
68 Int_t NumberOfDigits(Int_t detElemId);
69 AliMUONVDigit* Digit(Int_t detElemId, Int_t index);
554b38a6 70 Int_t NumberOfDigits(Int_t chamber, Int_t cathode);
e8636ba0 71 AliMUONVDigit* Digit(Int_t chamber, Int_t cathode, Int_t index);
554b38a6 72 Int_t NumberOfRawClusters(Int_t chamber);
2060b217 73 AliMUONVCluster* RawCluster(Int_t chamber, Int_t index);
554b38a6 74 Int_t NumberOfLocalTriggers();
e8636ba0 75 AliMUONLocalTrigger* LocalTrigger(Int_t index);
76 Int_t NumberOfRegionalTriggers();
77 AliMUONRegionalTrigger* RegionalTrigger(Int_t index);
78 AliMUONGlobalTrigger* GlobalTrigger();
554b38a6 79
e8636ba0 80private:
81
44c98559 82 /// The various identifiers for the type of iterator constructed.
e8636ba0 83 enum IteratorType
84 {
44c98559 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.
44c98559 89 kLocalTriggerIterator, ///< An iterator for iterating over reconstructed local triggers.
61fed964 90 kRegionalTriggerIterator ///< An iterator for iterating over reconstructed regional triggers.
e8636ba0 91 };
a202c2d2 92
e9bef706 93 void DumpSorted(const AliMUONVStore& store) const;
94
e8636ba0 95 Bool_t LoadEvent(Int_t event);
e9bef706 96
97 void NtupleTrigger(const char* treeLetter);
a202c2d2 98
e8636ba0 99 void ResetStores();
100
101 TIterator* GetIterator(IteratorType type, Int_t x = 0, Int_t y = 0);
102 void ResetIterator();
103
104 Int_t CountObjects(TIterator* iter);
105 TObject* FetchObject(TIterator* iter, Int_t index);
106
71a2d3aa 107 /// Not implemented
554b38a6 108 AliMUONDataInterface(const AliMUONDataInterface& rhs);
71a2d3aa 109 /// Not implemented
554b38a6 110 AliMUONDataInterface& operator=(const AliMUONDataInterface& rhs);
e8636ba0 111
e9bef706 112
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)
e9bef706 117 Int_t fCurrentEvent; //!< Current event we've read in
118 Bool_t fIsValid; //!< whether we were initialized properly or not
119
e8636ba0 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.
125
e9bef706 126 static Int_t fgInstanceCounter; //!< To build unique folder name for each instance
554b38a6 127
e8636ba0 128 ClassDef(AliMUONDataInterface, 0) // An easy to use interface to MUON reconstructed data
a202c2d2 129};
554b38a6 130
48b32e42 131
e8636ba0 132#endif // ALIMUONDATAINTERFACE_H