CMS 3D CMS Logo

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

Public Member Functions

 TestOneOutput (ParameterSet const &pset)
 
 ~TestOneOutput () override
 
- Public Member Functions inherited from edm::one::OutputModule< WatchInputFiles, RunCache< int >, LuminosityBlockCache< int > >
SerialTaskQueueglobalLuminosityBlocksQueue () final
 
SerialTaskQueueglobalRunsQueue () final
 
const OutputModuleoperator= (const OutputModule &)=delete
 
 OutputModule (edm::ParameterSet const &iPSet)
 
 OutputModule (const OutputModule &)=delete
 
bool wantsGlobalLuminosityBlocks () const final
 
bool wantsGlobalRuns () const final
 
bool wantsInputProcessBlocks () const final
 
bool wantsProcessBlocks () const final
 
- Public Member Functions inherited from edm::one::OutputModuleBase
OutputModuleBaseoperator= (OutputModuleBase const &)=delete
 
 OutputModuleBase (ParameterSet const &pset)
 
 OutputModuleBase (OutputModuleBase const &)=delete
 
SharedResourcesAcquirersharedResourcesAcquirer ()
 
SubProcessParentageHelper const * subProcessParentageHelper () const
 
bool wantsStreamLuminosityBlocks () const
 
bool wantsStreamRuns () 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 &) override
 
void globalEndRun (RunForOutput const &) override
 
void respondToCloseInputFile (FileBlock const &) override
 
void respondToOpenInputFile (FileBlock const &) override
 
void testFileBlock (FileBlock const &)
 
void write (EventForOutput const &e) override
 
void writeLuminosityBlock (LuminosityBlockForOutput const &) override
 
void writeProcessBlock (ProcessBlockForOutput const &) override
 
void writeRun (RunForOutput const &) override
 

Private Attributes

unsigned int countInputFiles_ = 0
 
unsigned int countWriteProcessBlockTransitions_ = 0
 
std::vector< std::string > expectedAddedProcesses_
 
std::vector< unsigned int > expectedCacheEntriesPerFile0_
 
std::vector< unsigned int > expectedCacheEntriesPerFile1_
 
std::vector< unsigned int > expectedCacheEntriesPerFile2_
 
std::vector< unsigned int > expectedCacheIndexSize_
 
std::vector< unsigned int > expectedCacheIndexVectorsPerFile_
 
unsigned int expectedNAddedProcesses_
 
std::vector< unsigned int > expectedNEntries0_
 
std::vector< unsigned int > expectedNEntries1_
 
std::vector< unsigned int > expectedNEntries2_
 
std::vector< unsigned int > expectedOuterOffset_
 
unsigned int expectedProcessesInFirstFile_
 
std::vector< std::string > expectedProcessesWithProcessBlockProducts_
 
std::vector< std::string > expectedProcessNamesAtWrite_
 
bool expectedProductsFromInputKept_
 
std::vector< std::string > expectedTopAddedProcesses_
 
std::vector< unsigned int > expectedTopCacheIndices0_
 
std::vector< unsigned int > expectedTopCacheIndices1_
 
std::vector< unsigned int > expectedTopCacheIndices2_
 
std::vector< std::string > expectedTopProcessesWithProcessBlockProducts_
 
std::vector< unsigned int > expectedTranslateFromStoredIndex_
 
int expectedWriteProcessBlockTransitions_
 
bool requireNullTTreesInFileBlock_
 
bool testTTreesInFileBlock_
 
bool verbose_
 

Additional Inherited Members

- Public Types inherited from edm::one::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::one::OutputModuleBase
void configure (OutputModuleDescription const &desc)
 
void doBeginJob ()
 
bool doEvent (EventTransitionInfo const &, ActivityRegistry *, ModuleCallingContext const *)
 
