Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2024-04-06 12:32:41

0001 #ifndef Validation_HLTrigger_HLTGenValObject_h
0002 #define Validation_HLTrigger_HLTGenValObject_h
0003 
0004 //********************************************************************************
0005 //
0006 // Description:
0007 //   This class is an object wrapper for the Generator level validation code.
0008 //   It handles the different type of objects the code needs to run on: GenParticles, GenJets and event-level energy sums
0009 //
0010 // Author : Finn Labe, UHH, Nov. 2021
0011 //
0012 //********************************************************************************
0013 
0014 #include "DataFormats/HepMCCandidate/interface/GenParticle.h"
0015 #include "DataFormats/JetReco/interface/GenJet.h"
0016 
0017 #include "DataFormats/Math/interface/LorentzVector.h"
0018 #include <vector>
0019 
0020 class HLTGenValObject {
0021 public:
0022   // empty constructor
0023   HLTGenValObject() {}
0024 
0025   // constructor from GenParticle
0026   HLTGenValObject(const reco::GenParticle &p) : p4Polar_(p.p4()), p4Cartesian_(p.p4()) {}
0027 
0028   // constructor from GenJet
0029   HLTGenValObject(const reco::GenJet &p) : p4Polar_(p.p4()), p4Cartesian_(p.p4()) {}
0030 
0031   // constructor from LorentzVector (for energy sums)
0032   HLTGenValObject(const reco::Candidate::PolarLorentzVector &p) : p4Polar_(p), p4Cartesian_(p) {}
0033 
0034   // object functions, for usage of HLTGenValObjects by other modules
0035   double pt() const { return p4Polar_.pt(); }
0036   double eta() const { return p4Polar_.eta(); }
0037   double phi() const { return p4Polar_.phi(); }
0038   double et() const { return (pt() <= 0) ? 0 : p4Cartesian_.Et(); }
0039 
0040 private:
0041   // containing information in two "shapes"
0042   math::PtEtaPhiMLorentzVector p4Polar_;
0043   math::XYZTLorentzVector p4Cartesian_;
0044 };
0045 
0046 #endif