ViewVC Help
View File | Revision Log | Show Annotations | Root Listing
root/cvsroot/UserCode/MitAna/TreeMod/interface/HLTMod.h
Revision: 1.14
Committed: Tue Aug 11 15:24:39 2009 UTC (15 years, 8 months ago) by loizides
Content type: text/plain
Branch: MAIN
CVS Tags: Mit_014d, Mit_014c, Mit_014b, Mit_014a, Mit_014, Mit_014pre3, Mit_014pre2, Mit_014pre1, Mit_013d, Mit_013c, Mit_013b, Mit_013a, Mit_013, Mit_013pre1, Mit_012i, Mit_012h, Mit_012g, Mit_012f, Mit_012e, Mit_012d, Mit_012c, Mit_012b, Mit_012a, Mit_012, Mit_011a, Mit_011, Mit_010a
Changes since 1.13: +6 -4 lines
Log Message:
Support different HLT menus

File Contents

# User Rev Content
1 loizides 1.1 //--------------------------------------------------------------------------------------------------
2 loizides 1.14 // $Id: HLTMod.h,v 1.13 2009/07/13 13:45:30 loizides Exp $
3 loizides 1.1 //
4     // HLTMod
5     //
6     // This module allows to select events according to given HLT trigger bits. The trigger bits
7     // are selected via their corresponding HLT trigger name.
8     // The trigger name is added to the list of accepted triggers using AddTrigger(). Each member of
9     // this list will be logically "ored" to the search mask (see description of AddTrigger()).
10     // For every accepted event the list of trigger objects will be published. The name of the
11     // published objects can be specified via SetTrigObjsName.
12     // The objects can be retrieved in sub-modules with BaseModule::GetHLTObjects().
13     // HLTMod will abort processing the chain of sub-modules if the trigger bits did not
14     // match the given trigger mask, unless you call SetAbortIfNotAccepted(kFALSE).
15     // For convenience HLTMod defines two virtual functions, OnAccepted() and OnFailed()
16     // that can be implemented in derived classes. OnAccepted() will be called if the event passes
17     // the trigger mask, on Failed() if it did not.
18     //
19     // An example of how this is supposed to work can be found in
20     // $CMSSW_BASE/src/MitAna/macros/examples/runHLTExample.C
21     //
22     // Authors: C.Loizides
23     //--------------------------------------------------------------------------------------------------
24    
25     #ifndef MITANA_TREEMOD_HLTMOD_H
26     #define MITANA_TREEMOD_HLTMOD_H
27    
28     #include <string>
29     #include <TString.h>
30     #include "MitAna/TreeMod/interface/BaseMod.h"
31 loizides 1.10 #include "MitAna/DataTree/interface/TriggerObjectFwd.h"
32 loizides 1.1
33     namespace mithep
34     {
35     class TriggerTable;
36     class TriggerObjectsTable;
37 loizides 1.6 class TriggerMask;
38 loizides 1.1
39     class HLTMod : public BaseMod {
40     public:
41 loizides 1.13 enum EObjMode { // which objects to get
42     kAll = 0,
43     kL1,
44     kHlt
45     };
46    
47 loizides 1.1 HLTMod(const char *name="HLTMod", const char *title="High-level trigger module");
48     ~HLTMod();
49    
50     void AddTrigger(const char *expr);
51 loizides 1.14 const char *GetBitsName() const { return fBitsName; }
52 loizides 1.7 Int_t GetNEvents() const { return fNEvents; }
53     Int_t GetNAccepted() const { return fNAcceped; }
54     Int_t GetNFailed() const { return fNFailed; }
55 loizides 1.11 const char *GetOutputName() const { return fMyObjsNamePub; }
56 loizides 1.7 const char *GetTrigObjsName() const { return fMyObjsNamePub; }
57 loizides 1.13 void SetAbortIfNotAccepted(Bool_t b) { fAbort = b; }
58 loizides 1.14 void SetBitsName(const char *n) { fBitsName = n; }
59     void SetIgnoreBits(Bool_t b) { fIgnoreBits = b; }
60     void SetInputName(const char *n) { fMyObjsNamePub = n; }
61     void SetObjMode(EObjMode m ) { fObjMode = m; }
62 loizides 1.13 void SetPrintTable(Bool_t b) { fPrintTable = b; }
63 loizides 1.1 void SetTrigObjsName(const char *n) { fMyObjsNamePub = n; }
64 loizides 1.13
65 loizides 1.1 protected:
66     void AddTrigObjs(UInt_t tid);
67     void BeginRun();
68     virtual void OnAccepted() {/*could be implemented in derived classes*/}
69     virtual void OnFailed() {/*could be implemented in derived classes*/}
70     void Process();
71     void SlaveBegin();
72 loizides 1.9 void SlaveTerminate();
73 loizides 1.1
74     Bool_t fAbort; //=true then abort (sub-)modules if not accepted
75 loizides 1.8 Bool_t fPrintTable; //=true then print HLT trigger table in BeginRun
76 loizides 1.13 Bool_t fIgnoreBits; //=true then try to get trigger objects (def=0)
77     EObjMode fObjMode; //defines which objects to get (def=kHlt)
78 loizides 1.1 TString fBitsName; //trigger bits branch name
79     TString fMyObjsNamePub; //name of exported trigger object array
80 loizides 1.5 std::vector<std::string> fTrigNames; //trigger names requested for test mask
81 loizides 1.6 const TriggerMask *fBits; //!trigger bits branch
82     std::vector<BitMask256> fTrigBitsAnd; //!trigger bits used in mask
83     std::vector<BitMask256> fTrigBitsCmp; //!trigger bits used for comparison
84 loizides 1.1 BitMask256 fBitsDone; //!bits for which trigger objects are copied
85     TriggerObjectOArr *fMyTrgObjs; //!exported published trigger object array
86 loizides 1.12 const TriggerTable *fTriggers; //!imported published HLT trigger table
87     const TriggerObjectsTable *fTrigObjs; //!imported published HLT trigger objects table
88 loizides 1.1 Int_t fNEvents; //!number of processed events
89     Int_t fNAcceped; //!number of accepted events
90     Int_t fNFailed; //!number of failed events
91    
92 loizides 1.4 ClassDef(HLTMod, 1) // HLT TAM module
93 loizides 1.1 };
94     }
95     #endif