CMS 3D CMS Logo

List of all members | Public Member Functions | Private Attributes
evf::GlobalEvFOutputEventWriter Class Reference

Public Member Functions

void close ()
 
void doOutputEvent (EventMsgBuilder const &msg)
 
void doOutputEventAsync (std::unique_ptr< EventMsgBuilder > msg, edm::WaitingTaskHolder iHolder)
 
uint32 get_adler32 () const
 
unsigned long getAccepted () const
 
std::string const & getFilePath () const
 
 GlobalEvFOutputEventWriter (std::string const &filePath)
 
void incAccepted ()
 
edm::SerialTaskQueuequeue ()
 
 ~GlobalEvFOutputEventWriter ()
 

Private Attributes

std::atomic< unsigned long > accepted_
 
std::string filePath_
 
edm::propagate_const< std::unique_ptr< StreamerOutputFile > > stream_writer_events_
 
edm::SerialTaskQueue writeQueue_
 

Detailed Description

Definition at line 43 of file GlobalEvFOutputModule.cc.

Constructor & Destructor Documentation

◆ GlobalEvFOutputEventWriter()

evf::GlobalEvFOutputEventWriter::GlobalEvFOutputEventWriter ( std::string const &  filePath)
inlineexplicit

◆ ~GlobalEvFOutputEventWriter()

evf::GlobalEvFOutputEventWriter::~GlobalEvFOutputEventWriter ( )
inline

Definition at line 48 of file GlobalEvFOutputModule.cc.

48 {}

Member Function Documentation

◆ close()

void evf::GlobalEvFOutputEventWriter::close ( void  )
inline

◆ doOutputEvent()

void evf::GlobalEvFOutputEventWriter::doOutputEvent ( EventMsgBuilder const &  msg)
inline

Definition at line 52 of file GlobalEvFOutputModule.cc.

52  {
53  EventMsgView eview(msg.startAddress());
54  stream_writer_events_->write(eview);
55  incAccepted();
56  }

References incAccepted(), mps_check::msg, and stream_writer_events_.

Referenced by doOutputEventAsync().

◆ doOutputEventAsync()

void evf::GlobalEvFOutputEventWriter::doOutputEventAsync ( std::unique_ptr< EventMsgBuilder msg,
edm::WaitingTaskHolder  iHolder 
)
inline

Definition at line 58 of file GlobalEvFOutputModule.cc.

58  {
59  auto group = iHolder.group();
60  writeQueue_.push(*group, [holder = std::move(iHolder), msg = msg.release(), this]() {
61  try {
62  std::unique_ptr<EventMsgBuilder> own(msg);
63  doOutputEvent(*msg); //msg is written and discarded at this point
64  } catch (...) {
65  auto tmp = holder;
66  tmp.doneWaiting(std::current_exception());
67  }
68  });
69  }

References doOutputEvent(), edm::WaitingTaskHolder::group(), watchdog::group, eostools::move(), mps_check::msg, edm::SerialTaskQueue::push(), createJobs::tmp, and writeQueue_.

◆ get_adler32()

uint32 evf::GlobalEvFOutputEventWriter::get_adler32 ( ) const
inline

Definition at line 71 of file GlobalEvFOutputModule.cc.

71 { return stream_writer_events_->adler32(); }

References stream_writer_events_.

◆ getAccepted()

unsigned long evf::GlobalEvFOutputEventWriter::getAccepted ( ) const
inline

Definition at line 75 of file GlobalEvFOutputModule.cc.

75 { return accepted_; }

References accepted_.

◆ getFilePath()

std::string const& evf::GlobalEvFOutputEventWriter::getFilePath ( ) const
inline

Definition at line 73 of file GlobalEvFOutputModule.cc.

73 { return filePath_; }

References filePath_.

◆ incAccepted()

void evf::GlobalEvFOutputEventWriter::incAccepted ( )
inline

Definition at line 76 of file GlobalEvFOutputModule.cc.

76 { accepted_++; }

References accepted_.

Referenced by doOutputEvent().

◆ queue()

edm::SerialTaskQueue& evf::GlobalEvFOutputEventWriter::queue ( )
inline

Definition at line 78 of file GlobalEvFOutputModule.cc.

78 { return writeQueue_; }

References writeQueue_.

Member Data Documentation

◆ accepted_

std::atomic<unsigned long> evf::GlobalEvFOutputEventWriter::accepted_
private

Definition at line 82 of file GlobalEvFOutputModule.cc.

Referenced by getAccepted(), and incAccepted().

◆ filePath_

std::string evf::GlobalEvFOutputEventWriter::filePath_
private

Definition at line 81 of file GlobalEvFOutputModule.cc.

Referenced by getFilePath().

◆ stream_writer_events_

edm::propagate_const<std::unique_ptr<StreamerOutputFile> > evf::GlobalEvFOutputEventWriter::stream_writer_events_
private

Definition at line 83 of file GlobalEvFOutputModule.cc.

Referenced by close(), doOutputEvent(), and get_adler32().

◆ writeQueue_

edm::SerialTaskQueue evf::GlobalEvFOutputEventWriter::writeQueue_
private

Definition at line 84 of file GlobalEvFOutputModule.cc.

Referenced by doOutputEventAsync(), and queue().

evf::GlobalEvFOutputEventWriter::stream_writer_events_
edm::propagate_const< std::unique_ptr< StreamerOutputFile > > stream_writer_events_
Definition: GlobalEvFOutputModule.cc:83
evf::GlobalEvFOutputEventWriter::incAccepted
void incAccepted()
Definition: GlobalEvFOutputModule.cc:76
evf::GlobalEvFOutputEventWriter::accepted_
std::atomic< unsigned long > accepted_
Definition: GlobalEvFOutputModule.cc:82
mps_check.msg
tuple msg
Definition: mps_check.py:285
edm::SerialTaskQueue::push
void push(tbb::task_group &, const T &iAction)
asynchronously pushes functor iAction into queue
Definition: SerialTaskQueue.h:167
createJobs.tmp
tmp
align.sh
Definition: createJobs.py:716
EventMsgView
Definition: EventMessage.h:72
evf::GlobalEvFOutputEventWriter::writeQueue_
edm::SerialTaskQueue writeQueue_
Definition: GlobalEvFOutputModule.cc:84
StreamerOutputFile
Definition: StreamerOutputFile.h:23
dt4ml_dqm_sourceclient-live_cfg.filePath
filePath
CUSTOMIZE FOR ML.
Definition: dt4ml_dqm_sourceclient-live_cfg.py:45
evf::GlobalEvFOutputEventWriter::filePath_
std::string filePath_
Definition: GlobalEvFOutputModule.cc:81
eostools.move
def move(src, dest)
Definition: eostools.py:511
evf::GlobalEvFOutputEventWriter::doOutputEvent
void doOutputEvent(EventMsgBuilder const &msg)
Definition: GlobalEvFOutputModule.cc:52
edm::WaitingTaskHolder::group
tbb::task_group * group() const noexcept
Definition: WaitingTaskHolder.h:77
watchdog.group
group
Definition: watchdog.py:82