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 std::auto_ptr<std::vector<pat::CompositeCandidate> > jpsiCands(
new 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 );
140 iEvent.
put( jpsiCands );
Analysis-level particle class.
virtual void produce(edm::Event &, const edm::EventSetup &) override
bool getByToken(EDGetToken token, Handle< PROD > &result) const
#define DEFINE_FWK_MODULE(type)
virtual void endJob() override
virtual double mass() const
mass
OrphanHandle< PROD > put(std::auto_ptr< PROD > product)
Put a new product.
void addUserFloat(const std::string &label, float data)
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
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