source: trunk/MagicSoft/Mars/mtrigger/MFTriggerPattern.h@ 8898

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