Skip to content
Snippets Groups Projects
Commit 3d80560b authored by Vakhtang Tsulaia's avatar Vakhtang Tsulaia
Browse files

Fixed unnecessary reopening of input files in EvtRangeProcessor (ES only)

parent 302b99ea
No related branches found
No related tags found
No related merge requests found
......@@ -47,6 +47,7 @@ EvtRangeProcessor::EvtRangeProcessor(const std::string& type
, m_isPileup(false)
, m_rankId(-1)
, m_nEventsBeforeFork(0)
, m_inpFile("")
, m_chronoStatSvc("ChronoStatSvc", name)
, m_incidentSvc("IncidentSvc", name)
, m_evtSeek(0)
......@@ -721,6 +722,8 @@ StatusCode EvtRangeProcessor::startProcess()
StatusCode EvtRangeProcessor::setNewInputFile(const std::string& newFile)
{
if(m_inpFile == newFile) return StatusCode::SUCCESS;
// Get Property Server
IProperty* propertyServer = dynamic_cast<IProperty*>(m_evtSelector);
if(!propertyServer) {
......@@ -729,12 +732,25 @@ StatusCode EvtRangeProcessor::setNewInputFile(const std::string& newFile)
}
std::string propertyName("InputCollections");
if(m_inpFile.empty()) {
std::vector<std::string> vect;
StringArrayProperty inputFileList(propertyName, vect);
if(propertyServer->getProperty(&inputFileList).isFailure()) {
ATH_MSG_ERROR("Failed to get InputCollections property value of the Event Selector");
return StatusCode::FAILURE;
}
if(newFile==inputFileList.value()[0]) {
m_inpFile = newFile;
return StatusCode::SUCCESS;
}
}
std::vector<std::string> vect{newFile,};
StringArrayProperty newInputFileList(propertyName, vect);
if(propertyServer->setProperty(newInputFileList).isFailure()) {
ATH_MSG_ERROR("Unable to update " << newInputFileList.name() << " property on the Event Selector");
return StatusCode::FAILURE;
}
m_inpFile=newFile;
return StatusCode::SUCCESS;
}
......
......@@ -63,6 +63,7 @@ class EvtRangeProcessor : public AthenaMPToolBase
bool m_isPileup; // Are we doing pile-up digitization?
int m_rankId; // Each worker has its own unique RankID from the range (0,...,m_nprocs-1)
int m_nEventsBeforeFork;
std::string m_inpFile; // Cached name of the input file. To avoid reopening
ServiceHandle<IChronoStatSvc> m_chronoStatSvc;
ServiceHandle<IIncidentSvc> m_incidentSvc;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment