1 |
loizides |
1.1 |
//--------------------------------------------------------------------------------------------------
|
2 |
loizides |
1.2 |
// $Id: BranchTable.h,v 1.1 2009/03/13 20:24:51 loizides Exp $
|
3 |
loizides |
1.1 |
//
|
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 |
loizides |
1.2 |
TList *GetBranches() const;
|
26 |
loizides |
1.1 |
const BranchName *Get(const char *name) const;
|
27 |
|
|
Bool_t Find(const char *brname, const char *brdep) const;
|
28 |
|
|
Bool_t Find(const BranchName &bn) const;
|
29 |
|
|
using TCollection::Print;
|
30 |
|
|
void Print(Option_t *opt="") const;
|
31 |
|
|
|
32 |
|
|
ClassDef(BranchTable, 1) // Table to store branch dependencies
|
33 |
|
|
};
|
34 |
|
|
}
|
35 |
|
|
|
36 |
|
|
//--------------------------------------------------------------------------------------------------
|
37 |
|
|
inline const mithep::BranchName *mithep::BranchTable::Get(const char *name) const
|
38 |
|
|
{
|
39 |
|
|
// Return a pointer to BranchName for given name.
|
40 |
|
|
|
41 |
|
|
return dynamic_cast<const BranchName *>(FindObject(name));
|
42 |
|
|
}
|
43 |
|
|
#endif
|