Vary energy of PFCandidates coinciding in eta-phi with selected electrons/muons/tau-jets/jets by electron/muon/tau-jet/jet energy uncertainty.
NOTE: Auxiliary class specific to estimating systematic uncertainty on PFMET reconstructed by MVA-based algorithm (implemented in RecoMET/METPUSubtraction/src/PFMETProducerMVA.cc)
- Author
- Christian Veelken, LLR
Definition at line 30 of file ShiftedPFCandidateProducerForPFMVAMEt.cc.
◆ CandidateView
◆ ShiftedPFCandidateProducerForPFMVAMEt()
ShiftedPFCandidateProducerForPFMVAMEt::ShiftedPFCandidateProducerForPFMVAMEt |
( |
const edm::ParameterSet & |
cfg | ) |
|
|
explicit |
◆ ~ShiftedPFCandidateProducerForPFMVAMEt()
ShiftedPFCandidateProducerForPFMVAMEt::~ShiftedPFCandidateProducerForPFMVAMEt |
( |
| ) |
|
|
override |
◆ produce()
Definition at line 96 of file ShiftedPFCandidateProducerForPFMVAMEt.cc.
108 std::vector<bool>
match(shiftedObjects->
size(),
false);
113 unshiftedObject != unshiftedObjects->
end();
115 bool isMatched_Object =
false;
125 double dR2 =
deltaR2(unshiftedObject->p4(), shiftedObject->p4());
127 shiftedObjectP4_matched = shiftedObject->p4();
128 isMatched_Object =
true;
129 dR2bestMatch_Object = dR2;
135 if (isMatched_Object) {
137 match[prevMatch] =
true;
138 objects_.push_back(objectEntryType(shiftedObjectP4_matched, unshiftedObject->p4(),
sqrt(dR2bestMatch_Object)));
144 auto shiftedPFCandidates = std::make_unique<reco::PFCandidateCollection>();
146 for (reco::PFCandidateCollection::const_iterator originalPFCandidate = originalPFCandidates->begin();
147 originalPFCandidate != originalPFCandidates->end();
148 ++originalPFCandidate) {
150 bool applyShift =
false;
151 double dR2bestMatch_PFCandidate =
dRDefault;
155 for (std::vector<objectEntryType>::const_iterator
object =
objects_.begin();
object !=
objects_.end(); ++
object) {
156 if (!
object->isValidMatch_)
161 double dR2 =
deltaR2(originalPFCandidate->p4(),
object->unshiftedObjectP4_);
163 shift =
object->shift_;
165 dR2bestMatch_PFCandidate = dR2;
175 match[prevMatch] =
true;
177 shiftedPFCandidateP4 *= (1. +
shift);
181 shiftedPFCandidate.setP4(shiftedPFCandidateP4);
183 shiftedPFCandidates->push_back(shiftedPFCandidate);
References edm::View< T >::begin(), HLTMuonOfflineAnalyzer_cfi::deltaR2, dR2match_Object_, dR2match_PFCandidate_, dRDefault, edm::View< T >::end(), edm::Event::getByToken(), match(), eostools::move(), resolutioncreator_cfi::object, objects_, edm::Event::put(), reco::LeafCandidate::setP4(), edm::shift, edm::View< T >::size(), mathSSE::sqrt(), srcPFCandidatesToken_, srcShiftedObjectsToken_, and srcUnshiftedObjectsToken_.
◆ dR2match_Object_
double ShiftedPFCandidateProducerForPFMVAMEt::dR2match_Object_ |
|
private |
◆ dR2match_PFCandidate_
double ShiftedPFCandidateProducerForPFMVAMEt::dR2match_PFCandidate_ |
|
private |
◆ dRmatch_Object_
double ShiftedPFCandidateProducerForPFMVAMEt::dRmatch_Object_ |
|
private |
◆ dRmatch_PFCandidate_
double ShiftedPFCandidateProducerForPFMVAMEt::dRmatch_PFCandidate_ |
|
private |
◆ moduleLabel_
std::string ShiftedPFCandidateProducerForPFMVAMEt::moduleLabel_ |
|
private |
◆ objects_
std::vector<objectEntryType> ShiftedPFCandidateProducerForPFMVAMEt::objects_ |
|
private |
◆ srcPFCandidatesToken_
◆ srcShiftedObjectsToken_
◆ srcUnshiftedObjectsToken_
std::pair< typename Association::data_type::first_type, double > match(Reference key, Association association, bool bestMatchByMaxValue)
Generic matching function.