CMS 3D CMS Logo

TimeoutPoolOutputModule.cc
Go to the documentation of this file.
5 
6 namespace edm {
7 
11  }
12 
15  PoolOutputModule(ps),
16  m_lastEvent(time(nullptr)),
17  eventsWrittenInCurrentFile(0),
18  m_timeout(-1) // we want the first event right away
19  {}
20 
24  descriptions.add("TimeoutPoolOutputModule", desc);
25  }
26 
28  time_t now(time(nullptr));
30  edm::LogVerbatim("TimeoutPoolOutputModule")
31  << " 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;
38  return false;
39  if (now - m_lastEvent < m_timeout)
40  return false;
41  // next files are needed in 15, 30 and 60 sec
42  m_lastEvent = now;
43  if (m_timeout == 30)
44  m_timeout = 60;
45  if (m_timeout == 15)
46  m_timeout = 30;
47  if (m_timeout == -1)
48  m_timeout = 15;
49 
50  edm::LogVerbatim("TimeoutPoolOutputModule")
51  << " Closing file " << currentFileName() << " with " << eventsWrittenInCurrentFile << " events.";
53  return true;
54  }
55 } // namespace edm
ConfigurationDescriptions.h
edm::TimeoutPoolOutputModule::TimeoutPoolOutputModule
TimeoutPoolOutputModule(ParameterSet const &ps)
Definition: TimeoutPoolOutputModule.cc:13
TimeoutPoolOutputModule.h
SiPixelPI::one
Definition: SiPixelPayloadInspectorHelper.h:39
MessageLogger.h
edm::TimeoutPoolOutputModule::m_timeout
int m_timeout
Definition: TimeoutPoolOutputModule.h:39
submitPVValidationJobs.now
now
Definition: submitPVValidationJobs.py:639
edm
HLT enums.
Definition: AlignableModifier.h:19
edm::PoolOutputModule::currentFileName
std::string const & currentFileName() const
Definition: PoolOutputModule.cc:116
edm::ParameterSetDescription
Definition: ParameterSetDescription.h:52
edm::TimeoutPoolOutputModule::write
void write(EventForOutput const &e) override
Definition: TimeoutPoolOutputModule.cc:8
edm::PoolOutputModule
Definition: PoolOutputModule.h:39
edm::TimeoutPoolOutputModule::eventsWrittenInCurrentFile
unsigned int eventsWrittenInCurrentFile
Definition: TimeoutPoolOutputModule.h:38
edm::ConfigurationDescriptions::add
void add(std::string const &label, ParameterSetDescription const &psetDescription)
Definition: ConfigurationDescriptions.cc:57
ParameterSetDescription.h
edm::ConfigurationDescriptions
Definition: ConfigurationDescriptions.h:28
edm::TimeoutPoolOutputModule::shouldWeCloseFile
bool shouldWeCloseFile() const override
allow inheriting classes to override but still be able to call this method in the overridden version
Definition: TimeoutPoolOutputModule.cc:27
OutputModuleBase
edm::ParameterSet
Definition: ParameterSet.h:47
edm::TimeoutPoolOutputModule::fillDescriptions
static void fillDescriptions(ConfigurationDescriptions &descriptions)
Definition: TimeoutPoolOutputModule.cc:21
edm::EventForOutput
Definition: EventForOutput.h:50
edm::TimeoutPoolOutputModule::m_lastEvent
time_t m_lastEvent
Definition: TimeoutPoolOutputModule.h:37
submitPVResolutionJobs.desc
string desc
Definition: submitPVResolutionJobs.py:251
edm::PoolOutputModule::shouldWeCloseFile
bool shouldWeCloseFile() const override
allow inheriting classes to override but still be able to call this method in the overridden version
Definition: PoolOutputModule.cc:332
edm::LogVerbatim
Log< level::Info, true > LogVerbatim
Definition: MessageLogger.h:128
ntuplemaker.time
time
Definition: ntuplemaker.py:310
edm::PoolOutputModule::write
void write(EventForOutput const &e) override
Definition: PoolOutputModule.cc:273
edm::PoolOutputModule::fillDescription
static void fillDescription(ParameterSetDescription &desc)
Definition: PoolOutputModule.cc:424
MillePedeFileConverter_cfg.e
e
Definition: MillePedeFileConverter_cfg.py:37