Ignore:
Timestamp:
05/25/08 11:28:15 (13 years ago)
Author:
tbretz
Message:
*** empty log message ***
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/MagicSoft/Mars/mtrigger/MFTriggerPattern.cc

    r8787 r8898  
    1919!   Author(s): Thomas Bretz  12/2004 <mailto:tbretz@astro.uni-wuerzburg.de>
    2020!
    21 !   Copyright: MAGIC Software Development, 2004-2007
     21!   Copyright: MAGIC Software Development, 2004-2008
    2222!
    2323\* ======================================================================== */
     
    3232//
    3333// For more details see: MTriggerPattern
     34//
     35//
     36// Input Containers:
     37//   MTriggerPattern
     38//
    3439//
    3540/////////////////////////////////////////////////////////////////////////////
     
    6772    fMaskRequiredPrescaled   = trigpatt.fMaskRequiredPrescaled;
    6873    fMaskRequiredUnprescaled = trigpatt.fMaskRequiredUnprescaled;
     74
     75    fMaskDeniedPrescaled     = trigpatt.fMaskDeniedPrescaled;
     76    fMaskDeniedUnprescaled   = trigpatt.fMaskDeniedUnprescaled;
     77
     78    fDefault                 = trigpatt.fDefault;
    6979}
    7080
    7181
    7282// --------------------------------------------------------------------------
     83//
     84// Search for MTriggerPattern in the paremeter list.
    7385//
    7486Int_t MFTriggerPattern::PreProcess(MParList *pList)
     
    8597
    8698// --------------------------------------------------------------------------
     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.
    87104//
    88105Int_t MFTriggerPattern::Process()
     
    110127}
    111128
    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//
     138void 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//
     153void 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//
     166void 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//
     178void 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//
     189void MFTriggerPattern::AllowAll(Prescale_t prescaled)
     190{
     191    prescaled==kPrescaled ? (fMaskDeniedPrescaled = 0) : (fMaskDeniedUnprescaled = 0);
    171192}
    172193
     
    268289// This method is there because is not possible to deny trigger patterns
    269290// using only the Require pattern. Possible arguments are (upper/lower
    270 // case is ignored):
    271 //
    272 //           "LT1"  : Trigger Level 1 flag
    273 //           "CAL"  : Calibration flag
    274 //           "LT2"  : Trigger Level 2 flag
    275 //           "PED"  : Pedestal flag
    276 //           "PIND" : Pin Diode flag
    277 //           "SUMT" : Sum Trigger flag
     291// 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
    278299//
    279300// concatenations of these strings are allowed and considered as
     
    304325        DenySumTrigger(prescaled);
    305326}
    306 
    307 // --------------------------------------------------------------------------
    308 //
    309 Bool_t MFTriggerPattern::IsExpressionTrue() const
    310 {
    311     return fResult;
    312 }
Note: See TracChangeset for help on using the changeset viewer.