void doPreallocate (PreallocationConfiguration 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 24 of file TestOneOutput.cc.

Constructor & Destructor Documentation

◆ TestOneOutput()

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

Definition at line 76 of file TestOneOutput.cc.

77  : one::OutputModuleBase(pset),
78  one::OutputModule<WatchInputFiles, RunCache<int>, LuminosityBlockCache<int>>(pset),
79  verbose_(pset.getUntrackedParameter<bool>("verbose")),
81  pset.getUntrackedParameter<std::vector<std::string>>("expectedProcessesWithProcessBlockProducts")),
83  pset.getUntrackedParameter<std::vector<std::string>>("expectedTopProcessesWithProcessBlockProducts")),
84  expectedAddedProcesses_(pset.getUntrackedParameter<std::vector<std::string>>("expectedAddedProcesses")),
85  expectedTopAddedProcesses_(pset.getUntrackedParameter<std::vector<std::string>>("expectedTopAddedProcesses")),
86  expectedTopCacheIndices0_(pset.getUntrackedParameter<std::vector<unsigned int>>("expectedTopCacheIndices0")),
87  expectedTopCacheIndices1_(pset.getUntrackedParameter<std::vector<unsigned int>>("expectedTopCacheIndices1")),
88  expectedTopCacheIndices2_(pset.getUntrackedParameter<std::vector<unsigned int>>("expectedTopCacheIndices2")),
90  pset.getUntrackedParameter<std::vector<std::string>>("expectedProcessNamesAtWrite")),
91  expectedWriteProcessBlockTransitions_(pset.getUntrackedParameter<int>("expectedWriteProcessBlockTransitions")),
92  requireNullTTreesInFileBlock_(pset.getUntrackedParameter<bool>("requireNullTTreesInFileBlock")),
93  testTTreesInFileBlock_(pset.getUntrackedParameter<bool>("testTTreesInFileBlock")),
94  expectedCacheIndexSize_(pset.getUntrackedParameter<std::vector<unsigned int>>("expectedCacheIndexSize")),
95  expectedProcessesInFirstFile_(pset.getUntrackedParameter<unsigned int>("expectedProcessesInFirstFile")),
97  pset.getUntrackedParameter<std::vector<unsigned int>>("expectedCacheIndexVectorsPerFile")),
98  expectedNEntries0_(pset.getUntrackedParameter<std::vector<unsigned int>>("expectedNEntries0")),
99  expectedNEntries1_(pset.getUntrackedParameter<std::vector<unsigned int>>("expectedNEntries1")),
100  expectedNEntries2_(pset.getUntrackedParameter<std::vector<unsigned int>>("expectedNEntries2")),
102  pset.getUntrackedParameter<std::vector<unsigned int>>("expectedCacheEntriesPerFile0")),
104  pset.getUntrackedParameter<std::vector<unsigned int>>("expectedCacheEntriesPerFile1")),
106  pset.getUntrackedParameter<std::vector<unsigned int>>("expectedCacheEntriesPerFile2")),
107  expectedOuterOffset_(pset.getUntrackedParameter<std::vector<unsigned int>>("expectedOuterOffset")),
109  pset.getUntrackedParameter<std::vector<unsigned int>>("expectedTranslateFromStoredIndex")),
110  expectedNAddedProcesses_(pset.getUntrackedParameter<unsigned int>("expectedNAddedProcesses")),
111  expectedProductsFromInputKept_(pset.getUntrackedParameter<bool>("expectedProductsFromInputKept")) {}
std::vector< unsigned int > expectedNEntries0_
std::vector< std::string > expectedTopProcessesWithProcessBlockProducts_
std::vector< unsigned int > expectedCacheEntriesPerFile1_
std::vector< unsigned int > expectedTopCacheIndices0_
bool requireNullTTreesInFileBlock_
std::vector< unsigned int > expectedOuterOffset_
std::vector< unsigned int > expectedTranslateFromStoredIndex_
std::vector< unsigned int > expectedCacheIndexVectorsPerFile_
std::vector< std::string > expectedAddedProcesses_
std::vector< unsigned int > expectedCacheEntriesPerFile2_
std::vector< unsigned int > expectedNEntries1_
unsigned int expectedProcessesInFirstFile_
std::vector< std::string > expectedProcessesWithProcessBlockProducts_
unsigned int expectedNAddedProcesses_
std::vector< std::string > expectedTopAddedProcesses_
int expectedWriteProcessBlockTransitions_
std::vector< unsigned int > expectedTopCacheIndices1_
std::vector< unsigned int > expectedCacheIndexSize_
std::vector< std::string > expectedProcessNamesAtWrite_
bool expectedProductsFromInputKept_
std::vector< unsigned int > expectedNEntries2_
std::vector< unsigned int > expectedTopCacheIndices2_
std::vector< unsigned int > expectedCacheEntriesPerFile0_

◆ ~TestOneOutput()

edm::TestOneOutput::~TestOneOutput ( )
override

Definition at line 113 of file TestOneOutput.cc.

113 {}

Member Function Documentation

◆ endJob()

void edm::TestOneOutput::endJob ( void  )
overrideprivatevirtual

Reimplemented from edm::core::OutputModuleCore.

