- Timestamp:
- 05/25/08 11:28:15 (17 years ago)
- Location:
- trunk/MagicSoft/Mars
- Files:
-
- 8 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/MagicSoft/Mars/Changelog
r8897 r8898 18 18 19 19 -*-*- 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 20 55 21 56 2008/05/24 Thomas Bretz -
trunk/MagicSoft/Mars/NEWS
r8892 r8898 80 80 * Tab "TrigPat" added showing the distribution of the trigger pattern 81 81 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. 82 85 83 86 ;star -
trunk/MagicSoft/Mars/mjobs/MJCalibrateSignal.cc
r8897 r8898 432 432 // data file will be processed. In any case there are no interleaved 433 433 // calibration events in such data, so this is fine. 434 // We allow only cosmics triggered events to pass (before prescaling) 434 435 MFTriggerPattern fcalped; 435 436 fcalped.SetInverted(); 436 437 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(); 441 442 442 443 // This will skip interleaved events with a cal- or ped-trigger … … 505 506 // without artifially calibration events 506 507 // 508 // Deny or allow is done before prescaling. 509 // 507 510 MFTriggerPattern fped; 508 511 fped.SetDefault(kTRUE); … … 510 513 if (!extractor1->HasLoGain()) 511 514 { 515 fped.DenyAll(); 512 516 fped.RequirePedestal(); 513 fped.DenyTriggerLvl1();514 fped.DenyTriggerLvl2();515 517 } 516 518 … … 565 567 MExtractBlindPixel bldext; 566 568 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. 567 572 MFTriggerPattern fcalib("CalibFilter"); 568 573 fcalib.SetDefault(kFALSE); 574 fcalib.DenyAll(); 569 575 fcalib.RequireCalibration(); 570 //fcalib.DenyPedestal(); // This should never happen!571 576 572 577 MCalibrationChargeCalc chcalc; … … 769 774 if (fIsInterlaced) 770 775 { 776 // The task list is executed for all events with the calibration 777 // trigger 771 778 tlist2.AddToList(&fcalib); // MFTriggerPattern 772 779 tlist2.AddToList(&tlist4); -
trunk/MagicSoft/Mars/mjobs/MJCalibration.cc
r8804 r8898 19 19 ! Author(s): Markus Gaug, 02/2004 <mailto:markus@ifae.es> 20 20 ! 21 ! Copyright: MAGIC Software Development, 2000-200 721 ! Copyright: MAGIC Software Development, 2000-2008 22 22 ! 23 23 ! … … 1715 1715 // anyway. So we set the default such that the MContinue ccalib 1716 1716 // 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?) 1717 1719 MTriggerPatternDecode trgpat; 1718 1720 MFTriggerPattern fcalib("CalibFilter"); 1719 1721 fcalib.SetDefault(kFALSE); 1720 1722 fcalib.DenyCalibration(MFTriggerPattern::kPrescaled); 1723 fcalib.DenyAll(); 1724 fcalib.AllowCalibration(); 1721 1725 1722 1726 MContinue ccalib(&fcalib,"ContTrigPattern"); … … 1831 1835 1832 1836 // 1833 // Apply a filter against cosmics 1834 // (will have to be needed in the future1835 // 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) 1836 1840 // 1837 1841 MFCosmics cosmics; -
trunk/MagicSoft/Mars/mjobs/MJPedestal.cc
r8892 r8898 1096 1096 // data file will be processed. In any case there are no interleaved 1097 1097 // calibration events in such data, so this is fine. 1098 // The selection is done with the trigger bits before prescaling 1098 1099 MTriggerPatternDecode decode; 1099 1100 MFTriggerPattern fcalib("CalibFilter"); 1100 1101 fcalib.SetDefault(kTRUE); 1101 fcalib.DenyCalibration(); 1102 fcalib.DenyPedestal(); 1102 fcalib.DenyAll(); 1103 fcalib.AllowTriggerLvl1(); 1104 fcalib.AllowTriggerLvl2(); 1105 //fcalib.AllowSumTrigger(); 1103 1106 1104 1107 tlist.AddToList(&decode); … … 1130 1133 1131 1134 //------------------------------ 1135 // Require that before the Prescaling we had only a pedestal trigger 1132 1136 MFTriggerPattern ftp2("PedestalFilter"); 1133 1137 ftp2.SetDefault(kTRUE); 1138 ftp2.DenyAll(); 1134 1139 ftp2.RequirePedestal(); 1135 ftp2.DenyCalibration();1136 1137 // NEW!1138 ftp2.DenyTriggerLvl1();1139 ftp2.DenyTriggerLvl2();1140 1140 1141 1141 if (!fSequence.IsMonteCarlo() && (!fExtractor || !fExtractor->HasLoGain())) -
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.