41 #include <TLorentzVector.h>
58 virtual void endJob()
override ;
78 muonSrcToken_ ( consumes<edm::
View<pat::
Muon> >( iConfig.getParameter<edm::
InputTag>(
"muonSrc") ) )
80 produces<std::vector<pat::CompositeCandidate> > ();
100 auto jpsiCands = std::make_unique<std::vector<pat::CompositeCandidate>>();
105 const double JPSI_MASS = 3.097;
108 if ( h_muons.isValid() && h_muons->size() > 1 ) {
111 muonsEnd = h_muons->end(), imuon = muonsBegin;
112 imuon != muonsEnd - 1; ++imuon ) {
113 if ( imuon->pt() > 1.0 ) {
117 jmuon != muonsEnd; ++jmuon ) {
118 if ( imuon->charge() * jmuon->charge() < 0 ) {
127 double dR = reco::deltaR<pat::Muon,pat::Muon>( *imuon, *jmuon );
131 if ( fabs( jpsi.
mass() - JPSI_MASS ) < 1.0 ) {
132 jpsiCands->push_back( jpsi );
Analysis-level particle class.
virtual 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.
virtual void endJob() override
edm::EDGetTokenT< edm::View< pat::Muon > > muonSrcToken_
virtual double mass() const final
mass
void addDaughter(const Candidate &, const std::string &s="")
add a clone of the passed candidate as daughter
virtual void beginJob() override
boost::indirect_iterator< typename seq_t::const_iterator > const_iterator
PatJPsiProducer(const edm::ParameterSet &)
void set(reco::Candidate &c) const
set up a candidate