CMS 3D CMS Logo

List of all members | Public Member Functions | Static Public Member Functions | Private Member Functions | Private Attributes
edm::TestGlobalOutput Class Reference
Inheritance diagram for edm::TestGlobalOutput:
edm::global::OutputModule< WatchInputFiles, RunCache< int >, LuminosityBlockCache< int > > edm::global::OutputModuleBase edm::core::OutputModuleCore edm::EDConsumerBase

Public Member Functions

 TestGlobalOutput (ParameterSet const &pset)
 
 ~TestGlobalOutput () override
 
- Public Member Functions inherited from edm::global::OutputModule< WatchInputFiles, RunCache< int >, LuminosityBlockCache< int > >
const OutputModuleoperator= (const OutputModule &)=delete
 
 OutputModule (edm::ParameterSet const &iPSet)
 
 OutputModule (const OutputModule &)=delete
 
bool wantsInputProcessBlocks () const final
 
bool wantsProcessBlocks () const final
 
bool wantsStreamLuminosityBlocks () const final
 
bool wantsStreamRuns () const final
 
- Public Member Functions inherited from edm::global::OutputModuleBase
OutputModuleBaseoperator= (OutputModuleBase const &)=delete
 
 OutputModuleBase (ParameterSet const &pset)
 
 OutputModuleBase (OutputModuleBase const &)=delete
 
bool wantsGlobalLuminosityBlocks () const
 
bool wantsGlobalRuns () const
 
- Public Member Functions inherited from edm::core::OutputModuleCore
BranchIDLists const * branchIDLists () const
 
void callWhenNewProductsRegistered (std::function< void(BranchDescription const &)> const &func)
 
std::array< bool, NumBranchTypes > const & hasNewlyDroppedBranch () const
 
SelectedProductsForBranchType const & keptProducts () const
 
int maxEvents () const
 
const ModuleDescriptionmoduleDescription () const
 
OutputModuleCoreoperator= (OutputModuleCore const &)=delete
 
 OutputModuleCore (ParameterSet const &pset)
 
 OutputModuleCore (OutputModuleCore const &)=delete
 
OutputProcessBlockHelper const & outputProcessBlockHelper () const
 
std::string const & processName () const
 
int remainingEvents () const
 
bool selected (BranchDescription const &desc) const
 
void selectProducts (ProductRegistry const &preg, ThinnedAssociationsHelper const &, ProcessBlockHelperBase const &)
 
ThinnedAssociationsHelper const * thinnedAssociationsHelper () const
 
bool wantAllEvents () const
 
 ~OutputModuleCore () override
 
- Public Member Functions inherited from edm::EDConsumerBase
std::vector< ConsumesInfoconsumesInfo () const
 
void convertCurrentProcessAlias (std::string const &processName)
 Convert "@currentProcess" in InputTag process names to the actual current process name. More...
 
 EDConsumerBase ()
 
 EDConsumerBase (EDConsumerBase const &)=delete
 
 EDConsumerBase (EDConsumerBase &&)=default
 
ESResolverIndex const * esGetTokenIndices (edm::Transition iTrans) const
 
std::vector< ESResolverIndex > const & esGetTokenIndicesVector (edm::Transition iTrans) const
 
std::vector< ESRecordIndex > const & esGetTokenRecordIndicesVector (edm::Transition iTrans) const
 
ProductResolverIndexAndSkipBit indexFrom (EDGetToken, BranchType, TypeID const &) const
 
void itemsMayGet (BranchType, std::vector< ProductResolverIndexAndSkipBit > &) const
 
void itemsToGet (BranchType, std::vector< ProductResolverIndexAndSkipBit > &) const
 
std::vector< ProductResolverIndexAndSkipBit > const & itemsToGetFrom (BranchType iType) const
 
void labelsForToken (EDGetToken iToken, Labels &oLabels) const
 
