Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2024-04-06 12:05: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 
0007 namespace pixelTrack {
0008 
0009   enum class Quality : uint8_t { bad = 0, edup, dup, loose, strict, tight, highPurity, notQuality };
0010   constexpr uint32_t qualitySize{uint8_t(Quality::notQuality)};
0011   constexpr std::string_view qualityName[qualitySize]{"bad", "edup", "dup", "loose", "strict", "tight", "highPurity"};
0012   inline Quality qualityByName(std::string_view name) {
0013     auto qp = std::find(qualityName, qualityName + qualitySize, name) - qualityName;
0014     auto ret = static_cast<Quality>(qp);
0015 
0016     if (ret == pixelTrack::Quality::notQuality)
0017       throw std::invalid_argument(std::string(name) + " is not a pixelTrack::Quality!");
0018 
0019     return ret;
0020   }
0021 
0022 #ifdef GPU_SMALL_EVENTS
0023   // kept for testing and debugging
0024   constexpr uint32_t maxNumber() { return 2 * 1024; }
0025 #else
0026   // tested on MC events with 55-75 pileup events
0027   constexpr uint32_t maxNumber() { return 32 * 1024; }
0028 #endif
0029 
0030 }  // namespace pixelTrack
0031 
0032 #endif