1 | #ifndef MARS_MFTriggerPattern
|
---|
2 | #define MARS_MFTriggerPattern
|
---|
3 |
|
---|
4 | #ifndef MARS_MFilter
|
---|
5 | #include "MFilter.h"
|
---|
6 | #endif
|
---|
7 |
|
---|
8 | #ifndef MARS_MTriggerPatter
|
---|
9 | #include "MTriggerPattern.h"
|
---|
10 | #endif
|
---|
11 |
|
---|
12 | class MTriggerPattern;
|
---|
13 |
|
---|
14 | class MFTriggerPattern : public MFilter
|
---|
15 | {
|
---|
16 | public:
|
---|
17 | enum Prescale_t {
|
---|
18 | kUnPrescaled,
|
---|
19 | kPrescaled
|
---|
20 | };
|
---|
21 |
|
---|
22 | private:
|
---|
23 | MTriggerPattern *fPattern; //!
|
---|
24 |
|
---|
25 | Byte_t fMaskRequiredPrescaled; // Mask for filtering Trigger Pattern allowed
|
---|
26 | Byte_t fMaskRequiredUnprescaled; // Mask for filtering Trigger Pattern allowed
|
---|
27 | Byte_t fMaskDeniedPrescaled; // Mask for filtering Trigger Pattern denied
|
---|
28 | Byte_t fMaskDeniedUnprescaled; // Mask for filtering Trigger Pattern denied
|
---|
29 |
|
---|
30 | Bool_t fDefault; // Default which is used if trigger pattern has default value (p==0&&u==0)
|
---|
31 | Bool_t fResult; //! Calculated result to be returned by IsExpressionTrue
|
---|
32 |
|
---|
33 | // MFTriggerPattern
|
---|
34 | void Require(const Byte_t mask, Prescale_t prescaled=kUnPrescaled);
|
---|
35 | void Deny(const Byte_t mask, Prescale_t prescaled=kUnPrescaled);
|
---|
36 | void Allow(const Byte_t mask, Prescale_t prescaled=kUnPrescaled);
|
---|
37 |
|
---|
38 | // MTask
|
---|
39 | Int_t PreProcess(MParList *pList);
|
---|
40 | Int_t Process();
|
---|
41 |
|
---|
42 | // MFilter
|
---|
43 | Bool_t IsExpressionTrue() const { return fResult; }
|
---|
44 |
|
---|
45 | public:
|
---|
46 | MFTriggerPattern(const char *name=NULL, const char *title=NULL);
|
---|
47 | MFTriggerPattern(MFTriggerPattern &trigpatt);
|
---|
48 |
|
---|
49 | // Setter
|
---|
50 | void RequireTriggerLvl1(Prescale_t prescaled=kUnPrescaled) { Require(MTriggerPattern::kTriggerLvl1, prescaled); }
|
---|
51 | void RequireTriggerLvl2(Prescale_t prescaled=kUnPrescaled) { Require(MTriggerPattern::kTriggerLvl2, prescaled); }
|
---|
52 | void RequireCalibration(Prescale_t prescaled=kUnPrescaled) { Require(MTriggerPattern::kCalibration, prescaled); }
|
---|
53 | void RequirePedestal(Prescale_t prescaled=kUnPrescaled) { Require(MTriggerPattern::kPedestal, prescaled); }
|
---|
54 | void RequirePinDiode(Prescale_t prescaled=kUnPrescaled) { Require(MTriggerPattern::kPinDiode, prescaled); }
|
---|
55 | void RequireSumTrigger(Prescale_t prescaled=kUnPrescaled) { Require(MTriggerPattern::kSumTrigger, prescaled); }
|
---|
56 |
|
---|
57 | void DenyTriggerLvl1(Prescale_t prescaled=kUnPrescaled) { Deny(MTriggerPattern::kTriggerLvl1, prescaled); }
|
---|
58 | void DenyTriggerLvl2(Prescale_t prescaled=kUnPrescaled) { Deny(MTriggerPattern::kTriggerLvl2, prescaled); }
|
---|
59 | void DenyCalibration(Prescale_t prescaled=kUnPrescaled) { Deny(MTriggerPattern::kCalibration, prescaled); }
|
---|
60 | void DenyPedestal(Prescale_t prescaled=kUnPrescaled) { Deny(MTriggerPattern::kPedestal, prescaled); }
|
---|
61 | void DenyPinDiode(Prescale_t prescaled=kUnPrescaled) { Deny(MTriggerPattern::kPinDiode, prescaled); }
|
---|
62 | void DenySumTrigger(Prescale_t prescaled=kUnPrescaled) { Deny(MTriggerPattern::kSumTrigger, prescaled); }
|
---|
63 |
|
---|
64 | void AllowTriggerLvl1(Prescale_t prescaled=kUnPrescaled) { Allow(MTriggerPattern::kTriggerLvl1, prescaled); }
|
---|
65 | void AllowTriggerLvl2(Prescale_t prescaled=kUnPrescaled) { Allow(MTriggerPattern::kTriggerLvl2, prescaled); }
|
---|
66 | void AllowCalibration(Prescale_t prescaled=kUnPrescaled) { Allow(MTriggerPattern::kCalibration, prescaled); }
|
---|
67 | void AllowPedestal(Prescale_t prescaled=kUnPrescaled) { Allow(MTriggerPattern::kPedestal, prescaled); }
|
---|
68 | void AllowPinDiode(Prescale_t prescaled=kUnPrescaled) { Allow(MTriggerPattern::kPinDiode, prescaled); }
|
---|
69 | void AllowSumTrigger(Prescale_t prescaled=kUnPrescaled) { Allow(MTriggerPattern::kSumTrigger, prescaled); }
|
---|
70 |
|
---|
71 | void DenyAll(Prescale_t prescaled=kUnPrescaled);
|
---|
72 | void AllowAll(Prescale_t prescaled=kUnPrescaled);
|
---|
73 |
|
---|
74 | void Require(TString patt, Prescale_t prescaled=kUnPrescaled);
|
---|
75 | void Deny(TString patt, Prescale_t prescaled=kUnPrescaled);
|
---|
76 |
|
---|
77 | void SetDefault(Bool_t b) { fDefault=b; }
|
---|
78 |
|
---|
79 | // Low level settings. USE THESE ONLY IF YOU ARE AN EXPERT!
|
---|
80 | void SetMaskRequired(const Byte_t mask, Prescale_t prescaled=kUnPrescaled);
|
---|
81 | void SetMaskDenied(const Byte_t mask, Prescale_t prescaled=kUnPrescaled);
|
---|
82 |
|
---|
83 | ClassDef(MFTriggerPattern, 1) // A Filter for the Trigger Pattern
|
---|
84 | };
|
---|
85 |
|
---|
86 | #endif
|
---|