8 , srcUnshiftedObjectsToken_(consumes<
CandidateView>(cfg.getParameter<edm::InputTag>(
"srcUnshiftedObjects")))
9 , srcShiftedObjectsToken_(consumes<
CandidateView>(cfg.getParameter<edm::InputTag>(
"srcShiftedObjects")))
15 produces<reco::PFCandidateCollection>();
37 unshiftedObject != unshiftedObjects->end(); ++unshiftedObject ) {
38 bool isMatched_Object =
false;
39 double dRbestMatch_Object = 1.e+3;
42 shiftedObject != shiftedObjects->end(); ++shiftedObject ) {
43 double dR =
deltaR(unshiftedObject->p4(), shiftedObject->p4());
45 shiftedObjectP4_matched = shiftedObject->p4();
46 isMatched_Object =
true;
47 dRbestMatch_Object =
dR;
50 if ( isMatched_Object ) {
57 for ( reco::PFCandidateCollection::const_iterator originalPFCandidate = originalPFCandidates->begin();
58 originalPFCandidate != originalPFCandidates->end(); ++originalPFCandidate ) {
61 bool applyShift =
false;
62 double dRbestMatch_PFCandidate = 1.e+3;
63 for ( std::vector<objectEntryType>::const_iterator
object =
objects_.begin();
65 if ( !
object->isValidMatch_ )
continue;
66 double dR =
deltaR(originalPFCandidate->p4(),
object->unshiftedObjectP4_);
68 shift =
object->shift_;
70 dRbestMatch_PFCandidate =
dR;
75 if ( applyShift ) shiftedPFCandidateP4 *= (1. +
shift);
78 shiftedPFCandidate.
setP4(shiftedPFCandidateP4);
80 shiftedPFCandidates->push_back(shiftedPFCandidate);
83 evt.
put(shiftedPFCandidates);
T getParameter(std::string const &) const
std::vector< objectEntryType > objects_
boost::indirect_iterator< typename seq_t::const_iterator > const_iterator
edm::EDGetTokenT< CandidateView > srcUnshiftedObjectsToken_
~ShiftedPFCandidateProducerForPFMEtMVA()
bool getByToken(EDGetToken token, Handle< PROD > &result) const
#define DEFINE_FWK_MODULE(type)
bool exists(std::string const ¶meterName) const
checks if a parameter exists
double dRmatch_PFCandidate_
void produce(edm::Event &, const edm::EventSetup &)
OrphanHandle< PROD > put(std::auto_ptr< PROD > product)
Put a new product.
edm::EDGetTokenT< CandidateView > srcShiftedObjectsToken_
ShiftedPFCandidateProducerForPFMEtMVA(const edm::ParameterSet &)
double deltaR(double eta1, double eta2, double phi1, double phi2)
std::vector< reco::PFCandidate > PFCandidateCollection
collection of PFCandidates
math::XYZTLorentzVector LorentzVector
Lorentz vector.
Particle reconstructed by the particle flow algorithm.
virtual void setP4(const LorentzVector &p4) GCC11_FINAL
set 4-momentum
static unsigned int const shift
edm::EDGetTokenT< reco::PFCandidateCollection > srcPFCandidatesToken_