10 : moduleLabel_(cfg.getParameter<std::
string>(
"@module_label"))
20 produces<reco::PFCandidateCollection>();
43 for ( CandidateView::const_iterator unshiftedObject = unshiftedObjects->begin();
44 unshiftedObject != unshiftedObjects->end(); ++unshiftedObject ) {
45 bool isMatched_Object =
false;
46 double dRbestMatch_Object = 1.e+3;
48 for ( CandidateView::const_iterator shiftedObject = shiftedObjects->begin();
49 shiftedObject != shiftedObjects->end(); ++shiftedObject ) {
50 double dR =
deltaR(unshiftedObject->p4(), shiftedObject->p4());
52 shiftedObjectP4_matched = shiftedObject->p4();
53 isMatched_Object =
true;
54 dRbestMatch_Object =
dR;
57 if ( isMatched_Object ) {
64 for ( reco::PFCandidateCollection::const_iterator originalPFCandidate = originalPFCandidates->begin();
65 originalPFCandidate != originalPFCandidates->end(); ++originalPFCandidate ) {
68 bool applyShift =
false;
69 double dRbestMatch_PFCandidate = 1.e+3;
70 for ( std::vector<objectEntryType>::const_iterator
object =
objects_.begin();
72 if ( !
object->isValidMatch_ )
continue;
73 double dR =
deltaR(originalPFCandidate->p4(),
object->unshiftedObjectP4_);
75 shift =
object->shift_;
77 dRbestMatch_PFCandidate =
dR;
82 if ( applyShift ) shiftedPFCandidateP4 *= (1. +
shift);
85 shiftedPFCandidate.
setP4(shiftedPFCandidateP4);
87 shiftedPFCandidates->push_back(shiftedPFCandidate);
90 evt.
put(shiftedPFCandidates);
T getParameter(std::string const &) const
std::vector< objectEntryType > objects_
~ShiftedPFCandidateProducerForPFMEtMVA()
#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 &)
edm::InputTag srcUnshiftedObjects_
OrphanHandle< PROD > put(std::auto_ptr< PROD > product)
Put a new product.
bool getByLabel(InputTag const &tag, Handle< PROD > &result) const
ShiftedPFCandidateProducerForPFMEtMVA(const edm::ParameterSet &)
edm::InputTag srcPFCandidates_
double deltaR(double eta1, double eta2, double phi1, double phi2)
edm::InputTag srcShiftedObjects_
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::View< Candidate > CandidateView
view of a collection containing candidates