00001 #ifndef _ots_EventDataSaver_h
00002 #define _ots_EventDataSaver_h
00003
00004 #include "otsdaq-core/DataManager/DataConsumer.h"
00005
00006 #include <string>
00007
00008 class TFile;
00009 class TTree;
00010
00011 namespace ots
00012 {
00013 class Event;
00014
00015 class EventDataSaver : public DataConsumer
00016 {
00017 public:
00018 EventDataSaver(std::string supervisorApplicationUID, std::string bufferUID, std::string processorUID, ConsumerPriority priority);
00019 virtual ~EventDataSaver(void);
00020
00021 void openFile(std::string fileName);
00022 void closeFile(void);
00023 void save(std::string& data);
00024
00025 std::string getName(void);
00026
00027
00028
00029 protected:
00030 void writeHeader(void);
00031 bool workLoopThread(toolbox::task::WorkLoop* workLoop);
00032 TFile* outFile_;
00033 Event* anEvent_;
00034 TTree* outTree_;
00035 };
00036
00037 }
00038
00039 #endif