void modulesWhoseProductsAreConsumed (std::array< std::vector< ModuleDescription const *> *, NumBranchTypes > &modulesAll, std::vector< ModuleProcessName > &modulesInPreviousProcesses, ProductRegistry const &preg, std::map< std::string, ModuleDescription const *> const &labelsToDesc, std::string const &processName) const
 
EDConsumerBase const & operator= (EDConsumerBase const &)=delete
 
EDConsumerBaseoperator= (EDConsumerBase &&)=default
 
bool registeredToConsume (ProductResolverIndex, bool, BranchType) const
 
void selectInputProcessBlocks (ProductRegistry const &productRegistry, ProcessBlockHelperBase const &processBlockHelperBase)
 
ProductResolverIndexAndSkipBit uncheckedIndexFrom (EDGetToken) const
 
void updateLookup (BranchType iBranchType, ProductResolverIndexHelper const &, bool iPrefetchMayGet)
 
void updateLookup (eventsetup::ESRecordsToProductResolverIndices const &)
 
virtual ~EDConsumerBase () noexcept(false)
 

Static Public Member Functions

static void fillDescriptions (ConfigurationDescriptions &descriptions)
 
- Static Public Member Functions inherited from edm::core::OutputModuleCore
static const std::string & baseType ()
 
static void fillDescription (ParameterSetDescription &desc, std::vector< std::string > const &iDefaultOutputCommands=ProductSelectorRules::defaultSelectionStrings())
 
static void fillDescriptions (ConfigurationDescriptions &descriptions)
 
static void prevalidate (ConfigurationDescriptions &)
 

Private Member Functions

void endJob () override
 
std::shared_ptr< int > globalBeginLuminosityBlock (LuminosityBlockForOutput const &) const override
 
std::shared_ptr< int > globalBeginRun (RunForOutput const &) const override
 
void globalEndLuminosityBlock (LuminosityBlockForOutput const &) const override
 
void globalEndRun (RunForOutput const &) const override
 
void respondToCloseInputFile (FileBlock const &) override
 
void respondToOpenInputFile (FileBlock const &) override
 
void write (EventForOutput const &e) override
 
void writeLuminosityBlock (LuminosityBlockForOutput const &) override
 
void writeProcessBlock (ProcessBlockForOutput const &) override
 
void writeRun (RunForOutput const &) override
 

Private Attributes

int countWriteProcessBlockTransitions_ = 0
 
std::vector< std::string > expectedProcessesWithProcessBlockProducts_
 
int expectedWriteProcessBlockTransitions_
 
bool verbose_
 

Additional Inherited Members

- Public Types inherited from edm::global::OutputModuleBase
typedef OutputModuleBase ModuleType
 
- Public Types inherited from edm::core::OutputModuleCore
typedef OutputModuleCore ModuleType
 
- Public Types inherited from edm::EDConsumerBase
typedef ProductLabels Labels
 
- Protected Member Functions inherited from edm::global::OutputModuleBase
void doAcquire (EventTransitionInfo const &, ActivityRegistry *, ModuleCallingContext const *, WaitingTaskWithArenaHolder &)
 
void doBeginJob ()
 
void doBeginStream (StreamID id)
 
void doEndStream (StreamID id)
 
bool doEvent (EventTransitionInfo const &, ActivityRegistry *, ModuleCallingContext const *)
 
void doPreallocate (PreallocationConfiguration const &)
 
void preActionBeforeRunEventAsync (WaitingTaskHolder iTask, ModuleCallingContext const &iModuleCallingContext, Principal const &iPrincipal) const
 
- Protected Member Functions inherited from edm::core::OutputModuleCore
void configure (OutputModuleDescription const &desc)
 
ModuleDescription const & description () const
 
void doAccessInputProcessBlock (ProcessBlockPrincipal const &, ModuleCallingContext const *)
 
void doBeginJob_ ()
 
bool doBeginLuminosityBlock (LumiTransitionInfo const &, ModuleCallingContext const *)
 
void doBeginProcessBlock (ProcessBlockPrincipal const &, ModuleCallingContext const *)
 
