33 #include "CLHEP/Vector/ThreeVector.h"
34 #include "CLHEP/Vector/LorentzVector.h"
35 #include "CLHEP/Matrix/Vector.h"
63 maxRapidity_(iConfig.getParameter<double>(
"maxRapidity"))
65 produces< std::vector<pat::PackedGenParticle> > ();
66 produces< edm::Association< std::vector<pat::PackedGenParticle> > >();
76 std::vector<reco::Candidate>::const_iterator cand;
82 iEvent.
getByToken( AssoOriginal_, assoOriginal);
86 std::vector<int> mapping(genOrigs->size(), -1);
95 PVpos = PV->position();
100 for(
unsigned int ic=0, nc = genOrigs->size(); ic < nc; ++ic)
107 auto outPtrP = std::make_unique<std::vector<pat::PackedGenParticle>>();
109 unsigned int packed=0;
110 for(
unsigned int ic=0, nc = cands->size(); ic < nc; ++ic) {
117 mapping[originalRef.
key()]=packed;
133 auto gp2pgp = std::make_unique<edm::Association<std::vector<pat::PackedGenParticle>>>(oh);
135 gp2pgpFiller.insert(genOrigs, mapping.begin(), mapping.end());
std::vector< GenParticle > GenParticleCollection
collection of GenParticles
OrphanHandle< PROD > put(std::unique_ptr< PROD > product)
Put a new product.
bool getByToken(EDGetToken token, Handle< PROD > &result) const
#define DEFINE_FWK_MODULE(type)
PATPackedGenParticleProducer(const edm::ParameterSet &)
virtual double y() const final
rapidity
std::vector< Vertex > VertexCollection
collection of Vertex objects
key_type key() const
Accessor for product key.
virtual void produce(edm::StreamID, edm::Event &, const edm::EventSetup &) const
const double maxRapidity_
virtual int status() const final
status word
const edm::EDGetTokenT< reco::GenParticleCollection > Cands_
virtual size_t numberOfMothers() const
number of mothers
Abs< T >::type abs(const T &t)
edm::Ref< VertexCollection > VertexRef
persistent reference to a Vertex
const edm::EDGetTokenT< edm::Association< reco::GenParticleCollection > > Asso_
daughters::value_type motherRef(size_type i=0) const
reference to mother at given position
const edm::EDGetTokenT< reco::VertexCollection > PVs_
~PATPackedGenParticleProducer()
XYZPointD XYZPoint
point in space with cartesian internal representation
const edm::EDGetTokenT< reco::GenParticleCollection > GenOrigs_
const edm::EDGetTokenT< edm::Association< reco::GenParticleCollection > > AssoOriginal_