CMS 3D CMS Logo

List of all members | Public Member Functions | Static Public Member Functions | Private Member Functions | Private Attributes
edm::OutputModuleCommunicatorT< T > Class Template Reference

#include <OutputModuleBase.h>

Inheritance diagram for edm::OutputModuleCommunicatorT< T >:
edm::OutputModuleCommunicator

Public Member Functions

void closeFile () override
 
void configure (edm::OutputModuleDescription const &desc) override
 
ModuleDescription const & description () const override
 
edm::SelectedProductsForBranchType const & keptProducts () const override
 
bool limitReached () const override
 
void openFile (edm::FileBlock const &fb) override
 
 OutputModuleCommunicatorT (T *iModule)
 
void selectProducts (edm::ProductRegistry const &preg, ThinnedAssociationsHelper const &) override
 
void setEventSelectionInfo (std::map< std::string, std::vector< std::pair< std::string, int > > > const &outputModulePathPositions, bool anyProductProduced) override
 
bool shouldWeCloseFile () const override
 
bool wantAllEvents () const override
 
void writeLumiAsync (WaitingTaskHolder iTask, edm::LuminosityBlockPrincipal const &lbp, ProcessContext const *, ActivityRegistry *) override
 
void writeRunAsync (WaitingTaskHolder iTask, edm::RunPrincipal const &rp, ProcessContext const *, ActivityRegistry *) override
 
- Public Member Functions inherited from edm::OutputModuleCommunicator
 OutputModuleCommunicator ()=default
 
virtual ~OutputModuleCommunicator ()
 

Static Public Member Functions

static std::unique_ptr< edm::OutputModuleCommunicatorcreateIfNeeded (T *iMod)
 

Private Member Functions

Tmodule () const
 

Private Attributes

Tmodule_
 

Detailed Description

template<typename T>
class edm::OutputModuleCommunicatorT< T >

Definition at line 53 of file OutputModuleBase.h.

Constructor & Destructor Documentation

template<typename T >
edm::OutputModuleCommunicatorT< T >::OutputModuleCommunicatorT ( T iModule)
inline

Member Function Documentation

template<typename T >
void edm::OutputModuleCommunicatorT< T >::closeFile ( )
overridevirtual

Implements edm::OutputModuleCommunicator.

Definition at line 52 of file OutputModuleCommunicatorT.cc.

Referenced by Vispa.Main.Application.Application::tabCloseRequest().

52  {
53  module().doCloseFile();
54  }
template<typename T >
void edm::OutputModuleCommunicatorT< T >::configure ( edm::OutputModuleDescription const &  desc)
overridevirtual

Implements edm::OutputModuleCommunicator.

Definition at line 144 of file OutputModuleCommunicatorT.cc.

144 {module().configure(desc);}
template<typename T >
static std::unique_ptr<edm::OutputModuleCommunicator> edm::OutputModuleCommunicatorT< T >::createIfNeeded ( T iMod)
inlinestatic

Definition at line 71 of file OutputModuleCommunicatorT.h.

References edm::impl::createCommunicatorIfNeeded(), and eostools::move().

71  {
73  }
std::unique_ptr< edm::OutputModuleCommunicator > createCommunicatorIfNeeded(void *)
def move(src, dest)
Definition: eostools.py:510
template<typename T >
ModuleDescription const & edm::OutputModuleCommunicatorT< T >::description ( ) const
overridevirtual

Implements edm::OutputModuleCommunicator.

Definition at line 163 of file OutputModuleCommunicatorT.cc.

163  {
164  return module().description();
165  }
template<typename T >
edm::SelectedProductsForBranchType const & edm::OutputModuleCommunicatorT< T >::keptProducts ( ) const
overridevirtual

Implements edm::OutputModuleCommunicator.

Definition at line 147 of file OutputModuleCommunicatorT.cc.

