CMS 3D CMS Logo

ShiftedPFCandidateProducerByMatchedObject.h
Go to the documentation of this file.
1 #ifndef PhysicsTools_PatUtils_ShiftedPFCandidateProducerByMatchedObject_h
2 #define PhysicsTools_PatUtils_ShiftedPFCandidateProducerByMatchedObject_h
3 
18 
20 
23 
27 
28 #include <string>
29 #include <vector>
30 
32 public:
35 
36 private:
37  void produce(edm::Event&, const edm::EventSetup&) override;
38 
42 
47 
48  struct objectEntryType {
50  const reco::Candidate::LorentzVector& unshiftedObjectP4,
51  double dRmatch)
52  : shiftedObjectP4_(shiftedObjectP4),
53  unshiftedObjectP4_(unshiftedObjectP4),
54  dRmatch_(dRmatch),
56  if (unshiftedObjectP4.energy() > 0.) {
57  shift_ = (shiftedObjectP4.energy() / unshiftedObjectP4.energy()) - 1.;
58  isValidMatch_ = true;
59  }
60  }
64  double dRmatch_;
65  double shift_;
67  };
68 
69  std::vector<objectEntryType> objects_;
70 };
71 
72 #endif
objectEntryType(const reco::Candidate::LorentzVector &shiftedObjectP4, const reco::Candidate::LorentzVector &unshiftedObjectP4, double dRmatch)
edm::EDGetTokenT< edm::View< reco::Candidate > > srcShiftedObjects_
edm::EDGetTokenT< reco::PFCandidateCollection > srcPFCandidates_
edm::EDGetTokenT< edm::View< reco::Candidate > > srcUnshiftedObjects_
math::XYZTLorentzVector LorentzVector
Lorentz vector.
Definition: Candidate.h:37
void produce(edm::Event &, const edm::EventSetup &) override