44 produces<PFOutputCollection>();
45 produces< edm::ValueMap<reco::CandidatePtr> >();
59 std::vector<const reco::Candidate*> phoCands;
60 std::vector<uint16_t> phoIndx;
72 bool passObject =
false;
73 if(itPho->isPhoton() &&
usePhotonId_) passObject = (*photonId) [phoCol->
ptrAt(iC)];
74 if(itPho->pt() <
pt_)
continue;
76 if(!
usePFRef_) phoCands.push_back(&(*itPho));
82 phoIndx.push_back(ref.key());
83 phoCands.push_back(&(*(pfCol->
ptrAt(ref.key()))));
92 phoIndx.push_back(ref.key());
93 phoCands.push_back(&(*(pfCol->
ptrAt(ref.key()))));
102 std::vector<reco::CandidatePtr>
values(hPFProduct->size());
104 std::vector<float> lWeights;
107 std::vector<int> foundPhoIndex;
116 for(std::vector<const reco::Candidate*>::iterator itPho = phoCands.begin(); itPho!=phoCands.end(); itPho++) {
121 for(std::vector<uint16_t>::const_iterator itPho = phoIndx.begin(); itPho!=phoIndx.end(); itPho++) {
123 if(pupCol->
refAt(iPF).key() != *itPho)
continue;
125 if(!
useValueMap_ && itPF->pt() != 0) pWeight = pWeight*(phoCands[iPho]->
pt()/itPF->pt());
126 foundPhoIndex.push_back(iPho); }
129 if(itPF->pt() != 0) pVec.SetPxPyPzE(itPF->px()*pWeight,itPF->py()*pWeight,itPF->pz()*pWeight,itPF->energy()*pWeight);
131 lWeights.push_back(pWeight);
133 puppiP4s.push_back( pVec );
139 for(
unsigned int iPho = 0; iPho < phoCands.size(); iPho++) {
141 for(
unsigned int jPho = 0; jPho < foundPhoIndex.size(); jPho++) {
142 if(foundPhoIndex[jPho] ==
int(iPho)) {
155 puppiP4s.push_back( pVec );
160 for(
unsigned int ic=0, nc = pupCol->
size(); ic < nc; ++ic) {
173 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