QApolloTrigger.hh

00001 
00016 #ifndef _Q_APOLLO_TRIGGER_H_
00017 #define _Q_APOLLO_TRIGGER_H_
00018 
00019 #include <string>
00020 #include <ostream>
00021 #include <map>
00022 #include "QCuore.hh"
00023 #include "QNamed.hh"
00024 #include "QVdt.hh"
00025 #include "QApolloDbDaq.hh"
00026 #include "QCrateReceiverBuffer.hh"
00027 
00028 class QApolloTrigger : public QNamed {
00029 
00030 protected: 
00031   // protected ctor
00032   // base class for real triggers
00033   QApolloTrigger(const std::string&, QCrateReceiverBuffer&, unsigned int);
00034 
00035 public:
00037   QApolloTrigger() : QNamed(""), fBuffer( *((QCrateReceiverBuffer*)0) ) {}
00038 
00040   virtual ~QApolloTrigger();
00041 
00048   inline void SetTrgEnabled(bool enabled) 
00049   { fBuffer.SetTriggerEnabled(enabled); }
00050 
00056   virtual int SearchForTrigger(int nWords) = 0;
00057   
00059   virtual bool SelfAdjust(int nWords) {return true;}
00060 
00062   inline void SetProcessed(int n) {fBuffer.SetProcessed(n);}
00063 
00065   inline int Lg() const {return fBuffer.GetLg(); }
00066 
00068    inline unsigned int GetTag() const {return fTag;}
00069 
00075    inline unsigned long GetMinWords() const {return fMinWords;}
00076 
00082    inline unsigned long GetDelayWords() const {return fDelayWords;}
00083 
00084   // to avoid border effects in trigger; right now cabled to 100 samples
00085   // can be got from DB if necessary
00086   inline int Tolerance() const { return 100;}
00087 
00091    inline unsigned long GetToBeProcessed() const 
00092    {return fBuffer.GetToBeProcessed();}
00093 
00094 protected:
00095 
00096    const QVdt& GetParam(const std::string p);
00097   
00098    QCrateReceiverBuffer& fBuffer;   
00099    unsigned int fTag;
00100    unsigned long fMinWords;
00101    unsigned long fDelayWords;
00102 
00103    friend std::ostream& operator << (std::ostream&, QApolloTrigger&);
00104   
00105 };
00106 
00107 std::ostream& operator << (std::ostream&, QApolloTrigger&);
00108 
00109 #endif

Generated on Tue Nov 16 10:49:55 2010 for CUORE Software by  doxygen 1.5.6