PAASS
Software suite to Acquire and Analyze Data from Pixie16
|
#include <hribf_buffers.h>
Public Member Functions | |
PollOutputFile () | |
Default constructor. More... | |
PollOutputFile (std::string filename_) | |
Constructor to set the output filename prefix. More... | |
~PollOutputFile () | |
std::streampos | GetFilesize () |
Get the size of the current file, in bytes. More... | |
std::string | GetCurrentFilename () |
Get the name of the current output file. More... | |
unsigned int | GetNumberSpills () |
Return the total number of spills written since the current file was opened. More... | |
PLD_header * | GetPLDheader () |
Return a pointer to the PLD header object. More... | |
PLD_data * | GetPLDdata () |
Return a pointer to the PLD data object. More... | |
DIR_buffer * | GetDIRbuffer () |
Return a pointer to the DIR buffer object. More... | |
HEAD_buffer * | GetHEADbuffer () |
Return a pointer to the HEAD buffer object. More... | |
DATA_buffer * | GetDATAbuffer () |
Return a pointer to the DATA buffer object. More... | |
EOF_buffer * | GetEOFbuffer () |
Return a pointer to the EOF buffer object. More... | |
void | SetDebugMode (bool debug_=true) |
Toggle debug mode. More... | |
bool | SetFileFormat (unsigned int format_) |
Set the output file format. More... | |
void | SetFilenamePrefix (std::string filename_) |
Set the output filename prefix. More... | |
bool | IsOpen () |
Return true if an output file is open and writable and false otherwise. More... | |
int | Write (char *data_, unsigned int nWords_) |
Write nWords_ of data to the file. More... | |
int | SendPacket (Client *cli_) |
bool | OpenNewFile (std::string title_, unsigned int &run_num_, std::string prefix, std::string output_dir="./", bool continueRun=false) |
Close the current file, if one is open, and open a new file for data output. More... | |
std::string | GetNextFileName (unsigned int &run_num_, std::string prefix, std::string output_dir, bool continueRun=false) |
Return the filename of the next output file. More... | |
unsigned int | GetRunNumber () |
void | CloseFile (float total_run_time_=0.0) |
Write the footer and close the file. More... | |
Private Member Functions | |
std::string | get_filename () |
Get the formatted filename of the current file. More... | |
bool | get_full_filename (std::string &output) |
Get the full path of the current file. More... | |
bool | overwrite_dir (int total_buffers_=-1) |
void | initialize () |
Initialize the output file with initial parameters. More... | |
Private Attributes | |
std::ofstream | output_file |
std::string | fname_prefix |
std::string | current_filename |
std::string | current_full_filename |
PLD_header | pldHead |
PLD_data | pldData |
DIR_buffer | dirBuff |
HEAD_buffer | headBuff |
DATA_buffer | dataBuff |
EOF_buffer | eofBuff |
unsigned int | max_spill_size |
unsigned int | current_file_num |
unsigned int | output_format |
unsigned int | number_spills |
unsigned int | run_num |
bool | debug_mode |
unsigned int | current_depth |
std::string | current_directory |
std::vector< std::string > | directories |
Definition at line 316 of file hribf_buffers.h.
PollOutputFile::PollOutputFile | ( | ) |
Default constructor.
Definition at line 1068 of file hribf_buffers.cpp.
PollOutputFile::PollOutputFile | ( | std::string | filename_ | ) |
Constructor to set the output filename prefix.
Definition at line 1073 of file hribf_buffers.cpp.
|
inline |
Definition at line 358 of file hribf_buffers.h.
void PollOutputFile::CloseFile | ( | float | total_run_time_ = 0.0 | ) |
Write the footer and close the file.
Definition at line 1279 of file hribf_buffers.cpp.
|
private |
Get the formatted filename of the current file.
Definition at line 938 of file hribf_buffers.cpp.
|
private |
Get the full path of the current file.
Get the full filename of the current file including path.
Definition at line 954 of file hribf_buffers.cpp.
|
inline |
Get the name of the current output file.
Definition at line 364 of file hribf_buffers.h.
|
inline |
Return a pointer to the DATA buffer object.
Definition at line 382 of file hribf_buffers.h.
|
inline |
Return a pointer to the DIR buffer object.
Definition at line 376 of file hribf_buffers.h.
|
inline |
Return a pointer to the EOF buffer object.
Definition at line 385 of file hribf_buffers.h.
|
inline |
Get the size of the current file, in bytes.
Definition at line 361 of file hribf_buffers.h.
|
inline |
Return a pointer to the HEAD buffer object.
Definition at line 379 of file hribf_buffers.h.
std::string PollOutputFile::GetNextFileName | ( | unsigned int & | run_num_, |
std::string | prefix, | ||
std::string | output_dir, | ||
bool | continueRun = false |
||
) |
Return the filename of the next output file.
Definition at line 1246 of file hribf_buffers.cpp.
|
inline |
Return the total number of spills written since the current file was opened.
Definition at line 367 of file hribf_buffers.h.
|
inline |
Return a pointer to the PLD data object.
Definition at line 373 of file hribf_buffers.h.
|
inline |
Return a pointer to the PLD header object.
Definition at line 370 of file hribf_buffers.h.
unsigned int PollOutputFile::GetRunNumber | ( | ) |
Definition at line 1271 of file hribf_buffers.cpp.
|
private |
Initialize the output file with initial parameters.
Definition at line 1035 of file hribf_buffers.cpp.
|
inline |
Return true if an output file is open and writable and false otherwise.
Definition at line 397 of file hribf_buffers.h.
bool PollOutputFile::OpenNewFile | ( | std::string | title_, |
unsigned int & | run_num_, | ||
std::string | prefix, | ||
std::string | output_dir = "./" , |
||
bool | continueRun = false |
||
) |
Close the current file, if one is open, and open a new file for data output.
Definition at line 1199 of file hribf_buffers.cpp.
|
private |
Overwrite the fourth word of the file with the total number of buffers and close the file Returns false if no output file is open or if the number of 4 byte words in the file is not evenly divisible by the number of words in a buffer
Overwrite the fourth word of the file with the total number of buffers and close the file. Returns false if no output file is open or if the number of 4 byte words in the file is not evenly divisible by the number of words in a buffer.
Definition at line 1000 of file hribf_buffers.cpp.
int PollOutputFile::SendPacket | ( | Client * | cli_ | ) |
Build a data spill notification message for broadcast onto the network Return the total number of bytes in the packet upon success, and -1 otherwise
Broadcast a data spill notification message onto the network. Return the total number of bytes in the packet upon success, and -1 otherwise.
Definition at line 1133 of file hribf_buffers.cpp.
void PollOutputFile::SetDebugMode | ( | bool | debug_ = true | ) |
Toggle debug mode.
Definition at line 1079 of file hribf_buffers.cpp.
bool PollOutputFile::SetFileFormat | ( | unsigned int | format_ | ) |
Set the output file format.
Set the output file data format.
Definition at line 1090 of file hribf_buffers.cpp.
void PollOutputFile::SetFilenamePrefix | ( | std::string | filename_ | ) |
Set the output filename prefix.
Definition at line 1099 of file hribf_buffers.cpp.
int PollOutputFile::Write | ( | char * | data_, |
unsigned int | nWords_ | ||
) |
Write nWords_ of data to the file.
Write nWords_ words of pixie data to disk.
Definition at line 1105 of file hribf_buffers.cpp.
|
private |
Definition at line 335 of file hribf_buffers.h.
|
private |
Definition at line 336 of file hribf_buffers.h.
|
private |
Definition at line 329 of file hribf_buffers.h.
|
private |
Definition at line 320 of file hribf_buffers.h.
|
private |
Definition at line 321 of file hribf_buffers.h.
|
private |
Definition at line 326 of file hribf_buffers.h.
|
private |
Definition at line 333 of file hribf_buffers.h.
|
private |
Definition at line 324 of file hribf_buffers.h.
|
private |
Definition at line 337 of file hribf_buffers.h.
|
private |
Definition at line 327 of file hribf_buffers.h.
|
private |
Definition at line 319 of file hribf_buffers.h.
|
private |
Definition at line 325 of file hribf_buffers.h.
|
private |
Definition at line 328 of file hribf_buffers.h.
|
private |
Definition at line 331 of file hribf_buffers.h.
|
private |
Definition at line 318 of file hribf_buffers.h.
|
private |
Definition at line 330 of file hribf_buffers.h.
|
private |
Definition at line 323 of file hribf_buffers.h.
|
private |
Definition at line 322 of file hribf_buffers.h.
|
private |
Definition at line 332 of file hribf_buffers.h.