ViewVC Help
View File | Revision Log | Show Annotations | Root Listing
root/cvsroot/UserCode/MitAna/TreeMod/src/BaseMod.cc
Revision: 1.2
Committed: Sun Sep 28 02:34:14 2008 UTC (16 years, 7 months ago) by loizides
Content type: text/plain
Branch: MAIN
CVS Tags: Mit_006, Mit_005, Mit_004
Changes since 1.1: +49 -1 lines
Log Message:
Implement convenient get functions for HLT trigger and objects.

File Contents

# User Rev Content
1 loizides 1.2 // $Id: BaseMod.cc,v 1.1 2008/06/12 08:47:57 loizides Exp $
2 loizides 1.1
3     #include "MitAna/TreeMod/interface/BaseMod.h"
4 loizides 1.2 #include "MitAna/TreeMod/interface/HLTFwkMod.h"
5 loizides 1.1
6     using namespace mithep;
7    
8     ClassImp(mithep::BaseMod)
9 loizides 1.2
10     //--------------------------------------------------------------------------------------------------
11     const TriggerObjectsTable *BaseMod::GetHLTObjectsTable(const char *hltfwk) const
12     {
13     // Get pointer to HLT objects table obtained by module with given name. (Note: normally
14     // you want to stick to the default argument.)
15    
16     if (!HasHLTInfo())
17     return 0;
18    
19     const TList *tasks = GetSelector()->GetTopModule()->GetSubModules();
20     const HLTFwkMod *mod = static_cast<const HLTFwkMod *>(tasks->FindObject(hltfwk));
21     return (dynamic_cast<const TriggerObjectsTable *>(FindPublicObj(mod->HLTObjsNamePub())));
22     }
23    
24     //--------------------------------------------------------------------------------------------------
25     const TriggerTable *BaseMod::GetHLTTable(const char *hltfwk) const
26     {
27     // Get pointer to HLT trigger table obtained by module with given name. (Note: normally
28     // you want to stick to the default argument.)
29    
30     if (!HasHLTInfo(hltfwk))
31     return 0;
32    
33     const TList *tasks = GetSelector()->GetTopModule()->GetSubModules();
34     const HLTFwkMod *mod = static_cast<const HLTFwkMod *>(tasks->FindObject(hltfwk));
35     return (dynamic_cast<const TriggerTable *>(FindPublicObj(mod->HLTTabNamePub())));
36     }
37    
38     //--------------------------------------------------------------------------------------------------
39     Bool_t BaseMod::HasHLTInfo(const char *hltfwk) const
40     {
41     // Check if HLT framework module is in list of modules. (Note: normally
42     // you want to stick to the default argument.)
43    
44     if (!GetSelector() || !GetSelector()->GetTopModule())
45     return kFALSE;
46    
47     const TList *tasks = GetSelector()->GetTopModule()->GetSubModules();
48     if (!tasks)
49     return kFALSE;
50    
51     const HLTFwkMod *mod = dynamic_cast<const HLTFwkMod *>(tasks->FindObject(hltfwk));
52     if (mod)
53     return kTRUE;
54     return kFALSE;
55     }