Changeset 8898 for trunk


Ignore:
Timestamp:
05/25/08 11:28:15 (17 years ago)
Author:
tbretz
Message:
*** empty log message ***
Location:
trunk/MagicSoft/Mars
Files:
8 edited

Legend:

Unmodified
Added
Removed
  • trunk/MagicSoft/Mars/Changelog

    r8897 r8898  
    1818
    1919                                                 -*-*- END OF LINE -*-*-
     20
     21 2008/05/25 Thomas Bretz
     22
     23   * mtrigger/MTriggerPattern.cc:
     24     - fixed a typo in a comment
     25
     26   * mtrigger/MFTriggerPattern.[h,cc]:
     27     - some code cleanup (mainly unified all the Require and Deny
     28       functions into one)
     29     - added a DenyAll member function
     30     - added Allow member functions including an AllowAll member function
     31
     32
     33   * mjobs/MJPedestal.cc:
     34     - To choose pedestals we now deny all other trigger bits except the
     35       pedestal bit and in the case of data runs we deny all bits
     36       except trigger lvl1 and trigger lvl2
     37
     38   * mjobs/MJCalibration.cc:
     39     - In addition to denial of prescaled calibration events we
     40       deny any bit in the unprescaled pattern but allow only
     41       calibration events
     42
     43   * mjobs/MJCalibrateSignal.cc:
     44     - Instead of the denial of only calibration and pedestal events,
     45       we now deny any bit in the pattern, but allow Trigger Lvl1
     46       and Trigger Lvl2 events to choose cosmics
     47     - Instead of the denial of only lvl1 and lvl2 events,
     48       we now deny any bit in the pattern, but allow pedestal
     49       events to choose pedestals
     50     - Instead of requiring only calibration events,
     51       we now deny any bit in the pattern, but require the calibration
     52       bit to choose calibration events
     53
     54
    2055
    2156 2008/05/24 Thomas Bretz
  • trunk/MagicSoft/Mars/NEWS

    r8892 r8898  
    8080    * Tab "TrigPat" added showing the distribution of the trigger pattern
    8181      as found in the run-files (normalized with the run length)
     82
     83    * The selection of events from the trigger pattern has been improved.
     84      If the trigger pattern is corrupted events won't pass anymore.
    8285
    8386 ;star
  • trunk/MagicSoft/Mars/mjobs/MJCalibrateSignal.cc

    r8897 r8898  
    432432    // data file will be processed. In any case there are no interleaved
    433433    // calibration events in such data, so this is fine.
     434    // We allow only cosmics triggered events to pass (before prescaling)
    434435    MFTriggerPattern fcalped;
    435436    fcalped.SetInverted();
    436437    fcalped.SetDefault(kTRUE);
    437     //    ftp.RequireCalibration();
    438     fcalped.DenyCalibration();
    439     fcalped.DenyPedestal();
    440     //    ftp.DenyPinDiode();
     438    fcalped.DenyAll();
     439    fcalped.AllowTriggerLvl1();
     440    fcalped.AllowTriggerLvl2();
     441    //fcalped.AllowSumTrigger();
    441442
    442443    // This will skip interleaved events with a cal- or ped-trigger
     
    505506    // without artifially calibration events
    506507    //
     508    // Deny or allow is done before prescaling.
     509    //
    507510    MFTriggerPattern fped;
    508511    fped.SetDefault(kTRUE);
     
    510513    if (!extractor1->HasLoGain())
    511514    {
     515        fped.DenyAll();
    512516        fped.RequirePedestal();
    513         fped.DenyTriggerLvl1();
    514         fped.DenyTriggerLvl2();
    515517    }
    516518
     
    565567    MExtractBlindPixel      bldext;
    566568
     569    // Execute for all events with the calibration trigger. If no
     570    // trigger pattern is available do not execute it
     571    // The selection is done before prescaling.
    567572    MFTriggerPattern        fcalib("CalibFilter");
    568573    fcalib.SetDefault(kFALSE);
     574    fcalib.DenyAll();
    569575    fcalib.RequireCalibration();
    570     //fcalib.DenyPedestal(); // This should never happen!
    571576
    572577    MCalibrationChargeCalc  chcalc;
     
    769774    if (fIsInterlaced)
    770775    {
     776        // The task list is executed for all events with the calibration
     777        // trigger
    771778        tlist2.AddToList(&fcalib);     // MFTriggerPattern
    772779        tlist2.AddToList(&tlist4);
  • trunk/MagicSoft/Mars/mjobs/MJCalibration.cc

    r8804 r8898  
    1919!   Author(s): Markus Gaug, 02/2004 <mailto:markus@ifae.es>
    2020!
    21 !   Copyright: MAGIC Software Development, 2000-2007
     21!   Copyright: MAGIC Software Development, 2000-2008
    2222!
    2323!
     
    17151715    // anyway. So we set the default such that the MContinue ccalib
    17161716    // will never be executed.
     1717    // We allow to have only calibration events before Prescaling.
     1718    // We require that the calibration events have not been prescaled (why?)
    17171719    MTriggerPatternDecode     trgpat;
    17181720    MFTriggerPattern          fcalib("CalibFilter");
    17191721    fcalib.SetDefault(kFALSE);
    17201722    fcalib.DenyCalibration(MFTriggerPattern::kPrescaled);
     1723    fcalib.DenyAll();
     1724    fcalib.AllowCalibration();
    17211725
    17221726    MContinue                 ccalib(&fcalib,"ContTrigPattern");
     
    18311835
    18321836    //
    1833     // Apply a filter against cosmics
    1834     // (will have to be needed in the future
    1835     // when the calibration hardware-trigger is working)
     1837    // Apply a filter against cosmics (this is for the old times in which
     1838    // the calibration events where triggered by level 1 and for
     1839    // sanity against empty trigger events)
    18361840    //
    18371841    MFCosmics cosmics;
  • trunk/MagicSoft/Mars/mjobs/MJPedestal.cc

    r8892 r8898  
    10961096    // data file will be processed. In any case there are no interleaved
    10971097    // calibration events in such data, so this is fine.
     1098    // The selection is done with the trigger bits before prescaling
    10981099    MTriggerPatternDecode decode;
    10991100    MFTriggerPattern fcalib("CalibFilter");
    11001101    fcalib.SetDefault(kTRUE);
    1101     fcalib.DenyCalibration();
    1102     fcalib.DenyPedestal();
     1102    fcalib.DenyAll();
     1103    fcalib.AllowTriggerLvl1();
     1104    fcalib.AllowTriggerLvl2();
     1105    //fcalib.AllowSumTrigger();
    11031106
    11041107    tlist.AddToList(&decode);
     
    11301133
    11311134    //------------------------------
     1135    // Require that before the Prescaling we had only a pedestal trigger
    11321136    MFTriggerPattern ftp2("PedestalFilter");
    11331137    ftp2.SetDefault(kTRUE);
     1138    ftp2.DenyAll();
    11341139    ftp2.RequirePedestal();
    1135     ftp2.DenyCalibration();
    1136 
    1137     // NEW!
    1138     ftp2.DenyTriggerLvl1();
    1139     ftp2.DenyTriggerLvl2();
    11401140
    11411141    if (!fSequence.IsMonteCarlo() && (!fExtractor || !fExtractor->HasLoGain()))
  • 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 }
  • trunk/MagicSoft/Mars/mtrigger/MFTriggerPattern.h

    r8787 r8898  
    2525
    2626  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
    2828
     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
    2935  Int_t PreProcess(MParList *pList);
    3036  Int_t Process();
    3137
    32   Bool_t IsExpressionTrue() const;
     38  // MFilter
     39  Bool_t IsExpressionTrue() const { return fResult; }
    3340
    3441public:
     
    3643  MFTriggerPattern(MFTriggerPattern &trigpatt);
    3744
    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);  }
    4452
    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);
    5169
    5270  void Require(TString patt, Prescale_t prescaled=kUnPrescaled);
  • trunk/MagicSoft/Mars/mtrigger/MTriggerPattern.cc

    r8892 r8898  
    5252// 2) The second concerns prescaled triggers.
    5353//
    54 // The prescaler is a devise installed AFTER the LT2. It collects
     54// The prescaler is a devicee installed AFTER the LT2. It collects
    5555// all kind of triggers and can prescale each trigger by a different
    5656// prescaling factor. This means that we can set the prescaler to
Note: See TracChangeset for help on using the changeset viewer.