00001 /* Cuore Reconstruction program 00002 * 00003 * Author: MP 31/07/06 00004 * $Id: QApolloThresholdTrigger.hh 62 2006-05-05 13:46:36Z pallas $ 00005 * 00006 * Class QApolloThresholdTrigger 00007 * Threshold Trigger class for Cuore 00008 * Very simple triggering algorythm. A trigger is generated when the signal is above a threhsold 00009 * over the average baseline for a certain number of consecutive samples. Both the baseline and 00010 * the sigma noise can be fixed or auto-calculated during data taking 00011 * The first sample of the group that triggers is tagged. 00012 * 00013 */ 00014 00015 #ifndef _Q_APOLLO_THRESHOLD_TRIGGER_H_ 00016 #define _Q_APOLLO_THRESHOLD_TRIGGER_H_ 00017 00018 #include "QApolloTrigger.hh" 00019 00020 class QApolloThresholdTrigger : public QApolloTrigger { 00021 00022 public: 00023 00024 // ctor 00025 QApolloThresholdTrigger(QCrateReceiverBuffer &b,unsigned int); 00026 00027 // dtor 00028 virtual ~QApolloThresholdTrigger(); 00029 00030 // search for triggers 00031 virtual int SearchForTrigger(int); 00032 00033 private: 00034 00035 void RefreshBaseSigma(); // recompute base and sigma 00036 00037 bool fAutoBase; // if true, base is auto-calculated during data flow 00038 bool fAutoSigma; // if true, sigma is auto-calculated during data flow 00039 double fThreshold; // number of sigma above base to use as threshold 00040 unsigned int fNumThreshBins; // number of consequtive samples that must be above threshold 00041 double fSigma; // sigma of noise 00042 double fBase; // average base line 00043 00044 }; 00045 00046 #endif