147  {
148  return module().keptProducts();
149  }
template<typename T >
bool edm::OutputModuleCommunicatorT< T >::limitReached ( ) const
overridevirtual
Returns
true if OutputModule has reached its limit on maximum number of events it wants to see

Implements edm::OutputModuleCommunicator.

Definition at line 141 of file OutputModuleCommunicatorT.cc.

141 {return module().limitReached();}
template<typename T >
T& edm::OutputModuleCommunicatorT< T >::module ( ) const
inlineprivate

Definition at line 76 of file OutputModuleCommunicatorT.h.

References sistrip::module_.

template<typename T >
void edm::OutputModuleCommunicatorT< T >::openFile ( edm::FileBlock const &  fb)
overridevirtual
template<typename T >
void edm::OutputModuleCommunicatorT< T >::selectProducts ( edm::ProductRegistry const &  preg,
ThinnedAssociationsHelper const &  helper 
)
overridevirtual

Implements edm::OutputModuleCommunicator.

Definition at line 152 of file OutputModuleCommunicatorT.cc.

152  {
153  module().selectProducts(preg, helper);
154  }
Definition: helper.py:1
template<typename T >
void edm::OutputModuleCommunicatorT< T >::setEventSelectionInfo ( std::map< std::string, std::vector< std::pair< std::string, int > > > const &  outputModulePathPositions,
bool  anyProductProduced 
)
overridevirtual

Implements edm::OutputModuleCommunicator.

Definition at line 157 of file OutputModuleCommunicatorT.cc.

158  {
159  module().setEventSelectionInfo(outputModulePathPositions, anyProductProduced);
160  }
template<typename T >
bool edm::OutputModuleCommunicatorT< T >::shouldWeCloseFile ( ) const
overridevirtual
Returns
true if output module wishes to close its file

Implements edm::OutputModuleCommunicator.

Definition at line 58 of file OutputModuleCommunicatorT.cc.

58  {
59  return module().shouldWeCloseFile();
60  }
template<typename T >
bool edm::OutputModuleCommunicatorT< T >::wantAllEvents ( ) const
overridevirtual
Returns
true if no event filtering is applied to OutputModule

Implements edm::OutputModuleCommunicator.

Definition at line 138 of file OutputModuleCommunicatorT.cc.

138 {return module().wantAllEvents();}
template<typename T >
void edm::OutputModuleCommunicatorT< T >::writeLumiAsync ( WaitingTaskHolder  iTask,
edm::LuminosityBlockPrincipal const &  lbp,
ProcessContext const *  processContext,
ActivityRegistry activityRegistry 
)
overridevirtual

Implements edm::OutputModuleCommunicator.

Definition at line 104 of file OutputModuleCommunicatorT.cc.

References edm::LuminosityBlockPrincipal::beginTime(), heppy_report::description, edm::WaitingTaskHolder::doneWaiting(), edm::LuminosityBlockPrincipal::id(), edm::RunPrincipal::index(), edm::LuminosityBlockPrincipal::index(), edm::ServiceRegistry::instance(), edm::GlobalContext::kWriteLuminosityBlock, edm::make_sentry(), mod(), eostools::move(), edm::ActivityRegistry::postModuleWriteLumiSignal_, edm::ServiceRegistry::presentToken(), edm::LuminosityBlockPrincipal::runPrincipal(), and lumiQTWidget::t.

