• Main Page
  • Related Pages
  • Namespaces
  • Data Structures
  • Files
  • File List
  • Globals

newmonitor/get4/Processor.h (r3879/r3877)

Go to the documentation of this file.
00001 #ifndef GET4_PROCESSOR_H
00002 #define GET4_PROCESSOR_H
00003 
00004 #include "base/SysCoreProc.h"
00005 
00006 #include "roc/Iterator.h"
00007 
00008 namespace get4 {
00009 
00010    class SubEvent;
00011 
00012    enum { NumChannels = 4 };
00013 
00014    struct Get4Rec {
00015       bool used;
00016 
00017       base::H1handle fChannels;  
00018 
00019       base::H1handle fRisTm[NumChannels]; 
00020       base::H1handle fFalTm[NumChannels]; 
00021       base::H1handle fRisFineTm[NumChannels]; 
00022       base::H1handle fFalFineTm[NumChannels]; 
00023       base::H1handle fWidth[NumChannels]; 
00024       base::H1handle fRisRef[NumChannels]; 
00025       base::H1handle fFalRef[NumChannels]; 
00026 
00027       uint64_t lastFallingEdge[NumChannels];
00028       uint64_t lastRisingEdge[NumChannels];
00029 
00030       Get4Rec();
00031    };
00032 
00033    class Processor : public base::SysCoreProc {
00034 
00035       protected:
00036 
00037          roc::Iterator fIter;  
00038          roc::Iterator fIter2;  
00039 
00040          base::H1handle fMsgsKind;   
00041          base::H1handle fSysTypes;   
00042 
00043          std::vector<get4::Get4Rec> GET4;      
00044 
00045          int fNumHits;
00046          int fNumBadHits;
00047 
00048          unsigned fRefGet4;
00049          unsigned fRefChannel;
00050 
00051          uint64_t fLastRefRising;         
00052          uint64_t fLastRefFalling;        
00053 
00054          bool get4_in_use(unsigned id) { return id < GET4.size() ? GET4[id].used : false; }
00055 
00056          bool IsValidBufIndex(unsigned indx) const { return indx<fQueue.size(); }
00057 
00058          void AssignBufferTo(roc::Iterator& iter, const base::Buffer& buf);
00059 
00060          // this constant identify to which extend NX time can be disordered
00061          virtual double MaximumDisorderTm() const { return 1000.; }
00062 
00064          virtual unsigned GetTriggerMultipl(unsigned indx);
00065 
00067          virtual bool doTriggerSelection() const { return (fTriggerSignal < 4) || (fTriggerSignal==10) || (fTriggerSignal==11); }
00068 
00069          virtual void SortDataInSubEvent(base::SubEvent*);
00070 
00071          int Get4TimeDiff(uint64_t t1, uint64_t t2) { return t1<=t2 ? t2-t1 : -1*((int) (t1-t2)); }
00072 
00073       public:
00074 
00075          Processor(unsigned rocid, unsigned nxmask = 0x5);
00076          virtual ~Processor();
00077 
00078          void setRefChannel(unsigned ref_get4, unsigned ref_ch);
00079          bool isRefChannel() const { return fRefChannel < NumChannels; }
00080 
00082          virtual bool FirstBufferScan(const base::Buffer& buf);
00083 
00085          virtual bool SecondBufferScan(const base::Buffer& buf);
00086    };
00087 }
00088 
00089 #endif

Generated on Thu Dec 13 2012 04:52:22 for ROCsoft by  doxygen 1.7.1