ViewVC Help
View File | Revision Log | Show Annotations | Root Listing
root/cvsroot/UserCode/MitAna/TreeMod/interface/HLTMod.h
Revision: 1.9
Committed: Tue May 12 18:41:43 2009 UTC (15 years, 11 months ago) by loizides
Content type: text/plain
Branch: MAIN
CVS Tags: Mit_009a
Changes since 1.8: +2 -1 lines
Log Message:
Save number of triggered events.

File Contents

# User Rev Content
1 loizides 1.1 //--------------------------------------------------------------------------------------------------
2 loizides 1.9 // $Id: HLTMod.h,v 1.8 2009/05/12 14:21:13 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     #include "MitAna/DataTree/interface/Collections.h"
32    
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     HLTMod(const char *name="HLTMod", const char *title="High-level trigger module");
42     ~HLTMod();
43    
44     void AddTrigger(const char *expr);
45 loizides 1.7 Int_t GetNEvents() const { return fNEvents; }
46     Int_t GetNAccepted() const { return fNAcceped; }
47     Int_t GetNFailed() const { return fNFailed; }
48     const char *GetTrigObjsName() const { return fMyObjsNamePub; }
49     void SetAbortIfNotAccepted(Bool_t b) { fAbort = b; }
50     void SetPrintTable(Bool_t b) { fPrintTable = b; }
51 loizides 1.1 void SetTrigObjsName(const char *n) { fMyObjsNamePub = n; }
52 loizides 1.2
53 loizides 1.1 protected:
54     void AddTrigObjs(UInt_t tid);
55     void BeginRun();
56     virtual void OnAccepted() {/*could be implemented in derived classes*/}
57     virtual void OnFailed() {/*could be implemented in derived classes*/}
58     void Process();
59     void SlaveBegin();
60 loizides 1.9 void SlaveTerminate();
61 loizides 1.1
62     Bool_t fAbort; //=true then abort (sub-)modules if not accepted
63 loizides 1.8 Bool_t fPrintTable; //=true then print HLT trigger table in BeginRun
64 loizides 1.1 TString fBitsName; //trigger bits branch name
65     TString fMyObjsNamePub; //name of exported trigger object array
66 loizides 1.5 std::vector<std::string> fTrigNames; //trigger names requested for test mask
67 loizides 1.6 const TriggerMask *fBits; //!trigger bits branch
68     std::vector<BitMask256> fTrigBitsAnd; //!trigger bits used in mask
69     std::vector<BitMask256> fTrigBitsCmp; //!trigger bits used for comparison
70 loizides 1.1 BitMask256 fBitsDone; //!bits for which trigger objects are copied
71     TriggerObjectOArr *fMyTrgObjs; //!exported published trigger object array
72     const TriggerTable *fTriggers; //!inported published HLT trigger table
73     const TriggerObjectsTable *fTrigObjs; //!inported published HLT trigger objects table
74     Int_t fNEvents; //!number of processed events
75     Int_t fNAcceped; //!number of accepted events
76     Int_t fNFailed; //!number of failed events
77    
78 loizides 1.4 ClassDef(HLTMod, 1) // HLT TAM module
79 loizides 1.1 };
80     }
81     #endif