AliRoot Core  a565103 (a565103)
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
AliMUONMCDataInterface.h
Go to the documentation of this file.
1 #ifndef ALIMUONMCDATAINTERFACE_H
2 #define ALIMUONMCDATAINTERFACE_H
3 
4 /* Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
5 * See cxx source for full Copyright notice */
6 
7 // $Id$
8 
13 // Author Laurent Aphecetche
14 //
15 // Moved parts of old AliMUONDataInterface interface to AliMUONMCDataInterface
16 // Artur Szostak <artursz@iafrica.com> (University of Cape Town)
17 
18 #ifndef ROOT_TObject
19 # include "TObject.h"
20 #endif
21 
22 class AliMUONVStore;
23 class AliMUONVHitStore;
24 class AliMUONVDigitStore;
26 class AliMUONHit;
27 class AliMUONVDigit;
31 
32 class AliLoader;
33 class AliStack;
34 
35 class TIterator;
36 class TClonesArray;
37 class TParticle;
38 
39 class AliMUONMCDataInterface : public TObject
40 {
41 public:
42  AliMUONMCDataInterface(const char* filename="galice.root");
43  virtual ~AliMUONMCDataInterface();
44 
45  void Open(const char* filename);
46 
48  Bool_t IsValid() const { return fIsValid; };
49 
50  Int_t NumberOfEvents() const;
51 
56  Int_t CurrentEvent() const { return fCurrentEvent; }
57 
58  Int_t NumberOfTracks(Int_t event);
59  Int_t NumberOfTrackRefs(Int_t event);
60 
61  AliMUONVHitStore* HitStore(Int_t event, Int_t track);
62  AliMUONVDigitStore* SDigitStore(Int_t event);
63  AliMUONVDigitStore* DigitStore(Int_t event);
64  AliStack* Stack(Int_t event);
65  TClonesArray* TrackRefs(Int_t event, Int_t track);
66  AliMUONVTriggerStore* TriggerStore(Int_t event);
67 
68  void DumpDigits(Int_t event, Bool_t sorted=kTRUE);
69  void DumpSDigits(Int_t event, Bool_t sorted=kTRUE);
70  void DumpHits(Int_t event);
71  void DumpKine(Int_t event);
72  void DumpTrackRefs(Int_t event);
73  void DumpTrigger(Int_t event);
74 
75  Bool_t GetEvent(Int_t event = 0);
76 
77  // Note the following methods can be extremely slow. Remember they are only
78  // here for end user convenience for his/her small tests and macros.
79  // If you want speed then don't use these methods. If you really want peak
80  // performance then you should be talking to the AliRunLoader and Store
81  // objects directly.
82  Int_t NumberOfParticles();
83  TParticle* Particle(Int_t index);
84  Int_t NumberOfTracks();
85  Int_t NumberOfHits(Int_t track);
86  AliMUONHit* Hit(Int_t track, Int_t index);
87  Int_t NumberOfSDigits(Int_t detElemId);
88  AliMUONVDigit* SDigit(Int_t detElemId, Int_t index);
89  Int_t NumberOfSDigits(Int_t chamber, Int_t cathode);
90  AliMUONVDigit* SDigit(Int_t chamber, Int_t cathode, Int_t index);
91  Int_t NumberOfDigits(Int_t detElemId);
92  AliMUONVDigit* Digit(Int_t detElemId, Int_t index);
93  Int_t NumberOfDigits(Int_t chamber, Int_t cathode);
94  AliMUONVDigit* Digit(Int_t chamber, Int_t cathode, Int_t index);
95  Int_t NumberOfLocalTriggers();
96  AliMUONLocalTrigger* LocalTrigger(Int_t index);
100  Int_t NumberOfTrackRefs();
101  TClonesArray* TrackRefs(Int_t track);
102 
103 private:
104 
107  {
116  };
117 
122 
123  void DumpSorted(const AliMUONVStore& store) const;
124  Bool_t LoadEvent(Int_t event);
125 
126  void ResetStores();
127 
128  TIterator* GetIterator(IteratorType type, Int_t x = 0, Int_t y = 0);
129  void ResetIterator();
130 
131  Int_t CountObjects(TIterator* iter);
132  TObject* FetchObject(TIterator* iter, Int_t index);
133 
134 
135  AliLoader* fLoader;
140  TClonesArray* fTrackRefs;
142  Bool_t fIsValid;
143 
146  Int_t fDataX;
147  Int_t fDataY;
148  TIterator* fIterator;
149 
150  static Int_t fgInstanceCounter;
151 
152  ClassDef(AliMUONMCDataInterface,0) // Easy to use MC data accessor
153 };
154 
155 #endif
AliMUONVDigitStore * SDigitStore(Int_t event)
TClonesArray * fTrackRefs
! current trackrefs (owner)
AliLoader * fLoader
! Tree accessor
Interface for a digit container.
Virtual store to hold digit.
TIterator * GetIterator(IteratorType type, Int_t x=0, Int_t y=0)
AliMUONVDigit * Digit(Int_t detElemId, Int_t index)
AliMUONVDigitStore * fDigitStore
! current digit store (owner)
void Open(const char *filename)
An iterator for iterating over the simulated regional triggers.
An iterator for simulated digits to iterate over the detector elements.
Int_t fDataY
! Extra data parameter about the iterator, can be the cathode number.
static Int_t fgInstanceCounter
! To build unique folder name for each instance
TParticle * Particle(Int_t index)
AliTPCfastTrack * track
AliMUONVTriggerStore * TriggerStore(Int_t event)
AliMUONRegionalTrigger * RegionalTrigger(Int_t index)
void DumpSorted(const AliMUONVStore &store) const
An iterator for simulated digits to iterate over chambers and cathodes.
AliMUONGlobalTrigger * GlobalTrigger()
Base class of a trigger information store.
TClonesArray * TrackRefs(Int_t event, Int_t track)
AliMUONVDigitStore * fSDigitStore
! current sdigit store (owner)
AliMUONVDigitStore * DigitStore(Int_t event)
AliMUONVHitStore * fHitStore
! current hit store (owner)
Reconstructed regional Trigger object.
Int_t CountObjects(TIterator *iter)
AliMUONHit * Hit(Int_t track, Int_t index)
Reconstructed Local Trigger object.
Int_t NumberOfSDigits(Int_t detElemId)
IteratorType
The various identifiers for the type of iterator constructed.
Int_t fDataX
! Extra data parameter about the iterator, can be the chamber number, detector element or track numbe...
void DumpDigits(Int_t event, Bool_t sorted=kTRUE)
An iterator for iterating over the simulated local triggers.
AliMUONVTriggerStore * fTriggerStore
! current trigger store (owner)
An iterator to iterate over the hits.
IteratorType fCurrentIteratorType
! The type of iterator that is currently set.
TIterator * fIterator
! Iterator for various iteration operations.
Bool_t IsValid() const
Returns true if the data interface was able to open the root file correctly.
void DumpSDigits(Int_t event, Bool_t sorted=kTRUE)
Bool_t fIsValid
! whether we were initialized properly or not
Easy to use data access to MC information.
MonteCarlo hit.
Definition: AliMUONHit.h:24
Bool_t GetEvent(Int_t event=0)
Global trigger object.
ABC of a MUON digit.
Definition: AliMUONVDigit.h:18
Int_t NumberOfDigits(Int_t detElemId)
AliMUONVHitStore * HitStore(Int_t event, Int_t track)
TObject * FetchObject(TIterator *iter, Int_t index)
AliMUONVDigit * SDigit(Int_t detElemId, Int_t index)
AliStack * Stack(Int_t event)
AliMUONMCDataInterface(const char *filename="galice.root")
Base class for MUON data stores.
Definition: AliMUONVStore.h:22
Int_t fCurrentIndex
! A current index number maintained for certain iteration operations.
Int_t fCurrentEvent
! Current event we've read in
A summable digit iterator to iterate over chambers and cathodes.
A summable digit iterator to iterate over the detector elements.
AliMUONMCDataInterface & operator=(const AliMUONMCDataInterface &)
Not implemented.
AliMUONLocalTrigger * LocalTrigger(Int_t index)