56 #ifndef _Q_FILEWRITER_HH_
57 #define _Q_FILEWRITER_HH_
160 virtual bool IsToOpen(
const Diana::QEvent& ev)
const;
#define Q_BEGIN_NAMESPACE
Visitor class to inspect the QEvent content.
Base class for diana file writers.
std::string fOutputDir
Directory that we are writing to.
std::string fFileIdentifier
The file identifier (follows the prefix)
int fEventNumber
current event number
std::string fFileNamePrefix
filename components
void WriteFilesList()
write list of files
std::string fFileName
fFileName = fFileNamePrefix + fFileId
std::map< std::string, int > fPartialsByFileId
Current partial file for a given file ID.
std::string fFilesListName
int fPartial
Partial number that we are currently working on.
virtual void Init(QEventInspector &evi)
Init method called by the framework.
virtual void BuildFileName(const QEvent &evi)
bool fDoGetTower
Flag to get the tower from the current event.
std::list< std::string > fFilesList
List of the full paths of files opened.
virtual const std::string & GetCorrespondingReaderFileName(const Diana::QEvent &ev) const
Get the file from which this event was read.
int fPartialSize
Partial size. When reached, automatically create a new file.
static const std::list< std::string > & GetFileList()
list of output files
virtual void Done()
Done method called by the framework.
virtual bool IsToOpen(const Diana::QEvent &ev) const
Test to see if a new file needs to be opened.
virtual void Require(const QEventInspector &evi)
optional method to set required QObjects, called before Open
bool fSaveTempFiles
Flag to say whether we save the temporary files created.
bool fWarnRunData
If the run data is not valid, pass a warning.
virtual void Do(QEventInspector &evi)
Do method called by the framework.
bool fOneFileOpenOnly
Can the writer open more than one file at a time?
std::string fCurrFilesListName
Name of the file list for this iteration.
QFileWriter(const std::string &extension)
constructor
std::string fFileFullPath
fFileFullPath = fOutputDir + "/" + fFileName + fFileExtension
bool fSyncWithReader
Flag to synchronize the output files with the input.
std::string fOldFilesListName
Name of the file list written in the previous iteration.
bool fKeepFrameWorkConfig
Write the Sequence config data to the file.
static std::list< std::string > fFullPathFilesList
List of the full paths of files opened by all writers.
virtual void Open(const std::string &filename, const QEventInspector &evi)=0
Open File.
int fCurrentRun
Current run being worked on.
virtual void Close()=0
Close file.
std::list< std::string > fOldFilesList
List of files opened on the previous iteration.
virtual int IncrementPartial(const std::string &fileId)
bool fNewPartialOnRerun
Does rerunning the sequence create new files, or a new partial.
std::string fFileId
End of the file name to be tacked on to the prefix.
std::string fFileExtension
file extension
virtual void Dump(const QEventInspector &evi)=0
Dump ev to file.
bool fSyncWithRun
Flag to start a new file for each new run.
bool fUseEventCachedFileName
Flag to determine whether to use the file in the event cache.
bool fWriteFilesList
Flag whether we are writing a files list.
void RemoveFilesList()
remove list of files
virtual ~QFileWriter()
destructor
Abstract class for diana writers.