107  {
108  auto token = ServiceRegistry::instance().presentToken();
109  GlobalContext globalContext(GlobalContext::Transition::kWriteLuminosityBlock,
110  lbp.id(),
111  lbp.runPrincipal().index(),
112  lbp.index(),
113  lbp.beginTime(),
114  processContext);
115  auto t=[&mod = module(), &lbp, activityRegistry, token, globalContext,desc = &description(),iTask]() mutable {
116  std::exception_ptr ex;
117  try {
118  ServiceRegistry::Operate op(token);
119 
120  ParentContext parentContext(&globalContext);
121  ModuleCallingContext mcc(desc);
122  ModuleContextSentry moduleContextSentry(&mcc, parentContext);
123  activityRegistry->preModuleWriteLumiSignal_(globalContext, mcc);
124  auto sentry( make_sentry(activityRegistry,
125  [&globalContext, &mcc](ActivityRegistry* activityRegistry) {
126  activityRegistry->postModuleWriteLumiSignal_(globalContext, mcc);
127  }));
128  mod.doWriteLuminosityBlock(lbp, &mcc);
129  } catch(...) {
130  ex = std::current_exception();
131  }
132  iTask.doneWaiting(ex);
133  };
134  async(module(), std::move(t));
135  }
std::unique_ptr< T, F > make_sentry(T *iObject, F iFunc)
NOTE: if iObject is null, then iFunc will not be called.
Definition: make_sentry.h:29
ServiceToken presentToken() const
ModuleDescription const & description() const override
static ServiceRegistry & instance()
T mod(const T &a, const T &b)
Definition: ecalDccMap.h:4
def move(src, dest)
Definition: eostools.py:510
template<typename T >
void edm::OutputModuleCommunicatorT< T >::writeRunAsync ( WaitingTaskHolder  iTask,
edm::RunPrincipal const &  rp,
ProcessContext const *  processContext,
ActivityRegistry activityRegistry 
)
overridevirtual

Implements edm::OutputModuleCommunicator.

Definition at line 70 of file OutputModuleCommunicatorT.cc.

References heppy_report::description, edm::WaitingTaskHolder::doneWaiting(), edm::RunPrincipal::endTime(), edm::RunPrincipal::index(), edm::ServiceRegistry::instance(), edm::LuminosityBlockIndex::invalidLuminosityBlockIndex(), edm::GlobalContext::kWriteRun, edm::make_sentry(), mod(), eostools::move(), edm::ActivityRegistry::postModuleWriteRunSignal_, edm::ActivityRegistry::preModuleWriteRunSignal_, edm::ServiceRegistry::presentToken(), edm::RunPrincipal::run(), and lumiQTWidget::t.

73  {
74  auto token = ServiceRegistry::instance().presentToken();
75  GlobalContext globalContext(GlobalContext::Transition::kWriteRun,
76  LuminosityBlockID(rp.run(), 0),
77  rp.index(),
79  rp.endTime(),
80  processContext);
81  auto t = [&mod = module(), &rp, globalContext, token, desc = &description(), activityRegistry, iTask]() mutable {
82  std::exception_ptr ex;
83  try {
84  ServiceRegistry::Operate op(token);
85  ParentContext parentContext(&globalContext);
86  ModuleCallingContext mcc(desc);
87  ModuleContextSentry moduleContextSentry(&mcc, parentContext);
88  activityRegistry->preModuleWriteRunSignal_(globalContext, mcc);
89  auto sentry( make_sentry(activityRegistry,
90  [&globalContext, &mcc](ActivityRegistry* activityRegistry) {
91  activityRegistry->postModuleWriteRunSignal_(globalContext, mcc);
92  }));
93  mod.doWriteRun(rp, &mcc);
94  } catch(...) {
95  ex = std::current_exception();
96  }
97  iTask.doneWaiting(ex);
98  };
99  async(module(), std::move(t));
100  }
std::unique_ptr< T, F > make_sentry(T *iObject, F iFunc)
NOTE: if iObject is null, then iFunc will not be called.
Definition: make_sentry.h:29
ServiceToken presentToken() const
ModuleDescription const & description() const override
static ServiceRegistry & instance()
static LuminosityBlockIndex invalidLuminosityBlockIndex()
T mod(const T &a, const T &b)
Definition: ecalDccMap.h:4
def move(src, dest)
Definition: eostools.py:510

Member Data Documentation

template<typename T >
T* edm::OutputModuleCommunicatorT< T >::module_
private

Definition at line 77 of file OutputModuleCommunicatorT.h.