39 #include <TLorentzVector.h>
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) {
103 jpsi.addDaughter(*imuon,
"mu1");
104 jpsi.addDaughter(*jmuon,
"mu2");
109 double dR = reco::deltaR<pat::Muon, pat::Muon>(*imuon, *jmuon);
111 jpsi.addUserFloat(
"dR",
dR);
113 if (fabs(
jpsi.mass() - JPSI_MASS) < 1.0) {
114 jpsiCands->push_back(
jpsi);