Definition at line 367 of file TestOneOutput.cc.

References countWriteProcessBlockTransitions_, Exception, and expectedWriteProcessBlockTransitions_.

367  {
370  throw cms::Exception("TestFailure")
371  << "TestOneOutput::writeProcessBlock unexpected number of writeProcessBlock transitions";
372  }
373  }
374  }
int expectedWriteProcessBlockTransitions_
unsigned int countWriteProcessBlockTransitions_

◆ fillDescriptions()

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

Definition at line 376 of file TestOneOutput.cc.

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

376  {
378  OutputModule::fillDescription(desc);
379  desc.addUntracked<bool>("verbose", true);
380  desc.addUntracked<std::vector<std::string>>("expectedProcessesWithProcessBlockProducts",
381  std::vector<std::string>());
382  desc.addUntracked<std::vector<std::string>>("expectedTopProcessesWithProcessBlockProducts",
383  std::vector<std::string>());
384  desc.addUntracked<std::vector<std::string>>("expectedAddedProcesses",
385  std::vector<std::string>(1, std::string("DONOTTEST")));
386  desc.addUntracked<std::vector<std::string>>("expectedTopAddedProcesses",
387  std::vector<std::string>(1, std::string("DONOTTEST")));
388  desc.addUntracked<std::vector<unsigned int>>("expectedTopCacheIndices0", std::vector<unsigned int>());
389  desc.addUntracked<std::vector<unsigned int>>("expectedTopCacheIndices1", std::vector<unsigned int>());
390  desc.addUntracked<std::vector<unsigned int>>("expectedTopCacheIndices2", std::vector<unsigned int>());
391  desc.addUntracked<std::vector<std::string>>("expectedProcessNamesAtWrite", std::vector<std::string>());
392  desc.addUntracked<int>("expectedWriteProcessBlockTransitions", -1);
393  desc.addUntracked<bool>("requireNullTTreesInFileBlock", false);
394  desc.addUntracked<bool>("testTTreesInFileBlock", false);
395  desc.addUntracked<std::vector<unsigned int>>("expectedCacheIndexSize", std::vector<unsigned int>());
396  desc.addUntracked<unsigned int>("expectedProcessesInFirstFile", 0);
397  desc.addUntracked<std::vector<unsigned int>>("expectedCacheIndexVectorsPerFile", std::vector<unsigned int>());
398  desc.addUntracked<std::vector<unsigned int>>("expectedNEntries0", std::vector<unsigned int>());
399  desc.addUntracked<std::vector<unsigned int>>("expectedNEntries1", std::vector<unsigned int>());
400  desc.addUntracked<std::vector<unsigned int>>("expectedNEntries2", std::vector<unsigned int>());
401  desc.addUntracked<std::vector<unsigned int>>("expectedCacheEntriesPerFile0", std::vector<unsigned int>());
402  desc.addUntracked<std::vector<unsigned int>>("expectedCacheEntriesPerFile1", std::vector<unsigned int>());
403  desc.addUntracked<std::vector<unsigned int>>("expectedCacheEntriesPerFile2", std::vector<unsigned int>());
404  desc.addUntracked<std::vector<unsigned int>>("expectedOuterOffset", std::vector<unsigned int>());
405  desc.addUntracked<std::vector<unsigned int>>("expectedTranslateFromStoredIndex", std::vector<unsigned int>());
406  desc.addUntracked<unsigned int>("expectedNAddedProcesses", kDoNotTest);
407  desc.addUntracked<bool>("expectedProductsFromInputKept", true);
408 
409  descriptions.addDefault(desc);
410  }
constexpr unsigned int kDoNotTest

◆ globalBeginLuminosityBlock()

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

Definition at line 354 of file TestOneOutput.cc.

References verbose_.

354  {
355  if (verbose_) {
356  LogAbsolute("TestOneOutput") << "one globalBeginLuminosityBlock";
357  }
358  return std::make_shared<int>(0);
359  }
Log< level::System, true > LogAbsolute

◆ globalBeginRun()

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

Definition at line 337 of file TestOneOutput.cc.

References edm::ConstProductRegistry::productList(), and verbose_.

337  {
338  if (verbose_) {
339  LogAbsolute("TestOneOutput") << "one globalBeginRun";
341  for (auto const& it : reg->productList()) {
342  LogAbsolute("TestOneOutput") << it.second;
343  }
344  }
345  return std::make_shared<int>(0);
346  }
ProductList const & productList() const
Log< level::System, true > LogAbsolute

