32 @example_myparticle#
include "DataFormats/Candidate/interface/Particle.h" 33 @example_myparticle#
include "DataFormats/EgammaCandidates/interface/GsfElectron.h" 34 @example_myparticle#
include "DataFormats/EgammaCandidates/interface/GsfElectronFwd.h" 35 @example_myparticle#
include "DataFormats/MuonReco/interface/Muon.h" 36 @example_myparticle#
include "DataFormats/MuonReco/interface/MuonFwd.h" 37 @example_myparticle#
include "FWCore/MessageLogger/interface/MessageLogger.h" 38 @example_myparticle#
include "FWCore/Utilities/interface/InputTag.h" 84 @example_myparticle electronToken_(consumes<reco::GsfElectronCollection>(iConfig.
getParameter<
edm::InputTag>(
"electrons"))),
85 @example_myparticle putToken_(produces<MyParticleCollection>(
"particles")) {
113 @example_myparticle
using namespace reco;
114 @example_myparticle
using namespace std;
133 @example_myparticle
auto newParticles = std::make_unique<MyParticleCollection>();
142 @example_myparticle
for (
auto const&
muon :
muons) {
143 @example_myparticle totalP4 +=
muon.p4();
145 @example_myparticle }
148 @example_myparticle totalP4 +=
electron.p4();
150 @example_myparticle }
153 @example_myparticle newParticles->emplace_back(
charge, totalP4);
154 @example_myparticle }
void produce(edm::Event &, const edm::EventSetup &) override
example_myparticle example_myparticle edm::EDGetTokenT< reco::MuonCollection > muonToken_
T getParameter(std::string const &) const
example_myparticle edm::EDPutTokenT< MyParticleCollection > putToken_
static void fillDescriptions(edm::ConfigurationDescriptions &descriptions)
example_myparticle edm::EDGetTokenT< reco::GsfElectronCollection > electronToken_
example_global example_streamclass __class__
void addDefault(ParameterSetDescription const &psetDescription)
void endStream() override
#define DEFINE_FWK_MODULE(type)
bool include(const CollT &coll, const ItemT &item)
void beginStream(edm::StreamID) override
math::PtEtaPhiELorentzVectorF LorentzVector
example_myparticle example_myparticle typedef std::vector< reco::Particle > MyParticleCollection