CMS 3D CMS Logo

TimeoutPoolOutputModule.cc
Go to the documentation of this file.
5 
6 namespace edm {
7 
11  }
12 
15  PoolOutputModule(ps),
18  m_timeout(-1) // we want the first event right away
19  { }
20 
21  void
25  descriptions.add("TimeoutPoolOutputModule", desc);
26  }
27 
29  time_t now(time(NULL));
31  edm::LogVerbatim("TimeoutPoolOutputModule") <<" Closing file "<< currentFileName()<< " with "<< eventsWrittenInCurrentFile <<" events.";
33  m_lastEvent = now;
34  return true;
35  }
36  // std::cout <<" Events "<< eventsWrittenInCurrentFile<<" time "<< now - m_lastEvent<<std::endl;
37  if (eventsWrittenInCurrentFile==0) return false;
38  if ( now - m_lastEvent < m_timeout ) return false;
39  // next files are needed in 15, 30 and 60 sec
40  m_lastEvent = now;
41  if (m_timeout == 30) m_timeout = 60;
42  if (m_timeout == 15) m_timeout = 30;
43  if (m_timeout == -1) m_timeout = 15;
44 
45  edm::LogVerbatim("TimeoutPoolOutputModule") <<" Closing file "<< currentFileName()<< " with "<< eventsWrittenInCurrentFile <<" events.";
47  return true;
48  }
49 }
50 
static void fillDescriptions(ConfigurationDescriptions &descriptions)
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
void add(std::string const &label, ParameterSetDescription const &psetDescription)
TimeoutPoolOutputModule(ParameterSet const &ps)
HLT enums.
static void fillDescription(ParameterSetDescription &desc)