8 : moduleLabel_(cfg.getParameter<
std::
string>(
"@module_label")),
18 produces<reco::PFCandidateCollection>();
37 std::vector<bool>
match(shiftedObjects->
size(),
false);
42 unshiftedObject != unshiftedObjects->
end();
44 bool isMatched_Object =
false;
54 double dR2 =
deltaR2(unshiftedObject->p4(), shiftedObject->p4());
56 shiftedObjectP4_matched = shiftedObject->p4();
57 isMatched_Object =
true;
58 dR2bestMatch_Object = dR2;
64 if (isMatched_Object) {
66 match[prevMatch] =
true;
73 auto shiftedPFCandidates = std::make_unique<reco::PFCandidateCollection>();
75 for (reco::PFCandidateCollection::const_iterator originalPFCandidate = originalPFCandidates->begin();
76 originalPFCandidate != originalPFCandidates->end();
77 ++originalPFCandidate) {
79 bool applyShift =
false;
80 double dR2bestMatch_PFCandidate =
dRDefault;
84 for (std::vector<objectEntryType>::const_iterator
object =
objects_.begin();
object !=
objects_.end(); ++
object) {
85 if (!
object->isValidMatch_)
90 double dR2 =
deltaR2(originalPFCandidate->p4(),
object->unshiftedObjectP4_);
92 shift =
object->shift_;
94 dR2bestMatch_PFCandidate = dR2;
104 match[prevMatch] =
true;
106 shiftedPFCandidateP4 *= (1. +
shift);
110 shiftedPFCandidate.
setP4(shiftedPFCandidateP4);
112 shiftedPFCandidates->push_back(shiftedPFCandidate);
double dRmatch_PFCandidate_
T getParameter(std::string const &) const
OrphanHandle< PROD > put(std::unique_ptr< PROD > product)
Put a new product.
bool getByToken(EDGetToken token, Handle< PROD > &result) const
~ShiftedPFCandidateProducerForPFMVAMEt() override
double dR2match_PFCandidate_
bool exists(std::string const ¶meterName) const
checks if a parameter exists
std::vector< objectEntryType > objects_
#define DEFINE_FWK_MODULE(type)
const_iterator begin() const
ShiftedPFCandidateProducerForPFMVAMEt(const edm::ParameterSet &)
std::vector< reco::PFCandidate > PFCandidateCollection
collection of PFCandidates
edm::EDGetTokenT< CandidateView > srcShiftedObjectsToken_
math::XYZTLorentzVector LorentzVector
Lorentz vector.
Particle reconstructed by the particle flow algorithm.
boost::indirect_iterator< typename seq_t::const_iterator > const_iterator
static unsigned int const shift
const_iterator end() const
std::pair< typename Association::data_type::first_type, double > match(Reference key, Association association, bool bestMatchByMaxValue)
Generic matching function.
void produce(edm::Event &, const edm::EventSetup &) override
void setP4(const LorentzVector &p4) final
set 4-momentum
edm::EDGetTokenT< CandidateView > srcUnshiftedObjectsToken_
edm::EDGetTokenT< reco::PFCandidateCollection > srcPFCandidatesToken_