Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2023-12-05 03:11:45

0001 #ifndef DataFormatsL1TCorrelator_TkElectron_h
0002 #define DataFormatsL1TCorrelator_TkElectron_h
0003 
0004 // -*- C++ -*-
0005 //
0006 // Package:     L1Trigger
0007 // Class  :     TkEm
0008 //
0009 
0010 #include "DataFormats/Common/interface/Ptr.h"
0011 
0012 #include "DataFormats/L1Trigger/interface/EGamma.h"
0013 
0014 #include "DataFormats/L1TCorrelator/interface/TkEm.h"
0015 #include "DataFormats/L1TCorrelator/interface/TkEmFwd.h"
0016 
0017 #include "DataFormats/L1TrackTrigger/interface/TTTypes.h"
0018 
0019 #include <vector>
0020 
0021 namespace l1t {
0022 
0023   class TkElectron : public TkEm {
0024   public:
0025     typedef TTTrack<Ref_Phase2TrackerDigi_> L1TTTrackType;
0026     typedef std::vector<L1TTTrackType> L1TTTrackCollection;
0027 
0028     TkElectron();
0029 
0030     TkElectron(const LorentzVector& p4,
0031                const edm::Ptr<L1Candidate>& egCaloPtr,
0032                const edm::Ptr<L1TTTrackType>& trkPtr,
0033                float tkisol = -999.);
0034 
0035     TkElectron(const LorentzVector& p4, float tkisol = -999.);
0036 
0037     // ---------- const member functions ---------------------
0038 
0039     const edm::Ptr<L1TTTrackType>& trkPtr() const { return trkPtr_; }
0040 
0041     float trkzVtx() const { return trkzVtx_; }
0042     float idScore() const { return idScore_; }
0043     // ---------- member functions ---------------------------
0044 
0045     void setTrkPtr(const edm::Ptr<L1TTTrackType>& tkPtr) { trkPtr_ = tkPtr; }
0046     void setTrkzVtx(float TrkzVtx) { trkzVtx_ = TrkzVtx; }
0047     void setIdScore(float score) { idScore_ = score; }
0048 
0049     l1gt::Electron hwObj() const {
0050       if (encoding() != HWEncoding::GT) {
0051         throw cms::Exception("RuntimeError") << "TkElectron::hwObj : encoding is not in GT format!" << std::endl;
0052       }
0053       return l1gt::Electron::unpack_ap(egBinaryWord<l1gt::Electron::BITWIDTH>());
0054     }
0055 
0056   private:
0057     edm::Ptr<L1TTTrackType> trkPtr_;
0058     float trkzVtx_;
0059     float idScore_;
0060   };
0061 }  // namespace l1t
0062 #endif