Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2023-03-17 13:02:43

0001 /**
0002    \file
0003    Test suit for DTTopology
0004 
0005    \author R.Bellan
0006    \version 
0007    \date 
0008 
0009    \note 
0010 */
0011 
0012 #include <cppunit/extensions/HelperMacros.h>
0013 #include <Geometry/DTGeometry/interface/DTTopology.h>
0014 
0015 class testDTTopology : public CppUnit::TestFixture {
0016   CPPUNIT_TEST_SUITE(testDTTopology);
0017 
0018   CPPUNIT_TEST(testDTTopologyMeth);
0019 
0020   CPPUNIT_TEST_SUITE_END();
0021 
0022 public:
0023   void testDTTopologyMeth();
0024 
0025   //  void setUp(){}
0026   // void tearDown(){}
0027 };
0028 
0029 ///registration of the test so that the runner can find it
0030 CPPUNIT_TEST_SUITE_REGISTRATION(testDTTopology);
0031 
0032 void testDTTopology::testDTTopologyMeth() {
0033   int firstWire1 = 1;
0034   int nChannels = 48;
0035   float length = 20.;
0036 
0037   DTTopology topology(firstWire1, nChannels, length);
0038 
0039   CPPUNIT_ASSERT(firstWire1 == topology.firstChannel());
0040   CPPUNIT_ASSERT(nChannels == topology.channels());
0041   CPPUNIT_ASSERT(3 == topology.channel(LocalPoint(topology.wirePosition(3), 0, 0)));
0042   CPPUNIT_ASSERT(3 == topology.measurementPosition(LocalPoint(topology.wirePosition(3), 0, 0)).x());
0043   CPPUNIT_ASSERT(3 == topology.channel(topology.localPosition(
0044                           topology.measurementPosition(LocalPoint(topology.wirePosition(3), 0, 0)))));
0045 }
0046 
0047 #include <Utilities/Testing/interface/CppUnit_testdriver.icpp>