Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2024-04-06 12:01:15

0001 #ifndef DetIdSelector_h
0002 #define DetIdSelector_h
0003 
0004 #include <string>
0005 #include <vector>
0006 
0007 class DetId;
0008 namespace edm {
0009   class ParameterSet;
0010 }
0011 
0012 class DetIdSelector {
0013 public:
0014   DetIdSelector();
0015   DetIdSelector(const std::string& selstring);
0016   DetIdSelector(const std::vector<std::string>& selstrings);
0017   DetIdSelector(const edm::ParameterSet& selconfig);
0018 
0019   bool isSelected(const DetId& detid) const;
0020   bool isSelected(const unsigned int& rawid) const;
0021   bool operator()(const DetId& detid) const;
0022   bool operator()(const unsigned int& rawid) const;
0023   inline bool isValid() const { return !m_selections.empty(); }
0024 
0025 private:
0026   void addSelection(const std::string& selstring);
0027   void addSelection(const std::vector<std::string>& selstrings);
0028 
0029   std::vector<unsigned int> m_selections;
0030   std::vector<unsigned int> m_masks;
0031 };
0032 
0033 #endif  // DetIdSelector_h