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 (const PythonEventProcessor &)=delete
 
 PythonEventProcessor (PyBind11ProcessDesc const &)
 
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(),

◆ PythonEventProcessor() [2/2]

PythonEventProcessor::PythonEventProcessor ( const PythonEventProcessor )
delete

◆ ~PythonEventProcessor()

PythonEventProcessor::~PythonEventProcessor ( )

Definition at line 89 of file PythonEventProcessor.cc.

89  {
90  auto gil = PyEval_SaveThread();
91  // Protects the destructor from throwing exceptions.
92  CMS_SA_ALLOW try { processor_.endJob(); } catch (...) {
93  }
94  PyEval_RestoreThread(gil);
95 }

References CMS_SA_ALLOW, edm::EventProcessor::endJob(), and processor_.

Member Function Documentation

◆ operator=()

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

◆ run()

void PythonEventProcessor::run ( )

Definition at line 97 of file PythonEventProcessor.cc.

97  {
98  auto gil = PyEval_SaveThread();
99  try {
100  tbb::task_arena{nThreads}.execute([this]() { (void)processor_.runToCompletion(); });
101  } catch (...) {
102  }
103  PyEval_RestoreThread(gil);
104 }

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

Referenced by PYBIND11_MODULE().

◆ 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.

40 { return processor_.totalEvents(); }

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

Referenced by PYBIND11_MODULE().

◆ 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.

48 { return processor_.totalEventsFailed(); }

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

Referenced by PYBIND11_MODULE().

◆ 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.

44 { return processor_.totalEventsPassed(); }

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

Referenced by PYBIND11_MODULE().

Member Data Documentation

◆ forcePluginSetupFirst_

int PythonEventProcessor::forcePluginSetupFirst_
private

Definition at line 57 of file PythonEventProcessor.h.

◆ processor_

edm::EventProcessor PythonEventProcessor::processor_
private
edm::EventProcessor::totalEventsPassed
int totalEventsPassed() const
Definition: EventProcessor.cc:631
PythonEventProcessor::processor_
edm::EventProcessor processor_
Definition: PythonEventProcessor.h:58
edm::EventProcessor::totalEvents
int totalEvents() const
Definition: EventProcessor.cc:629
PythonEventProcessor::forcePluginSetupFirst_
int forcePluginSetupFirst_
Definition: PythonEventProcessor.h:57
edm::EventProcessor::endJob
void endJob()
Definition: EventProcessor.cc:592
edm::EventProcessor::runToCompletion
StatusCode runToCompletion()
Definition: EventProcessor.cc:688
CMS_SA_ALLOW
#define CMS_SA_ALLOW
Definition: thread_safety_macros.h:5
edm::EventProcessor::totalEventsFailed
int totalEventsFailed() const
Definition: EventProcessor.cc:633
runTheMatrix.nThreads
nThreads
Definition: runTheMatrix.py:355
edm::serviceregistry::kOverlapIsError
Definition: ServiceLegacy.h:29
funct::void
TEMPL(T2) struct Divides void
Definition: Factorize.h:24