25 #include "fastjet/PseudoJet.hh"
42 produces<edm::ValueMap<float> > ();
43 produces<edm::ValueMap<LorentzVector> > ();
44 produces< edm::ValueMap<reco::CandidatePtr> >();
46 produces<PFOutputCollection>();
70 pReco.
pt = itPF->pt();
71 pReco.
eta = itPF->eta();
72 pReco.
phi = itPF->phi();
73 pReco.
m = itPF->mass();
74 pReco.
charge = itPF->charge();
83 for(reco::VertexCollection::const_iterator iV = pvCol->begin(); iV!=pvCol->end(); ++iV) {
90 if(pDZ > -9999) pVtxId = 0;
92 if(iV->trackWeight(pPF->
trackRef())>0) {
110 if(closestVtx == 0) pReco.
vtxId = -1;
111 if(closestVtx != 0) pReco.
vtxId = pVtxId;
116 if(closestVtx != 0 && pVtxId == 0 && fabs(pReco.
charge) > 0) pReco.
id = 1;
117 if(closestVtx != 0 && pVtxId > 0 && fabs(pReco.
charge) > 0) pReco.
id = 2;
119 if(
fUseDZ && pDZ > -9999 && closestVtx == 0 && (fabs(pDZ) <
fDZCut) && fabs(pReco.
charge) > 0) pReco.
id = 1;
120 if(
fUseDZ && pDZ > -9999 && closestVtx == 0 && (fabs(pDZ) >
fDZCut) && fabs(pReco.
charge) > 0) pReco.
id = 2;
133 lPupFiller.
insert(hPFProduct,lWeights.begin(),lWeights.end());
146 const std::vector<fastjet::PseudoJet> lCandidates =
fPuppiContainer->puppiParticles();
150 std::vector<reco::CandidatePtr>
values(hPFProduct->size());
153 for (
auto i0 = hPFProduct->begin(),
154 i0begin = hPFProduct->begin(),
155 i0end = hPFProduct->end(); i0 != i0end; ++i0 ) {
162 int val = i0 - i0begin;
165 auto puppiMatched = find_if( lCandidates.begin(), lCandidates.end(), [&val]( fastjet::PseudoJet
const &
i ){
return i.user_index() == val; } );
166 if ( puppiMatched != lCandidates.end() ) {
167 pVec.SetPxPyPzE(puppiMatched->px(),puppiMatched->py(),puppiMatched->pz(),puppiMatched->E());
169 pVec.SetPxPyPzE( 0, 0, 0, 0);
172 puppiP4s.push_back( pVec );
178 p4PupFiller.
insert(hPFProduct,puppiP4s.begin(), puppiP4s.end() );
182 iEvent.
put(p4PupOut);
184 for(
unsigned int ic=0, nc = oh->size(); ic < nc; ++ic) {
virtual float dz(size_t ipv=0) const
dz with respect to the PV[ipv]
T getParameter(std::string const &) const
virtual void produce(edm::Event &, const edm::EventSetup &)
bool isNonnull() const
Checks for non-null.
bool getByToken(EDGetToken token, Handle< PROD > &result) const
std::vector< reco::PFCandidate > PFOutputCollection
#define DEFINE_FWK_MODULE(type)
void insert(const H &h, I begin, I end)
std::vector< RecoObj > fRecoObjCollection
virtual void setP4(const LorentzVector &p4)
set 4-momentum
std::vector< Vertex > VertexCollection
collection of Vertex objects
std::vector< LorentzVector > LorentzVectorCollection
math::XYZTLorentzVector LorentzVector
const reco::VertexRef vertexRef() const
std::unique_ptr< PuppiContainer > fPuppiContainer
edm::EDGetTokenT< VertexCollection > tokenVertices_
reco::TrackRef trackRef() const
void addDefault(ParameterSetDescription const &psetDescription)
const_iterator begin() const
OrphanHandle< PROD > put(std::auto_ptr< PROD > product)
Put a new product.
const PVAssoc fromPV(size_t ipv=0) const
PuppiProducer(const edm::ParameterSet &)
virtual void beginRun(edm::Run &, edm::EventSetup const &)
virtual void endLuminosityBlock(edm::LuminosityBlock &, edm::EventSetup const &)
T const * product() const
static void fillDescriptions(edm::ConfigurationDescriptions &descriptions)
ParticleType translatePdgIdToType(int pdgid) const
Particle reconstructed by the particle flow algorithm.
boost::indirect_iterator< typename seq_t::const_iterator > const_iterator
reco::GsfTrackRef gsfTrackRef() const
edm::EDGetTokenT< CandidateView > tokenPFCandidates_
std::auto_ptr< PFOutputCollection > fPuppiCandidates
const_iterator end() const
virtual void endRun(edm::Run &, edm::EventSetup const &)
virtual void beginLuminosityBlock(edm::LuminosityBlock &, edm::EventSetup const &)
virtual float dxy() const
dxy with respect to the PV ref