◆ globalEndLuminosityBlock()

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

Definition at line 361 of file TestOneOutput.cc.

References verbose_.

361  {
362  if (verbose_) {
363  LogAbsolute("TestOneOutput") << "one globalEndLuminosityBlock";
364  }
365  }
Log< level::System, true > LogAbsolute

◆ globalEndRun()

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

Definition at line 348 of file TestOneOutput.cc.

References verbose_.

348  {
349  if (verbose_) {
350  LogAbsolute("TestOneOutput") << "one globalEndRun";
351  }
352  }
Log< level::System, true > LogAbsolute

◆ respondToCloseInputFile()

void edm::TestOneOutput::respondToCloseInputFile ( FileBlock const &  fb)
overrideprivate

Definition at line 306 of file TestOneOutput.cc.

References testFileBlock(), and verbose_.

306  {
307  if (verbose_) {
308  LogAbsolute("TestOneOutput") << "one respondToCloseInputFile";
309  }
310  testFileBlock(fb);
311  }
void testFileBlock(FileBlock const &)
Log< level::System, true > LogAbsolute

◆ respondToOpenInputFile()

void edm::TestOneOutput::respondToOpenInputFile ( FileBlock const &  fb)
overrideprivate

Definition at line 298 of file TestOneOutput.cc.

References countInputFiles_, testFileBlock(), and verbose_.

298  {
299  if (verbose_) {
300  LogAbsolute("TestOneOutput") << "one respondToOpenInputFile";
301  }
302  testFileBlock(fb);
304  }
unsigned int countInputFiles_
void testFileBlock(FileBlock const &)
Log< level::System, true > LogAbsolute

◆ testFileBlock()

void edm::TestOneOutput::testFileBlock ( FileBlock const &  fb)
private

Definition at line 313 of file TestOneOutput.cc.

References Exception, edm::FileBlock::lumiTree(), edm::FileBlock::processBlockTree(), edm::FileBlock::processBlockTrees(), edm::FileBlock::processesWithProcessBlockTrees(), requireNullTTreesInFileBlock_, edm::FileBlock::runTree(), AlCaHLTBitMon_QueryRunRegistry::string, testTTreesInFileBlock_, and edm::FileBlock::tree().

Referenced by respondToCloseInputFile(), and respondToOpenInputFile().

313  {
315  if (fb.tree() != nullptr || fb.lumiTree() != nullptr || fb.runTree() != nullptr ||
316  !fb.processBlockTrees().empty() || !fb.processesWithProcessBlockTrees().empty() ||
317  fb.processBlockTree(std::string("DoesNotExist")) != nullptr) {
318  throw cms::Exception("TestFailure")
319  << "TestOneOutput::respondToOpenInputFile expected null TTree pointers in FileBlock";
320  }
321  } else if (testTTreesInFileBlock_) {
322  if (fb.tree() == nullptr || std::string("Events") != fb.tree()->GetName() ||
323  std::string("LuminosityBlocks") != fb.lumiTree()->GetName() ||
324  std::string("Runs") != fb.runTree()->GetName() || fb.processesWithProcessBlockTrees().size() != 2 ||
325  fb.processesWithProcessBlockTrees()[0] != "PROD1" || fb.processesWithProcessBlockTrees()[1] != "MERGE" ||
326  fb.processBlockTrees().size() != 2 ||
327  std::string("ProcessBlocksPROD1") != fb.processBlockTrees()[0]->GetName() ||
328  std::string("ProcessBlocksMERGE") != fb.processBlockTrees()[1]->GetName() ||
329  std::string("ProcessBlocksPROD1") != fb.processBlockTree("PROD1")->GetName() ||
330  std::string("ProcessBlocksMERGE") != fb.processBlockTree("MERGE")->GetName() ||
331  fb.processBlockTree("DOESNOTEXIST") != nullptr) {
332  throw cms::Exception("TestFailure") << "TestOneOutput::testFileBlock failed. Testing tree pointers";
333  }
334  }
335  }
bool requireNullTTreesInFileBlock_

◆ write()

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

Implements edm::core::OutputModuleCore.

Definition at line 115 of file TestOneOutput.cc.

References verbose_.

Referenced by pkg.AbstractPkg::generate().

115  {
116  if (verbose_) {
117  LogAbsolute("TestOneOutput") << "one write event";
118  }
119  }
Log< level::System, true > LogAbsolute

◆ writeLuminosityBlock()

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

Implements edm::core::OutputModuleCore.

Definition at line 121 of file TestOneOutput.cc.

