Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2024-04-30 04:10:23

0001 #ifndef DataFormats_Track_interface_TrackDefinitions_h
0002 #define DataFormats_Track_interface_TrackDefinitions_h
0003 #include <string>
0004 #include <algorithm>
0005 #include <stdexcept>
0006 #include <cstdint>
0007 
0008 namespace pixelTrack {
0009 
0010   enum class Quality : uint8_t { bad = 0, edup, dup, loose, strict, tight, highPurity, notQuality };
0011   constexpr uint32_t qualitySize{uint8_t(Quality::notQuality)};
0012   constexpr std::string_view qualityName[qualitySize]{"bad", "edup", "dup", "loose", "strict", "tight", "highPurity"};
0013   inline Quality qualityByName(std::string_view name) {
0014     auto qp = std::find(qualityName, qualityName + qualitySize, name) - qualityName;
0015     auto ret = static_cast<Quality>(qp);
0016 
0017     if (ret == pixelTrack::Quality::notQuality)
0018       throw std::invalid_argument(std::string(name) + " is not a pixelTrack::Quality!");
0019 
0020     return ret;
0021   }
0022 
0023 #ifdef GPU_SMALL_EVENTS
0024   // kept for testing and debugging
0025   constexpr uint32_t maxNumber() { return 2 * 1024; }
0026 #else
0027   // tested on MC events with 55-75 pileup events
0028   constexpr uint32_t maxNumber() { return 32 * 1024; }
0029 #endif
0030 
0031 }  // namespace pixelTrack
0032 
0033 #endif