CMS 3D CMS Logo

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

Public Member Functions

 TestLimitedOutput (ParameterSet const &pset)
 
 ~TestLimitedOutput () override
 
- Public Member Functions inherited from edm::limited::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::limited::OutputModuleBase
unsigned int concurrencyLimit () const
 
OutputModuleBaseoperator= (OutputModuleBase const &)=delete
 
 OutputModuleBase (ParameterSet const &pset)
 
 OutputModuleBase (OutputModuleBase const &)=delete
 
LimitedTaskQueuequeue ()
 
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::limited::OutputModuleBase
static void fillDescription (ParameterSetDescription &desc, std::vector< std::string > const &iDefaultOutputCommands=ProductSelectorRules::defaultSelectionStrings())
 
- 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::limited::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::limited::OutputModuleBase
void doBeginJob ()
 
void doBeginStream (StreamID id)
 
void doEndStream (StreamID id)
 
bool doEvent (EventTransitionInfo const &, ActivityRegistry *, ModuleCallingContext const *)
 
void doPreallocate (PreallocationConfiguration const &)
 
void preActionBeforeRunEventAsync (WaitingTaskHolder, ModuleCallingContext const &, Principal const &) 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 TestLimitedOutput.cc.

Constructor & Destructor Documentation

◆ TestLimitedOutput()

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

Definition at line 46 of file TestLimitedOutput.cc.

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

◆ ~TestLimitedOutput()

edm::TestLimitedOutput::~TestLimitedOutput ( )
override

Definition at line 55 of file TestLimitedOutput.cc.

55 {}

Member Function Documentation

◆ endJob()

void edm::TestLimitedOutput::endJob ( void  )
overrideprivatevirtual

Reimplemented from edm::core::OutputModuleCore.

Definition at line 132 of file TestLimitedOutput.cc.

References countWriteProcessBlockTransitions_, Exception, and expectedWriteProcessBlockTransitions_.

132  {
135  throw cms::Exception("TestFailure")
136  << "TestLimitedOutput::writeProcessBlock unexpected number of writeProcessBlock transitions";
137  }
138  }
139  }

◆ fillDescriptions()

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

Definition at line 141 of file TestLimitedOutput.cc.

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

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

◆ globalBeginLuminosityBlock()

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

Definition at line 119 of file TestLimitedOutput.cc.

References verbose_.

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

◆ globalBeginRun()

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

Definition at line 97 of file TestLimitedOutput.cc.

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

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

◆ globalEndLuminosityBlock()

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

Definition at line 126 of file TestLimitedOutput.cc.

References verbose_.

126  {
127  if (verbose_) {
128  LogAbsolute("TestLimitedOutput") << "limited globalEndLuminosityBlock";
129  }
130  }
Log< level::System, true > LogAbsolute

◆ globalEndRun()

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

Definition at line 115 of file TestLimitedOutput.cc.

115  {
116  LogAbsolute("TestLimitedOutput") << "limited globalEndRun";
117  }
Log< level::System, true > LogAbsolute

◆ respondToCloseInputFile()

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

Definition at line 91 of file TestLimitedOutput.cc.

References verbose_.

91  {
92  if (verbose_) {
93  LogAbsolute("TestLimitedOutput") << "limited respondToCloseInputFile";
94  }
95  }
Log< level::System, true > LogAbsolute

◆ respondToOpenInputFile()

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

Definition at line 85 of file TestLimitedOutput.cc.

References verbose_.

85  {
86  if (verbose_) {
87  LogAbsolute("TestLimitedOutput") << "limited respondToOpenInputFile";
88  }
89  }
Log< level::System, true > LogAbsolute

◆ write()

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

Implements edm::core::OutputModuleCore.

Definition at line 57 of file TestLimitedOutput.cc.

References verbose_.

Referenced by pkg.AbstractPkg::generate().

57  {
58  if (verbose_) {
59  LogAbsolute("TestLimitedOutput") << "limited write event";
60  }
61  }
Log< level::System, true > LogAbsolute

◆ writeLuminosityBlock()

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

Implements edm::core::OutputModuleCore.

Definition at line 63 of file TestLimitedOutput.cc.

References verbose_.

63  {
64  if (verbose_) {
65  LogAbsolute("TestLimitedOutput") << "limited writeLuminosityBlock";
66  }
67  }
Log< level::System, true > LogAbsolute

◆ writeProcessBlock()

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

Reimplemented from edm::core::OutputModuleCore.

Definition at line 71 of file TestLimitedOutput.cc.

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

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

◆ writeRun()

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

Implements edm::core::OutputModuleCore.

Definition at line 69 of file TestLimitedOutput.cc.

69 { LogAbsolute("TestLimitedOutput") << "limited writeRun"; }
Log< level::System, true > LogAbsolute

Member Data Documentation

◆ countWriteProcessBlockTransitions_

int edm::TestLimitedOutput::countWriteProcessBlockTransitions_ = 0
private

Definition at line 43 of file TestLimitedOutput.cc.

Referenced by endJob(), and writeProcessBlock().

◆ expectedProcessesWithProcessBlockProducts_

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

Definition at line 41 of file TestLimitedOutput.cc.

Referenced by writeProcessBlock().

◆ expectedWriteProcessBlockTransitions_

int edm::TestLimitedOutput::expectedWriteProcessBlockTransitions_
private

Definition at line 42 of file TestLimitedOutput.cc.

Referenced by endJob().

◆ verbose_

bool edm::TestLimitedOutput::verbose_
private