CMS 3D CMS Logo

TimeoutPoolOutputModule.cc
Go to the documentation of this file.
3 
4 namespace edm {
5 
9  }
10 
13  PoolOutputModule(ps),
16  m_timeout(-1) // we want the first event right away
17  { }
18 
20  time_t now(time(NULL));
22  edm::LogVerbatim("TimeoutPoolOutputModule") <<" Closing file "<< currentFileName()<< " with "<< eventsWrittenInCurrentFile <<" events.";
24  m_lastEvent = now;
25  return true;
26  }
27  // std::cout <<" Events "<< eventsWrittenInCurrentFile<<" time "<< now - m_lastEvent<<std::endl;
28  if (eventsWrittenInCurrentFile==0) return false;
29  if ( now - m_lastEvent < m_timeout ) return false;
30  // next files are needed in 15, 30 and 60 sec
31  m_lastEvent = now;
32  if (m_timeout == 30) m_timeout = 60;
33  if (m_timeout == 15) m_timeout = 30;
34  if (m_timeout == -1) m_timeout = 15;
35 
36  edm::LogVerbatim("TimeoutPoolOutputModule") <<" Closing file "<< currentFileName()<< " with "<< eventsWrittenInCurrentFile <<" events.";
38  return true;
39  }
40 }
41 
virtual bool shouldWeCloseFile() const override
allow inheriting classes to override but still be able to call this method in the overridden version ...
virtual void write(EventForOutput const &e) override
virtual bool shouldWeCloseFile() const override
allow inheriting classes to override but still be able to call this method in the overridden version ...
#define NULL
Definition: scimark2.h:8
std::string const & currentFileName() const
virtual void write(EventForOutput const &e) override
TimeoutPoolOutputModule(ParameterSet const &ps)
HLT enums.