ViewVC Help
View File | Revision Log | Show Annotations | Root Listing
root/cvsroot/UserCode/MitAna/TreeMod/interface/HLTMod.h
Revision: 1.5
Committed: Mon Mar 2 13:26:45 2009 UTC (16 years, 2 months ago) by loizides
Content type: text/plain
Branch: MAIN
CVS Tags: Mit_008pre1
Changes since 1.4: +2 -2 lines
Log Message:
Removed Vector<std:string>

File Contents

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