CMS 3D CMS Logo

List of all members | Public Member Functions | Private Attributes
PythonEventProcessor Class Reference

#include "PythonEventProcessor.h"

Public Member Functions

const PythonEventProcessoroperator= (const PythonEventProcessor &)=delete
 
 PythonEventProcessor (PyBind11ProcessDesc const &)
 
 PythonEventProcessor (const PythonEventProcessor &)=delete
 
void run ()
 
int totalEvents () const
 
int totalEventsFailed () const
 
int totalEventsPassed () const
 
 ~PythonEventProcessor ()
 

Private Attributes

int forcePluginSetupFirst_
 
edm::EventProcessor processor_
 

Detailed Description

Description: [one line class summary]

Usage: <usage>

Definition at line 30 of file PythonEventProcessor.h.

Constructor & Destructor Documentation

◆ PythonEventProcessor() [1/2]

PythonEventProcessor::PythonEventProcessor ( PyBind11ProcessDesc const &  iDesc)

Definition at line 83 of file PythonEventProcessor.cc.

84  : forcePluginSetupFirst_(setupPluginSystem()),
85  processor_(addDefaultServicesToProcessDesc(setupThreading(iDesc.processDesc())),
86  createJobReport(),
edm::EventProcessor processor_

◆ PythonEventProcessor() [2/2]

PythonEventProcessor::PythonEventProcessor ( const PythonEventProcessor )
delete

◆ ~PythonEventProcessor()

PythonEventProcessor::~PythonEventProcessor ( )

Definition at line 100 of file PythonEventProcessor.cc.

References CMS_SA_ALLOW, edm::EventProcessor::endJob(), ConfigBuilder::nThreads, processor_, and alignCSCRings::s.

100  {
101  auto gil = PyEval_SaveThread();
102  // Protects the destructor from throwing exceptions.
103  CMS_SA_ALLOW try {
104  oneapi::tbb::task_arena{nThreads}.execute([this]() {
105  TaskCleanupSentry s(&processor_);
106  processor_.endJob();
107  });
108  } catch (...) {
109  }
110  PyEval_RestoreThread(gil);
111 }
#define CMS_SA_ALLOW
edm::EventProcessor processor_

Member Function Documentation

◆ operator=()

const PythonEventProcessor& PythonEventProcessor::operator= ( const PythonEventProcessor )
delete

◆ run()

void PythonEventProcessor::run ( )

Definition at line 113 of file PythonEventProcessor.cc.

References ConfigBuilder::nThreads, processor_, edm::EventProcessor::runToCompletion(), and funct::void.

Referenced by PYBIND11_MODULE().

113  {
114  auto gil = PyEval_SaveThread();
115  try {
116  oneapi::tbb::task_arena{nThreads}.execute([this]() { (void)processor_.runToCompletion(); });
117  } catch (...) {
118  }
119  PyEval_RestoreThread(gil);
120 }
edm::EventProcessor processor_
TEMPL(T2) struct Divides void
Definition: Factorize.h:24
StatusCode runToCompletion()

◆ totalEvents()

int PythonEventProcessor::totalEvents ( ) const
inline

Return the number of events this EventProcessor has tried to process (inclues both successes and failures, including failures due to exceptions during processing).

Definition at line 40 of file PythonEventProcessor.h.

References processor_, and edm::EventProcessor::totalEvents().

Referenced by PYBIND11_MODULE().

40 { return processor_.totalEvents(); }
edm::EventProcessor processor_

◆ totalEventsFailed()

int PythonEventProcessor::totalEventsFailed ( ) const
inline

Return the number of events that have not passed any trigger. (N.B. totalEventsFailed() + totalEventsPassed() == totalEvents()

Definition at line 48 of file PythonEventProcessor.h.

References processor_, and edm::EventProcessor::totalEventsFailed().

Referenced by PYBIND11_MODULE().

48 { return processor_.totalEventsFailed(); }
int totalEventsFailed() const
edm::EventProcessor processor_

◆ totalEventsPassed()

int PythonEventProcessor::totalEventsPassed ( ) const
inline

Return the number of events processed by this EventProcessor which have been passed by one or more trigger paths.

Definition at line 44 of file PythonEventProcessor.h.

References processor_, and edm::EventProcessor::totalEventsPassed().

Referenced by PYBIND11_MODULE().

44 { return processor_.totalEventsPassed(); }
edm::EventProcessor processor_
int totalEventsPassed() const

Member Data Documentation

◆ forcePluginSetupFirst_

int PythonEventProcessor::forcePluginSetupFirst_
private

Definition at line 57 of file PythonEventProcessor.h.

◆ processor_

edm::EventProcessor PythonEventProcessor::processor_
private