Commit 147be324 authored by Remi Mommsen's avatar Remi Mommsen Committed by Remi Mommsen
Browse files

references #144: add HLT information

parent 4f1a7fa7
......@@ -73,6 +73,10 @@ namespace evb {
xdata::String fuBlacklist; // The FUs to blacklist as string
xdata::String whitelistName; // Name of the whitelist file
xdata::String fuWhitelist; // The FUs to whitelist as string
xdata::String hltinfoName; // Name of the file containing the HLT info
xdata::String daqSystem; // Idenfier of the DAQ system, e.g. 'cDAQ','904', etc
xdata::String daqInstance; // Idenfier of the DAQ instance, e.g. 'global','ecal','hcal', etc
xdata::String fuGroup; // Name of the group of FUs assigned to this BU
xdata::UnsignedInteger32 roundTripTimeSamples; // Rolling average of round trip times for the last N I2O mesage (0 disables it)
xdata::UnsignedInteger32 maxPostRetries; // Max. attempts to post an I2O message
......@@ -126,6 +130,10 @@ namespace evb {
fuBlacklist("[]"),
whitelistName("whitelist"),
fuWhitelist("[]"),
hltinfoName("hltinfo"),
daqSystem(""),
daqInstance(""),
fuGroup(""),
roundTripTimeSamples(1000),
maxPostRetries(10)
{
......@@ -188,6 +196,10 @@ namespace evb {
params.add("fuBlacklist", &fuBlacklist);
params.add("whitelistName", &whitelistName);
params.add("fuWhitelist", &fuWhitelist);
params.add("hltinfoName", &hltinfoName);
params.add("daqSystem", &daqSystem);
params.add("daqInstance", &daqInstance);
params.add("fuGroup", &fuGroup);
params.add("roundTripTimeSamples", &roundTripTimeSamples);
params.add("maxPostRetries", &maxPostRetries);
}
......
......@@ -150,6 +150,7 @@ namespace evb {
void closeAnyOldRuns() const;
void populateHltdDirectory(const boost::filesystem::path& runDir) const;
void getHLTmenu(const boost::filesystem::path& tmpDir) const;
void writeHLTinfo(const boost::filesystem::path& tmpDir) const;
void writeBlacklist(const boost::filesystem::path& tmpDir) const;
void writeWhitelist(const boost::filesystem::path& tmpDir) const;
void writeHostList(const boost::filesystem::path&, const xdata::String& hosts) const;
......
......@@ -676,14 +676,16 @@ void evb::bu::DiskWriter::populateHltdDirectory(const boost::filesystem::path& r
const boost::filesystem::path tmpPath = runDir / "tmp";
createDir(tmpPath);
getHLTmenu(tmpPath);
writeHLTinfo(tmpPath);
writeBlacklist(tmpPath);
writeWhitelist(tmpPath);
const boost::filesystem::path hltPath( runDir / configuration_->hltDirName.value_ );
boost::filesystem::rename(tmpPath,hltPath);
}
void evb::bu::DiskWriter::getHLTmenu(const boost::filesystem::path& tmpPath) const
void evb::bu::DiskWriter::getHLTmenu(const boost::filesystem::path& tmpDir) const
{
if ( configuration_->hltParameterSetURL.value_.empty() ) return;
......@@ -703,7 +705,7 @@ void evb::bu::DiskWriter::getHLTmenu(const boost::filesystem::path& tmpPath) con
for (auto const& hltFile : configuration_->hltFiles)
{
const std::string fileName = hltFile.toString();
retrieveFromURL(curl, url+fileName, tmpPath/fileName);
retrieveFromURL(curl, url+fileName, tmpDir/fileName);
}
}
catch(xcept::Exception& e)
......@@ -716,16 +718,31 @@ void evb::bu::DiskWriter::getHLTmenu(const boost::filesystem::path& tmpPath) con
}
void evb::bu::DiskWriter::writeBlacklist(const boost::filesystem::path& tmpPath) const
void evb::bu::DiskWriter::writeHLTinfo(const boost::filesystem::path& tmpDir) const
{
const boost::filesystem::path blacklistPath( tmpPath / configuration_->blacklistName.value_ );
const boost::filesystem::path hltInfoPath( tmpDir / configuration_->hltinfoName.value_ );
std::ofstream json(hltInfoPath.string().c_str());
json << "{" << std::endl;
json << " \"daqSystem\": \"" << configuration_->daqSystem.value_ << "\"," << std::endl;
json << " \"daqInstance\": \"" << configuration_->daqInstance.value_ << "\"," << std::endl;
json << " \"fuGroup\": \"" << configuration_->fuGroup.value_ << "\"" << std::endl;
json << "}" << std::endl;
json.close();
}
void evb::bu::DiskWriter::writeBlacklist(const boost::filesystem::path& tmpDir) const
{
const boost::filesystem::path blacklistPath( tmpDir / configuration_->blacklistName.value_ );
writeHostList(blacklistPath, configuration_->fuBlacklist);
}
void evb::bu::DiskWriter::writeWhitelist(const boost::filesystem::path& tmpPath) const
void evb::bu::DiskWriter::writeWhitelist(const boost::filesystem::path& tmpDir) const
{
const boost::filesystem::path whitelistPath( tmpPath / configuration_->whitelistName.value_ );
const boost::filesystem::path whitelistPath( tmpDir / configuration_->whitelistName.value_ );
writeHostList(whitelistPath, configuration_->fuWhitelist);
}
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment