Back to home page

Project CMSSW displayed by LXR

 
 

    


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

0001 #include "L1Trigger/TrackFindingTracklet/interface/Track.h"
0002 
0003 #include "DataFormats/Math/interface/deltaPhi.h"
0004 
0005 #include <algorithm>
0006 
0007 using namespace std;
0008 using namespace trklet;
0009 
0010 Track::Track(TrackPars<int> ipars,
0011              int ichisqrphi,
0012              int ichisqrz,
0013              double chisqrphi,
0014              double chisqrz,
0015              int hitpattern,
0016              std::map<int, int> stubID,
0017              const std::vector<L1TStub>& l1stub,
0018              int seed) {
0019   ipars_ = ipars;
0020   ichisqrphi_ = ichisqrphi;
0021   ichisqrz_ = ichisqrz;
0022 
0023   chisqrphi_ = chisqrphi;
0024   chisqrz_ = chisqrz;
0025 
0026   hitpattern_ = hitpattern;
0027 
0028   nstubs_ = std::max((int)l1stub.size(), (int)N_FITSTUB);
0029 
0030   stubID_ = stubID;
0031   l1stub_ = l1stub;
0032 
0033   seed_ = seed;
0034   duplicate_ = false;
0035   sector_ = -1;
0036 }
0037 
0038 double Track::phi0(Settings const& settings) const {
0039   double dphi = 2 * M_PI / N_SECTOR;
0040   double dphiHG = 0.5 * settings.dphisectorHG() - M_PI / N_SECTOR;
0041   double phimin = sector_ * dphi - dphiHG;
0042   double phimax = phimin + dphi + 2 * dphiHG;
0043   phimin -= M_PI / N_SECTOR;
0044   phimax -= M_PI / N_SECTOR;
0045   phimin = reco::reduceRange(phimin);
0046   phimax = reco::reduceRange(phimax);
0047   if (phimin > phimax)
0048     phimin -= 2 * M_PI;
0049   double phioffset = phimin;
0050 
0051   double phi0 = ipars_.phi0() * settings.kphi0pars() + phioffset;
0052   phi0 = reco::reduceRange(phi0);
0053   return phi0;
0054 }