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;
154 @example_myparticle
for( MuonCollection::const_iterator
muon =
muons->begin();
muon !=
muons->end(); ++
muon ) {
155 @example_myparticle totalP4 +=
muon->p4();
156 @example_myparticle charge +=
muon->charge();
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( newParticles,
"particles" );
virtual void endLuminosityBlock(edm::LuminosityBlock &, edm::EventSetup const &)
virtual void produce(edm::Event &, const edm::EventSetup &)
virtual void beginLuminosityBlock(edm::LuminosityBlock &, edm::EventSetup const &)
#define DEFINE_FWK_MODULE(type)
static void fillDescriptions(edm::ConfigurationDescriptions &descriptions)
int Charge
electric charge type
example_myparticle edm::InputTag electronTags_
void addDefault(ParameterSetDescription const &psetDescription)
OrphanHandle< PROD > put(std::auto_ptr< PROD > product)
Put a new product.
virtual void beginRun(edm::Run &, edm::EventSetup const &)
example_myparticle edm::InputTag muonTags_
bool getByLabel(InputTag const &tag, Handle< PROD > &result) const
The Signals That Services Can Subscribe To This is based on ActivityRegistry h
Helper function to determine trigger accepts.
bool include(const CollT &coll, const ItemT &item)
prodname(const edm::ParameterSet &)
math::XYZTLorentzVector LorentzVector
Lorentz vector.
example_myparticle example_myparticle typedef std::vector< reco::Particle > MyParticleCollection
virtual void endRun(edm::Run &, edm::EventSetup const &)