32 #include "CLHEP/Vector/ThreeVector.h" 33 #include "CLHEP/Vector/LorentzVector.h" 34 #include "CLHEP/Matrix/Vector.h" 59 iConfig.getParameter<
edm::
InputTag>(
"inputCollection"))),
60 maxRapidity_(iConfig.getParameter<double>(
"maxRapidity")) {
61 produces<std::vector<pat::PackedGenParticle>>();
62 produces<edm::Association<std::vector<pat::PackedGenParticle>>>();
75 iEvent.getByToken(Asso_, asso);
78 iEvent.getByToken(AssoOriginal_, assoOriginal);
81 iEvent.getByToken(GenOrigs_, genOrigs);
82 std::vector<int>
mapping(genOrigs->size(), -1);
86 for (
unsigned int ic = 0, nc = genOrigs->size(); ic < nc; ++ic) {
93 auto outPtrP = std::make_unique<std::vector<pat::PackedGenParticle>>();
95 unsigned int packed = 0;
96 for (
unsigned int ic = 0, nc =
cands->size(); ic < nc; ++ic) {
108 if (
cand.numberOfMothers() > 0) {
120 auto gp2pgp = std::make_unique<edm::Association<std::vector<pat::PackedGenParticle>>>(oh);
std::vector< GenParticle > GenParticleCollection
collection of GenParticles
PATPackedGenParticleProducer(const edm::ParameterSet &)
bool isNonnull() const
Checks for non-null.
key_type key() const
Accessor for product key.
const double maxRapidity_
const edm::EDGetTokenT< reco::GenParticleCollection > Cands_
Abs< T >::type abs(const T &t)
#define DEFINE_FWK_MODULE(type)
const edm::EDGetTokenT< edm::Association< reco::GenParticleCollection > > Asso_
const edm::EDGetTokenT< reco::GenParticleCollection > GenOrigs_
void produce(edm::StreamID, edm::Event &, const edm::EventSetup &) const override
~PATPackedGenParticleProducer() override
const edm::EDGetTokenT< edm::Association< reco::GenParticleCollection > > AssoOriginal_