Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2022-04-06 03:10:50

0001 #include "catch.hpp"
0002 #include <iostream>
0003 #include <iomanip>  // std::setw
0004 #include "CondFormats/SiStripObjects/interface/SiStripBadStrip.h"
0005 
0006 TEST_CASE("SiStripBadStrip testing", "[SiStripBadStrip]") {
0007   //_____________________________________________________________
0008   SECTION("Check barrel plotting") {
0009     SiStripBadStrip testObject;
0010 
0011     static constexpr unsigned short maxStrips = 0x7FF;
0012 
0013     int counter{0};
0014     for (unsigned short fs = 0; fs <= maxStrips; fs++) {
0015       for (unsigned short rng = 0; rng <= maxStrips; rng++) {
0016         auto encoded = testObject.encodePhase2(fs, rng);
0017         auto decoded = testObject.decodePhase2(encoded);
0018 
0019         if (counter < 10) {
0020           std::cout << "input: (" << fs << "," << rng << ") | encoded:" << std::setw(10) << encoded << "| decoded : ("
0021                     << decoded.firstStrip << "," << decoded.range << ")" << std::endl;
0022         }
0023 
0024         assert(decoded.firstStrip == fs);
0025         assert(decoded.range == rng);
0026 
0027         counter++;
0028       }
0029     }
0030     REQUIRE(true);
0031   }
0032 }