ViewVC Help
View File | Revision Log | Show Annotations | Root Listing
root/cvsroot/UserCode/MitAna/TreeMod/interface/HLTMod.h
Revision: 1.16
Committed: Mon Mar 21 15:58:37 2011 UTC (14 years, 1 month ago) by paus
Content type: text/plain
Branch: MAIN
CVS Tags: Mit_020d, TMit_020d, Mit_020c, Mit_021pre1, Mit_020b, Mit_020a, Mit_020, Mit_020pre1
Changes since 1.15: +3 -3 lines
Log Message:
Improved caching.

File Contents

# User Rev Content
1 loizides 1.1 //--------------------------------------------------------------------------------------------------
2 paus 1.16 // $Id: HLTMod.h,v 1.15 2010/09/14 22:51:28 bendavid 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 bendavid 1.15 #include <utility>
30 loizides 1.1 #include <TString.h>
31     #include "MitAna/TreeMod/interface/BaseMod.h"
32 loizides 1.10 #include "MitAna/DataTree/interface/TriggerObjectFwd.h"
33 loizides 1.1
34     namespace mithep
35     {
36     class TriggerTable;
37     class TriggerObjectsTable;
38 loizides 1.6 class TriggerMask;
39 loizides 1.1
40     class HLTMod : public BaseMod {
41     public:
42 loizides 1.13 enum EObjMode { // which objects to get
43     kAll = 0,
44     kL1,
45     kHlt
46     };
47    
48 loizides 1.1 HLTMod(const char *name="HLTMod", const char *title="High-level trigger module");
49     ~HLTMod();
50    
51 bendavid 1.15 void AddTrigger(const char *expr, UInt_t firstRun=0, UInt_t lastRun=0);
52 loizides 1.14 const char *GetBitsName() const { return fBitsName; }
53 loizides 1.7 Int_t GetNEvents() const { return fNEvents; }
54 paus 1.16 Int_t GetNAccepted() const { return fNAccepted; }
55 loizides 1.7 Int_t GetNFailed() const { return fNFailed; }
56 loizides 1.11 const char *GetOutputName() const { return fMyObjsNamePub; }
57 loizides 1.7 const char *GetTrigObjsName() const { return fMyObjsNamePub; }
58 loizides 1.13 void SetAbortIfNotAccepted(Bool_t b) { fAbort = b; }
59 loizides 1.14 void SetBitsName(const char *n) { fBitsName = n; }
60     void SetIgnoreBits(Bool_t b) { fIgnoreBits = b; }
61     void SetInputName(const char *n) { fMyObjsNamePub = n; }
62     void SetObjMode(EObjMode m ) { fObjMode = m; }
63 loizides 1.13 void SetPrintTable(Bool_t b) { fPrintTable = b; }
64 loizides 1.1 void SetTrigObjsName(const char *n) { fMyObjsNamePub = n; }
65 loizides 1.13
66 loizides 1.1 protected:
67     void AddTrigObjs(UInt_t tid);
68     void BeginRun();
69     virtual void OnAccepted() {/*could be implemented in derived classes*/}
70     virtual void OnFailed() {/*could be implemented in derived classes*/}
71     void Process();
72     void SlaveBegin();
73 loizides 1.9 void SlaveTerminate();
74 loizides 1.1
75     Bool_t fAbort; //=true then abort (sub-)modules if not accepted
76 loizides 1.8 Bool_t fPrintTable; //=true then print HLT trigger table in BeginRun
77 loizides 1.13 Bool_t fIgnoreBits; //=true then try to get trigger objects (def=0)
78     EObjMode fObjMode; //defines which objects to get (def=kHlt)
79 loizides 1.1 TString fBitsName; //trigger bits branch name
80     TString fMyObjsNamePub; //name of exported trigger object array
81 bendavid 1.15 std::vector<std::pair<std::string,std::pair<UInt_t,UInt_t> > > fTrigNames; //trigger names requested for test mask with valid run range
82 loizides 1.6 const TriggerMask *fBits; //!trigger bits branch
83     std::vector<BitMask256> fTrigBitsAnd; //!trigger bits used in mask
84     std::vector<BitMask256> fTrigBitsCmp; //!trigger bits used for comparison
85 loizides 1.1 BitMask256 fBitsDone; //!bits for which trigger objects are copied
86     TriggerObjectOArr *fMyTrgObjs; //!exported published trigger object array
87 loizides 1.12 const TriggerTable *fTriggers; //!imported published HLT trigger table
88     const TriggerObjectsTable *fTrigObjs; //!imported published HLT trigger objects table
89 loizides 1.1 Int_t fNEvents; //!number of processed events
90 paus 1.16 Int_t fNAccepted; //!number of accepted events
91 loizides 1.1 Int_t fNFailed; //!number of failed events
92    
93 loizides 1.4 ClassDef(HLTMod, 1) // HLT TAM module
94 loizides 1.1 };
95     }
96     #endif