20 #include "TStopwatch.h"
77 for (FWConfiguration::KeyValues::const_iterator it = iConfig.
keyValues()->begin(), itEnd = iConfig.
keyValues()->end();
80 std::map<std::string, FWConfigurable*>::const_iterator itFound =
m_configurables.find(it->first);
82 itFound->second->setFrom(it->second);
88 for (std::map<std::string, FWConfigurable*>::const_iterator it =
m_configurables.begin(),
99 std::ofstream
file(iName.c_str());
101 std::string message =
"unable to open file " + iName;
103 throw std::runtime_error(message.c_str());
111 }
catch (std::runtime_error&
e) {
119 gROOT->LoadMacro(iName.c_str(), &
error);
123 throw std::runtime_error(message.c_str());
129 Long_t lConfig = gROOT->ProcessLineFast(
command.c_str(), &
error);
138 std::string message(
"unable to properly parse configuration file ");
140 throw std::runtime_error(message.c_str());
142 std::unique_ptr<FWConfiguration>
config(reinterpret_cast<FWConfiguration*>(lConfig));
154 std::ifstream
f(iName.c_str());
155 if (
f.peek() != (
int)
'<')
164 std::ifstream
g(iName.c_str());
178 bool operator<(
const CMatch&
x)
const {
return cnt <
x.cnt; }
181 std::vector<CMatch> clist;
182 clist.push_back(CMatch(
"reco.fwc"));
183 clist.push_back(CMatch(
"miniaod.fwc"));
184 clist.push_back(CMatch(
"aod.fwc"));
185 std::vector<FWJobMetadataManager::Data>& sdata = dataMng->
usableData();
187 for (std::vector<CMatch>::iterator
c = clist.begin();
c != clist.end(); ++
c) {
188 std::string iName = gSystem->Which(TROOT::GetMacroPath(),
c->file.c_str(), kReadPermission);
189 std::ifstream
f(iName.c_str());
190 if (
f.peek() != (
int)
'<') {
191 fwLog(
fwlog::kWarning) <<
"FWConfigurationManager::guessAndReadFromFile can't open " << iName << std::endl;
196 std::ifstream
g(iName.c_str());
202 for (FWConfiguration::KeyValues::const_iterator it =
c->cfg->keyValues()->begin(),
203 itEnd =
c->cfg->keyValues()->end();
206 if (it->first ==
"EventItems") {
207 keyValues = it->second.keyValues();
212 for (FWConfiguration::KeyValues::const_iterator it = keyValues->begin(); it != keyValues->end(); ++it) {
216 for (std::vector<FWJobMetadataManager::Data>::iterator di = sdata.begin(); di != sdata.end(); ++di) {
217 if (di->type_ ==
type) {
225 std::sort(clist.begin(), clist.end());
226 fwLog(
fwlog::kInfo) <<
"Loading configuration file " << clist.back().file << std::endl;
229 return clist.back().file;