10int raw_ifstream::_nHandler = 0;
12pthread_mutex_t raw_ifstream::_pthread_lock = PTHREAD_MUTEX_INITIALIZER;
19 if ( _instance == 0 ) {
34 if ( _nHandler > 0 && --_nHandler == 0 ) {
35 if ( _instance->m_isOpen ) {
36 std::cout <<
"[RawFile] Closing: " << *(_instance->m_curFile) << std::endl;
47 : m_isOpen(
false), m_fnames(fnames)
49 if ( m_fnames.empty() ) {
50 throw RawExMessage(
"[RawFile] Empty input file list!");
53 m_curFile = m_fnames.begin();
63 std::cout <<
"[RawFile] Closing: " << *m_curFile << std::endl;
67 if ( ++m_curFile == m_fnames.end() ) {
80void raw_ifstream::init_fstream()
82 if ( access( m_curFile->c_str(), F_OK ) < 0 ) {
83 std::cerr <<
"[RawFile] Invalid file: " << *m_curFile << std::endl;
87 std::cout <<
"[RawFile] Prepare for reading: " << *m_curFile << std::endl;
89 open( m_curFile->c_str(), std::ios::binary );
93 (*this) >> m_fileStartRecord >> m_fileNameStrings >> m_runParametersRecord;
m_outputFile open("YYYY/m_txt_dir/LumTau_XXXX.txt", ios_base::app)
virtual void print() const
const run_parameters_record & getRecord() const
raw_ifstream(const std::vector< std::string > &fnames)
static raw_ifstream * instance(const std::vector< std::string > &fnames)