bool doBeginRun (RunTransitionInfo const &, ModuleCallingContext const *)
 
void doEndJob ()
 
bool doEndLuminosityBlock (LumiTransitionInfo const &, ModuleCallingContext const *)
 
void doEndProcessBlock (ProcessBlockPrincipal const &, ModuleCallingContext const *)
 
bool doEndRun (RunTransitionInfo const &, ModuleCallingContext const *)
 
bool doEvent_ (EventTransitionInfo const &, ActivityRegistry *, ModuleCallingContext const *)
 
void doPreallocate_ (PreallocationConfiguration const &)
 
std::map< BranchID::value_type, BranchID::value_type > const & droppedBranchIDToKeptBranchID ()
 
virtual void preallocLumis (unsigned int)
 
ParameterSetID selectorConfig () const
 
void setEventSelectionInfo (std::map< std::string, std::vector< std::pair< std::string, int >>> const &outputModulePathPositions, bool anyProductProduced)
 
- Protected Member Functions inherited from edm::EDConsumerBase
template<typename ProductType , BranchType B = InEvent>
EDGetTokenT< ProductType > consumes (edm::InputTag const &tag)
 
template<BranchType B = InEvent>
EDConsumerBaseAdaptor< Bconsumes (edm::InputTag tag) noexcept
 
EDGetToken consumes (const TypeToGet &id, edm::InputTag const &tag)
 
template<BranchType B>
EDGetToken consumes (TypeToGet const &id, edm::InputTag const &tag)
 
ConsumesCollector consumesCollector ()
 Use a ConsumesCollector to gather consumes information from helper functions. More...
 
template<typename ESProduct , typename ESRecord , Transition Tr = Transition::Event>
auto esConsumes ()
 
template<typename ESProduct , typename ESRecord , Transition Tr = Transition::Event>
auto esConsumes (ESInputTag const &tag)
 
template<Transition Tr = Transition::Event>
constexpr auto esConsumes ()
 
template<Transition Tr = Transition::Event>
auto esConsumes (ESInputTag tag)
 
template<Transition Tr = Transition::Event>
ESGetTokenGeneric esConsumes (eventsetup::EventSetupRecordKey const &iRecord, eventsetup::DataKey const &iKey)
 Used with EventSetupRecord::doGet. More...
 
template<typename ProductType , BranchType B = InEvent>
EDGetTokenT< ProductType > mayConsume (edm::InputTag const &tag)
 
EDGetToken mayConsume (const TypeToGet &id, edm::InputTag const &tag)
 
template<BranchType B>
EDGetToken mayConsume (const TypeToGet &id, edm::InputTag const &tag)
 
void resetItemsToGetFrom (BranchType iType)
 
- Protected Attributes inherited from edm::core::OutputModuleCore
std::atomic< int > remainingEvents_
 

Detailed Description

Definition at line 17 of file TestGlobalOutput.cc.

Constructor & Destructor Documentation

◆ TestGlobalOutput()

edm::TestGlobalOutput::TestGlobalOutput ( ParameterSet const &  pset)
explicit

Definition at line 45 of file TestGlobalOutput.cc.

46  : global::OutputModuleBase(pset),
47  global::OutputModule<WatchInputFiles, RunCache<int>, LuminosityBlockCache<int>>(pset),
48  verbose_(pset.getUntrackedParameter<bool>("verbose")),
50  pset.getUntrackedParameter<std::vector<std::string>>("expectedProcessesWithProcessBlockProducts")),
51  expectedWriteProcessBlockTransitions_(pset.getUntrackedParameter<int>("expectedWriteProcessBlockTransitions")) {
52  }
std::vector< std::string > expectedProcessesWithProcessBlockProducts_

◆ ~TestGlobalOutput()

edm::TestGlobalOutput::~TestGlobalOutput ( )
override

Definition at line 54 of file TestGlobalOutput.cc.

54 {}

Member Function Documentation