References verbose_.

121  {
122  if (verbose_) {
123  LogAbsolute("TestOneOutput") << "one writeLuminosityBlock";
124  }
125  }
Log< level::System, true > LogAbsolute

◆ writeProcessBlock()

void edm::TestOneOutput::writeProcessBlock ( ProcessBlockForOutput const &  pb)
overrideprivatevirtual

Reimplemented from edm::core::OutputModuleCore.

Definition at line 133 of file TestOneOutput.cc.

References edm::ProcessBlockHelperBase::addedProcesses(), edm::ProcessBlockHelperBase::cacheEntriesPerFile(), edm::ProcessBlockHelperBase::cacheIndexVectorsPerFile(), countInputFiles_, countWriteProcessBlockTransitions_, Exception, expectedAddedProcesses_, expectedCacheEntriesPerFile0_, expectedCacheEntriesPerFile1_, expectedCacheEntriesPerFile2_, expectedCacheIndexSize_, expectedCacheIndexVectorsPerFile_, expectedNAddedProcesses_, expectedNEntries0_, expectedNEntries1_, expectedNEntries2_, expectedOuterOffset_, expectedProcessesInFirstFile_, expectedProcessesWithProcessBlockProducts_, expectedProcessNamesAtWrite_, expectedProductsFromInputKept_, expectedTopAddedProcesses_, expectedTopCacheIndices0_, expectedTopCacheIndices1_, expectedTopCacheIndices2_, expectedTopProcessesWithProcessBlockProducts_, expectedTranslateFromStoredIndex_, mps_fire::i, dqmiolumiharvest::j, kDoNotTest, edm::ProcessBlockHelperBase::nEntries(), edm::ProcessBlockHelperBase::nProcessesInFirstFile(), edm::ProcessBlockHelperBase::outerOffset(), edm::core::OutputModuleCore::outputProcessBlockHelper(), LaserDQM_cfg::process, edm::ProcessBlockHelperBase::processBlockCacheIndices(), edm::OutputProcessBlockHelper::processBlockHelper(), edm::OutputProcessBlockHelper::processesWithProcessBlockProducts(), edm::ProcessBlockForOutput::processName(), findQualityFiles::size, edm::ProcessBlockHelperBase::topProcessBlockHelper(), edm::ProcessBlockHelperBase::topProcessesWithProcessBlockProducts(), edm::OutputProcessBlockHelper::translateFromStoredIndex(), and verbose_.

