Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2021-02-14 12:54:01

0001 #include <cppunit/extensions/HelperMacros.h>
0002 #include "DataFormats/Luminosity/interface/LumiInfoRunHeader.h"
0003 
0004 #include <string>
0005 #include <vector>
0006 #include <iostream>
0007 #include <cmath>
0008 
0009 class TestLumiInfoRunHeader : public CppUnit::TestFixture {
0010   static const float tol;
0011 
0012   CPPUNIT_TEST_SUITE(TestLumiInfoRunHeader);
0013   CPPUNIT_TEST(testConstructor);
0014   CPPUNIT_TEST_SUITE_END();
0015 
0016 public:
0017   void setUp() {}
0018   void tearDown() {}
0019 
0020   void testConstructor();
0021 };
0022 
0023 ///registration of the test so that the runner can find it
0024 CPPUNIT_TEST_SUITE_REGISTRATION(TestLumiInfoRunHeader);
0025 
0026 void TestLumiInfoRunHeader::testConstructor() {
0027   std::cout << "\nTesting LumiInfoRunHeader\n";
0028 
0029   std::string lumiProviderName = "lumiProviderTest";
0030   std::string fillingSchemeName = "fillingSchemeTest";
0031   std::bitset<LumiConstants::numBX> fillingScheme;
0032 
0033   fillingScheme[1] = true;
0034   fillingScheme[10] = true;
0035   fillingScheme[12] = true;
0036   fillingScheme[16] = true;
0037 
0038   LumiInfoRunHeader lumiInfoRH(lumiProviderName, fillingSchemeName, fillingScheme);
0039 
0040   CPPUNIT_ASSERT(lumiInfoRH.getLumiProvider() == lumiProviderName);
0041   CPPUNIT_ASSERT(lumiInfoRH.getFillingSchemeName() == fillingSchemeName);
0042   CPPUNIT_ASSERT(lumiInfoRH.getFillingScheme() == fillingScheme);
0043   CPPUNIT_ASSERT(lumiInfoRH.getBunchFilled(0) == false);
0044   CPPUNIT_ASSERT(lumiInfoRH.getBunchFilled(1) == true);
0045   CPPUNIT_ASSERT(lumiInfoRH.getBunchSpacing() == 50);
0046 }