$treeview $search $mathjax $extrastylesheet
artdaq_demo
v3_04_01
$projectbrief
|
$projectbrief
|
$searchbox |
00001 00002 // Class: NthEvent 00003 // Module Type: filter 00004 // File: NthEvent_module.cc 00005 // 00006 // Generated at Tue Jan 6 11:52:08 2015 by John Freeman using artmod 00007 // from cetpkgsupport v1_07_01. 00009 00010 #include "art/Framework/Core/EDFilter.h" 00011 #include "art/Framework/Core/ModuleMacros.h" 00012 #include "art/Framework/Principal/Event.h" 00013 #include "art/Framework/Principal/Handle.h" 00014 #include "art/Framework/Principal/Run.h" 00015 #include "art/Framework/Principal/SubRun.h" 00016 #include "canvas/Utilities/InputTag.h" 00017 00018 #include "fhiclcpp/ParameterSet.h" 00019 #include "messagefacility/MessageLogger/MessageLogger.h" 00020 00021 #include <memory> 00022 00023 class NthEvent; 00024 00028 class NthEvent : public art::EDFilter 00029 { 00030 public: 00035 explicit NthEvent(fhicl::ParameterSet const& p); 00036 00037 // The destructor generated by the compiler is fine for classes 00038 // without bare pointers or other resource use. 00039 00041 NthEvent(NthEvent const&) = delete; 00042 00044 NthEvent(NthEvent&&) = delete; 00045 00047 NthEvent& operator =(NthEvent const&) = delete; 00048 00050 NthEvent& operator =(NthEvent&&) = delete; 00051 00057 bool filter(art::Event& e) override; 00058 00059 00060 private: 00061 00062 uint32_t nth_; 00063 }; 00064 00065 00066 NthEvent::NthEvent(fhicl::ParameterSet const& p) 00067 : nth_(p.get<uint32_t>("nth")) {} 00068 00069 inline 00070 bool NthEvent::filter(art::Event& e) 00071 { 00072 return e.event() % nth_ == 0 ? true : false; 00073 } 00074 00075 DEFINE_ART_MODULE(NthEvent)