Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2022-04-01 23:54:06

0001 #ifndef PHASE2GMT_CONEVRTEDTTRACK
0002 #define PHASE2GMT_CONEVRTEDTTRACK
0003 #include "L1Trigger/Phase2L1GMT/interface/Constants.h"
0004 #include "DataFormats/L1TrackTrigger/interface/TTTypes.h"
0005 #include "FWCore/MessageLogger/interface/MessageLogger.h"
0006 
0007 namespace Phase2L1GMT {
0008 
0009   class ConvertedTTTrack {
0010   public:
0011     ConvertedTTTrack(const uint& charge,
0012                      const int& curvature,
0013                      const uint& abseta,
0014                      const uint& pt,
0015                      const int& eta,
0016                      const int& phi,
0017                      const int& z0,
0018                      const int& d0,
0019                      const int& quality,
0020                      const ap_uint<96>& word)
0021         : charge_(charge),
0022           curvature_(curvature),
0023           abseta_(abseta),
0024           pt_(pt),
0025           eta_(eta),
0026           phi_(phi),
0027           z0_(z0),
0028           d0_(d0),
0029           quality_(quality),
0030           word_(word) {}
0031 
0032     const uint charge() const { return charge_; }
0033 
0034     const int curvature() const { return curvature_; }
0035     const uint abseta() const { return abseta_; }
0036 
0037     const uint pt() const { return pt_; }
0038 
0039     const int eta() const { return eta_; }
0040     const int phi() const { return phi_; }
0041 
0042     void setPhi(int phi) { phi_ = phi; }
0043 
0044     const int z0() const { return z0_; }
0045     const int d0() const { return d0_; }
0046     const int quality() const { return quality_; }
0047     const float offline_pt() const { return offline_pt_; }
0048     const float offline_eta() const { return offline_eta_; }
0049     const float offline_phi() const { return offline_phi_; }
0050 
0051     const ap_uint<96>& word() const { return word_; }
0052     void setOfflineQuantities(float pt, float eta, float phi) {
0053       offline_pt_ = pt;
0054       offline_eta_ = eta;
0055       offline_phi_ = phi;
0056     }
0057 
0058     void print() const {
0059       LogDebug("ConvertedTTTrack") << "converted track : charge=" << charge_ << " curvature=" << curvature_
0060                                    << " pt=" << offline_pt_ << "," << pt_ << " eta=" << offline_eta_ << "," << eta_
0061                                    << " phi=" << offline_phi_ << "," << phi_ << " z0=" << z0_ << " d0=" << d0_
0062                                    << " quality=" << quality_;
0063     }
0064 
0065     void printWord() const {
0066       LogDebug("ConvertedTTTrack") << "converted track : word=" << std::setfill('0') << std::setw(8) << std::hex
0067                                    << (long long unsigned int)((word_ >> 64).to_uint64()) << std::setfill('0')
0068                                    << std::setw(16) << std::hex
0069                                    << (long long unsigned int)((word_ & 0xffffffffffffffff).to_uint64());
0070     }
0071 
0072     void setTrkPtr(const edm::Ptr<TTTrack<Ref_Phase2TrackerDigi_> >& trkPtr) { trkPtr_ = trkPtr; }
0073 
0074     const edm::Ptr<TTTrack<Ref_Phase2TrackerDigi_> > trkPtr() const { return trkPtr_; }
0075 
0076   private:
0077     uint charge_;
0078     int curvature_;
0079     uint abseta_;
0080     uint pt_;
0081     int eta_;
0082     int phi_;
0083     int z0_;
0084     int d0_;
0085     uint quality_;
0086     float offline_pt_;
0087     float offline_eta_;
0088     float offline_phi_;
0089     ap_uint<96> word_;
0090 
0091     edm::Ptr<TTTrack<Ref_Phase2TrackerDigi_> > trkPtr_;
0092   };
0093 }  // namespace Phase2L1GMT
0094 
0095 #endif