Changeset 8929 for trunk/MagicSoft/Mars/mtrigger
- Timestamp:
- 06/08/08 13:55:36 (16 years ago)
- Location:
- trunk/MagicSoft/Mars/mtrigger
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/MagicSoft/Mars/mtrigger/MFTriggerPattern.cc
r8903 r8929 93 93 } 94 94 95 memset(fCounter, 0, sizeof(fCounter)); 96 95 97 return kTRUE; 96 98 } … … 103 105 // If any bit matches the fMasDenied* mask fResult is forced to be false. 104 106 // 105 Int_t MFTriggerPattern:: Process()107 Int_t MFTriggerPattern::Eval() const 106 108 { 107 109 const Byte_t p = fPattern->GetPrescaled(); … … 109 111 if (p==0 && u==0) 110 112 { 111 fResult = fDefault; 112 return kTRUE; 113 return fDefault; 113 114 } 114 115 115 fResult= kFALSE;116 Bool_t rc = kFALSE; 116 117 117 118 // Check whether all the bits required are ON 118 119 if ( ((p & fMaskRequiredPrescaled) == fMaskRequiredPrescaled) && 119 120 ((u & fMaskRequiredUnprescaled) == fMaskRequiredUnprescaled)) 120 fResult= kTRUE;121 rc = kTRUE; 121 122 122 123 // Now overwrite the result if one of the bits is denied 123 124 if ( (p & fMaskDeniedPrescaled) || (u & fMaskDeniedUnprescaled) ) 124 fResult = kFALSE; 125 return kFALSE; 126 127 return rc; 128 } 129 130 // -------------------------------------------------------------------------- 131 // 132 // If Prescaled and Unprescaled pattern is 0 return default. 133 // If all bits of the fMaskRequired* mask are found in the pattern set 134 // fResult to true. 135 // If any bit matches the fMasDenied* mask fResult is forced to be false. 136 // 137 Int_t MFTriggerPattern::Process() 138 { 139 fResult = Eval(); 140 fCounter[fResult ? 0 : 1]++; 141 142 return kTRUE; 143 } 144 145 // -------------------------------------------------------------------------- 146 // 147 Int_t MFTriggerPattern::PostProcess() 148 { 149 const UInt_t n = GetNumExecutions(); 150 if (n==0) 151 return kTRUE; 152 153 *fLog << inf << endl; 154 *fLog << GetDescriptor() << " execution statistics:" << endl; 155 *fLog << dec << setfill(' '); 156 157 *fLog << " " << setw(7) << fCounter[0] << " (" << setw(3) ; 158 *fLog << (int)(fCounter[0]*100/n); 159 *fLog << "%) Accepted trigger pattern." << endl; 160 161 *fLog << " " << setw(7) << fCounter[1] << " (" << setw(3) ; 162 *fLog << (int)(fCounter[1]*100/n); 163 *fLog << "%) Rejected trigger pattern!" << endl; 164 *fLog << endl; 125 165 126 166 return kTRUE; -
trunk/MagicSoft/Mars/mtrigger/MFTriggerPattern.h
r8903 r8929 29 29 30 30 Bool_t fDefault; // Default which is used if trigger pattern has default value (p==0&&u==0) 31 31 32 Bool_t fResult; //! Calculated result to be returned by IsExpressionTrue 33 Int_t fCounter[2]; //! Counter for results 32 34 33 35 // MFTriggerPattern … … 36 38 void Allow(const Byte_t mask, Prescale_t prescaled=kUnPrescaled); 37 39 40 Int_t Eval() const; 41 38 42 // MTask 39 43 Int_t PreProcess(MParList *pList); 40 44 Int_t Process(); 45 Int_t PostProcess(); 41 46 42 47 // MFilter
Note:
See TracChangeset
for help on using the changeset viewer.