Line data Source code
1 : #ifndef ALIMUONVSTORE_H
2 : #define ALIMUONVSTORE_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 :
9 : /// \ingroup core
10 : /// \class AliMUONVStore
11 : /// \brief Base class for MUON data stores.
12 : ///
13 : // Author Laurent Aphecetche, Subatech
14 :
15 : #ifndef ROOT_TObject
16 : # include "TObject.h"
17 : #endif
18 :
19 : class TIterator;
20 : class TTree;
21 :
22 0 : class AliMUONVStore : public TObject
23 : {
24 : public:
25 : AliMUONVStore();
26 : virtual ~AliMUONVStore();
27 :
28 : /// Add an object to the store
29 : virtual Bool_t Add(TObject* object) = 0;
30 :
31 : /// Clear ourselves (i.e. Reset)
32 : virtual void Clear(Option_t* opt="") = 0;
33 :
34 : /// Create an empty copy of this
35 : virtual AliMUONVStore* Create() const = 0;
36 :
37 : /// Create a store from a TTree
38 : static AliMUONVStore* Create(TTree& tree, const char* what);
39 :
40 : /// Return an iterator to loop over the whole store
41 : virtual TIterator* CreateIterator() const = 0;
42 :
43 : /// Whether the Connect(TTree&) method is implemented
44 : virtual Bool_t CanConnect() const = 0;
45 :
46 : /// Connect us to a TTree (only valid if CanConnect()==kTRUE)
47 : virtual Bool_t Connect(TTree& tree, Bool_t alone=kTRUE) const;
48 :
49 : /// Find an object by name
50 : virtual TObject* FindObject(const char* name) const;
51 :
52 : /// Find an object
53 : virtual TObject* FindObject(const TObject* object) const;
54 :
55 : /// Find an object using a single id
56 : virtual TObject* FindObject(UInt_t uniqueID) const;
57 :
58 : /// Find an object using 2 ids
59 : virtual TObject* FindObject(Int_t i, Int_t j) const;
60 :
61 : /// The number of objects stored
62 : virtual Int_t GetSize() const = 0;
63 :
64 : /// The number of objects stored for firstid=i. Not implemented by default.
65 : virtual Int_t GetSize(Int_t i) const;
66 :
67 : /// Whether we are empty or not
68 0 : virtual Bool_t IsEmpty() const { return GetSize() == 0; }
69 :
70 : /// Print all objects whose name matches wildcard
71 : virtual void Print(Option_t* wildcard="") const;
72 :
73 : /// Print, with option, all objects whose name matches wildcard
74 : virtual void Print(Option_t* wildcard, Option_t* opt) const;
75 :
76 40 : ClassDef(AliMUONVStore,1) // Base class for a MUON data store
77 : };
78 :
79 : #endif
|