Back to home page

Project CMSSW displayed by LXR

 
 

    


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

0001 // -*- C++ -*-
0002 //
0003 // Package:    SiStripCommissioningSeedFilter
0004 // Class:      SiStripCommissioningSeedFilter
0005 //
0006 /**\class SiStripCommissioningSeedFilter SiStripCommissioningSeedFilter.cc myTestArea/SiStripCommissioningSeedFilter/src/SiStripCommissioningSeedFilter.cc
0007 
0008  Description: simply filter acording to the run type
0009 
0010  Implementation:
0011      Uses information from SiStripEventSummary, so it has to be called after Raw2Digi.
0012 */
0013 //
0014 // Original Author:  Christophe DELAERE
0015 //         Created:  Fri Jan 18 12:17:46 CET 2008
0016 //
0017 //
0018 
0019 // system include files
0020 #include <memory>
0021 #include <algorithm>
0022 #include <vector>
0023 
0024 // user include files
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 // class declaration
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   // ----------member data ---------------------------
0047   //      edm::InputTag inputModuleLabel_;
0048   edm::EDGetTokenT<TrajectorySeedCollection> seedcollToken_;
0049 };
0050 
0051 //
0052 // constructors and destructor
0053 //
0054 SiStripCommissioningSeedFilter::SiStripCommissioningSeedFilter(const edm::ParameterSet& iConfig) {
0055   //now do what ever initialization is needed
0056   //   inputModuleLabel_ = iConfig.getParameter<edm::InputTag>( "InputModuleLabel" ) ;
0057   seedcollToken_ = consumes<TrajectorySeedCollection>(iConfig.getParameter<edm::InputTag>("InputModuleLabel"));
0058 }
0059 
0060 //
0061 // member functions
0062 //
0063 
0064 // ------------ method called on each new Event  ------------
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);