ATLAS Offline Software
Loading...
Searching...
No Matches
Trigger
TrigValidation
TrigValTools
src
TMultiFileLooper.cxx
Go to the documentation of this file.
1
/*
2
Copyright (C) 2002-2018 CERN for the benefit of the ATLAS collaboration
3
*/
4
12
13
#include "
TrigValTools/TMultiFileLooper.h
"
14
#include "TString.h"
15
16
#include <iostream>
17
18
using namespace
std
;
19
20
Int_t
TMultiFileLooper::run
(
const
char
* fileListName,
const
char
*
/*rootDir*/
)
21
{
22
m_errorCode
= 0;
23
24
if
(fileListName==0) {
25
cout <<
"Invalid file list (0)"
<< endl;
26
m_errorCode
= 1;
27
return
m_errorCode
;
28
}
29
30
ifstream ifs;
31
ifs.open(fileListName);
32
if
(!ifs) {
33
cout <<
"Cannot open file "
<< fileListName << endl;
34
m_errorCode
= 1;
35
return
m_errorCode
;
36
}
37
38
while
(!ifs.eof()) {
39
string
filename;
40
ifs >> filename;
41
if
(filename!=
""
)
addFile
(filename.c_str());
42
}
43
44
return
run
();
45
}
46
47
48
Int_t
TMultiFileLooper::run
()
49
{
50
m_errorCode
= 0;
51
beginJob
();
52
53
vector<TString>::iterator iter;
54
for
(iter=
m_fileList
.begin(); iter!=
m_fileList
.end(); ++iter) {
55
processFile
(*iter);
56
}
57
58
endJob
();
59
return
m_errorCode
;
60
}
61
62
void
TMultiFileLooper::addFile
(
const
char
*filename)
63
{
64
if
(filename)
m_fileList
.push_back(TString(filename));
65
}
TMultiFileLooper.h
TMultiFileLooper class.
TFileLooper::beginJob
virtual void beginJob()
Definition
TFileLooper.h:54
TFileLooper::endJob
virtual void endJob()
Definition
TFileLooper.h:55
TFileLooper::m_errorCode
Int_t m_errorCode
Definition
TFileLooper.h:94
TFileLooper::processFile
void processFile(const char *filename, const char *rootDir=0)
Definition
TFileLooper.cxx:44
TMultiFileLooper::m_fileList
std::vector< TString > m_fileList
Definition
TMultiFileLooper.h:39
TMultiFileLooper::run
Int_t run()
Definition
TMultiFileLooper.cxx:48
TMultiFileLooper::addFile
void addFile(const char *filename)
Definition
TMultiFileLooper.cxx:62
std
STL namespace.
Generated on
for ATLAS Offline Software by
1.14.0