00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015 #ifndef DaqEvent_DaqLtb_H
00016 #define DaqEvent_DaqLtb_H 1
00017
00018
00019 #include "Conventions/Detectors.h"
00020 #include "Event/DaqLtbFrame.h"
00021 #include "LtbReadoutFormat/LtbReadout.h"
00022 #include "GaudiKernel/boost_allocator.h"
00023 #include <ostream>
00024
00025
00026
00027 namespace DayaBay
00028 {
00029
00030
00031
00041 class DaqLtb
00042 {
00043 public:
00044
00046 typedef std::vector<DayaBay::DaqLtbFrame*> LtbFramePtrList;
00047
00049 DaqLtb(const DybDaq::LtbReadout& ltbReadout,
00050 const DayaBay::Detector& detector);
00051
00053 DaqLtb(const unsigned int localTriggerNumber,
00054 const unsigned int rawTriggerTotal,
00055 const unsigned int ltbStatus,
00056 const DayaBay::Detector& detector);
00057
00059 DaqLtb() : m_ltbReadout(0),
00060 m_detector(0),
00061 m_framePtrs(0) {}
00062
00064 virtual ~DaqLtb();
00065
00067 virtual std::ostream& fillStream(std::ostream& s) const;
00068
00070 const LtbFramePtrList& frames() const;
00071
00073 const DaqLtbFrame& firstFrame() const;
00074
00076 unsigned int localTriggerNumber() const;
00077
00079 const DybDaq::LtbReadout* ltbReadout() const;
00080
00082 bool addFrame(DaqLtbFrame* frame);
00083
00084
00085 #ifndef GOD_NOALLOC
00087 static void* operator new ( size_t size )
00088 {
00089 return ( sizeof(DaqLtb) == size ?
00090 boost::singleton_pool<DaqLtb, sizeof(DaqLtb)>::malloc() :
00091 ::operator new(size) );
00092 }
00093
00097 static void* operator new ( size_t size, void* pObj )
00098 {
00099 return ::operator new (size,pObj);
00100 }
00101
00103 static void operator delete ( void* p )
00104 {
00105 boost::singleton_pool<DaqLtb, sizeof(DaqLtb)>::is_from(p) ?
00106 boost::singleton_pool<DaqLtb, sizeof(DaqLtb)>::free(p) :
00107 ::operator delete(p);
00108 }
00109
00112 static void operator delete ( void* p, void* pObj )
00113 {
00114 ::operator delete (p, pObj);
00115 }
00116 #endif
00117 protected:
00118
00119 private:
00120
00121 DybDaq::LtbReadout* m_ltbReadout;
00122 const DayaBay::Detector* m_detector;
00123 LtbFramePtrList* m_framePtrs;
00124
00125 };
00126
00127 inline std::ostream& operator<< (std::ostream& str, const DaqLtb& obj)
00128 {
00129 return obj.fillStream(str);
00130 }
00131
00132 }
00133
00134
00135
00136
00137
00138
00139
00140 inline std::ostream& DayaBay::DaqLtb::fillStream(std::ostream& s) const
00141 {
00142 s << "{ " << "ltbReadout : " << m_ltbReadout << std::endl
00143 << "detector : " << m_detector << std::endl
00144 << "framePtrs : " << m_framePtrs << std::endl << " }";
00145 return s;
00146 }
00147
00148
00149
00150 #endif