1 |
loizides |
1.1 |
//--------------------------------------------------------------------------------------------------
|
2 |
|
|
// $Id: L1Mod.h,v 1.14 2009/08/11 15:24:39 loizides Exp $
|
3 |
|
|
//
|
4 |
|
|
// L1Mod
|
5 |
|
|
//
|
6 |
|
|
// This module allows to select events according to given L1 trigger bits. The trigger bits
|
7 |
|
|
// are selected via their corresponding L1 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 |
|
|
// L1Mod will abort processing the chain of sub-modules if the trigger bits did not
|
11 |
|
|
// match the given trigger mask, unless you call SetAbortIfNotAccepted(kFALSE).
|
12 |
|
|
// For convenience L1Mod defines two virtual functions, OnAccepted() and OnFailed()
|
13 |
|
|
// that can be implemented in derived classes. OnAccepted() will be called if the event passes
|
14 |
|
|
// the trigger mask, on Failed() if it did not.
|
15 |
|
|
//
|
16 |
|
|
// Authors: C.Loizides
|
17 |
|
|
//--------------------------------------------------------------------------------------------------
|
18 |
|
|
|
19 |
|
|
#ifndef MITANA_TREEMOD_L1MOD_H
|
20 |
|
|
#define MITANA_TREEMOD_L1MOD_H
|
21 |
|
|
|
22 |
|
|
#include <string>
|
23 |
|
|
#include <TString.h>
|
24 |
|
|
#include "MitAna/TreeMod/interface/BaseMod.h"
|
25 |
|
|
|
26 |
|
|
namespace mithep
|
27 |
|
|
{
|
28 |
|
|
class TriggerTable;
|
29 |
|
|
class L1TriggerMask;
|
30 |
|
|
|
31 |
|
|
class L1Mod : public BaseMod {
|
32 |
|
|
public:
|
33 |
|
|
L1Mod(const char *name="L1Mod", const char *title="L1 trigger module");
|
34 |
|
|
~L1Mod();
|
35 |
|
|
|
36 |
|
|
void AddTrigger(const char *expr);
|
37 |
|
|
Bool_t GetAlgoBit() const { return fAlgo; }
|
38 |
|
|
const char *GetBitsName() const { return fBitsName; }
|
39 |
|
|
Int_t GetNEvents() const { return fNEvents; }
|
40 |
|
|
Int_t GetNAccepted() const { return fNAcceped; }
|
41 |
|
|
Int_t GetNFailed() const { return fNFailed; }
|
42 |
|
|
void SetAbortIfNotAccepted(Bool_t b) { fAbort = b; }
|
43 |
|
|
void SetAlgoBit(Bool_t b) { fAlgo = b; }
|
44 |
|
|
void SetBitsName(const char *n) { fBitsName = n; }
|
45 |
|
|
void SetIgnoreBits(Bool_t b) { fIgnoreBits = b; }
|
46 |
|
|
void SetPrintTable(Bool_t b) { fPrintTable = b; }
|
47 |
|
|
|
48 |
|
|
protected:
|
49 |
|
|
void BeginRun();
|
50 |
|
|
virtual void OnAccepted() {/*could be implemented in derived classes*/}
|
51 |
|
|
virtual void OnFailed() {/*could be implemented in derived classes*/}
|
52 |
|
|
void Process();
|
53 |
|
|
void SlaveBegin();
|
54 |
|
|
void SlaveTerminate();
|
55 |
|
|
|
56 |
|
|
Bool_t fAbort; //=true then abort (sub-)modules if not accepted
|
57 |
|
|
Bool_t fAlgo; //=true then use algorithm bits
|
58 |
|
|
Bool_t fPrintTable; //=true then print L1 trigger table in BeginRun
|
59 |
|
|
Bool_t fIgnoreBits; //=true then try to get trigger objects (def=0)
|
60 |
|
|
TString fBitsName; //trigger bits branch name
|
61 |
|
|
std::vector<std::string> fTrigNames; //trigger names requested for test mask
|
62 |
|
|
const L1TriggerMask *fBits; //!trigger bits branch
|
63 |
|
|
std::vector<BitMask64 > fTrigBitsAnd; //!trigger bits used in mask
|
64 |
|
|
std::vector<BitMask64> fTrigBitsCmp; //!trigger bits used for comparison
|
65 |
|
|
BitMask256 fBitsDone; //!bits for which events are accepted
|
66 |
|
|
const TriggerTable *fTriggers; //!imported published L1 trigger table
|
67 |
|
|
Int_t fNEvents; //!number of processed events
|
68 |
|
|
Int_t fNAcceped; //!number of accepted events
|
69 |
|
|
Int_t fNFailed; //!number of failed events
|
70 |
|
|
|
71 |
|
|
ClassDef(L1Mod, 1) // L1 TAM module
|
72 |
|
|
};
|
73 |
|
|
}
|
74 |
|
|
#endif
|