CMS 3D CMS Logo

V0EventSelector.cc
Go to the documentation of this file.
1 #include <memory>
2 #include <vector>
10 
12 public:
13  explicit V0EventSelector(const edm::ParameterSet&);
14  ~V0EventSelector() override = default;
15 
16  bool filter(edm::Event&, const edm::EventSetup&) override;
17  static void fillDescriptions(edm::ConfigurationDescriptions& descriptions);
18 
19 private:
21  const unsigned int minNumCandidates_;
22 };
23 
25  : vccToken_{consumes<reco::VertexCompositeCandidateCollection>(
26  iConfig.getParameter<edm::InputTag>("vertexCompositeCandidates"))},
27  minNumCandidates_{iConfig.getParameter<unsigned int>("minCandidates")} {}
28 
31  iEvent.getByToken(vccToken_, vccHandle);
32 
33  return vccHandle->size() >= minNumCandidates_;
34 }
35 
38  desc.add<edm::InputTag>("vertexCompositeCandidates", edm::InputTag("generalV0Candidates:Kshort"));
39  desc.add<unsigned int>("minCandidates", 1); // Change '1' to your desired minimum number of candidates
40  descriptions.addWithDefaultLabel(desc);
41 }
42 
static void fillDescriptions(edm::ConfigurationDescriptions &descriptions)
void addWithDefaultLabel(ParameterSetDescription const &psetDescription)
T getParameter(std::string const &) const
Definition: ParameterSet.h:307
~V0EventSelector() override=default
int iEvent
Definition: GenABIO.cc:224
bool filter(edm::Event &, const edm::EventSetup &) override
#define DEFINE_FWK_MODULE(type)
Definition: MakerMacros.h:16
V0EventSelector(const edm::ParameterSet &)
const edm::EDGetTokenT< reco::VertexCompositeCandidateCollection > vccToken_
const unsigned int minNumCandidates_