CMS 3D CMS Logo

/afs/cern.ch/work/a/aaltunda/public/www/CMSSW_5_3_14/src/PhysicsTools/PatUtils/interface/PatSelectorByFlags.h

Go to the documentation of this file.
00001 #ifndef PhysicsTools_PatUtils_interface_PatSelectorByFlags_h
00002 #define PhysicsTools_PatUtils_interface_PatSelectorByFlags_h
00003 
00004 #include "DataFormats/PatCandidates/interface/Flags.h"
00005 
00006 namespace pat {
00007     class SelectorByFlags {
00008         public:
00009             SelectorByFlags() : mask_(0) { }
00010             SelectorByFlags(uint32_t    maskToTest) : mask_(~maskToTest) {}
00011             SelectorByFlags(const std::string &bitToTest)  ;
00012             SelectorByFlags(const std::vector<std::string> bitsToTest) ;
00013             bool operator()(const reco::Candidate &c) const { return pat::Flags::test(c, mask_); }
00014             bool operator()(const reco::Candidate *c) const { return (c == 0 ? false : pat::Flags::test(*c, mask_)); }
00015         private:
00016             uint32_t mask_;
00017     };
00018 }
00019 #endif