◆ endJob()

void edm::TestGlobalOutput::endJob ( void  )
overrideprivatevirtual

Reimplemented from edm::core::OutputModuleCore.

Definition at line 131 of file TestGlobalOutput.cc.

References countWriteProcessBlockTransitions_, Exception, and expectedWriteProcessBlockTransitions_.

131  {
134  throw cms::Exception("TestFailure")
135  << "TestGlobalOutput::writeProcessBlock unexpected number of writeProcessBlock transitions";
136  }
137  }
138  }

◆ fillDescriptions()

void edm::TestGlobalOutput::fillDescriptions ( ConfigurationDescriptions descriptions)
static

Definition at line 140 of file TestGlobalOutput.cc.

References edm::ConfigurationDescriptions::addDefault(), and submitPVResolutionJobs::desc.

140  {
142  OutputModule::fillDescription(desc);
143  desc.addUntracked<bool>("verbose", true);
144  desc.addUntracked<std::vector<std::string>>("expectedProcessesWithProcessBlockProducts",
145  std::vector<std::string>());
146  desc.addUntracked<int>("expectedWriteProcessBlockTransitions", -1);
147  descriptions.addDefault(desc);
148  }

◆ globalBeginLuminosityBlock()

std::shared_ptr< int > edm::TestGlobalOutput::globalBeginLuminosityBlock ( LuminosityBlockForOutput const &  ) const
overrideprivate

Definition at line 118 of file TestGlobalOutput.cc.

References verbose_.

118  {
119  if (verbose_) {
120  LogAbsolute("TestGlobalOutput") << "global globalBeginLuminosityBlock";
121  }
122  return std::make_shared<int>(0);
123  }
Log< level::System, true > LogAbsolute

◆ globalBeginRun()

std::shared_ptr< int > edm::TestGlobalOutput::globalBeginRun ( RunForOutput const &  ) const
overrideprivate

Definition at line 96 of file TestGlobalOutput.cc.

References edm::core::OutputModuleCore::branchIDLists(), edm::ConstProductRegistry::productList(), and verbose_.

96  {
97  LogAbsolute("TestGlobalOutput") << "global globalBeginRun";
98  if (verbose_) {
99  BranchIDLists const* theBranchIDLists = branchIDLists();
100  for (auto const& branchIDList : *theBranchIDLists) {
101  LogAbsolute("TestGlobalOutput") << "A branchID list";
102  for (auto const& branchID : branchIDList) {
103  LogAbsolute("TestGlobalOutput") << " global branchID " << branchID;
104  }
105  }
107  for (auto const& it : reg->productList()) {
108  LogAbsolute("TestGlobalOutput") << it.second;
109  }
110  }
111  return std::make_shared<int>(0);
112  }
std::vector< BranchIDList > BranchIDLists
Definition: BranchIDList.h:19
ProductList const & productList() const
BranchIDLists const * branchIDLists() const
Log< level::System, true > LogAbsolute

◆ globalEndLuminosityBlock()

void edm::TestGlobalOutput::globalEndLuminosityBlock ( LuminosityBlockForOutput const &  ) const
overrideprivate

Definition at line 125 of file TestGlobalOutput.cc.

References verbose_.

125  {
126  if (verbose_) {
127  LogAbsolute("TestGlobalOutput") << "global globalEndLuminosityBlock";
128  }
129  }
Log< level::System, true > LogAbsolute

◆ globalEndRun()

void edm::TestGlobalOutput::globalEndRun ( RunForOutput const &  ) const
overrideprivate

Definition at line 114 of file TestGlobalOutput.cc.

114  {
115  LogAbsolute("TestGlobalOutput") << "global globalEndRun";
116  }
Log< level::System, true > LogAbsolute

◆ respondToCloseInputFile()

void edm::TestGlobalOutput::respondToCloseInputFile ( FileBlock const &  )
overrideprivate

Definition at line 90 of file TestGlobalOutput.cc.

References verbose_.