133  {
134  if (verbose_) {
135  LogAbsolute("TestOneOutput") << "one writeProcessBlock";
136  }
139  throw cms::Exception("TestFailure") << "TestOneOutput::writeProcessBlock unexpected process name";
140  }
141  }
143  if (verbose_) {
145  LogAbsolute("TestOneOutput") << " " << process;
146  }
147  }
149  outputProcessBlockHelper().processesWithProcessBlockProducts()) {
150  throw cms::Exception("TestFailure") << "TestOneOutput::writeProcessBlock unexpected process name list";
151  }
152  }
153  if (!(!expectedAddedProcesses_.empty() && expectedAddedProcesses_[0] == "DONOTTEST")) {
155  throw cms::Exception("TestFailure") << "TestOneOutput::writeProcessBlock unexpected addedProcesses list";
156  }
157  }
158  if (!(!expectedTopAddedProcesses_.empty() && expectedTopAddedProcesses_[0] == "DONOTTEST")) {
161  throw cms::Exception("TestFailure") << "TestOneOutput::writeProcessBlock unexpected top addedProcesses list";
162  }
163  }
165  // Same test as the previous except check the list of names in
166  // the top level process name list from the EventProcessor
171  throw cms::Exception("TestFailure") << "TestOneOutput::writeProcessBlock unexpected top process name list";
172  }
173  // Almost the same as the previous test, should get the same result
175  outputProcessBlockHelper().processBlockHelper()->topProcessesWithProcessBlockProducts()) {
176  throw cms::Exception("TestFailure") << "TestOneOutput::writeProcessBlock unexpected top process name list 2";
177  }
178 
179  std::vector<unsigned int> const* expectedTopCacheIndices = nullptr;
180  if (countInputFiles_ == 1 && !expectedTopCacheIndices0_.empty()) {
181  expectedTopCacheIndices = &expectedTopCacheIndices0_;
182  } else if (countInputFiles_ == 2 && !expectedTopCacheIndices1_.empty()) {
183  expectedTopCacheIndices = &expectedTopCacheIndices1_;
184  } else if (countInputFiles_ == 3 && !expectedTopCacheIndices2_.empty()) {
185  expectedTopCacheIndices = &expectedTopCacheIndices2_;
186  }
187  if (expectedTopCacheIndices != nullptr) {
188  unsigned int expectedInputProcesses =
191 
192  std::vector<std::vector<unsigned int>> const& topProcessBlockCacheIndices =
194  if (expectedTopCacheIndices->size() != expectedInputProcesses * topProcessBlockCacheIndices.size()) {
195  throw cms::Exception("TestFailure")
196  << "TestOneOutput::writeProcessBlock unexpected sizes related to top cache indices on input file "
197  << (countInputFiles_ - 1);
198  }
199  unsigned int iStored = 0;
200  for (unsigned int i = 0; i < topProcessBlockCacheIndices.size(); ++i) {
201  if (topProcessBlockCacheIndices[i].size() != expectedInputProcesses) {
202  throw cms::Exception("TestFailure")
203  << "TestOneOutput::writeProcessBlock unexpected size of inner cache indices vector on input file "
204  << (countInputFiles_ - 1);
205  }
206  for (unsigned int j = 0; j < topProcessBlockCacheIndices[i].size(); ++j) {
207  if (topProcessBlockCacheIndices[i][j] != (*expectedTopCacheIndices)[iStored]) {
208  throw cms::Exception("TestFailure")
209  << "TestOneOutput::writeProcessBlock unexpected cache index value on input file "
210  << (countInputFiles_ - 1);
211  }
212  ++iStored;
213  }
214  }
215  }
216  }
219  throw cms::Exception("TestFailure")
220  << "TestOneOutput::writeProcessBlock unexpected value for nProcessesInFirstFile";
221  }
222  }
223  for (unsigned int i = 0; i < expectedCacheIndexVectorsPerFile_.size(); ++i) {
224  if (i < countInputFiles_) {
227  throw cms::Exception("TestFailure")
228  << "TestOneOutput::writeProcessBlock unexpected value for cacheIndexVectorsPerFile, element " << i;
229  }
230  }
231  }
232  if (countInputFiles_ >= 1 && !expectedNEntries0_.empty()) {
234  throw cms::Exception("TestFailure") << "TestOneOutput::writeProcessBlock unexpected value for nEntries 0";
235  }
236  }
237  if (countInputFiles_ >= 2 && !expectedNEntries1_.empty()) {
239  throw cms::Exception("TestFailure") << "TestOneOutput::writeProcessBlock unexpected value for nEntries 1";
240  }
241  }
242  if (countInputFiles_ >= 3 && !expectedNEntries2_.empty()) {
244  throw cms::Exception("TestFailure") << "TestOneOutput::writeProcessBlock unexpected value for nEntries 2";
245  }
246  }
247 
248  if (countInputFiles_ == 1 && !expectedCacheEntriesPerFile0_.empty()) {
250  throw cms::Exception("TestFailure")
251  << "TestOneOutput::writeProcessBlock unexpected value for cacheEntriesPerFile 0";
252  }
253  } else if (countInputFiles_ == 2 && !expectedCacheEntriesPerFile1_.empty()) {
255  throw cms::Exception("TestFailure")
256  << "TestOneOutput::writeProcessBlock unexpected value for cacheEntriesPerFile 1";
257  }
258  } else if (countInputFiles_ == 3 && !expectedCacheEntriesPerFile2_.empty()) {
260  throw cms::Exception("TestFailure")
261  << "TestOneOutput::writeProcessBlock unexpected value for cacheEntriesPerFile 2";
262  }
263  }
264 
265  if (!expectedOuterOffset_.empty() && (countInputFiles_ - 1) < expectedOuterOffset_.size()) {
268  throw cms::Exception("TestFailure")
269  << "TestOneOutput::writeProcessBlock unexpected value for outerOffset, file " << (countInputFiles_ - 1);
270  }
271  }
275  throw cms::Exception("TestFailure")
276  << "TestOneOutput::writeProcessBlock unexpected cache index size "
278  }
279  }
280  if (!expectedTranslateFromStoredIndex_.empty()) {
282  throw cms::Exception("TestFailure")
283  << "TestOneOutput::writeProcessBlock unexpected value for translateFromStoredIndex";
284  }
285  }
287  if (expectedNAddedProcesses_ != outputProcessBlockHelper().nAddedProcesses()) {
288  throw cms::Exception("TestFailure") << "TestOneOutput::writeProcessBlock unexpected value for nAddedProcesses";
289  }
290  }
291  if (expectedProductsFromInputKept_ != outputProcessBlockHelper().productsFromInputKept()) {
292  throw cms::Exception("TestFailure")
293  << "TestOneOutput::writeProcessBlock unexpected value for productsFromInputKept";
294  }
296  }
virtual ProcessBlockHelperBase const * topProcessBlockHelper() const =0
size
Write out results.
std::vector< unsigned int > expectedNEntries0_
std::vector< std::string > expectedTopProcessesWithProcessBlockProducts_
std::vector< unsigned int > expectedCacheEntriesPerFile1_
virtual unsigned int nProcessesInFirstFile() const =0
std::vector< unsigned int > expectedTopCacheIndices0_
std::vector< unsigned int > expectedOuterOffset_
OutputProcessBlockHelper const & outputProcessBlockHelper() const
std::vector< unsigned int > expectedTranslateFromStoredIndex_
std::vector< unsigned int > expectedCacheIndexVectorsPerFile_
std::vector< std::string > expectedAddedProcesses_
std::vector< unsigned int > expectedCacheEntriesPerFile2_
unsigned int countInputFiles_
std::vector< unsigned int > expectedNEntries1_
unsigned int expectedProcessesInFirstFile_
std::vector< std::string > const & processesWithProcessBlockProducts() const
virtual std::vector< std::string > const & topProcessesWithProcessBlockProducts() const =0
std::vector< std::string > expectedProcessesWithProcessBlockProducts_
virtual unsigned int outerOffset() const =0
unsigned int expectedNAddedProcesses_
std::vector< std::string > expectedTopAddedProcesses_
std::vector< std::string > const & addedProcesses() const
virtual std::vector< unsigned int > const & cacheIndexVectorsPerFile() const =0
unsigned int countWriteProcessBlockTransitions_
std::vector< unsigned int > expectedTopCacheIndices1_
constexpr unsigned int kDoNotTest
std::vector< unsigned int > const & translateFromStoredIndex() const
std::vector< unsigned int > expectedCacheIndexSize_
std::vector< std::string > expectedProcessNamesAtWrite_
virtual std::vector< unsigned int > const & cacheEntriesPerFile() const =0
virtual std::vector< std::vector< unsigned int > > const & nEntries() const =0
Log< level::System, true > LogAbsolute
bool expectedProductsFromInputKept_
virtual std::vector< std::vector< unsigned int > > const & processBlockCacheIndices() const =0
std::vector< unsigned int > expectedNEntries2_
std::vector< unsigned int > expectedTopCacheIndices2_
ProcessBlockHelperBase const * processBlockHelper() const
std::vector< unsigned int > expectedCacheEntriesPerFile0_

