/
githubmirror
/
cmssw
Обзор
Документация
Войти
/
githubmirror
/
cmssw
Код
Запросы
0
Пакеты
0
Релизы
0
Аналитика
Безопасность
master
DataFormats/CaloRecHit/test/testCaloCluster.cppunit.cc
60 строк
2 KB
Cms Build
Clang-Format
11 июн 2019, 11:29
11 июн 2019, 11:29
146bc98
Код
Авторство
О чём код?
/* Unit test for CaloCluster Stefano Argiro', Dec 2010 */ #include <cppunit/extensions/HelperMacros.h> #include "DataFormats/CaloRecHit/interface/CaloCluster.h" #include "DataFormats/Math/interface/Point3D.h" #include "DataFormats/CaloRecHit/interface/CaloID.h" #include "DataFormats/DetId/interface/DetId.h" class testCaloCluster : public CppUnit::TestFixture { CPPUNIT_TEST_SUITE(testCaloCluster); CPPUNIT_TEST(FlagsTest); CPPUNIT_TEST_SUITE_END(); public: void setUp() {} void tearDown() {} void FlagsTest(); }; ///registration of the test so that the runner can find it CPPUNIT_TEST_SUITE_REGISTRATION(testCaloCluster); void testCaloCluster::FlagsTest() { using namespace reco; using namespace math; CaloCluster c1(0., XYZPoint(), CaloID(), CaloCluster::island, CaloCluster::cleanOnly); CPPUNIT_ASSERT(c1.flags() == CaloCluster::cleanOnly); CPPUNIT_ASSERT(c1.isInClean() == true); CPPUNIT_ASSERT(c1.isInUnclean() == false); CaloCluster c2(0., XYZPoint(), CaloID(), CaloCluster::island, CaloCluster::uncleanOnly); CPPUNIT_ASSERT(c2.flags() == CaloCluster::uncleanOnly); CPPUNIT_ASSERT(c2.isInUnclean() == true); CPPUNIT_ASSERT(c2.isInClean() == false); CaloCluster c3(0., XYZPoint(), CaloID(), CaloCluster::island, CaloCluster::common); CPPUNIT_ASSERT(c3.flags() == CaloCluster::common); CPPUNIT_ASSERT(c3.isInUnclean() == true); CPPUNIT_ASSERT(c3.isInClean() == true); c3.setFlags(CaloCluster::common); CPPUNIT_ASSERT(c3.isInUnclean() == true); CPPUNIT_ASSERT(c3.isInClean() == true); CPPUNIT_ASSERT(c3.flags() == CaloCluster::common); c3.setFlags(CaloCluster::uncleanOnly); CPPUNIT_ASSERT(c3.isInUnclean() == true); CPPUNIT_ASSERT(c3.isInClean() == false); CPPUNIT_ASSERT(c3.flags() == CaloCluster::uncleanOnly); c3.setFlags(CaloCluster::cleanOnly); CPPUNIT_ASSERT(c3.isInUnclean() == false); CPPUNIT_ASSERT(c3.isInClean() == true); CPPUNIT_ASSERT(c3.flags() == CaloCluster::cleanOnly); }