QEventFiller.hh
00001 #ifndef _Q_EVENT_FILLER_HH_
00002 #define _Q_EVENT_FILLER_HH_
00003
00004 #include "QCuore.hh"
00005
00006 #include <map>
00007 #include <vector>
00008 #include <list>
00009
00010 #include "QBuilderDefs.hh"
00011 #include "QMuonEventBuilder.hh"
00012
00013 namespace Cuore {
00014 class QEvent;
00015 class QPulse;
00016 }
00017
00018 class QTrgInfo;
00019
00020 class QEventFiller
00021 {
00022 public:
00023 QEventFiller();
00024 virtual ~QEventFiller();
00025
00026 bool SetMap(const std::map<unsigned int, QBuilderInfo_t>& info);
00027
00028 bool SetSidePulses(const std::map<unsigned int,
00029 std::list<unsigned int> >& sidePulses);
00036 bool SetMuonChannel(const unsigned int& ch);
00037
00044 bool SetHeaterChannel(const unsigned int& ch);
00045
00051 bool SetRunNumber(const unsigned int& run);
00052
00058 bool Consolidate();
00059
00069 bool FillEvent(QEvent* ev,
00070 const QTrgInfo& mainTrg,
00071 const std::list<QTrgInfo>& triggers);
00072
00073 private:
00074
00075 const std::map<unsigned int, QBuilderInfo_t>* fInfo;
00076
00077 const std::map<unsigned int, std::list<unsigned int> >* fSidePulses;
00082 bool fIsReady;
00083
00085 unsigned int fMuonCh;
00086
00088 unsigned int fHeaterCh;
00089
00091 unsigned int fCurrentDaqRun;
00092
00094 time_t fStartRunUnix;
00095
00097 unsigned int fEventNumber;
00098
00100 QMuonEventBuilder fMuonBuilder;
00101
00102 bool FillMuonEvent(QEvent* ev);
00103
00111 bool FillPulse(QPulse* pulse,
00112 const QTrgInfo& trgInfo,
00113 const std::list<QTrgInfo>& triggers,
00114 const bool& isMain);
00115
00123 bool FillSidePulses(std::vector<QPulse>& pulses,
00124 const unsigned int& ch,
00125 const long long& time,
00126 const std::list<QTrgInfo>& triggers);
00127 };
00128 #endif