45 produces<PFOutputCollection>();
46 produces< edm::ValueMap<reco::CandidatePtr> >();
60 std::vector<const reco::Candidate*> phoCands;
61 std::vector<uint16_t> phoIndx;
73 bool passObject =
false;
74 if(itPho->isPhoton() &&
usePhotonId_) passObject = (*photonId) [phoCol->
ptrAt(iC)];
75 if(itPho->pt() <
pt_)
continue;
83 phoIndx.push_back(ref.key());
84 phoCands.push_back(&(*(pfCol->
ptrAt(ref.key()))));
93 phoIndx.push_back(ref.key());
94 phoCands.push_back(&(*(pfCol->
ptrAt(ref.key()))));
103 std::vector<reco::CandidatePtr>
values(hPFProduct->size());
105 std::vector<float> lWeights;
108 std::vector<int> foundPhoIndex;
118 for(std::vector<const reco::Candidate*>::iterator itPho = phoCands.begin(); itPho!=phoCands.end(); itPho++) {
122 if(!
useValueMap_ && itPF->pt() != 0) pWeight = pWeight*(phoCands[iPho]->
pt()/itPF->pt());
123 if(!
useValueMap_ && itPF->pt() == 0) pVec.SetPxPyPzE(phoCands[iPho]->px()*pWeight,phoCands[iPho]->py()*pWeight,phoCands[iPho]->pz()*pWeight,phoCands[iPho]->energy()*pWeight);
124 foundPhoIndex.push_back(iPho);
128 for(std::vector<uint16_t>::const_iterator itPho = phoIndx.begin(); itPho!=phoIndx.end(); itPho++) {
130 if(pupCol->
refAt(iPF).key() != *itPho)
continue;
132 if(!
useValueMap_ && itPF->pt() != 0) pWeight = pWeight*(phoCands[iPho]->
pt()/itPF->pt());
133 if(!
useValueMap_ && itPF->pt() == 0) pVec.SetPxPyPzE(phoCands[iPho]->px()*pWeight,phoCands[iPho]->py()*pWeight,phoCands[iPho]->pz()*pWeight,phoCands[iPho]->energy()*pWeight);
134 foundPhoIndex.push_back(iPho);
137 if(itPF->pt() != 0) pVec.SetPxPyPzE(itPF->px()*pWeight,itPF->py()*pWeight,itPF->pz()*pWeight,itPF->energy()*pWeight);
139 lWeights.push_back(pWeight);
141 puppiP4s.push_back( pVec );
147 for(
unsigned int iPho = 0; iPho < phoCands.size(); iPho++) {
149 for(
unsigned int jPho = 0; jPho < foundPhoIndex.size(); jPho++) {
150 if(foundPhoIndex[jPho] ==
int(iPho)) {
163 puppiP4s.push_back( pVec );
168 for(
unsigned int ic=0, nc = pupCol->
size(); ic < nc; ++ic) {
181 for(
unsigned int i0 = 0; i0 <
pdgIds_.size(); i0++) {
std::vector< int32_t > pdgIds_
T getParameter(std::string const &) const
Analysis-level Photon class.
edm::EDGetTokenT< CandidateView > tokenPhotonCandidates_
PuppiPhoton(const edm::ParameterSet &)
bool getByToken(EDGetToken token, Handle< PROD > &result) const
Ptr< value_type > ptrAt(size_type i) const
std::vector< reco::PFCandidate > PFOutputCollection
#define DEFINE_FWK_MODULE(type)
std::auto_ptr< PFOutputCollection > corrCandidates_
void insert(const H &h, I begin, I end)
edm::RefVector< pat::PackedCandidateCollection > associatedPackedPFCandidates() const
References to PFCandidates linked to this object (e.g. for isolation vetos or masking before jet recl...
void setSourceCandidatePtr(const PFCandidatePtr &ptr)
edm::EDGetTokenT< CandidateView > tokenPuppiCandidates_
RefToBase< value_type > refAt(size_type i) const
void addDefault(ParameterSetDescription const &psetDescription)
const_iterator begin() const
OrphanHandle< PROD > put(std::auto_ptr< PROD > product)
Put a new product.
Abs< T >::type abs(const T &t)
virtual void produce(edm::Event &, const edm::EventSetup &)
bool matchPFCandidate(const reco::Candidate *iPF, const reco::Candidate *iPho)
double deltaR(double eta1, double eta2, double phi1, double phi2)
virtual int pdgId() const =0
PDG identifier.
T const * product() const
edm::EDGetTokenT< edm::ValueMap< float > > tokenWeights_
Analysis-level electron class.
virtual void setP4(const LorentzVector &p4) final
set 4-momentum
ParticleType translatePdgIdToType(int pdgid) const
std::vector< double > dRMatch_
Particle reconstructed by the particle flow algorithm.
boost::indirect_iterator< typename seq_t::const_iterator > const_iterator
edm::EDGetTokenT< edm::ValueMap< bool > > tokenPhotonId_
const_iterator end() const
math::XYZTLorentzVector LorentzVector
edm::EDGetTokenT< CandidateView > tokenPFCandidates_
edm::RefVector< pat::PackedCandidateCollection > associatedPackedPFCandidates() const
References to PFCandidates linked to this object (e.g. for isolation vetos or masking before jet recl...
std::vector< LorentzVector > LorentzVectorCollection
static void fillDescriptions(edm::ConfigurationDescriptions &descriptions)
virtual double phi() const =0
momentum azimuthal angle
virtual double eta() const =0
momentum pseudorapidity