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 100 of file PythonEventProcessor.cc.

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

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

Member Function Documentation

◆ operator=()

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

◆ run()

void PythonEventProcessor::run ( )

Definition at line 113 of file PythonEventProcessor.cc.

113  {
114  auto gil = PyEval_SaveThread();
115  try {
116  tbb::task_arena{nThreads}.execute([this]() { (void)processor_.runToCompletion(); });
117  } catch (...) {
118  }
119  PyEval_RestoreThread(gil);
120 }

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:732
PythonEventProcessor::processor_
edm::EventProcessor processor_
Definition: PythonEventProcessor.h:58
edm::EventProcessor::totalEvents
int totalEvents() const
Definition: EventProcessor.cc:730
PythonEventProcessor::forcePluginSetupFirst_
int forcePluginSetupFirst_
Definition: PythonEventProcessor.h:57
edm::EventProcessor::endJob
void endJob()
Definition: EventProcessor.cc:693
edm::EventProcessor::runToCompletion
StatusCode runToCompletion()
Definition: EventProcessor.cc:789
CMS_SA_ALLOW
#define CMS_SA_ALLOW
Definition: thread_safety_macros.h:5
edm::EventProcessor::totalEventsFailed
int totalEventsFailed() const
Definition: EventProcessor.cc:734
alignCSCRings.s
s
Definition: alignCSCRings.py:92
runTheMatrix.nThreads
nThreads
Definition: runTheMatrix.py:371
edm::serviceregistry::kOverlapIsError
Definition: ServiceLegacy.h:29
funct::void
TEMPL(T2) struct Divides void
Definition: Factorize.h:24