File indexing completed on 2025-02-13 02:58:34
0001 #ifndef Validation_HLTrigger_HLTGenValObject_h
0002 #define Validation_HLTrigger_HLTGenValObject_h
0003
0004
0005
0006
0007
0008
0009
0010
0011
0012
0013
0014 #include "DataFormats/HepMCCandidate/interface/GenParticle.h"
0015 #include "DataFormats/JetReco/interface/GenJet.h"
0016 #include "DataFormats/HLTReco/interface/TriggerObject.h"
0017
0018 #include "DataFormats/Math/interface/LorentzVector.h"
0019 #include <vector>
0020
0021 class HLTGenValObject {
0022 public:
0023
0024 HLTGenValObject() : trigObject_(0, 0., 0., 0., 0.) {}
0025
0026
0027 HLTGenValObject(const reco::GenParticle &p)
0028 : p4Polar_(p.p4()), p4Cartesian_(p.p4()), trigObject_(0, 0., 0., 0., 0.) {}
0029
0030
0031 HLTGenValObject(const reco::GenJet &p) : p4Polar_(p.p4()), p4Cartesian_(p.p4()), trigObject_(0, 0., 0., 0., 0.) {}
0032
0033
0034 HLTGenValObject(const reco::Candidate::PolarLorentzVector &p)
0035 : p4Polar_(p), p4Cartesian_(p), trigObject_(0, 0., 0., 0., 0.) {}
0036
0037
0038 double pt() const { return p4Polar_.pt(); }
0039 double eta() const { return p4Polar_.eta(); }
0040 double phi() const { return p4Polar_.phi(); }
0041 double et() const { return (pt() <= 0) ? 0 : p4Cartesian_.Et(); }
0042 double mass() const { return p4Cartesian_.mass(); }
0043
0044 double hasTrigObject() const { return trigObject_.pt() > 0; }
0045 const trigger::TriggerObject &trigObject() const { return trigObject_; }
0046 void setTrigObject(const trigger::TriggerObject &trigObject) { trigObject_ = trigObject; }
0047 double ptRes() const { return pt() > 0 ? trigObject_.pt() / pt() : 0.; }
0048 double etaRes() const { return eta() > 0 ? trigObject_.eta() / eta() : 0.; }
0049 double phiRes() const { return phi() > 0 ? trigObject_.phi() / phi() : 0.; }
0050 double massRes() const { return mass() > 0 ? trigObject_.mass() / mass() : 0.; }
0051
0052 private:
0053
0054 math::PtEtaPhiMLorentzVector p4Polar_;
0055 math::XYZTLorentzVector p4Cartesian_;
0056 trigger::TriggerObject trigObject_;
0057 };
0058
0059 #endif