33 @example_myparticle #
include "DataFormats/MuonReco/interface/Muon.h"
34 @example_myparticle #
include "DataFormats/EgammaCandidates/interface/PixelMatchGsfElectron.h"
35 @example_myparticle #
include "DataFormats/Candidate/interface/Particle.h"
36 @example_myparticle #
include "FWCore/MessageLogger/interface/MessageLogger.h"
37 @example_myparticle #
include "FWCore/Utilities/interface/InputTag.h"
81 @example_myparticle muonTags_( iConfig.getParameter<
edm::InputTag>(
"muons" )),
82 @example_myparticle electronTags_( iConfig.getParameter<
edm::InputTag>(
"electrons" ))
94 @example_myparticle produces<MyParticleCollection>(
"particles" );
118 @example_myparticle
using namespace reco;
119 @example_myparticle
using namespace std;
151 @example_myparticle Particle::Charge
charge( 0 );
154 @example_myparticle
for( MuonCollection::const_iterator
muon =
muons->begin();
muon !=
muons->end(); ++
muon ) {
155 @example_myparticle totalP4 +=
muon->p4();
157 @example_myparticle }
160 @example_myparticle totalP4 +=
electron->p4();
161 @example_myparticle charge +=
electron->charge();
162 @example_myparticle }
166 @example_myparticle h.setP4(totalP4);
167 @example_myparticle h.setCharge(charge);
170 @example_myparticle newParticles->push_back( h );
171 @example_myparticle }
174 @example_myparticle iEvent.
put(
move(newParticles),
"particles" );
virtual void produce(edm::Event &, const edm::EventSetup &) override
example_myparticle edm::InputTag electronTags_
static void fillDescriptions(edm::ConfigurationDescriptions &descriptions)
#define DEFINE_FWK_MODULE(type)
void addDefault(ParameterSetDescription const &psetDescription)
virtual void endStream() override
OrphanHandle< PROD > put(std::auto_ptr< PROD > product)
Put a new product.
The Signals That Services Can Subscribe To This is based on ActivityRegistry h
Helper function to determine trigger accepts.
bool getByLabel(InputTag const &tag, Handle< PROD > &result) const
bool include(const CollT &coll, const ItemT &item)
example_myparticle example_myparticle typedef std::vector< reco::Particle > MyParticleCollection
example_myparticle edm::InputTag muonTags_
virtual void beginStream(edm::StreamID) override
math::PtEtaPhiELorentzVectorF LorentzVector