ViewVC Help
View File | Revision Log | Show Annotations | Root Listing
root/cvsroot/UserCode/MitAna/DataTree/interface/BranchTable.h
Revision: 1.1
Committed: Fri Mar 13 20:24:51 2009 UTC (16 years, 1 month ago) by loizides
Content type: text/plain
Branch: MAIN
Log Message:
Added BranchTable.

File Contents

# User Rev Content
1 loizides 1.1 //--------------------------------------------------------------------------------------------------
2     // $Id:$
3     //
4     // BranchTable
5     //
6     // A convenient table to store dependencies among branches.
7     //
8     // Authors: C.Loizides
9     //--------------------------------------------------------------------------------------------------
10    
11     #ifndef MITANA_DATATREE_BRANCHTABLE_H
12     #define MITANA_DATATREE_BRANCHTABLE_H
13    
14     #include <THashTable.h>
15     #include "MitAna/DataTree/interface/BranchName.h"
16    
17     namespace mithep
18     {
19     class BranchTable : public THashTable
20     {
21     public:
22     BranchTable(Int_t capacity = TCollection::kInitHashTableCapacity, Int_t rehash = 0) :
23     THashTable(capacity,rehash) {}
24    
25     const BranchName *Get(const char *name) const;
26     Bool_t Find(const char *brname, const char *brdep) const;
27     Bool_t Find(const BranchName &bn) const;
28     using TCollection::Print;
29     void Print(Option_t *opt="") const;
30    
31     ClassDef(BranchTable, 1) // Table to store branch dependencies
32     };
33     }
34    
35     //--------------------------------------------------------------------------------------------------
36     inline const mithep::BranchName *mithep::BranchTable::Get(const char *name) const
37     {
38     // Return a pointer to BranchName for given name.
39    
40     return dynamic_cast<const BranchName *>(FindObject(name));
41     }
42     #endif