Back to home page

Project CMSSW displayed by LXR

 
 

    


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

0001 #ifndef CommonTools_Utils_CutSetter_h
0002 #define CommonTools_Utils_CutSetter_h
0003 /* \class reco::parser::CutSetter
0004  *
0005  * Cut setter
0006  *
0007  * \author original version: Chris Jones, Cornell, 
0008  *         adapted by Luca Lista, INFN
0009  *
0010  * \version $Revision: 1.3 $
0011  *
0012  */
0013 #include "CommonTools/Utils/interface/parser/SelectorPtr.h"
0014 #include "CommonTools/Utils/interface/parser/SelectorStack.h"
0015 #include <cassert>
0016 
0017 namespace reco {
0018   namespace parser {
0019     struct CutSetter {
0020       CutSetter(SelectorPtr& cut, SelectorStack& selStack) : cut_(cut), selStack_(selStack) {}
0021 
0022       void operator()(const char*, const char*) const {
0023         assert(nullptr == cut_.get());
0024         assert(!selStack_.empty());
0025         cut_ = selStack_.back();
0026         selStack_.pop_back();
0027       }
0028       SelectorPtr& cut_;
0029       SelectorStack& selStack_;
0030     };
0031   }  // namespace parser
0032 }  // namespace reco
0033 
0034 #endif