Skip to content

Commit

Permalink
enhance the BeamSpotPayloadInspector unit tests for the BeamSpotOnlin…
Browse files Browse the repository at this point in the history
…eObjects
  • Loading branch information
mmusich committed Mar 4, 2022

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
1 parent 333a337 commit 8c57f57
Showing 1 changed file with 23 additions and 0 deletions.
23 changes: 23 additions & 0 deletions CondCore/BeamSpotPlugins/test/testBeamSpotPayloadInspector.cpp
Original file line number Diff line number Diff line change
@@ -51,10 +51,33 @@ int main(int argc, char** argv) {

tag = "BeamSpotOnlineTestLegacy";
start = static_cast<unsigned long long>(1443392479297557);
end = static_cast<unsigned long long>(1470910334763033);

edm::LogPrint("") << "###########################################################################\n"
<< " DISCLAIMER\n"
<< " The following unit test is going to print error messages about\n"
<< " out-of-range indices for the BeamSpotOnlineParameters.\n"
<< " This normal and expected, since the test payload has been written \n"
<< " with an obsolete data layout which doesn't contain few additional \n"
<< " parameters, see https://github.com/cms-sw/cmssw/pull/35338 for details. \n"
<< " This tests the catching of exceptions coming from reading not existing \n"
<< " parameters in the Payload inspector.\n";

BeamSpotOnlineParameters histoOnlineParameters;
histoOnlineParameters.process(connectionString, PI::mk_input(tag, start, start));
edm::LogPrint("testBeamSpotPayloadInspector") << histoOnlineParameters.data() << std::endl;

BeamSpotOnlineParametersDiffSingleTag histoOnlineParametersDiff;
histoOnlineParametersDiff.process(connectionString, PI::mk_input(tag, start, end));
edm::LogPrint("testBeamSpotPayloadInspector") << histoOnlineParametersDiff.data() << std::endl;

tag1 = "BeamSpotOnlineObjects_Ideal_Centered_SLHC_v3_mc";
tag2 = "BeamSpotOnlineObjects_Realistic25ns_13TeVCollisions_RoundOpticsLowSigmaZ_RunBased_v1_mc";
start = static_cast<unsigned long long>(4294967297); /*Run 1 : LS 1 (packed: 4294967297) this needs to be per LS */

BeamSpotOnlineParametersDiffTwoTags histoOnlineParametersDiffTwoTags;
histoOnlineParametersDiffTwoTags.process(connectionString, PI::mk_input(tag1, start, start, tag2, start, start));
edm::LogPrint("testBeamSpotPayloadInspector") << histoOnlineParametersDiffTwoTags.data() << std::endl;

Py_Finalize();
}

0 comments on commit 8c57f57

Please sign in to comment.