79 const reco::VertexCollection::const_iterator vtxEnd = pvCol->end();
80 for (reco::VertexCollection::const_iterator vtxIter = pvCol->begin(); vtxEnd != vtxIter; ++vtxIter) {
90 pReco.
pt = itPF->pt();
91 pReco.
eta = itPF->eta();
92 pReco.
phi = itPF->phi();
93 pReco.
m = itPF->mass();
95 pReco.
charge = itPF->charge();
106 int closestVtxForUnassociateds = -9999;
107 for(reco::VertexCollection::const_iterator iV = pvCol->begin(); iV!=pvCol->end(); ++iV) {
114 if(pDZ > -9999) pVtxId = 0;
116 if(iV->trackWeight(pPF->
trackRef())>0) {
121 double tmpdz = 99999;
124 if (fabs(tmpdz) < curdz){
126 closestVtxForUnassociateds = pVtxId;
133 if (closestVtx != 0 && fabs(pReco.
charge) > 0 && pVtxId > 0) tmpFromPV = 0;
134 if (closestVtx != 0 && fabs(pReco.
charge) > 0 && pVtxId == 0) tmpFromPV = 3;
135 if (closestVtx == 0 && fabs(pReco.
charge) > 0 && closestVtxForUnassociateds == 0) tmpFromPV = 2;
136 if (closestVtx == 0 && fabs(pReco.
charge) > 0 && closestVtxForUnassociateds != 0) tmpFromPV = 1;
140 if (fabs(pReco.
charge) == 0){ pReco.
id = 0; }
142 if (tmpFromPV == 0){ pReco.
id = 2; }
143 if (tmpFromPV == 3){ pReco.
id = 1; }
144 if (tmpFromPV == 1 || tmpFromPV == 2){
161 if (fabs(pReco.
charge) == 0){ pReco.
id = 0; }
162 if (fabs(pReco.
charge) > 0){
163 if (lPack->
fromPV() == 0){ pReco.
id = 2; }
182 std::vector<double> lWeights;
183 std::vector<fastjet::PseudoJet> lCandidates;
194 float curpupweight = -1.;
204 lWeights.push_back(curpupweight);
205 fastjet::PseudoJet curjet( curpupweight*lPack->
px(), curpupweight*lPack->
py(), curpupweight*lPack->
pz(), curpupweight*lPack->
energy());
206 curjet.set_user_index(lPackCtr);
207 lCandidates.push_back(curjet);
215 lPupFiller.insert(hPFProduct,lWeights.begin(),lWeights.end());
230 std::vector<reco::CandidatePtr>
values(hPFProduct->size());
233 for (
auto i0 = hPFProduct->begin(),
234 i0begin = hPFProduct->begin(),
235 i0end = hPFProduct->end(); i0 != i0end; ++i0 ) {
242 int val = i0 - i0begin;
245 auto puppiMatched = find_if( lCandidates.begin(), lCandidates.end(), [&val]( fastjet::PseudoJet
const &
i ){
return i.user_index() == val; } );
246 if ( puppiMatched != lCandidates.end() ) {
247 pVec.SetPxPyPzE(puppiMatched->px(),puppiMatched->py(),puppiMatched->pz(),puppiMatched->E());
250 pVec.SetPxPyPzE( 0, 0, 0, 0);
253 puppiP4s.push_back( pVec );
255 pCand.setSourceCandidatePtr( i0->sourceCandidatePtr(0) );
261 p4PupFiller.insert(hPFProduct,puppiP4s.begin(), puppiP4s.end() );
265 iEvent.
put(p4PupOut);
267 for(
unsigned int ic=0, nc = oh->size(); ic < nc; ++ic) {
274 filler.insert(hPFProduct,
values.begin(),
values.end());
284 std::auto_ptr<std::vector<double> > theAlphas(
new std::vector<double>(
fPuppiContainer->puppiAlphas()));
285 std::auto_ptr<std::vector<double> > theAlphasMed(
new std::vector<double>(
fPuppiContainer->puppiAlphasMed()));
286 std::auto_ptr<std::vector<double> > theAlphasRms(
new std::vector<double>(
fPuppiContainer->puppiAlphasRMS()));
287 std::auto_ptr<std::vector<double> > alphas(
new std::vector<double>(
fPuppiContainer->puppiRawAlphas()));
288 std::auto_ptr<double> nalgos(
new double(
fPuppiContainer->puppiNAlgos()));
290 iEvent.
put(alphas,
"PuppiRawAlphas");
291 iEvent.
put(nalgos,
"PuppiNAlgos");
292 iEvent.
put(theAlphas,
"PuppiAlphas");
293 iEvent.
put(theAlphasMed,
"PuppiAlphasMed");
294 iEvent.
put(theAlphasRms,
"PuppiAlphasRms");
float puppiWeight() const
Set both weights at once (with option for only full PUPPI)
virtual float dz(size_t ipv=0) const
dz with respect to the PV[ipv]
bool isNonnull() const
Checks for non-null.
bool getByToken(EDGetToken token, Handle< PROD > &result) const
std::vector< reco::PFCandidate > PFOutputCollection
std::vector< RecoObj > fRecoObjCollection
std::vector< Vertex > VertexCollection
collection of Vertex objects
const reco::VertexRef vertexRef() const
std::unique_ptr< PuppiContainer > fPuppiContainer
edm::EDGetTokenT< VertexCollection > tokenVertices_
reco::TrackRef trackRef() const
const_iterator begin() const
OrphanHandle< PROD > put(std::auto_ptr< PROD > product)
Put a new product.
const PVAssoc fromPV(size_t ipv=0) const
virtual double py() const
y coordinate of momentum vector
virtual double energy() const
energy
std::vector< LorentzVector > LorentzVectorCollection
T const * product() const
ParticleType translatePdgIdToType(int pdgid) const
ROOT::Math::LorentzVector< ROOT::Math::PxPyPzE4D< float > > LorentzVector
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 double px() const
x coordinate of momentum vector
virtual float dxy() const
dxy with respect to the PV ref
virtual double pz() const
z coordinate of momentum vector