◆ writeRun()

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

Implements edm::core::OutputModuleCore.

Definition at line 127 of file TestOneOutput.cc.

References verbose_.

127  {
128  if (verbose_) {
129  LogAbsolute("TestOneOutput") << "one writeRun";
130  }
131  }
Log< level::System, true > LogAbsolute

Member Data Documentation

◆ countInputFiles_

unsigned int edm::TestOneOutput::countInputFiles_ = 0
private

Definition at line 58 of file TestOneOutput.cc.

Referenced by respondToOpenInputFile(), and writeProcessBlock().

◆ countWriteProcessBlockTransitions_

unsigned int edm::TestOneOutput::countWriteProcessBlockTransitions_ = 0
private

Definition at line 57 of file TestOneOutput.cc.

Referenced by endJob(), and writeProcessBlock().

◆ expectedAddedProcesses_

std::vector<std::string> edm::TestOneOutput::expectedAddedProcesses_
private

Definition at line 50 of file TestOneOutput.cc.

Referenced by writeProcessBlock().

◆ expectedCacheEntriesPerFile0_

std::vector<unsigned int> edm::TestOneOutput::expectedCacheEntriesPerFile0_
private

Definition at line 67 of file TestOneOutput.cc.

Referenced by writeProcessBlock().

◆ expectedCacheEntriesPerFile1_

std::vector<unsigned int> edm::TestOneOutput::expectedCacheEntriesPerFile1_
private

Definition at line 68 of file TestOneOutput.cc.

Referenced by writeProcessBlock().

◆ expectedCacheEntriesPerFile2_

std::vector<unsigned int> edm::TestOneOutput::expectedCacheEntriesPerFile2_
private

Definition at line 69 of file TestOneOutput.cc.

Referenced by writeProcessBlock().

