File indexing completed on 2024-04-06 12:08:35
0001
0002
0003
0004
0005
0006
0007
0008
0009
0010
0011
0012
0013
0014
0015
0016
0017
0018
0019
0020 #include <memory>
0021 #include <algorithm>
0022 #include <vector>
0023
0024
0025 #include "FWCore/Framework/interface/stream/EDFilter.h"
0026 #include "FWCore/Framework/interface/Event.h"
0027 #include "FWCore/Framework/interface/Frameworkfwd.h"
0028 #include "FWCore/Framework/interface/MakerMacros.h"
0029 #include "FWCore/ParameterSet/interface/ParameterSet.h"
0030 #include "FWCore/Utilities/interface/EDGetToken.h"
0031 #include "FWCore/Utilities/interface/InputTag.h"
0032
0033
0034
0035
0036 #include "DataFormats/TrajectorySeed/interface/TrajectorySeedCollection.h"
0037
0038 class SiStripCommissioningSeedFilter : public edm::stream::EDFilter<> {
0039 public:
0040 explicit SiStripCommissioningSeedFilter(const edm::ParameterSet&);
0041 ~SiStripCommissioningSeedFilter() override = default;
0042
0043 private:
0044 bool filter(edm::Event&, const edm::EventSetup&) override;
0045
0046
0047
0048 edm::EDGetTokenT<TrajectorySeedCollection> seedcollToken_;
0049 };
0050
0051
0052
0053
0054 SiStripCommissioningSeedFilter::SiStripCommissioningSeedFilter(const edm::ParameterSet& iConfig) {
0055
0056
0057 seedcollToken_ = consumes<TrajectorySeedCollection>(iConfig.getParameter<edm::InputTag>("InputModuleLabel"));
0058 }
0059
0060
0061
0062
0063
0064
0065 bool SiStripCommissioningSeedFilter::filter(edm::Event& iEvent, const edm::EventSetup& iSetup) {
0066 using namespace edm;
0067
0068 edm::Handle<TrajectorySeedCollection> seedcoll;
0069 iEvent.getByToken(seedcollToken_, seedcoll);
0070 bool result = !(*seedcoll).empty();
0071 return result;
0072 }
0073
0074 DEFINE_FWK_MODULE(SiStripCommissioningSeedFilter);