CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
CSCTightHalo2015Filter.cc
Go to the documentation of this file.
6 
8 
9  public:
10 
11  explicit CSCTightHalo2015Filter(const edm::ParameterSet & iConfig);
13 
14  private:
15 
16  virtual bool filter(edm::StreamID iID, edm::Event & iEvent, const edm::EventSetup & iSetup) const override;
17 
18  const bool taggingMode_;
20 };
21 
23  : taggingMode_ (iConfig.getParameter<bool> ("taggingMode"))
24  , beamHaloSummaryToken_(consumes<reco::BeamHaloSummary>(edm::InputTag("BeamHaloSummary")))
25 {
26 
27  produces<bool>();
28 }
29 
31 
32  edm::Handle<reco::BeamHaloSummary> beamHaloSummary;
33  iEvent.getByToken(beamHaloSummaryToken_ , beamHaloSummary);
34 
35  const bool pass = !beamHaloSummary->CSCTightHaloId2015();
36 
37  iEvent.put( std::auto_ptr<bool>(new bool(pass)) );
38 
39  return taggingMode_ || pass; // return false if it is a beamhalo event
40 }
41 
virtual bool filter(edm::StreamID iID, edm::Event &iEvent, const edm::EventSetup &iSetup) const override
CSCTightHalo2015Filter(const edm::ParameterSet &iConfig)
bool getByToken(EDGetToken token, Handle< PROD > &result) const
Definition: Event.h:464
#define DEFINE_FWK_MODULE(type)
Definition: MakerMacros.h:17
int iEvent
Definition: GenABIO.cc:230
OrphanHandle< PROD > put(std::auto_ptr< PROD > product)
Put a new product.
Definition: Event.h:120
edm::EDGetTokenT< reco::BeamHaloSummary > beamHaloSummaryToken_