CMS 3D CMS Logo

PATSingleVertexSelector.h
Go to the documentation of this file.
1 #ifndef PhysicsTools_PatAlgos_PATSingleVertexSelector_h
2 #define PhysicsTools_PatAlgos_PATSingleVertexSelector_h
3 //
4 //
5 
20 
25 
26 namespace pat {
27 
29 
30  public:
31 
32  explicit PATSingleVertexSelector(const edm::ParameterSet & iConfig);
34 
35  virtual bool filter(edm::Event & iEvent, const edm::EventSetup& iSetup) override;
36 
37  private:
41 
42  Mode parseMode(const std::string &name) const;
43 
44  std::unique_ptr<std::vector<reco::Vertex> >
45  filter_(Mode mode, const edm::Event & iEvent, const edm::EventSetup & iSetup);
46  bool hasMode_(Mode mode) const ;
47  // configurables
48  std::vector<Mode> modes_; // mode + optional fallbacks
50  std::vector<edm::EDGetTokenT<edm::View<reco::Candidate> > > candidatesToken_;
51  const VtxSel vtxPreselection_;
52  const CandSel candPreselection_;
54  // transient data. meaningful while 'filter()' is on the stack
55  std::vector<reco::VertexRef> selVtxs_;
57 
58  // flag to enable/disable EDFilter functionality:
59  // if set to false, PATSingleVertexSelector selects the "one" event vertex,
60  // but does not reject any events
62  };
63 
64 }
65 
66 #endif
67 
Produces a list containing a single vertex selected by some criteria.
edm::EDGetTokenT< reco::BeamSpot > beamSpotToken_
edm::EDGetTokenT< std::vector< reco::Vertex > > verticesToken_
Definition: HeavyIon.h:7
std::vector< reco::VertexRef > selVtxs_
int iEvent
Definition: GenABIO.cc:230
Mode parseMode(const std::string &name) const
std::vector< edm::EDGetTokenT< edm::View< reco::Candidate > > > candidatesToken_
virtual bool filter(edm::Event &iEvent, const edm::EventSetup &iSetup) override
PATSingleVertexSelector(const edm::ParameterSet &iConfig)
StringCutObjectSelector< reco::Vertex > VtxSel
StringCutObjectSelector< reco::Candidate > CandSel
std::unique_ptr< std::vector< reco::Vertex > > filter_(Mode mode, const edm::Event &iEvent, const edm::EventSetup &iSetup)