Skip to content

Commit

Permalink
Merge pull request #12612 from slava77/CMSSW_7_6_1/from-davidlange6-f…
Browse files Browse the repository at this point in the history
…ixPackedCandidateUnitTests-rebase

PackedCandidates.. comment out parts of unit test that are not expected to work given that data are packed upon creation with precision loss (same as #12430)
  • Loading branch information
cmsbuild committed Dec 1, 2015
2 parents 621692f + 24e7650 commit 574b353
Showing 1 changed file with 11 additions and 15 deletions.
26 changes: 11 additions & 15 deletions DataFormats/PatCandidates/test/testPackedCandidate.cc
Expand Up @@ -50,15 +50,16 @@ void testPackedCandidate::testCopyConstructor() {
//invalid Refs use a special key
pat::PackedCandidate pc(lv, v, 1., 11, reco::VertexRefProd(), reco::VertexRef().key());

CPPUNIT_ASSERT(pc.polarP4() == plv);
CPPUNIT_ASSERT(pc.p4() == lv);
CPPUNIT_ASSERT(pc.vertex() == v);
//these by design do not work
// CPPUNIT_ASSERT(pc.polarP4() == plv);
// CPPUNIT_ASSERT(pc.p4() == lv);
// CPPUNIT_ASSERT(pc.vertex() == v);

pat::PackedCandidate copy_pc(pc);

CPPUNIT_ASSERT(copy_pc.polarP4() == plv);
CPPUNIT_ASSERT(copy_pc.p4() == lv);
CPPUNIT_ASSERT(copy_pc.vertex() == v);
//CPPUNIT_ASSERT(copy_pc.polarP4() == plv);
//CPPUNIT_ASSERT(copy_pc.p4() == lv);
//CPPUNIT_ASSERT(copy_pc.vertex() == v);

CPPUNIT_ASSERT(&copy_pc.polarP4() != &pc.polarP4());
CPPUNIT_ASSERT(&copy_pc.p4() != &pc.p4());
Expand All @@ -81,11 +82,6 @@ testPackedCandidate::testPackUnpack() {
//invalid Refs use a special key
pat::PackedCandidate pc(lv, v, -3./4.*3.1416, 11, reco::VertexRefProd(), reco::VertexRef().key());

CPPUNIT_ASSERT(pc.polarP4() == plv);
CPPUNIT_ASSERT(pc.p4() == lv);
CPPUNIT_ASSERT(pc.vertex() == v);
CPPUNIT_ASSERT(pc.pseudoTrack().p() == lv.P());

pc.pack(true);
pc.packVtx(true);

Expand All @@ -112,10 +108,10 @@ void testPackedCandidate::testSimulateReadFromRoot() {
//invalid Refs use a special key
pat::PackedCandidate pc(lv, v, -3./4.*3.1416, 11, reco::VertexRefProd(), reco::VertexRef().key());

CPPUNIT_ASSERT(pc.polarP4() == plv);
CPPUNIT_ASSERT(pc.p4() == lv);
CPPUNIT_ASSERT(pc.vertex() == v);
CPPUNIT_ASSERT(pc.pseudoTrack().p() == lv.P());
// CPPUNIT_ASSERT(pc.polarP4() == plv);
// CPPUNIT_ASSERT(pc.p4() == lv);
// CPPUNIT_ASSERT(pc.vertex() == v);
// CPPUNIT_ASSERT(pc.pseudoTrack().p() == lv.P());

//When reading back from ROOT, these were not stored and are nulled out
delete pc.p4_.exchange(nullptr);
Expand Down

0 comments on commit 574b353

Please sign in to comment.