ViewVC Help
View File | Revision Log | Show Annotations | Root Listing
root/cvsroot/UserCode/MitAna/DataTree/src/BranchTable.cc
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 // $Id: BranchName.cc,v 1.1 2009/03/13 08:40:01 loizides Exp $
2    
3     #include "MitAna/DataTree/interface/BranchTable.h"
4     #include <TList.h>
5    
6     ClassImp(mithep::BranchTable)
7    
8     using namespace mithep;
9    
10     //--------------------------------------------------------------------------------------------------
11     Bool_t BranchTable::Find(const char *brname, const char *brdep) const
12     {
13     // Search for given pair of branch dependency.
14    
15     if (!brname || !brdep)
16     return kFALSE;
17    
18     TList *l = GetListForObject(brname);
19     if (!l)
20     return kFALSE;
21    
22     TIter next(l);
23     while (const BranchName *bn = dynamic_cast<const BranchName*>(next())) {
24     if (strcmp(bn->Dep(),brdep)==0)
25     return kTRUE;
26     }
27     return kFALSE;
28     }
29    
30     //--------------------------------------------------------------------------------------------------
31     Bool_t BranchTable::Find(const BranchName &bn) const
32     {
33     // Search for given pair of branch dependency.
34    
35     return Find(bn.Name(), bn.Dep());
36     }
37    
38     //--------------------------------------------------------------------------------------------------
39     void BranchTable::Print(Option_t *opt) const
40     {
41     // Print trigger table content (not ordered!)
42    
43     TIter iter(MakeIterator());
44     const BranchName *bn = dynamic_cast<const BranchName*>(iter.Next());
45     while (bn) {
46     bn->Print();
47     bn = dynamic_cast<const BranchName*>(iter.Next());
48     }
49     }