39 #include <TLorentzVector.h>
74 : muonSrcToken_(consumes<edm::
View<pat::
Muon>>(iConfig.getParameter<edm::
InputTag>(
"muonSrc"))) {
75 produces<std::vector<pat::CompositeCandidate>>();
86 auto jpsiCands = std::make_unique<std::vector<pat::CompositeCandidate>>();
91 const double JPSI_MASS = 3.097;
93 if (h_muons.isValid() && h_muons->size() > 1) {
95 muonsEnd = h_muons->end(),
97 imuon != muonsEnd - 1;
99 if (imuon->pt() > 1.0) {
101 if (imuon->charge() * jmuon->charge() < 0) {
109 double dR = reco::deltaR<pat::Muon, pat::Muon>(*imuon, *jmuon);
113 if (fabs(jpsi.
mass() - JPSI_MASS) < 1.0) {
114 jpsiCands->push_back(jpsi);
Analysis-level particle class.
void produce(edm::Event &, const edm::EventSetup &) override
OrphanHandle< PROD > put(std::unique_ptr< PROD > product)
Put a new product.
bool getByToken(EDGetToken token, Handle< PROD > &result) const
#define DEFINE_FWK_MODULE(type)
void addUserFloat(const std::string &label, float data, const bool overwrite=false)
Set user-defined float.
edm::EDGetTokenT< edm::View< pat::Muon > > muonSrcToken_
void addDaughter(const Candidate &, const std::string &s="")
add a clone of the passed candidate as daughter
double mass() const final
mass
boost::indirect_iterator< typename seq_t::const_iterator > const_iterator
PatJPsiProducer(const edm::ParameterSet &)
void set(reco::Candidate &c) const
set up a candidate
~PatJPsiProducer() override