CMS 3D CMS Logo

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

#include "PythonEventProcessor.h"

Public Member Functions

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

Private Member Functions

const PythonEventProcessoroperator= (const PythonEventProcessor &)=delete
 
 PythonEventProcessor (const PythonEventProcessor &)=delete
 

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

63  : forcePluginSetupFirst_(setupPluginSystem()),
64  processor_(addDefaultServicesToProcessDesc(iDesc.processDesc()),
65  createJobReport(),

◆ ~PythonEventProcessor()

PythonEventProcessor::~PythonEventProcessor ( )

Definition at line 68 of file PythonEventProcessor.cc.

68  {
69  auto gil = PyEval_SaveThread();
70  // Protects the destructor from throwing exceptions.
71  CMS_SA_ALLOW try { processor_.endJob(); } catch (...) {
72  }
73  PyEval_RestoreThread(gil);
74 }

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

◆ PythonEventProcessor() [2/2]

PythonEventProcessor::PythonEventProcessor ( const PythonEventProcessor )
privatedelete

Member Function Documentation

◆ operator=()

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

◆ run()

void PythonEventProcessor::run ( )

Definition at line 76 of file PythonEventProcessor.cc.

76  {
77  auto gil = PyEval_SaveThread();
78  try {
80  } catch (...) {
81  }
82  PyEval_RestoreThread(gil);
83 }

References 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 38 of file PythonEventProcessor.h.

38 { 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 46 of file PythonEventProcessor.h.

46 { 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 42 of file PythonEventProcessor.h.

42 { return processor_.totalEventsPassed(); }

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

Referenced by PYBIND11_MODULE().

Member Data Documentation

◆ forcePluginSetupFirst_

int PythonEventProcessor::forcePluginSetupFirst_
private

Definition at line 59 of file PythonEventProcessor.h.

◆ processor_

edm::EventProcessor PythonEventProcessor::processor_
private
edm::EventProcessor::totalEventsPassed
int totalEventsPassed() const
Definition: EventProcessor.cc:618
PythonEventProcessor::processor_
edm::EventProcessor processor_
Definition: PythonEventProcessor.h:60
edm::EventProcessor::totalEvents
int totalEvents() const
Definition: EventProcessor.cc:616
PythonEventProcessor::forcePluginSetupFirst_
int forcePluginSetupFirst_
Definition: PythonEventProcessor.h:59
edm::EventProcessor::endJob
void endJob()
Definition: EventProcessor.cc:579
edm::EventProcessor::runToCompletion
StatusCode runToCompletion()
Definition: EventProcessor.cc:677
CMS_SA_ALLOW
#define CMS_SA_ALLOW
Definition: thread_safety_macros.h:5
edm::EventProcessor::totalEventsFailed
int totalEventsFailed() const
Definition: EventProcessor.cc:620
edm::serviceregistry::kOverlapIsError
Definition: ServiceLegacy.h:29
funct::void
TEMPL(T2) struct Divides void
Definition: Factorize.h:29