79 verbose_(
pset.getUntrackedParameter<
bool>(
"verbose")),
80 expectedProcessesWithProcessBlockProducts_(
82 expectedTopProcessesWithProcessBlockProducts_(
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")),
89 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")),
96 expectedCacheIndexVectorsPerFile_(
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")),
101 expectedCacheEntriesPerFile0_(
102 pset.getUntrackedParameter<
std::
vector<unsigned
int>>(
"expectedCacheEntriesPerFile0")),
103 expectedCacheEntriesPerFile1_(
104 pset.getUntrackedParameter<
std::
vector<unsigned
int>>(
"expectedCacheEntriesPerFile1")),
105 expectedCacheEntriesPerFile2_(
106 pset.getUntrackedParameter<
std::
vector<unsigned
int>>(
"expectedCacheEntriesPerFile2")),
107 expectedOuterOffset_(
pset.getUntrackedParameter<
std::
vector<unsigned
int>>(
"expectedOuterOffset")),
108 expectedTranslateFromStoredIndex_(
109 pset.getUntrackedParameter<
std::
vector<unsigned
int>>(
"expectedTranslateFromStoredIndex")),
110 expectedNAddedProcesses_(
pset.getUntrackedParameter<unsigned
int>(
"expectedNAddedProcesses")),
111 expectedProductsFromInputKept_(
pset.getUntrackedParameter<
bool>(
"expectedProductsFromInputKept")) {}
123 LogAbsolute(
"TestOneOutput") <<
"one writeLuminosityBlock";
135 LogAbsolute(
"TestOneOutput") <<
"one writeProcessBlock";
139 throw cms::Exception(
"TestFailure") <<
"TestOneOutput::writeProcessBlock unexpected process name";
150 throw cms::Exception(
"TestFailure") <<
"TestOneOutput::writeProcessBlock unexpected process name list";
155 throw cms::Exception(
"TestFailure") <<
"TestOneOutput::writeProcessBlock unexpected addedProcesses list";
161 throw cms::Exception(
"TestFailure") <<
"TestOneOutput::writeProcessBlock unexpected top addedProcesses list";
171 throw cms::Exception(
"TestFailure") <<
"TestOneOutput::writeProcessBlock unexpected top process name list";
176 throw cms::Exception(
"TestFailure") <<
"TestOneOutput::writeProcessBlock unexpected top process name list 2";
179 std::vector<unsigned int>
const* expectedTopCacheIndices =
nullptr;
187 if (expectedTopCacheIndices !=
nullptr) {
188 unsigned int expectedInputProcesses =
192 std::vector<std::vector<unsigned int>>
const& topProcessBlockCacheIndices =
194 if (expectedTopCacheIndices->size() != expectedInputProcesses * topProcessBlockCacheIndices.size()) {
196 <<
"TestOneOutput::writeProcessBlock unexpected sizes related to top cache indices on input file " 199 unsigned int iStored = 0;
200 for (
unsigned int i = 0;
i < topProcessBlockCacheIndices.size(); ++
i) {
201 if (topProcessBlockCacheIndices[
i].size() != expectedInputProcesses) {
203 <<
"TestOneOutput::writeProcessBlock unexpected size of inner cache indices vector on input file " 206 for (
unsigned int j = 0;
j < topProcessBlockCacheIndices[
i].size(); ++
j) {
207 if (topProcessBlockCacheIndices[
i][
j] != (*expectedTopCacheIndices)[iStored]) {
209 <<
"TestOneOutput::writeProcessBlock unexpected cache index value on input file " 220 <<
"TestOneOutput::writeProcessBlock unexpected value for nProcessesInFirstFile";
228 <<
"TestOneOutput::writeProcessBlock unexpected value for cacheIndexVectorsPerFile, element " <<
i;
234 throw cms::Exception(
"TestFailure") <<
"TestOneOutput::writeProcessBlock unexpected value for nEntries 0";
239 throw cms::Exception(
"TestFailure") <<
"TestOneOutput::writeProcessBlock unexpected value for nEntries 1";
244 throw cms::Exception(
"TestFailure") <<
"TestOneOutput::writeProcessBlock unexpected value for nEntries 2";
251 <<
"TestOneOutput::writeProcessBlock unexpected value for cacheEntriesPerFile 0";
256 <<
"TestOneOutput::writeProcessBlock unexpected value for cacheEntriesPerFile 1";
261 <<
"TestOneOutput::writeProcessBlock unexpected value for cacheEntriesPerFile 2";
269 <<
"TestOneOutput::writeProcessBlock unexpected value for outerOffset, file " << (
countInputFiles_ - 1);
276 <<
"TestOneOutput::writeProcessBlock unexpected cache index size " 283 <<
"TestOneOutput::writeProcessBlock unexpected value for translateFromStoredIndex";
288 throw cms::Exception(
"TestFailure") <<
"TestOneOutput::writeProcessBlock unexpected value for nAddedProcesses";
293 <<
"TestOneOutput::writeProcessBlock unexpected value for productsFromInputKept";
300 LogAbsolute(
"TestOneOutput") <<
"one respondToOpenInputFile";
308 LogAbsolute(
"TestOneOutput") <<
"one respondToCloseInputFile";
319 <<
"TestOneOutput::respondToOpenInputFile expected null TTree pointers in FileBlock";
332 throw cms::Exception(
"TestFailure") <<
"TestOneOutput::testFileBlock failed. Testing tree pointers";
339 LogAbsolute(
"TestOneOutput") <<
"one globalBeginRun";
345 return std::make_shared<int>(0);
350 LogAbsolute(
"TestOneOutput") <<
"one globalEndRun";
356 LogAbsolute(
"TestOneOutput") <<
"one globalBeginLuminosityBlock";
358 return std::make_shared<int>(0);
363 LogAbsolute(
"TestOneOutput") <<
"one globalEndLuminosityBlock";
371 <<
"TestOneOutput::writeProcessBlock unexpected number of writeProcessBlock transitions";
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);
TestOneOutput(ParameterSet const &pset)
virtual ProcessBlockHelperBase const * topProcessBlockHelper() const =0
std::vector< unsigned int > expectedNEntries0_
std::vector< std::string > expectedTopProcessesWithProcessBlockProducts_
std::vector< unsigned int > expectedCacheEntriesPerFile1_
std::vector< TTree * > const & processBlockTrees() const
virtual unsigned int nProcessesInFirstFile() const =0
std::vector< unsigned int > expectedTopCacheIndices0_
bool requireNullTTreesInFileBlock_
void writeRun(RunForOutput const &) override
std::vector< unsigned int > expectedOuterOffset_
OutputProcessBlockHelper const & outputProcessBlockHelper() const
std::vector< unsigned int > expectedTranslateFromStoredIndex_
std::vector< unsigned int > expectedCacheIndexVectorsPerFile_
std::vector< std::string > expectedAddedProcesses_
TTree * processBlockTree(std::string const &processName) const
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
ProductList const & productList() const
std::vector< std::string > expectedProcessesWithProcessBlockProducts_
virtual unsigned int outerOffset() const =0
unsigned int expectedNAddedProcesses_
bool testTTreesInFileBlock_
std::vector< std::string > expectedTopAddedProcesses_
std::vector< std::string > const & addedProcesses() const
virtual std::vector< unsigned int > const & cacheIndexVectorsPerFile() const =0
void writeLuminosityBlock(LuminosityBlockForOutput const &) override
void addDefault(ParameterSetDescription const &psetDescription)
std::shared_ptr< int > globalBeginLuminosityBlock(LuminosityBlockForOutput const &) const override
void testFileBlock(FileBlock const &)
int expectedWriteProcessBlockTransitions_
#define DEFINE_FWK_MODULE(type)
std::string const & processName() const
void globalEndLuminosityBlock(LuminosityBlockForOutput const &) override
unsigned int countWriteProcessBlockTransitions_
void respondToCloseInputFile(FileBlock const &) override
std::vector< unsigned int > expectedTopCacheIndices1_
constexpr unsigned int kDoNotTest
void writeProcessBlock(ProcessBlockForOutput const &) override
void globalEndRun(RunForOutput const &) override
std::vector< unsigned int > const & translateFromStoredIndex() const
std::vector< unsigned int > expectedCacheIndexSize_
std::vector< std::string > expectedProcessNamesAtWrite_
~TestOneOutput() override
void write(EventForOutput const &e) override
virtual std::vector< unsigned int > const & cacheEntriesPerFile() const =0
virtual std::vector< std::vector< unsigned int > > const & nEntries() const =0
void respondToOpenInputFile(FileBlock const &) override
Log< level::System, true > LogAbsolute
bool expectedProductsFromInputKept_
std::vector< std::string > const & processesWithProcessBlockTrees() const
virtual std::vector< std::vector< unsigned int > > const & processBlockCacheIndices() const =0
std::shared_ptr< int > globalBeginRun(RunForOutput const &) const override
std::vector< unsigned int > expectedNEntries2_
std::vector< unsigned int > expectedTopCacheIndices2_
ProcessBlockHelperBase const * processBlockHelper() const
std::vector< unsigned int > expectedCacheEntriesPerFile0_
static void fillDescriptions(ConfigurationDescriptions &descriptions)