CMS 3D CMS Logo

/data/refman/pasoursint/CMSSW_6_1_1/src/CommonTools/UtilAlgos/interface/DetIdSelector.h

Go to the documentation of this file.
00001 #ifndef DetIdSelector_h
00002 #define DetIdSelector_h
00003 
00004 #include <string>
00005 #include <vector>
00006 
00007 class DetId;
00008 namespace edm {
00009   class ParameterSet;
00010 }
00011 
00012 class DetIdSelector {
00013  public:
00014   DetIdSelector();
00015   DetIdSelector(const std::string& selstring);
00016   DetIdSelector(const std::vector<std::string>& selstrings);
00017   DetIdSelector(const edm::ParameterSet& selconfig);
00018 
00019   bool isSelected(const DetId& detid ) const;
00020   bool isSelected(const unsigned int& rawid) const;
00021   bool operator()(const DetId& detid ) const;
00022   bool operator()(const unsigned int& rawid) const;
00023   inline bool isValid() const { return m_selections.size()!=0;}
00024 
00025  private:
00026 
00027   void addSelection(const std::string& selstring);
00028   void addSelection(const std::vector<std::string>& selstrings);
00029 
00030   std::vector<unsigned int> m_selections;
00031   std::vector<unsigned int> m_masks;
00032 
00033 };
00034 
00035 #endif // DetIdSelector_h