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  public:
30  explicit PATSingleVertexSelector(const edm::ParameterSet& iConfig);
31  ~PATSingleVertexSelector() override;
32 
33  bool filter(edm::Event& iEvent, const edm::EventSetup& iSetup) override;
34 
35  private:
39 
40  Mode parseMode(const std::string& name) const;
41 
42  std::unique_ptr<std::vector<reco::Vertex> > filter_(Mode mode,
43  const edm::Event& iEvent,
44  const edm::EventSetup& iSetup);
45  bool hasMode_(Mode mode) const;
46  // configurables
47  std::vector<Mode> modes_; // mode + optional fallbacks
49  std::vector<edm::EDGetTokenT<edm::View<reco::Candidate> > > candidatesToken_;
50  const VtxSel vtxPreselection_;
51  const CandSel candPreselection_;
53  // transient data. meaningful while 'filter()' is on the stack
54  std::vector<reco::VertexRef> selVtxs_;
56 
57  // flag to enable/disable EDFilter functionality:
58  // if set to false, PATSingleVertexSelector selects the "one" event vertex,
59  // but does not reject any events
61  };
62 
63 } // namespace pat
64 
65 #endif
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:224
Mode parseMode(const std::string &name) const
std::vector< edm::EDGetTokenT< edm::View< reco::Candidate > > > candidatesToken_
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)