Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2024-04-06 12:24:35

0001 #include "FWCore/Framework/interface/stream/EDFilter.h"
0002 #include "FWCore/ParameterSet/interface/ParameterSet.h"
0003 
0004 namespace BTagSkimMCCount {
0005   struct Counters {
0006     Counters() : nEvents_(0), nAccepted_(0) {}
0007     mutable std::atomic<unsigned int> nEvents_, nAccepted_;
0008   };
0009 }  // namespace BTagSkimMCCount
0010 
0011 class BTagSkimMC : public edm::stream::EDFilter<edm::GlobalCache<BTagSkimMCCount::Counters> > {
0012 public:
0013   /// constructor
0014   explicit BTagSkimMC(const edm::ParameterSet&, const BTagSkimMCCount::Counters* count);
0015 
0016   static std::unique_ptr<BTagSkimMCCount::Counters> initializeGlobalCache(edm::ParameterSet const&) {
0017     return std::make_unique<BTagSkimMCCount::Counters>();
0018   }
0019 
0020   bool filter(edm::Event& evt, const edm::EventSetup& es) override;
0021   void endStream() override;
0022   static void globalEndJob(const BTagSkimMCCount::Counters* counters);
0023 
0024 private:
0025   bool verbose;
0026   double overallLumi;
0027 
0028   unsigned int nEvents_;
0029   unsigned int nAccepted_;
0030   double pthatMin, pthatMax;
0031   std::string process_;
0032 };