source: trunk/Mars/mtrigger/MFTriggerPattern.h@ 19727

Last change on this file since 19727 was 8952, checked in by tbretz, 16 years ago
*** empty log message ***
File size: 4.0 KB
Line 
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
12class MTriggerPattern;
13
14class MFTriggerPattern : public MFilter
15{
16public:
17 enum Prescale_t {
18 kUnPrescaled,
19 kPrescaled
20 };
21
22private:
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
32 Bool_t fResult; //! Calculated result to be returned by IsExpressionTrue
33 Int_t fCounter[4]; //! Counter for results
34
35 // MFTriggerPattern
36 void Require(const Byte_t mask, Prescale_t prescaled=kUnPrescaled);
37 void Deny(const Byte_t mask, Prescale_t prescaled=kUnPrescaled);
38 void Allow(const Byte_t mask, Prescale_t prescaled=kUnPrescaled);
39
40 Int_t Eval();
41
42 // MTask
43 Int_t PreProcess(MParList *pList);
44 Int_t Process();
45 Int_t PostProcess();
46
47 // MFilter
48 Bool_t IsExpressionTrue() const { return fResult; }
49
50public:
51 MFTriggerPattern(const char *name=NULL, const char *title=NULL);
52 MFTriggerPattern(MFTriggerPattern &trigpatt);
53
54 // Setter
55 void RequireTriggerLvl1(Prescale_t prescaled=kUnPrescaled) { Require(MTriggerPattern::kTriggerLvl1, prescaled); }
56 void RequireTriggerLvl2(Prescale_t prescaled=kUnPrescaled) { Require(MTriggerPattern::kTriggerLvl2, prescaled); }
57 void RequireCalibration(Prescale_t prescaled=kUnPrescaled) { Require(MTriggerPattern::kCalibration, prescaled); }
58 void RequirePedestal(Prescale_t prescaled=kUnPrescaled) { Require(MTriggerPattern::kPedestal, prescaled); }
59 void RequirePinDiode(Prescale_t prescaled=kUnPrescaled) { Require(MTriggerPattern::kPinDiode, prescaled); }
60 void RequireSumTrigger(Prescale_t prescaled=kUnPrescaled) { Require(MTriggerPattern::kSumTrigger, prescaled); }
61
62 void DenyTriggerLvl1(Prescale_t prescaled=kUnPrescaled) { Deny(MTriggerPattern::kTriggerLvl1, prescaled); }
63 void DenyTriggerLvl2(Prescale_t prescaled=kUnPrescaled) { Deny(MTriggerPattern::kTriggerLvl2, prescaled); }
64 void DenyCalibration(Prescale_t prescaled=kUnPrescaled) { Deny(MTriggerPattern::kCalibration, prescaled); }
65 void DenyPedestal(Prescale_t prescaled=kUnPrescaled) { Deny(MTriggerPattern::kPedestal, prescaled); }
66 void DenyPinDiode(Prescale_t prescaled=kUnPrescaled) { Deny(MTriggerPattern::kPinDiode, prescaled); }
67 void DenySumTrigger(Prescale_t prescaled=kUnPrescaled) { Deny(MTriggerPattern::kSumTrigger, prescaled); }
68
69 void AllowTriggerLvl1(Prescale_t prescaled=kUnPrescaled) { Allow(MTriggerPattern::kTriggerLvl1, prescaled); }
70 void AllowTriggerLvl2(Prescale_t prescaled=kUnPrescaled) { Allow(MTriggerPattern::kTriggerLvl2, prescaled); }
71 void AllowCalibration(Prescale_t prescaled=kUnPrescaled) { Allow(MTriggerPattern::kCalibration, prescaled); }
72 void AllowPedestal(Prescale_t prescaled=kUnPrescaled) { Allow(MTriggerPattern::kPedestal, prescaled); }
73 void AllowPinDiode(Prescale_t prescaled=kUnPrescaled) { Allow(MTriggerPattern::kPinDiode, prescaled); }
74 void AllowSumTrigger(Prescale_t prescaled=kUnPrescaled) { Allow(MTriggerPattern::kSumTrigger, prescaled); }
75
76 void DenyAll(Prescale_t prescaled=kUnPrescaled);
77 void AllowAll(Prescale_t prescaled=kUnPrescaled);
78
79 void Require(TString patt, Prescale_t prescaled=kUnPrescaled);
80 void Deny(TString patt, Prescale_t prescaled=kUnPrescaled);
81
82 void SetDefault(Bool_t b) { fDefault=b; }
83
84 // Low level settings. USE THESE ONLY IF YOU ARE AN EXPERT!
85 void SetMaskRequired(const Byte_t mask, Prescale_t prescaled=kUnPrescaled);
86 void SetMaskDenied(const Byte_t mask, Prescale_t prescaled=kUnPrescaled);
87
88 ClassDef(MFTriggerPattern, 1) // A Filter for the Trigger Pattern
89};
90
91#endif
Note: See TracBrowser for help on using the repository browser.