Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2021-07-07 22:33:28

0001 #ifndef L1Trigger_TrackFindingTracklet_interface_Track_h
0002 #define L1Trigger_TrackFindingTracklet_interface_Track_h
0003 
0004 #include <iostream>
0005 #include <fstream>
0006 #include <cassert>
0007 #include <cmath>
0008 #include <vector>
0009 #include <map>
0010 
0011 #include "L1Trigger/TrackFindingTracklet/interface/Settings.h"
0012 #include "L1Trigger/TrackFindingTracklet/interface/Util.h"
0013 #include "L1Trigger/TrackFindingTracklet/interface/SLHCEvent.h"
0014 #include "L1Trigger/TrackFindingTracklet/interface/TrackPars.h"
0015 
0016 namespace trklet {
0017 
0018   class Track {
0019   public:
0020     Track(TrackPars<int> ipars,
0021           int ichisqrphi,
0022           int ichisqrz,
0023           double chisqrphi,
0024           double chisqrz,
0025           int hitpattern,
0026           std::map<int, int> stubID,
0027           const std::vector<L1TStub>& l1stub,
0028           int seed);
0029 
0030     ~Track() = default;
0031 
0032     void setDuplicate(bool flag) { duplicate_ = flag; }
0033     void setSector(int nsec) { sector_ = nsec; }
0034     void setStubIDpremerge(std::vector<std::pair<int, int>> stubIDpremerge) { stubIDpremerge_ = stubIDpremerge; }
0035     void setStubIDprefit(std::vector<std::pair<int, int>> stubIDprefit) { stubIDprefit_ = stubIDprefit; }
0036 
0037     const TrackPars<int>& pars() const { return ipars_; }
0038 
0039     int ichisq() const { return ichisqrphi_ + ichisqrz_; }
0040 
0041     const std::map<int, int>& stubID() const { return stubID_; }
0042     const std::vector<L1TStub>& stubs() const { return l1stub_; }
0043 
0044     //These are not used? Should be removed?
0045     const std::vector<std::pair<int, int>>& stubIDpremerge() const { return stubIDpremerge_; }
0046     const std::vector<std::pair<int, int>>& stubIDprefit() const { return stubIDprefit_; }
0047 
0048     int hitpattern() const { return hitpattern_; }
0049     int seed() const { return seed_; }
0050     int duplicate() const { return duplicate_; }
0051     int sector() const { return sector_; }
0052 
0053     double pt(Settings const& settings) const {
0054       return (settings.c() * settings.bfield() * 0.01) / (ipars_.rinv() * settings.krinvpars());
0055     }
0056 
0057     double phi0(Settings const& settings) const;
0058 
0059     double eta(Settings const& settings) const { return asinh(ipars_.t() * settings.ktpars()); }
0060     double tanL(Settings const& settings) const { return ipars_.t() * settings.ktpars(); }
0061     double z0(Settings const& settings) const { return ipars_.z0() * settings.kz0pars(); }
0062     double rinv(Settings const& settings) const { return ipars_.rinv() * settings.krinvpars(); }
0063     double d0(Settings const& settings) const { return ipars_.d0() * settings.kd0pars(); }
0064     double chisq() const { return chisqrphi_ + chisqrz_; }
0065 
0066     double chisqrphi() const { return chisqrphi_; }
0067     double chisqrz() const { return chisqrz_; }
0068 
0069     int nPSstubs() const {
0070       int npsstubs = 0;
0071       for (const auto& istub : l1stub_) {
0072         if (istub.layer() < N_PSLAYER)
0073           npsstubs++;
0074       }
0075       return npsstubs;
0076     }
0077 
0078   private:
0079     TrackPars<int> ipars_;
0080     int ichisqrphi_;
0081     int ichisqrz_;
0082 
0083     double chisqrphi_;
0084     double chisqrz_;
0085 
0086     int hitpattern_;
0087 
0088     std::vector<std::pair<int, int>> stubIDpremerge_;
0089     std::vector<std::pair<int, int>> stubIDprefit_;
0090     std::map<int, int> stubID_;
0091     std::vector<L1TStub> l1stub_;
0092 
0093     unsigned int nstubs_;
0094     int seed_;
0095     bool duplicate_;
0096     int sector_;
0097   };
0098 
0099 };  // namespace trklet
0100 #endif