39 #include <TLorentzVector.h>
71 : muonSrcToken_(consumes<edm::
View<pat::
Muon>>(iConfig.getParameter<edm::
InputTag>(
"muonSrc"))) {
72 produces<std::vector<pat::CompositeCandidate>>();
81 auto jpsiCands = std::make_unique<std::vector<pat::CompositeCandidate>>();
86 const double JPSI_MASS = 3.097;
88 if (h_muons.isValid() && h_muons->size() > 1) {
90 muonsEnd = h_muons->end(),
92 imuon != muonsEnd - 1;
94 if (imuon->pt() > 1.0) {
96 if (imuon->charge() * jmuon->charge() < 0) {
104 double dR = reco::deltaR<pat::Muon, pat::Muon>(*imuon, *jmuon);
108 if (fabs(jpsi.
mass() - JPSI_MASS) < 1.0) {
109 jpsiCands->push_back(jpsi);
Analysis-level particle class.
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
void produce(edm::StreamID, edm::Event &, const edm::EventSetup &) const override