Changeset 8898 for trunk/MagicSoft/Mars/mtrigger
- Timestamp:
- 05/25/08 11:28:15 (16 years ago)
- Location:
- trunk/MagicSoft/Mars/mtrigger
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/MagicSoft/Mars/mtrigger/MFTriggerPattern.cc
r8787 r8898 19 19 ! Author(s): Thomas Bretz 12/2004 <mailto:tbretz@astro.uni-wuerzburg.de> 20 20 ! 21 ! Copyright: MAGIC Software Development, 2004-200 721 ! Copyright: MAGIC Software Development, 2004-2008 22 22 ! 23 23 \* ======================================================================== */ … … 32 32 // 33 33 // For more details see: MTriggerPattern 34 // 35 // 36 // Input Containers: 37 // MTriggerPattern 38 // 34 39 // 35 40 ///////////////////////////////////////////////////////////////////////////// … … 67 72 fMaskRequiredPrescaled = trigpatt.fMaskRequiredPrescaled; 68 73 fMaskRequiredUnprescaled = trigpatt.fMaskRequiredUnprescaled; 74 75 fMaskDeniedPrescaled = trigpatt.fMaskDeniedPrescaled; 76 fMaskDeniedUnprescaled = trigpatt.fMaskDeniedUnprescaled; 77 78 fDefault = trigpatt.fDefault; 69 79 } 70 80 71 81 72 82 // -------------------------------------------------------------------------- 83 // 84 // Search for MTriggerPattern in the paremeter list. 73 85 // 74 86 Int_t MFTriggerPattern::PreProcess(MParList *pList) … … 85 97 86 98 // -------------------------------------------------------------------------- 99 // 100 // If Prescaled and Unprescaled pattern is 0 return default. 101 // If all bits of the fMaskRequired* mask are found in the pattern set 102 // fResult to true. 103 // If any bit matches the fMasDenied* mask fResult is forced to be false. 87 104 // 88 105 Int_t MFTriggerPattern::Process() … … 110 127 } 111 128 112 void MFTriggerPattern::RequireTriggerLvl1(Prescale_t prescaled) 113 { 114 prescaled==kPrescaled ? (fMaskRequiredPrescaled |= MTriggerPattern::kTriggerLvl1) : (fMaskRequiredUnprescaled |= MTriggerPattern::kTriggerLvl1); 115 } 116 117 void MFTriggerPattern::RequireTriggerLvl2(Prescale_t prescaled) 118 { 119 prescaled==kPrescaled ? (fMaskRequiredPrescaled |= MTriggerPattern::kTriggerLvl2) : (fMaskRequiredUnprescaled |= MTriggerPattern::kTriggerLvl2); 120 } 121 122 void MFTriggerPattern::RequireCalibration(Prescale_t prescaled) 123 { 124 prescaled==kPrescaled ? (fMaskRequiredPrescaled |= MTriggerPattern::kCalibration) : (fMaskRequiredUnprescaled |= MTriggerPattern::kCalibration); 125 } 126 127 void MFTriggerPattern::RequirePedestal(Prescale_t prescaled) 128 { 129 prescaled==kPrescaled ? (fMaskRequiredPrescaled |= MTriggerPattern::kPedestal) : (fMaskRequiredUnprescaled |= MTriggerPattern::kPedestal); 130 } 131 132 void MFTriggerPattern::RequirePinDiode(Prescale_t prescaled) 133 { 134 prescaled==kPrescaled ? (fMaskRequiredPrescaled |= MTriggerPattern::kPinDiode) : (fMaskRequiredUnprescaled |= MTriggerPattern::kPinDiode); 135 } 136 137 void MFTriggerPattern::RequireSumTrigger(Prescale_t prescaled) 138 { 139 prescaled==kPrescaled ? (fMaskRequiredPrescaled |= MTriggerPattern::kSumTrigger) : (fMaskRequiredUnprescaled |= MTriggerPattern::kSumTrigger); 140 } 141 142 143 void MFTriggerPattern::DenyTriggerLvl1(Prescale_t prescaled) 144 { 145 prescaled==kPrescaled ? (fMaskDeniedPrescaled |= MTriggerPattern::kTriggerLvl1) : (fMaskDeniedUnprescaled |= MTriggerPattern::kTriggerLvl1); 146 } 147 148 void MFTriggerPattern::DenyTriggerLvl2(Prescale_t prescaled) 149 { 150 prescaled==kPrescaled ? (fMaskDeniedPrescaled |= MTriggerPattern::kTriggerLvl2) : (fMaskDeniedUnprescaled |= MTriggerPattern::kTriggerLvl2); 151 } 152 153 void MFTriggerPattern::DenyCalibration(Prescale_t prescaled) 154 { 155 prescaled==kPrescaled ? (fMaskDeniedPrescaled |= MTriggerPattern::kCalibration) : (fMaskDeniedUnprescaled |= MTriggerPattern::kCalibration); 156 } 157 158 void MFTriggerPattern::DenyPedestal(Prescale_t prescaled) 159 { 160 prescaled==kPrescaled ? (fMaskDeniedPrescaled |= MTriggerPattern::kPedestal) : (fMaskDeniedUnprescaled |= MTriggerPattern::kPedestal); 161 } 162 163 void MFTriggerPattern::DenyPinDiode(Prescale_t prescaled) 164 { 165 prescaled==kPrescaled ? (fMaskDeniedPrescaled |= MTriggerPattern::kPinDiode) : (fMaskDeniedUnprescaled |= MTriggerPattern::kPinDiode); 166 } 167 168 void MFTriggerPattern::DenySumTrigger(Prescale_t prescaled) 169 { 170 prescaled==kPrescaled ? (fMaskDeniedPrescaled |= MTriggerPattern::kSumTrigger) : (fMaskDeniedUnprescaled |= MTriggerPattern::kSumTrigger); 129 // ------------------------------------------------------------------------- 130 // 131 // Require that a prescaled or unprescaled bit in the trigger pattern is 132 // passed. The bit is defined by mask, the prescaling by prescaled. The 133 // default is unprescaled. 134 // 135 // Because it doesn't make sense to require a denied bit we reset 136 // the deny bit at the same time. 137 // 138 void MFTriggerPattern::Require(const Byte_t mask, Prescale_t prescaled=kUnPrescaled) 139 { 140 prescaled==kPrescaled ? (fMaskRequiredPrescaled |= mask) : (fMaskRequiredUnprescaled |= mask); 141 prescaled==kPrescaled ? (fMaskDeniedPrescaled &= ^mask) : (fMaskDeniedUnprescaled &= ^mask); 142 } 143 144 // ------------------------------------------------------------------------- 145 // 146 // Deny that a prescaled or unprescaled bit in the trigger pattern is 147 // passed. The bit is defined by mask, the prescaling by prescaled. The 148 // default is unprescaled. 149 // 150 // Because it doesn't make sense to deny a required bit we reset 151 // the require bit at the same time. 152 // 153 void MFTriggerPatter::Deny(const Byte_t mask, Prescale_t prescaled=kUnPrescaled) 154 { 155 prescaled==kPrescaled ? (fMaskDeniedPrescaled |= mask) : (fMaskDeniedUnprescaled |= mask); 156 prescaled==kPrescaled ? (fMaskRequiredPrescaled &= ^mask) : (fMaskRequiredUnprescaled &= ^mask); 157 } 158 159 // ------------------------------------------------------------------------- 160 // 161 // Remove the given bits from the deny-mask. Thus you can first deny 162 // all bits to pass and then define which bit you want to allow 163 // to pass. The bit is defined by mask, the prescaling by prescaled. The 164 // default is unprescaled. 165 // 166 void MFTriggerPatter::Allow(const Byte_t mask, Prescale_t prescaled=kUnPrescaled) 167 { 168 prescaled==kPrescaled ? (fMaskDeniedPrescaled &= ^mask) : (fMaskDeniedUnprescaled &= ^mask); 169 } 170 171 172 // ------------------------------------------------------------------------- 173 // 174 // Deny all bits (i.e. also require non bits) for the given prescaling 175 // option. The prescaling is defined by prescaled. The default is 176 // unprescaled. 177 // 178 void MFTriggerPattern::DenyAll(Prescale_t prescaled) 179 { 180 Deny(0xff, prescaled); 181 } 182 183 // ------------------------------------------------------------------------- 184 // 185 // Allow all bits. resets the deny mask for the given prescaling option, 186 // but keeps the require mask unchanged. The prescaling is defined 187 // by prescaled. The default is unprescaled. 188 // 189 void MFTriggerPattern::AllowAll(Prescale_t prescaled) 190 { 191 prescaled==kPrescaled ? (fMaskDeniedPrescaled = 0) : (fMaskDeniedUnprescaled = 0); 171 192 } 172 193 … … 268 289 // This method is there because is not possible to deny trigger patterns 269 290 // using only the Require pattern. Possible arguments are (upper/lower 270 // case is ignored) :271 // 272 // "LT1" : Trigger Level 1 flag273 // "CAL" : Calibration flag274 // "LT2" : Trigger Level 2 flag275 // "PED" : Pedestal flag276 // "PIND" : Pin Diode flag277 // "SUMT" : Sum Trigger flag291 // case is ignored) the flags for: 292 // 293 // "LT1" : Trigger Level 1 294 // "CAL" : Calibration 295 // "LT2" : Trigger Level 2 296 // "PED" : Pedestal 297 // "PIND" : Pin Diode 298 // "SUMT" : Sum Trigger 278 299 // 279 300 // concatenations of these strings are allowed and considered as … … 304 325 DenySumTrigger(prescaled); 305 326 } 306 307 // --------------------------------------------------------------------------308 //309 Bool_t MFTriggerPattern::IsExpressionTrue() const310 {311 return fResult;312 } -
trunk/MagicSoft/Mars/mtrigger/MFTriggerPattern.h
r8787 r8898 25 25 26 26 Bool_t fDefault; // Default which is used if trigger pattern has default value (p==0&&u==0) 27 Bool_t fResult; //! 27 Bool_t fResult; //! Calculated result to be returned by IsExpressionTrue 28 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 29 35 Int_t PreProcess(MParList *pList); 30 36 Int_t Process(); 31 37 32 Bool_t IsExpressionTrue() const; 38 // MFilter 39 Bool_t IsExpressionTrue() const { return fResult; } 33 40 34 41 public: … … 36 43 MFTriggerPattern(MFTriggerPattern &trigpatt); 37 44 38 void RequireTriggerLvl1(Prescale_t prescaled=kUnPrescaled); 39 void RequireTriggerLvl2(Prescale_t prescaled=kUnPrescaled); 40 void RequireCalibration(Prescale_t prescaled=kUnPrescaled); 41 void RequirePedestal(Prescale_t prescaled=kUnPrescaled); 42 void RequirePinDiode(Prescale_t prescaled=kUnPrescaled); 43 void RequireSumTrigger(Prescale_t prescaled=kUnPrescaled); 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); } 44 52 45 void DenyTriggerLvl1(Prescale_t prescaled=kUnPrescaled); 46 void DenyTriggerLvl2(Prescale_t prescaled=kUnPrescaled); 47 void DenyCalibration(Prescale_t prescaled=kUnPrescaled); 48 void DenyPedestal(Prescale_t prescaled=kUnPrescaled); 49 void DenyPinDiode(Prescale_t prescaled=kUnPrescaled); 50 void DenySumTrigger(Prescale_t prescaled=kUnPrescaled); 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); 51 69 52 70 void Require(TString patt, Prescale_t prescaled=kUnPrescaled); -
trunk/MagicSoft/Mars/mtrigger/MTriggerPattern.cc
r8892 r8898 52 52 // 2) The second concerns prescaled triggers. 53 53 // 54 // The prescaler is a devi se installed AFTER the LT2. It collects54 // The prescaler is a devicee installed AFTER the LT2. It collects 55 55 // all kind of triggers and can prescale each trigger by a different 56 56 // prescaling factor. This means that we can set the prescaler to
Note:
See TracChangeset
for help on using the changeset viewer.