90  {
91  if (verbose_) {
92  LogAbsolute("TestGlobalOutput") << "global respondToCloseInputFile";
93  }
94  }
Log< level::System, true > LogAbsolute

◆ respondToOpenInputFile()

void edm::TestGlobalOutput::respondToOpenInputFile ( FileBlock const &  )
overrideprivate

Definition at line 84 of file TestGlobalOutput.cc.

References verbose_.

84  {
85  if (verbose_) {
86  LogAbsolute("TestGlobalOutput") << "global respondToOpenInputFile";
87  }
88  }
Log< level::System, true > LogAbsolute

◆ write()

void edm::TestGlobalOutput::write ( EventForOutput const &  e)
overrideprivatevirtual

Implements edm::core::OutputModuleCore.

Definition at line 56 of file TestGlobalOutput.cc.

References verbose_.

Referenced by pkg.AbstractPkg::generate().

56  {
57  if (verbose_) {
58  LogAbsolute("TestGlobalOutput") << "global write event";
59  }
60  }
Log< level::System, true > LogAbsolute

◆ writeLuminosityBlock()

void edm::TestGlobalOutput::writeLuminosityBlock ( LuminosityBlockForOutput const &  )
overrideprivatevirtual

Implements edm::core::OutputModuleCore.

Definition at line 62 of file TestGlobalOutput.cc.

References verbose_.

62  {
63  if (verbose_) {
64  LogAbsolute("TestGlobalOutput") << "global writeLuminosityBlock";
65  }
66  }
Log< level::System, true > LogAbsolute

◆ writeProcessBlock()

void edm::TestGlobalOutput::writeProcessBlock ( ProcessBlockForOutput const &  )
overrideprivatevirtual

Reimplemented from edm::core::OutputModuleCore.

Definition at line 70 of file TestGlobalOutput.cc.

References countWriteProcessBlockTransitions_, Exception, expectedProcessesWithProcessBlockProducts_, edm::core::OutputModuleCore::outputProcessBlockHelper(), LaserDQM_cfg::process, and edm::OutputProcessBlockHelper::processesWithProcessBlockProducts().

70  {
71  LogAbsolute("TestGlobalOutput") << "global writeProcessBlock";
75  LogAbsolute("TestGlobalOutput") << " " << process;
76  }
78  outputProcessBlockHelper().processesWithProcessBlockProducts()) {
79  throw cms::Exception("TestFailure") << "TestGlobalOutput::writeProcessBlock unexpected process name list";
80  }
81  }
82  }
OutputProcessBlockHelper const & outputProcessBlockHelper() const
std::vector< std::string > const & processesWithProcessBlockProducts() const
std::vector< std::string > expectedProcessesWithProcessBlockProducts_
Log< level::System, true > LogAbsolute

◆ writeRun()

void edm::TestGlobalOutput::writeRun ( RunForOutput const &  )
overrideprivatevirtual

Implements edm::core::OutputModuleCore.

Definition at line 68 of file TestGlobalOutput.cc.

68 { LogAbsolute("TestGlobalOutput") << "global writeRun"; }
Log< level::System, true > LogAbsolute

Member Data Documentation

◆ countWriteProcessBlockTransitions_

int edm::TestGlobalOutput::countWriteProcessBlockTransitions_ = 0
private

Definition at line 42 of file TestGlobalOutput.cc.

Referenced by endJob(), and writeProcessBlock().

◆ expectedProcessesWithProcessBlockProducts_

std::vector<std::string> edm::TestGlobalOutput::expectedProcessesWithProcessBlockProducts_
private

Definition at line 40 of file TestGlobalOutput.cc.

Referenced by writeProcessBlock().

◆ expectedWriteProcessBlockTransitions_

int edm::TestGlobalOutput::expectedWriteProcessBlockTransitions_
private

Definition at line 41 of file TestGlobalOutput.cc.

Referenced by endJob().

◆ verbose_

bool edm::TestGlobalOutput::verbose_
private