◆ expectedCacheIndexSize_

std::vector<unsigned int> edm::TestOneOutput::expectedCacheIndexSize_
private

Definition at line 61 of file TestOneOutput.cc.

Referenced by writeProcessBlock().

◆ expectedCacheIndexVectorsPerFile_

std::vector<unsigned int> edm::TestOneOutput::expectedCacheIndexVectorsPerFile_
private

Definition at line 63 of file TestOneOutput.cc.

Referenced by writeProcessBlock().

◆ expectedNAddedProcesses_

unsigned int edm::TestOneOutput::expectedNAddedProcesses_
private

Definition at line 72 of file TestOneOutput.cc.

Referenced by writeProcessBlock().

◆ expectedNEntries0_

std::vector<unsigned int> edm::TestOneOutput::expectedNEntries0_
private

Definition at line 64 of file TestOneOutput.cc.

Referenced by writeProcessBlock().

◆ expectedNEntries1_

std::vector<unsigned int> edm::TestOneOutput::expectedNEntries1_
private

Definition at line 65 of file TestOneOutput.cc.

Referenced by writeProcessBlock().

◆ expectedNEntries2_

std::vector<unsigned int> edm::TestOneOutput::expectedNEntries2_
private

Definition at line 66 of file TestOneOutput.cc.

Referenced by writeProcessBlock().

◆ expectedOuterOffset_

std::vector<unsigned int> edm::TestOneOutput::expectedOuterOffset_
private

Definition at line 70 of file TestOneOutput.cc.

Referenced by writeProcessBlock().

◆ expectedProcessesInFirstFile_

unsigned int edm::TestOneOutput::expectedProcessesInFirstFile_
private

Definition at line 62 of file TestOneOutput.cc.

Referenced by writeProcessBlock().

◆ expectedProcessesWithProcessBlockProducts_

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

Definition at line 48 of file TestOneOutput.cc.

Referenced by writeProcessBlock().

◆ expectedProcessNamesAtWrite_

std::vector<std::string> edm::TestOneOutput::expectedProcessNamesAtWrite_
private

Definition at line 55 of file TestOneOutput.cc.

Referenced by writeProcessBlock().

◆ expectedProductsFromInputKept_

bool edm::TestOneOutput::expectedProductsFromInputKept_
private

Definition at line 73 of file TestOneOutput.cc.

Referenced by writeProcessBlock().

◆ expectedTopAddedProcesses_

std::vector<std::string> edm::TestOneOutput::expectedTopAddedProcesses_
private

Definition at line 51 of file TestOneOutput.cc.

Referenced by writeProcessBlock().

◆ expectedTopCacheIndices0_

std::vector<unsigned int> edm::TestOneOutput::expectedTopCacheIndices0_
private

Definition at line 52 of file TestOneOutput.cc.

Referenced by writeProcessBlock().

◆ expectedTopCacheIndices1_

std::vector<unsigned int> edm::TestOneOutput::expectedTopCacheIndices1_
private

Definition at line 53 of file TestOneOutput.cc.

Referenced by writeProcessBlock().

◆ expectedTopCacheIndices2_

std::vector<unsigned int> edm::TestOneOutput::expectedTopCacheIndices2_
private

Definition at line 54 of file TestOneOutput.cc.

Referenced by writeProcessBlock().

◆ expectedTopProcessesWithProcessBlockProducts_

std::vector<std::string> edm::TestOneOutput::expectedTopProcessesWithProcessBlockProducts_
private

Definition at line 49 of file TestOneOutput.cc.

Referenced by writeProcessBlock().

◆ expectedTranslateFromStoredIndex_

std::vector<unsigned int> edm::TestOneOutput::expectedTranslateFromStoredIndex_
private

Definition at line 71 of file TestOneOutput.cc.

Referenced by writeProcessBlock().

◆ expectedWriteProcessBlockTransitions_

int edm::TestOneOutput::expectedWriteProcessBlockTransitions_
private

Definition at line 56 of file TestOneOutput.cc.

Referenced by endJob().

◆ requireNullTTreesInFileBlock_

bool edm::TestOneOutput::requireNullTTreesInFileBlock_
private

Definition at line 59 of file TestOneOutput.cc.

Referenced by testFileBlock().

◆ testTTreesInFileBlock_

bool edm::TestOneOutput::testTTreesInFileBlock_
private

Definition at line 60 of file TestOneOutput.cc.

Referenced by testFileBlock().

◆ verbose_

bool edm::TestOneOutput::verbose_
private