CMS 3D CMS Logo

List of all members | Public Member Functions | Private Attributes
trklet::Tracklet Class Reference

#include <Tracklet.h>

Public Member Functions

void addMatch (unsigned int layerdisk, int ideltaphi, int ideltarz, double dphi, double drz, double dphiapprox, double drzapprox, int stubid, const trklet::Stub *stubptr)
 
std::string addressstr ()
 
double chiSqfit () const
 
double d0 () const
 
double d0approx () const
 
double d0fit () const
 
double d0fitexact () const
 
int disk () const
 
const std::string diskstubstr (const unsigned disk) const
 
bool fit () const
 
const FPGAWordfpgad0 () const
 
const FPGAWordfpgaphi0 () const
 
const FPGAWordfpgarinv () const
 
const FPGAWordfpgat () const
 
const FPGAWordfpgaz0 () const
 
std::string fullmatchdiskstr (int disk)
 
std::string fullmatchstr (int layer)
 
int getISeed () const
 
int getITC () const
 
std::vector< const L1TStub * > getL1Stubs ()
 
std::map< int, int > getStubIDs ()
 
TrackgetTrack ()
 
FPGAWord ichiSqfit () const
 
const FPGAWordid0fit () const
 
const StubinnerFPGAStub () const
 
const FPGAWordiphi0fit () const
 
const FPGAWordirinvfit () const
 
bool isBarrel () const
 
int isDisk () const
 
bool isOverlap () const
 
const FPGAWorditfit () const
 
const FPGAWordiz0fit () const
 
int layer () const
 
const std::string layerstubstr (const unsigned layer) const
 
Track makeTrack (const std::vector< const L1TStub *> &l1stubs)
 
bool match (unsigned int layerdisk)
 
const StubmiddleFPGAStub () const
 
const StubouterFPGAStub () const
 
double phi0 () const
 
double phi0approx () const
 
double phi0fit () const
 
double phi0fitexact () const
 
Projectionproj (int layerdisk)
 
unsigned int PSseed () const
 
const Residualresid (unsigned int layerdisk)
 
double rinv () const
 
double rinvapprox () const
 
double rinvfit () const
 
double rinvfitexact () const
 
unsigned int seedIndex () const
 
void setFitPars (double rinvfit, double phi0fit, double d0fit, double tfit, double z0fit, double chisqrphifit, double chisqrzfit, double rinvfitexact, double phi0fitexact, double d0fitexact, double tfitexact, double z0fitexact, double chisqrphifitexact, double chisqrzfitexact, int irinvfit, int iphi0fit, int id0fit, int itfit, int iz0fit, int ichisqrphifit, int ichisqrzfit, int hitpattern, const std::vector< const L1TStub *> &l1stubs=std::vector< const L1TStub *>())
 
void setTCIndex (int index)
 
void setTrackIndex (int index)
 
void setTrackletIndex (unsigned int index)
 
bool stubtruthmatch (const L1TStub *stub)
 
double t () const
 
double tapprox () const
 
int TCID () const
 
int TCIndex () const
 
double tfit () const
 
double tfitexact () const
 
int tpseed ()
 
std::string trackfitstr () const
 
int trackIndex () const
 
 Tracklet (Settings const &settings, unsigned int iSeed, const Stub *innerFPGAStub, const Stub *middleFPGAStub, const Stub *outerFPGAStub, double rinv, double phi0, double d0, double z0, double t, double rinvapprox, double phi0approx, double d0approx, double z0approx, double tapprox, int irinv, int iphi0, int id0, int iz0, int it, Projection projs[N_LAYER+N_DISK], bool disk, bool overlap=false)
 
int trackletIndex () const
 
std::string trackletparstr ()
 
std::string trackletprojstr (int layer) const
 
std::string trackletprojstrD (int disk) const
 
std::string trackletprojstrdisk (int disk) const
 
std::string trackletprojstrlayer (int layer) const
 
bool validProj (int layerdisk) const
 
std::string vmstrdisk (int disk, unsigned int allstubindex)
 
std::string vmstrlayer (int layer, unsigned int allstubindex)
 
double z0 () const
 
double z0approx () const
 
double z0fit () const
 
double z0fitexact () const
 
 ~Tracklet ()=default
 

Private Attributes

bool barrel_
 
double chisqrphifit_
 
double chisqrphifitexact_
 
double chisqrzfit_
 
double chisqrzfitexact_
 
bool disk_
 
TrackPars< double > fitpars_
 
TrackPars< double > fitparsexact_
 
TrackPars< FPGAWordfpgafitpars_
 
TrackPars< FPGAWordfpgapars_
 
std::unique_ptr< Trackfpgatrack_
 
int hitpattern_
 
FPGAWord ichisqrphifit_
 
FPGAWord ichisqrzfit_
 
const StubinnerFPGAStub_
 
const StubmiddleFPGAStub_
 
const StubouterFPGAStub_
 
bool overlap_
 
Projection proj_ [N_LAYER+N_DISK]
 
int projdisk_ [N_DISK]
 
int projlayer_ [N_LAYER - 2]
 
Residual resid_ [N_LAYER+N_DISK]
 
unsigned int seedIndex_
 
Settings const & settings_
 
int TCIndex_
 
int trackIndex_
 
int trackletIndex_
 
TrackPars< double > trackpars_
 
TrackPars< double > trackparsapprox_
 
bool triplet_
 

Detailed Description

Definition at line 27 of file Tracklet.h.

Constructor & Destructor Documentation

◆ Tracklet()

Tracklet::Tracklet ( Settings const &  settings,
unsigned int  iSeed,
const Stub innerFPGAStub,
const Stub middleFPGAStub,
const Stub outerFPGAStub,
double  rinv,
double  phi0,
double  d0,
double  z0,
double  t,
double  rinvapprox,
double  phi0approx,
double  d0approx,
double  z0approx,
double  tapprox,
int  irinv,
int  iphi0,
int  id0,
int  iz0,
int  it,
Projection  projs[N_LAYER+N_DISK],
bool  disk,
bool  overlap = false 
)

Definition at line 16 of file Tracklet.cc.

References cms::cuda::assert(), barrel_, d0(), d0approx(), disk(), disk_, fpgapars_, fpgatrack_, mps_fire::i, ichisqrphifit_, ichisqrzfit_, trklet::TrackPars< T >::init(), innerFPGAStub(), innerFPGAStub_, ALPAKA_ACCELERATOR_NAMESPACE::vertexFinder::it, trklet::Stub::l1tstub(), trklet::L1TStub::layer(), middleFPGAStub(), middleFPGAStub_, trklet::N_DISK, trklet::N_LAYER, trklet::Settings::nbitsd0(), trklet::Settings::nbitsphi0(), trklet::Settings::nbitsrinv(), trklet::Settings::nbitst(), trklet::Settings::nbitsz0(), outerFPGAStub(), outerFPGAStub_, hltL1SingleMuFiltered5_cfi::overlap, overlap_, phi0(), phi0approx(), proj_, projdisk_, trklet::Settings::projdisks(), projlayer_, trklet::Settings::projlayers(), rinv(), rinvapprox(), seedIndex_, trklet::FPGAWord::set(), settings_, t(), tapprox(), TCIndex_, trackletIndex_, trackpars_, trackparsapprox_, triplet_, validateGeometry_cfg::valid, z0(), and z0approx().

39  : settings_(settings) {
40  seedIndex_ = iSeed;
41 
42  overlap_ = overlap;
43  disk_ = disk;
44  assert(!(disk && overlap));
45  barrel_ = (!disk) && (!overlap);
46  triplet_ = false;
47 
48  trackletIndex_ = -1;
49  TCIndex_ = -1;
50 
52 
53  if (barrel_ && middleFPGAStub == nullptr)
55 
59 
60  trackpars_.init(rinv, phi0, d0, t, z0);
61 
63 
64  fpgapars_.rinv().set(irinv, settings_.nbitsrinv(), false, __LINE__, __FILE__);
65  fpgapars_.phi0().set(iphi0, settings_.nbitsphi0(), false, __LINE__, __FILE__);
66  fpgapars_.d0().set(id0, settings_.nbitsd0(), false, __LINE__, __FILE__);
67  fpgapars_.z0().set(iz0, settings_.nbitsz0(), false, __LINE__, __FILE__);
68  fpgapars_.t().set(it, settings_.nbitst(), false, __LINE__, __FILE__);
69 
70  fpgatrack_ = nullptr;
71 
72  triplet_ = (seedIndex_ >= 8);
73 
74  //fill projection layers
75  for (unsigned int i = 0; i < N_LAYER - 2; i++) {
76  projlayer_[i] = settings.projlayers(seedIndex_, i);
77  }
78 
79  //fill projection disks
80  for (unsigned int i = 0; i < N_DISK; i++) {
81  projdisk_[i] = settings.projdisks(seedIndex_, i);
82  }
83 
84  //Handle projections to the layers
85  for (unsigned int i = 0; i < N_LAYER - 2; i++) {
86  if (projlayer_[i] == 0)
87  continue;
88  if (!projs[projlayer_[i] - 1].valid())
89  continue;
90 
91  proj_[projlayer_[i] - 1] = projs[projlayer_[i] - 1];
92  }
93  //Now handle projections to the disks
94  for (unsigned int i = 0; i < N_DISK; i++) {
95  if (projdisk_[i] == 0)
96  continue;
97  if (!projs[N_LAYER + projdisk_[i] - 1].valid())
98  continue;
99 
100  proj_[N_LAYER + projdisk_[i] - 1] = projs[N_LAYER + projdisk_[i] - 1];
101  }
102 
103  ichisqrphifit_.set(-1, 8, false);
104  ichisqrzfit_.set(-1, 8, false);
105 }
TrackPars< FPGAWord > fpgapars_
Definition: Tracklet.h:244
double t() const
Definition: Tracklet.h:123
Projection proj_[N_LAYER+N_DISK]
Definition: Tracklet.h:270
unsigned int layer() const
Definition: L1TStub.h:45
constexpr int N_DISK
Definition: Settings.h:26
int disk() const
Definition: Tracklet.cc:792
double phi0() const
Definition: Tracklet.h:121
TrackPars< double > trackparsapprox_
Definition: Tracklet.h:247
assert(be >=bs)
unsigned int nbitsd0() const
Definition: Settings.h:349
Settings const & settings_
Definition: Tracklet.h:274
FPGAWord ichisqrzfit_
Definition: Tracklet.h:256
FPGAWord ichisqrphifit_
Definition: Tracklet.h:255
int nbitst() const
Definition: Settings.h:376
double phi0approx() const
Definition: Tracklet.h:127
double rinv() const
Definition: Tracklet.h:120
int projdisk_[N_DISK]
Definition: Tracklet.h:251
const Stub * outerFPGAStub() const
Definition: Tracklet.h:65
int projlayer_[N_LAYER - 2]
Definition: Tracklet.h:250
int nbitsrinv() const
Definition: Settings.h:374
unsigned int seedIndex_
Definition: Tracklet.h:227
std::unique_ptr< Track > fpgatrack_
Definition: Tracklet.h:268
const Stub * middleFPGAStub() const
Definition: Tracklet.h:63
double tapprox() const
Definition: Tracklet.h:129
L1TStub * l1tstub()
Definition: Stub.h:83
double rinvapprox() const
Definition: Tracklet.h:126
double d0() const
Definition: Tracklet.h:122
double z0approx() const
Definition: Tracklet.h:130
void set(int value, int nbits, bool positive=true, int line=-1, const char *file=nullptr)
Definition: FPGAWord.cc:14
double d0approx() const
Definition: Tracklet.h:128
double z0() const
Definition: Tracklet.h:124
const Stub * outerFPGAStub_
Definition: Tracklet.h:237
const Stub * innerFPGAStub_
Definition: Tracklet.h:235
const Stub * middleFPGAStub_
Definition: Tracklet.h:236
int nbitsphi0() const
Definition: Settings.h:375
TrackPars< double > trackpars_
Definition: Tracklet.h:246
int nbitsz0() const
Definition: Settings.h:377
void init(T rinv, T phi0, T d0, T t, T z0)
Definition: TrackPars.h:21
constexpr int N_LAYER
Definition: Settings.h:25
const Stub * innerFPGAStub() const
Definition: Tracklet.h:61

◆ ~Tracklet()

trklet::Tracklet::~Tracklet ( )
default

Member Function Documentation

◆ addMatch()

void Tracklet::addMatch ( unsigned int  layerdisk,
int  ideltaphi,
int  ideltarz,
double  dphi,
double  drz,
double  dphiapprox,
double  drzapprox,
int  stubid,
const trklet::Stub stubptr 
)

Definition at line 303 of file Tracklet.cc.

References cms::cuda::assert(), trklet::Residual::init(), trklet::N_DISK, trklet::N_LAYER, resid_, and settings_.

Referenced by trklet::MatchCalculator::execute(), and trklet::MatchProcessor::matchCalculator().

311  {
312  assert(layerdisk < N_LAYER + N_DISK);
313  resid_[layerdisk].init(settings_, layerdisk, ideltaphi, ideltarz, stubid, dphi, drz, dphiapprox, drzapprox, stubptr);
314 }
constexpr int N_DISK
Definition: Settings.h:26
void init(Settings const &settings, unsigned int layerdisk, int iphiresid, int irzresid, int istubid, double phiresid, double rzresid, double phiresidapprox, double rzresidapprox, const Stub *stubptr)
Definition: Residual.cc:7
assert(be >=bs)
Settings const & settings_
Definition: Tracklet.h:274
Residual resid_[N_LAYER+N_DISK]
Definition: Tracklet.h:272
constexpr int N_LAYER
Definition: Settings.h:25

◆ addressstr()

std::string Tracklet::addressstr ( )

Definition at line 177 of file Tracklet.cc.

References innerFPGAStub_, middleFPGAStub_, outerFPGAStub_, trklet::Stub::phiregionaddressstr(), str, and AlCaHLTBitMon_QueryRunRegistry::string.

177  {
180  if (middleFPGAStub_) {
182  }
184 
185  return str;
186 }
std::string phiregionaddressstr() const
Definition: Stub.cc:119
const Stub * outerFPGAStub_
Definition: Tracklet.h:237
const Stub * innerFPGAStub_
Definition: Tracklet.h:235
const Stub * middleFPGAStub_
Definition: Tracklet.h:236
#define str(s)

◆ chiSqfit()

double trklet::Tracklet::chiSqfit ( ) const
inline

Definition at line 143 of file Tracklet.h.

References chisqrphifit_, and chisqrzfit_.

143 { return chisqrphifit_ + chisqrzfit_; }
double chisqrzfit_
Definition: Tracklet.h:260
double chisqrphifit_
Definition: Tracklet.h:259

◆ d0()

double trklet::Tracklet::d0 ( ) const
inline

Definition at line 122 of file Tracklet.h.

References trklet::TrackPars< T >::d0(), and trackpars_.

Referenced by trklet::PurgeDuplicate::getInventedCoordsExtended(), trklet::FitTrack::trackFitFake(), and Tracklet().

122 { return trackpars_.d0(); }
const T & d0() const
Definition: TrackPars.h:31
TrackPars< double > trackpars_
Definition: Tracklet.h:246

◆ d0approx()

double trklet::Tracklet::d0approx ( ) const
inline

Definition at line 128 of file Tracklet.h.

References trklet::TrackPars< T >::d0(), and trackparsapprox_.

Referenced by trklet::FitTrack::trackFitFake(), and Tracklet().

128 { return trackparsapprox_.d0(); }
TrackPars< double > trackparsapprox_
Definition: Tracklet.h:247
const T & d0() const
Definition: TrackPars.h:31

◆ d0fit()

double trklet::Tracklet::d0fit ( ) const
inline

Definition at line 140 of file Tracklet.h.

References trklet::TrackPars< T >::d0(), and fitpars_.

Referenced by setFitPars().

140 { return fitpars_.d0(); }
TrackPars< double > fitpars_
Definition: Tracklet.h:258
const T & d0() const
Definition: TrackPars.h:31

◆ d0fitexact()

double trklet::Tracklet::d0fitexact ( ) const
inline

Definition at line 147 of file Tracklet.h.

References trklet::TrackPars< T >::d0(), and fitparsexact_.

Referenced by setFitPars().

147 { return fitparsexact_.d0(); }
const T & d0() const
Definition: TrackPars.h:31
TrackPars< double > fitparsexact_
Definition: Tracklet.h:262

◆ disk()

int Tracklet::disk ( ) const

Definition at line 792 of file Tracklet.cc.

References funct::abs(), ztail::d, d1, trklet::L1TStub::disk(), innerFPGAStub_, trklet::Stub::l1tstub(), trklet::Stub::layerdisk(), middleFPGAStub_, SiStripPI::min, trklet::N_LAYER, and outerFPGAStub_.

Referenced by diskstubstr(), trklet::MatchCalculator::execute(), fullmatchdiskstr(), trklet::PurgeDuplicate::getInventedCoords(), trklet::PurgeDuplicate::getInventedCoordsExtended(), trklet::MatchProcessor::matchCalculator(), PSseed(), trklet::FitTrack::trackFitChisq(), Tracklet(), trackletprojstrD(), trackletprojstrdisk(), and vmstrdisk().

792  {
793  int d1 = (innerFPGAStub_ && (innerFPGAStub_->layerdisk() >= N_LAYER)) ? innerFPGAStub_->l1tstub()->disk() : 999,
795  d3 = (outerFPGAStub_ && (outerFPGAStub_->layerdisk() >= N_LAYER)) ? outerFPGAStub_->l1tstub()->disk() : 999,
796  d = 999;
797  if (abs(d1) < min(abs(d2), abs(d3)))
798  d = d1;
799  if (abs(d2) < min(abs(d1), abs(d3)))
800  d = d2;
801  if (abs(d3) < min(abs(d1), abs(d2)))
802  d = d3;
803  return (d < 999 ? d : 0);
804 }
Abs< T >::type abs(const T &t)
Definition: Abs.h:22
L1TStub * l1tstub()
Definition: Stub.h:83
int disk() const
Definition: L1TStub.h:46
unsigned int layerdisk() const
Definition: Stub.cc:193
d
Definition: ztail.py:151
const Stub * outerFPGAStub_
Definition: Tracklet.h:237
const Stub * innerFPGAStub_
Definition: Tracklet.h:235
const Stub * middleFPGAStub_
Definition: Tracklet.h:236
static constexpr float d1
constexpr int N_LAYER
Definition: Settings.h:25

◆ diskstubstr()

const std::string Tracklet::diskstubstr ( const unsigned  disk) const

Definition at line 603 of file Tracklet.cc.

References cms::cuda::assert(), gather_cfg::cout, disk(), trklet::Residual::fpgaphiresid(), trklet::Residual::fpgarzresid(), trklet::Residual::fpgastubid(), trklet::Stub::isPSmodule(), trklet::N_DISK, trklet::N_LAYER, trklet::Settings::nbitstrackletindex(), trklet::Settings::ntrackletmax(), trklet::Stub::r(), resid_, settings_, trklet::FPGAWord::str(), trklet::Residual::stubptr(), createJobs::tmp, trackIndex_, and validateGeometry_cfg::valid.

Referenced by trackfitstr().

603  {
604  assert(disk < N_DISK);
605 
606  std::stringstream oss("");
607  if (!resid_[N_LAYER + disk].valid())
608  oss << "0|0000000|0000000000|000000000000|000000000000|0000000";
609  else {
610  if (trackIndex_ < 0 || trackIndex_ > (int)settings_.ntrackletmax()) {
611  cout << "trackIndex_ = " << trackIndex_ << endl;
612  assert(0);
613  }
614  const FPGAWord tmp(trackIndex_, settings_.nbitstrackletindex(), true, __LINE__, __FILE__);
615  const FPGAWord& stubr = resid_[N_LAYER + disk].stubptr()->r();
616  const bool isPS = resid_[N_LAYER + disk].stubptr()->isPSmodule();
617  oss << "1|"; // valid bit
618  oss << tmp.str() << "|";
619  oss << resid_[N_LAYER + disk].fpgastubid().str() << "|";
620  oss << (isPS ? stubr.str() : ("00000000" + stubr.str())) << "|";
621  oss << resid_[N_LAYER + disk].fpgaphiresid().str() << "|";
622  oss << resid_[N_LAYER + disk].fpgarzresid().str();
623  }
624 
625  return oss.str();
626 }
constexpr int N_DISK
Definition: Settings.h:26
const FPGAWord & r() const
Definition: Stub.h:65
int disk() const
Definition: Tracklet.cc:792
unsigned int nbitstrackletindex() const
Definition: Settings.h:309
const FPGAWord & fpgastubid() const
Definition: Residual.h:42
const FPGAWord & fpgaphiresid() const
Definition: Residual.h:32
assert(be >=bs)
Settings const & settings_
Definition: Tracklet.h:274
const FPGAWord & fpgarzresid() const
Definition: Residual.h:37
Residual resid_[N_LAYER+N_DISK]
Definition: Tracklet.h:272
bool isPSmodule() const
Definition: Stub.h:77
const Stub * stubptr() const
Definition: Residual.h:67
unsigned int ntrackletmax() const
Definition: Settings.h:371
tmp
align.sh
Definition: createJobs.py:716
std::string str() const
Definition: FPGAWord.cc:54
constexpr int N_LAYER
Definition: Settings.h:25

◆ fit()

bool trklet::Tracklet::fit ( ) const
inline

◆ fpgad0()

const FPGAWord& trklet::Tracklet::fpgad0 ( ) const
inline

Definition at line 134 of file Tracklet.h.

References fpgapars_.

Referenced by trklet::FitTrack::trackFitFake().

134 { return fpgapars_.d0(); }
TrackPars< FPGAWord > fpgapars_
Definition: Tracklet.h:244

◆ fpgaphi0()

const FPGAWord& trklet::Tracklet::fpgaphi0 ( ) const
inline

Definition at line 133 of file Tracklet.h.

References fpgapars_.

Referenced by trklet::FitTrack::execute(), trklet::FitTrack::trackFitChisq(), and trklet::FitTrack::trackFitFake().

133 { return fpgapars_.phi0(); }
TrackPars< FPGAWord > fpgapars_
Definition: Tracklet.h:244

◆ fpgarinv()

const FPGAWord& trklet::Tracklet::fpgarinv ( ) const
inline

Definition at line 132 of file Tracklet.h.

References fpgapars_.

Referenced by trklet::FitTrack::execute(), trklet::FitTrack::trackFitChisq(), and trklet::FitTrack::trackFitFake().

132 { return fpgapars_.rinv(); }
TrackPars< FPGAWord > fpgapars_
Definition: Tracklet.h:244

◆ fpgat()

const FPGAWord& trklet::Tracklet::fpgat ( ) const
inline

Definition at line 135 of file Tracklet.h.

References fpgapars_.

Referenced by trklet::FitTrack::execute(), trklet::FitTrack::trackFitChisq(), and trklet::FitTrack::trackFitFake().

135 { return fpgapars_.t(); }
TrackPars< FPGAWord > fpgapars_
Definition: Tracklet.h:244

◆ fpgaz0()

const FPGAWord& trklet::Tracklet::fpgaz0 ( ) const
inline

Definition at line 136 of file Tracklet.h.

References fpgapars_.

Referenced by trklet::FitTrack::execute(), trklet::FitTrack::trackFitChisq(), and trklet::FitTrack::trackFitFake().

136 { return fpgapars_.z0(); }
TrackPars< FPGAWord > fpgapars_
Definition: Tracklet.h:244

◆ fullmatchdiskstr()

std::string Tracklet::fullmatchdiskstr ( int  disk)

Definition at line 332 of file Tracklet.cc.

References cms::cuda::assert(), disk(), Exception, trklet::Residual::fpgaphiresid(), trklet::Residual::fpgarzresid(), trklet::Residual::fpgastubid(), trklet::Stub::isPSmodule(), trklet::N_DISK, trklet::N_LAYER, trklet::Settings::nbitstcindex(), trklet::Settings::nbitstrackletindex(), trklet::Settings::ntrackletmax(), trklet::Stub::r(), resid_, trklet::FPGAWord::set(), settings_, trklet::FPGAWord::str(), AlCaHLTBitMon_QueryRunRegistry::string, trklet::Residual::stubptr(), TCIndex_, createJobs::tmp, and trackletIndex_.

332  {
333  assert(disk > 0 && disk <= N_DISK);
334 
335  FPGAWord tmp;
336  if (trackletIndex_ < 0 || trackletIndex_ > (int)settings_.ntrackletmax()) {
337  throw cms::Exception("BadConfig") << __FILE__ << " " << __LINE__ << " trackletIndex_ = " << trackletIndex_;
338  }
339  tmp.set(trackletIndex_, settings_.nbitstrackletindex(), true, __LINE__, __FILE__);
340  FPGAWord tcid;
341  tcid.set(TCIndex_, settings_.nbitstcindex(), true, __LINE__, __FILE__);
342  const FPGAWord& stubr = resid_[N_LAYER + disk - 1].stubptr()->r();
343  const bool isPS = resid_[N_LAYER + disk - 1].stubptr()->isPSmodule();
344  std::string oss = tcid.str() + "|" + tmp.str() + "|" + resid_[N_LAYER + disk - 1].fpgastubid().str() + "|" +
345  (isPS ? stubr.str() : ("00000000" + stubr.str())) + "|" +
346  resid_[N_LAYER + disk - 1].fpgaphiresid().str() + "|" +
347  resid_[N_LAYER + disk - 1].fpgarzresid().str();
348  return oss;
349 }
constexpr int N_DISK
Definition: Settings.h:26
const FPGAWord & r() const
Definition: Stub.h:65
int disk() const
Definition: Tracklet.cc:792
unsigned int nbitstrackletindex() const
Definition: Settings.h:309
const FPGAWord & fpgastubid() const
Definition: Residual.h:42
const FPGAWord & fpgaphiresid() const
Definition: Residual.h:32
assert(be >=bs)
Settings const & settings_
Definition: Tracklet.h:274
const FPGAWord & fpgarzresid() const
Definition: Residual.h:37
unsigned int nbitstcindex() const
Definition: Settings.h:314
Residual resid_[N_LAYER+N_DISK]
Definition: Tracklet.h:272
void set(int value, int nbits, bool positive=true, int line=-1, const char *file=nullptr)
Definition: FPGAWord.cc:14
bool isPSmodule() const
Definition: Stub.h:77
const Stub * stubptr() const
Definition: Residual.h:67
unsigned int ntrackletmax() const
Definition: Settings.h:371
tmp
align.sh
Definition: createJobs.py:716
std::string str() const
Definition: FPGAWord.cc:54
constexpr int N_LAYER
Definition: Settings.h:25

◆ fullmatchstr()

std::string Tracklet::fullmatchstr ( int  layer)

Definition at line 316 of file Tracklet.cc.

References cms::cuda::assert(), Exception, trklet::Residual::fpgaphiresid(), trklet::Residual::fpgarzresid(), trklet::Residual::fpgastubid(), layer(), trklet::N_LAYER, trklet::Settings::nbitstcindex(), trklet::Settings::nbitstrackletindex(), trklet::Settings::ntrackletmax(), trklet::Stub::r(), resid_, trklet::FPGAWord::set(), settings_, trklet::FPGAWord::str(), AlCaHLTBitMon_QueryRunRegistry::string, trklet::Residual::stubptr(), TCIndex_, createJobs::tmp, and trackletIndex_.

316  {
317  assert(layer > 0 && layer <= N_LAYER);
318 
319  FPGAWord tmp;
320  if (trackletIndex_ < 0 || trackletIndex_ > (int)settings_.ntrackletmax()) {
321  throw cms::Exception("BadConfig") << __FILE__ << " " << __LINE__ << " trackletIndex_ = " << trackletIndex_;
322  }
323  tmp.set(trackletIndex_, settings_.nbitstrackletindex(), true, __LINE__, __FILE__);
324  FPGAWord tcid;
325  tcid.set(TCIndex_, settings_.nbitstcindex(), true, __LINE__, __FILE__);
326  std::string oss = tcid.str() + "|" + tmp.str() + "|" + resid_[layer - 1].fpgastubid().str() + "|" +
327  resid_[layer - 1].stubptr()->r().str() + "|" + resid_[layer - 1].fpgaphiresid().str() + "|" +
328  resid_[layer - 1].fpgarzresid().str();
329  return oss;
330 }
const FPGAWord & r() const
Definition: Stub.h:65
unsigned int nbitstrackletindex() const
Definition: Settings.h:309
const FPGAWord & fpgastubid() const
Definition: Residual.h:42
const FPGAWord & fpgaphiresid() const
Definition: Residual.h:32
assert(be >=bs)
Settings const & settings_
Definition: Tracklet.h:274
const FPGAWord & fpgarzresid() const
Definition: Residual.h:37
unsigned int nbitstcindex() const
Definition: Settings.h:314
Residual resid_[N_LAYER+N_DISK]
Definition: Tracklet.h:272
void set(int value, int nbits, bool positive=true, int line=-1, const char *file=nullptr)
Definition: FPGAWord.cc:14
const Stub * stubptr() const
Definition: Residual.h:67
unsigned int ntrackletmax() const
Definition: Settings.h:371
int layer() const
Definition: Tracklet.cc:783
tmp
align.sh
Definition: createJobs.py:716
std::string str() const
Definition: FPGAWord.cc:54
constexpr int N_LAYER
Definition: Settings.h:25

◆ getISeed()

int Tracklet::getISeed ( ) const

◆ getITC()

int Tracklet::getITC ( ) const

Definition at line 817 of file Tracklet.cc.

References cms::cuda::assert(), getISeed(), trklet::Settings::nbitsitc(), settings_, and TCIndex_.

817  {
818  const int iSeed = getISeed(), iTC = TCIndex_ - (iSeed << settings_.nbitsitc());
819  assert(iTC >= 0 && iTC <= 14);
820  return iTC;
821 }
assert(be >=bs)
Settings const & settings_
Definition: Tracklet.h:274
unsigned int nbitsitc() const
Definition: Settings.h:312
int getISeed() const
Definition: Tracklet.cc:811

◆ getL1Stubs()

std::vector< const L1TStub * > Tracklet::getL1Stubs ( )

Definition at line 351 of file Tracklet.cc.

References innerFPGAStub_, trklet::Stub::l1tstub(), middleFPGAStub_, outerFPGAStub_, resid_, and createJobs::tmp.

Referenced by makeTrack().

351  {
352  std::vector<const L1TStub*> tmp;
353 
354  if (innerFPGAStub_)
355  tmp.push_back(innerFPGAStub_->l1tstub());
356  if (middleFPGAStub_)
357  tmp.push_back(middleFPGAStub_->l1tstub());
358  if (outerFPGAStub_)
359  tmp.push_back(outerFPGAStub_->l1tstub());
360 
361  for (const auto& iresid : resid_) {
362  if (iresid.valid())
363  tmp.push_back(iresid.stubptr()->l1tstub());
364  }
365 
366  return tmp;
367 }
L1TStub * l1tstub()
Definition: Stub.h:83
Residual resid_[N_LAYER+N_DISK]
Definition: Tracklet.h:272
const Stub * outerFPGAStub_
Definition: Tracklet.h:237
const Stub * innerFPGAStub_
Definition: Tracklet.h:235
const Stub * middleFPGAStub_
Definition: Tracklet.h:236
tmp
align.sh
Definition: createJobs.py:716

◆ getStubIDs()

std::map< int, int > Tracklet::getStubIDs ( )

Definition at line 369 of file Tracklet.cc.

References cms::cuda::assert(), barrel_, trklet::L1TStub::disk(), trklet::Stub::disk(), disk_, trklet::Residual::fpgastubid(), mps_fire::i, innerFPGAStub_, itfit(), trklet::Stub::l1tstub(), trklet::Stub::layer(), EcalCondDBWriter_cfi::location, middleFPGAStub_, trklet::N_BITSMEMADDRESS, trklet::N_DISK, trklet::N_LAYER, trklet::FPGAWord::nbits(), outerFPGAStub_, overlap_, trklet::Stub::phiregionaddress(), resid_, trklet::Stub::stubindex(), validateGeometry_cfg::valid, trklet::Residual::valid(), trklet::FPGAWord::value(), and relativeConstraints::value.

Referenced by makeTrack().

369  {
370  std::map<int, int> stubIDs;
371 
372  // For future reference, *resid_[i] uses i as the absolute stub index. (0-5 for barrel, 0-4 for disk)
373  // On the other hand, proj*_[i] uses i almost like *resid_[i], except the *seeding* layer indices are removed entirely.
374  // E.g. An L3L4 track has 0=L1, 1=L2, 2=L4, 3=L5 for the barrels (for proj*_[i])
375 
376  if (innerFPGAStub_)
378  if (middleFPGAStub_)
380  if (outerFPGAStub_)
382 
383  if (barrel_) {
384  for (int i = 0; i < N_LAYER; i++) {
385  //check barrel
386  if (resid_[i].valid()) {
387  // two extra bits to indicate if the matched stub is local or from neighbor
388  int location = 1; // local
389  location <<= resid_[i].fpgastubid().nbits();
390 
391  stubIDs[1 + i] = resid_[i].fpgastubid().value() + location;
392  }
393 
394  //check disk
395  if (i >= N_DISK)
396  continue; //i=[0..4] for disks
397  if (resid_[N_LAYER + i].valid()) {
398  if (i == 3 && resid_[0].valid() && innerFPGAStub_->layer().value() == 1)
399  continue; // Don't add D4 if track has L1 stub
400  // two extra bits to indicate if the matched stub is local or from neighbor
401  int location = 1; // local
403 
404  if (itfit().value() < 0) {
405  stubIDs[-(N_LAYER + N_DISK) - i] = resid_[N_LAYER + i].fpgastubid().value() + location;
406  } else {
407  stubIDs[N_LAYER + N_DISK + i] = resid_[N_LAYER + i].fpgastubid().value() + location;
408  }
409  }
410  }
411 
412  //get stubs making up tracklet
413  if (innerFPGAStub_)
414  stubIDs[innerFPGAStub_->layer().value() + 1] = innerFPGAStub_->phiregionaddress() + (1 << 10);
415  if (middleFPGAStub_)
416  stubIDs[middleFPGAStub_->layer().value() + 1] = middleFPGAStub_->phiregionaddress() + (1 << 10);
417  if (outerFPGAStub_)
418  stubIDs[outerFPGAStub_->layer().value() + 1] = outerFPGAStub_->phiregionaddress() + (1 << 10);
419 
420  } else if (disk_) {
421  for (int i = 0; i < N_DISK; i++) {
422  //check barrel
423  if (resid_[i].valid()) {
424  // two extra bits to indicate if the matched stub is local or from neighbor
425  int location = 1; // local
426  location <<= resid_[i].fpgastubid().nbits();
427 
428  stubIDs[1 + i] = resid_[i].fpgastubid().value() + location;
429  }
430 
431  //check disks
432  if (i == 4 && resid_[1].valid())
433  continue; // Don't add D5 if track has L2 stub
434  if (resid_[N_LAYER + i].valid()) {
435  // two extra bits to indicate if the matched stub is local or from neighbor
436  int location = 1; // local
438 
439  if (innerFPGAStub_->l1tstub()->disk() < 0) {
440  stubIDs[-11 - i] = resid_[N_LAYER + i].fpgastubid().value() + location;
441  } else {
442  stubIDs[11 + i] = resid_[N_LAYER + i].fpgastubid().value() + location;
443  }
444  }
445  }
446 
447  //get stubs making up tracklet
448  if (innerFPGAStub_->disk().value() < 0) { //negative side runs 6-10
449  if (innerFPGAStub_)
450  stubIDs[innerFPGAStub_->disk().value() - 10] = innerFPGAStub_->phiregionaddress() + (1 << 10);
451  if (middleFPGAStub_)
452  stubIDs[middleFPGAStub_->disk().value() - 10] = middleFPGAStub_->phiregionaddress() + (1 << 10);
453  if (outerFPGAStub_)
454  stubIDs[outerFPGAStub_->disk().value() - 10] = outerFPGAStub_->phiregionaddress() + (1 << 10);
455  } else { // positive side runs 11-15]
456  if (innerFPGAStub_)
457  stubIDs[innerFPGAStub_->disk().value() + 10] = innerFPGAStub_->phiregionaddress() + (1 << 10);
458  if (middleFPGAStub_)
459  stubIDs[middleFPGAStub_->disk().value() + 10] = middleFPGAStub_->phiregionaddress() + (1 << 10);
460  if (outerFPGAStub_)
461  stubIDs[outerFPGAStub_->disk().value() + 10] = outerFPGAStub_->phiregionaddress() + (1 << 10);
462  }
463 
464  } else if (overlap_) {
465  for (int i = 0; i < N_DISK; i++) {
466  //check barrel
467  if (resid_[i].valid()) {
468  // two extra bits to indicate if the matched stub is local or from neighbor
469  int location = 1; // local
470  location <<= resid_[i].fpgastubid().nbits();
471 
472  stubIDs[1 + i] = resid_[i].fpgastubid().value() + location;
473  }
474 
475  //check disks
476  if (resid_[N_LAYER + i].valid()) {
477  // two extra bits to indicate if the matched stub is local or from neighbor
478  int location = 1; // local
480 
481  if (innerFPGAStub_->l1tstub()->disk() < 0) { // if negative overlap
482  if (innerFPGAStub_->layer().value() != 2 || !resid_[0].valid() ||
483  i != 3) { // Don't add D4 if this is an L3L2 track with an L1 stub
484  stubIDs[-11 - i] = resid_[N_LAYER + i].fpgastubid().value() + location;
485  }
486  } else {
487  if (innerFPGAStub_->layer().value() != 2 || !resid_[0].valid() || i != 3) {
488  stubIDs[11 + i] = resid_[N_LAYER + i].fpgastubid().value() + location;
489  }
490  }
491  }
492  }
493 
494  //get stubs making up tracklet
495 
496  if (innerFPGAStub_->layer().value() == 2) { // L3L2 track
497  if (innerFPGAStub_)
498  stubIDs[innerFPGAStub_->layer().value() + 1] = innerFPGAStub_->phiregionaddress() + (1 << 10);
499  if (middleFPGAStub_)
500  stubIDs[middleFPGAStub_->layer().value() + 1] = middleFPGAStub_->phiregionaddress() + (1 << 10);
501  if (outerFPGAStub_)
502  stubIDs[outerFPGAStub_->layer().value() + 1] = outerFPGAStub_->phiregionaddress() + (1 << 10);
503  } else if (innerFPGAStub_->disk().value() < 0) { //negative side runs -11 - -15
504  if (innerFPGAStub_)
505  stubIDs[innerFPGAStub_->disk().value() - 10] = innerFPGAStub_->phiregionaddress() + (1 << 10);
506  if (middleFPGAStub_)
507  stubIDs[middleFPGAStub_->layer().value() + 1] = middleFPGAStub_->phiregionaddress() + (1 << 10);
508  if (outerFPGAStub_)
509  stubIDs[outerFPGAStub_->layer().value() + 1] = outerFPGAStub_->phiregionaddress() + (1 << 10);
510  } else { // positive side runs 11-15]
511  if (innerFPGAStub_)
512  stubIDs[innerFPGAStub_->disk().value() + 10] = innerFPGAStub_->phiregionaddress() + (1 << 10);
513  if (middleFPGAStub_)
514  stubIDs[middleFPGAStub_->layer().value() + 1] = middleFPGAStub_->phiregionaddress() + (1 << 10);
515  if (outerFPGAStub_)
516  stubIDs[outerFPGAStub_->layer().value() + 1] = outerFPGAStub_->phiregionaddress() + (1 << 10);
517  }
518  }
519 
520  return stubIDs;
521 }
constexpr int N_DISK
Definition: Settings.h:26
const FPGAWord & fpgastubid() const
Definition: Residual.h:42
assert(be >=bs)
const FPGAWord & disk() const
Definition: Stub.h:74
unsigned int phiregionaddress() const
Definition: Stub.cc:114
int value() const
Definition: FPGAWord.h:24
L1TStub * l1tstub()
Definition: Stub.h:83
int disk() const
Definition: L1TStub.h:46
const FPGAWord & stubindex() const
Definition: Stub.h:72
Residual resid_[N_LAYER+N_DISK]
Definition: Tracklet.h:272
int nbits() const
Definition: FPGAWord.h:25
bool valid() const
Definition: Residual.h:30
const FPGAWord & itfit() const
Definition: Tracklet.h:154
const Stub * outerFPGAStub_
Definition: Tracklet.h:237
const Stub * innerFPGAStub_
Definition: Tracklet.h:235
const FPGAWord & layer() const
Definition: Stub.h:73
const Stub * middleFPGAStub_
Definition: Tracklet.h:236
constexpr unsigned int N_BITSMEMADDRESS
Definition: Settings.h:43
constexpr int N_LAYER
Definition: Settings.h:25

◆ getTrack()

Track* trklet::Tracklet::getTrack ( )
inline

Definition at line 192 of file Tracklet.h.

References cms::cuda::assert(), and fpgatrack_.

Referenced by trklet::PurgeDuplicate::execute().

192  {
193  assert(fpgatrack_ != nullptr);
194  return fpgatrack_.get();
195  }
assert(be >=bs)
std::unique_ptr< Track > fpgatrack_
Definition: Tracklet.h:268

◆ ichiSqfit()

FPGAWord trklet::Tracklet::ichiSqfit ( ) const
inline

Definition at line 156 of file Tracklet.h.

References ichisqrphifit_, ichisqrzfit_, trklet::FPGAWord::nbits(), and trklet::FPGAWord::value().

156  {
157  return FPGAWord(ichisqrphifit_.value() + ichisqrzfit_.value(), ichisqrphifit_.nbits());
158  }
FPGAWord ichisqrzfit_
Definition: Tracklet.h:256
FPGAWord ichisqrphifit_
Definition: Tracklet.h:255
int value() const
Definition: FPGAWord.h:24
int nbits() const
Definition: FPGAWord.h:25

◆ id0fit()

const FPGAWord& trklet::Tracklet::id0fit ( ) const
inline

Definition at line 153 of file Tracklet.h.

References fpgafitpars_.

Referenced by setFitPars().

153 { return fpgafitpars_.d0(); }
TrackPars< FPGAWord > fpgafitpars_
Definition: Tracklet.h:254

◆ innerFPGAStub()

const Stub* trklet::Tracklet::innerFPGAStub ( ) const
inline

Definition at line 61 of file Tracklet.h.

References innerFPGAStub_.

Referenced by trklet::FitTrack::execute(), trklet::FitTrack::trackFitChisq(), trackfitstr(), and Tracklet().

61 { return innerFPGAStub_; }
const Stub * innerFPGAStub_
Definition: Tracklet.h:235

◆ iphi0fit()

const FPGAWord& trklet::Tracklet::iphi0fit ( ) const
inline

Definition at line 152 of file Tracklet.h.

References fpgafitpars_.

Referenced by setFitPars().

152 { return fpgafitpars_.phi0(); }
TrackPars< FPGAWord > fpgafitpars_
Definition: Tracklet.h:254

◆ irinvfit()

const FPGAWord& trklet::Tracklet::irinvfit ( ) const
inline

Definition at line 151 of file Tracklet.h.

References fpgafitpars_.

Referenced by setFitPars().

151 { return fpgafitpars_.rinv(); }
TrackPars< FPGAWord > fpgafitpars_
Definition: Tracklet.h:254

◆ isBarrel()

bool trklet::Tracklet::isBarrel ( ) const
inline

Definition at line 202 of file Tracklet.h.

References barrel_.

Referenced by trklet::FitTrack::trackFitChisq().

202 { return barrel_; }

◆ isDisk()

int trklet::Tracklet::isDisk ( ) const
inline

Definition at line 204 of file Tracklet.h.

References disk_.

Referenced by trklet::FitTrack::trackFitChisq().

204 { return disk_; }

◆ isOverlap()

bool trklet::Tracklet::isOverlap ( ) const
inline

Definition at line 203 of file Tracklet.h.

References overlap_.

Referenced by trklet::FitTrack::trackFitChisq().

203 { return overlap_; }

◆ itfit()

const FPGAWord& trklet::Tracklet::itfit ( ) const
inline

Definition at line 154 of file Tracklet.h.

References fpgafitpars_.

Referenced by getStubIDs(), and setFitPars().

154 { return fpgafitpars_.t(); }
TrackPars< FPGAWord > fpgafitpars_
Definition: Tracklet.h:254

◆ iz0fit()

const FPGAWord& trklet::Tracklet::iz0fit ( ) const
inline

Definition at line 155 of file Tracklet.h.

References fpgafitpars_.

Referenced by setFitPars().

155 { return fpgafitpars_.z0(); }
TrackPars< FPGAWord > fpgafitpars_
Definition: Tracklet.h:254

◆ layer()

int Tracklet::layer ( ) const

Definition at line 783 of file Tracklet.cc.

References innerFPGAStub_, MainPageGenerator::l, trklet::Stub::l1tstub(), trklet::Stub::layerdisk(), trklet::L1TStub::layerdisk(), middleFPGAStub_, SiStripPI::min, trklet::N_LAYER, and outerFPGAStub_.

Referenced by trklet::MatchCalculator::execute(), fullmatchstr(), geometryXMLparser.DTAlignable::index(), geometryXMLparser.CSCAlignable::index(), layerstubstr(), trklet::MatchProcessor::matchCalculator(), PSseed(), trklet::FitTrack::trackFitChisq(), trackletprojstr(), trackletprojstrlayer(), and vmstrlayer().

783  {
784  int l1 = (innerFPGAStub_ && innerFPGAStub_->layerdisk() < N_LAYER) ? innerFPGAStub_->l1tstub()->layerdisk() + 1 : 999,
786  : 999,
788  l = min(min(l1, l2), l3);
789  return (l < 999 ? l : 0);
790 }
int layerdisk() const
Definition: L1TStub.h:119
L1TStub * l1tstub()
Definition: Stub.h:83
unsigned int layerdisk() const
Definition: Stub.cc:193
const Stub * outerFPGAStub_
Definition: Tracklet.h:237
const Stub * innerFPGAStub_
Definition: Tracklet.h:235
const Stub * middleFPGAStub_
Definition: Tracklet.h:236
constexpr int N_LAYER
Definition: Settings.h:25

◆ layerstubstr()

const std::string Tracklet::layerstubstr ( const unsigned  layer) const

Definition at line 580 of file Tracklet.cc.

References cms::cuda::assert(), gather_cfg::cout, trklet::Residual::fpgaphiresid(), trklet::Residual::fpgarzresid(), trklet::Residual::fpgastubid(), layer(), trklet::N_LAYER, trklet::Settings::nbitstrackletindex(), trklet::Settings::ntrackletmax(), trklet::Stub::r(), resid_, settings_, trklet::FPGAWord::str(), trklet::Residual::stubptr(), createJobs::tmp, trackIndex_, and validateGeometry_cfg::valid.

Referenced by trackfitstr().

580  {
581  assert(layer < N_LAYER);
582 
583  std::stringstream oss("");
584  if (!resid_[layer].valid())
585  oss << "0|0000000|0000000000|0000000|000000000000|000000000";
586  else {
587  if (trackIndex_ < 0 || trackIndex_ > (int)settings_.ntrackletmax()) {
588  cout << "trackIndex_ = " << trackIndex_ << endl;
589  assert(0);
590  }
591  const FPGAWord tmp(trackIndex_, settings_.nbitstrackletindex(), true, __LINE__, __FILE__);
592  oss << "1|"; // valid bit
593  oss << tmp.str() << "|";
594  oss << resid_[layer].fpgastubid().str() << "|";
595  oss << resid_[layer].stubptr()->r().str() << "|";
596  oss << resid_[layer].fpgaphiresid().str() << "|";
597  oss << resid_[layer].fpgarzresid().str();
598  }
599 
600  return oss.str();
601 }
const FPGAWord & r() const
Definition: Stub.h:65
unsigned int nbitstrackletindex() const
Definition: Settings.h:309
const FPGAWord & fpgastubid() const
Definition: Residual.h:42
const FPGAWord & fpgaphiresid() const
Definition: Residual.h:32
assert(be >=bs)
Settings const & settings_
Definition: Tracklet.h:274
const FPGAWord & fpgarzresid() const
Definition: Residual.h:37
Residual resid_[N_LAYER+N_DISK]
Definition: Tracklet.h:272
const Stub * stubptr() const
Definition: Residual.h:67
unsigned int ntrackletmax() const
Definition: Settings.h:371
int layer() const
Definition: Tracklet.cc:783
tmp
align.sh
Definition: createJobs.py:716
std::string str() const
Definition: FPGAWord.cc:54
constexpr int N_LAYER
Definition: Settings.h:25

◆ makeTrack()

Track Tracklet::makeTrack ( const std::vector< const L1TStub *> &  l1stubs)

Definition at line 750 of file Tracklet.cc.

References cms::cuda::assert(), chisqrphifit_, chisqrzfit_, fit(), fpgafitpars_, getISeed(), getL1Stubs(), getStubIDs(), hitpattern_, ichisqrphifit_, ichisqrzfit_, createJobs::tmp, and trklet::FPGAWord::value().

Referenced by setFitPars().

750  {
751  assert(fit());
752 
753  // Digitized track helix params
754  TrackPars<int> ipars(fpgafitpars_.rinv().value(),
755  fpgafitpars_.phi0().value(),
756  fpgafitpars_.d0().value(),
757  fpgafitpars_.t().value(),
758  fpgafitpars_.z0().value());
759 
760  // If fitter produced no stub list, take it from original tracklet.
761  vector<const L1TStub*> tmp = l1stubs.empty() ? getL1Stubs() : l1stubs;
762 
763  vector<L1TStub> tmp2;
764 
765  tmp2.reserve(tmp.size());
766  for (auto stub : tmp) {
767  tmp2.push_back(*stub);
768  }
769 
770  Track tmpTrack(ipars,
774  chisqrzfit_,
775  hitpattern_,
776  getStubIDs(),
777  tmp2,
778  getISeed());
779 
780  return tmpTrack;
781 }
double chisqrzfit_
Definition: Tracklet.h:260
assert(be >=bs)
std::vector< const L1TStub * > getL1Stubs()
Definition: Tracklet.cc:351
FPGAWord ichisqrzfit_
Definition: Tracklet.h:256
bool fit() const
Definition: Tracklet.h:197
FPGAWord ichisqrphifit_
Definition: Tracklet.h:255
TrackPars< FPGAWord > fpgafitpars_
Definition: Tracklet.h:254
int value() const
Definition: FPGAWord.h:24
int getISeed() const
Definition: Tracklet.cc:811
tmp
align.sh
Definition: createJobs.py:716
double chisqrphifit_
Definition: Tracklet.h:259
std::map< int, int > getStubIDs()
Definition: Tracklet.cc:369

◆ match()

bool trklet::Tracklet::match ( unsigned int  layerdisk)
inline

Definition at line 105 of file Tracklet.h.

References cms::cuda::assert(), trklet::N_DISK, trklet::N_LAYER, resid_, and trklet::Residual::valid().

Referenced by trklet::FitTrack::execute(), trklet::MatchProcessor::matchCalculator(), and trklet::FitTrack::trackFitChisq().

105  {
106  assert(layerdisk < N_LAYER + N_DISK);
107  return resid_[layerdisk].valid();
108  }
constexpr int N_DISK
Definition: Settings.h:26
assert(be >=bs)
Residual resid_[N_LAYER+N_DISK]
Definition: Tracklet.h:272
bool valid() const
Definition: Residual.h:30
constexpr int N_LAYER
Definition: Settings.h:25

◆ middleFPGAStub()

const Stub* trklet::Tracklet::middleFPGAStub ( ) const
inline

Definition at line 63 of file Tracklet.h.

References middleFPGAStub_.

Referenced by Tracklet().

63 { return middleFPGAStub_; }
const Stub * middleFPGAStub_
Definition: Tracklet.h:236

◆ outerFPGAStub()

const Stub* trklet::Tracklet::outerFPGAStub ( ) const
inline

Definition at line 65 of file Tracklet.h.

References outerFPGAStub_.

Referenced by trklet::FitTrack::execute(), trklet::FitTrack::trackFitChisq(), trackfitstr(), and Tracklet().

65 { return outerFPGAStub_; }
const Stub * outerFPGAStub_
Definition: Tracklet.h:237

◆ phi0()

double trklet::Tracklet::phi0 ( ) const
inline

◆ phi0approx()

double trklet::Tracklet::phi0approx ( ) const
inline

Definition at line 127 of file Tracklet.h.

References trklet::TrackPars< T >::phi0(), and trackparsapprox_.

Referenced by trklet::FitTrack::trackFitChisq(), trklet::FitTrack::trackFitFake(), and Tracklet().

127 { return trackparsapprox_.phi0(); }
const T & phi0() const
Definition: TrackPars.h:30
TrackPars< double > trackparsapprox_
Definition: Tracklet.h:247

◆ phi0fit()

double trklet::Tracklet::phi0fit ( ) const
inline

Definition at line 139 of file Tracklet.h.

References fitpars_, and trklet::TrackPars< T >::phi0().

Referenced by setFitPars().

139 { return fitpars_.phi0(); }
const T & phi0() const
Definition: TrackPars.h:30
TrackPars< double > fitpars_
Definition: Tracklet.h:258

◆ phi0fitexact()

double trklet::Tracklet::phi0fitexact ( ) const
inline

Definition at line 146 of file Tracklet.h.

References fitparsexact_, and trklet::TrackPars< T >::phi0().

Referenced by setFitPars().

146 { return fitparsexact_.phi0(); }
const T & phi0() const
Definition: TrackPars.h:30
TrackPars< double > fitparsexact_
Definition: Tracklet.h:262

◆ proj()

Projection& trklet::Tracklet::proj ( int  layerdisk)
inline

◆ PSseed()

unsigned int trklet::Tracklet::PSseed ( ) const
inline

Definition at line 222 of file Tracklet.h.

References disk(), and layer().

Referenced by vmstrlayer().

222 { return ((layer() == 1) || (layer() == 2) || (disk() != 0)) ? 1 : 0; }
int disk() const
Definition: Tracklet.cc:792
int layer() const
Definition: Tracklet.cc:783

◆ resid()

const Residual& trklet::Tracklet::resid ( unsigned int  layerdisk)
inline

Definition at line 110 of file Tracklet.h.

References cms::cuda::assert(), trklet::N_DISK, trklet::N_LAYER, resid_, and validateGeometry_cfg::valid.

Referenced by trklet::FitTrack::execute(), trklet::MatchProcessor::matchCalculator(), and trklet::FitTrack::trackFitChisq().

110  {
111  assert(layerdisk < N_LAYER + N_DISK);
112  assert(resid_[layerdisk].valid());
113  return resid_[layerdisk];
114  }
constexpr int N_DISK
Definition: Settings.h:26
assert(be >=bs)
Residual resid_[N_LAYER+N_DISK]
Definition: Tracklet.h:272
constexpr int N_LAYER
Definition: Settings.h:25

◆ rinv()

double trklet::Tracklet::rinv ( ) const
inline

◆ rinvapprox()

double trklet::Tracklet::rinvapprox ( ) const
inline

Definition at line 126 of file Tracklet.h.

References trklet::TrackPars< T >::rinv(), and trackparsapprox_.

Referenced by trklet::FitTrack::trackFitChisq(), trklet::FitTrack::trackFitFake(), and Tracklet().

126 { return trackparsapprox_.rinv(); }
TrackPars< double > trackparsapprox_
Definition: Tracklet.h:247
const T & rinv() const
Definition: TrackPars.h:29

◆ rinvfit()

double trklet::Tracklet::rinvfit ( ) const
inline

Definition at line 138 of file Tracklet.h.

References fitpars_, and trklet::TrackPars< T >::rinv().

Referenced by setFitPars().

138 { return fitpars_.rinv(); }
TrackPars< double > fitpars_
Definition: Tracklet.h:258
const T & rinv() const
Definition: TrackPars.h:29

◆ rinvfitexact()

double trklet::Tracklet::rinvfitexact ( ) const
inline

Definition at line 145 of file Tracklet.h.

References fitparsexact_, and trklet::TrackPars< T >::rinv().

Referenced by setFitPars().

145 { return fitparsexact_.rinv(); }
const T & rinv() const
Definition: TrackPars.h:29
TrackPars< double > fitparsexact_
Definition: Tracklet.h:262

◆ seedIndex()

unsigned int trklet::Tracklet::seedIndex ( ) const
inline

◆ setFitPars()

void Tracklet::setFitPars ( double  rinvfit,
double  phi0fit,
double  d0fit,
double  tfit,
double  z0fit,
double  chisqrphifit,
double  chisqrzfit,
double  rinvfitexact,
double  phi0fitexact,
double  d0fitexact,
double  tfitexact,
double  z0fitexact,
double  chisqrphifitexact,
double  chisqrzfitexact,
int  irinvfit,
int  iphi0fit,
int  id0fit,
int  itfit,
int  iz0fit,
int  ichisqrphifit,
int  ichisqrzfit,
int  hitpattern,
const std::vector< const L1TStub *> &  l1stubs = std::vector<const L1TStub*>() 
)

Definition at line 523 of file Tracklet.cc.

References chisqrphifit_, chisqrphifitexact_, chisqrzfit_, chisqrzfitexact_, d0fit(), d0fitexact(), fitpars_, fitparsexact_, fpgafitpars_, fpgatrack_, hitpattern_, ichisqrphifit_, ichisqrzfit_, id0fit(), trklet::TrackPars< T >::init(), iphi0fit(), irinvfit(), itfit(), iz0fit(), makeTrack(), trklet::Settings::nbitsz0(), phi0fit(), phi0fitexact(), rinvfit(), rinvfitexact(), trklet::FPGAWord::set(), settings_, tfit(), tfitexact(), z0fit(), and z0fitexact().

Referenced by trklet::FitTrack::trackFitChisq(), and trklet::FitTrack::trackFitFake().

545  {
547  chisqrphifit_ = chisqrphifit;
548  chisqrzfit_ = chisqrzfit;
549 
551  chisqrphifitexact_ = chisqrphifitexact;
552  chisqrzfitexact_ = chisqrzfitexact;
553 
554  if (irinvfit > (1 << 14))
555  irinvfit = (1 << 14);
556  if (irinvfit <= -(1 << 14))
557  irinvfit = -(1 << 14) + 1;
558  fpgafitpars_.rinv().set(irinvfit, 15, false, __LINE__, __FILE__);
559  fpgafitpars_.phi0().set(iphi0fit, 19, false, __LINE__, __FILE__);
560  fpgafitpars_.d0().set(id0fit, 19, false, __LINE__, __FILE__);
561  fpgafitpars_.t().set(itfit, 14, false, __LINE__, __FILE__);
562 
563  if (iz0fit >= (1 << (settings_.nbitsz0() - 1))) {
564  iz0fit = (1 << (settings_.nbitsz0() - 1)) - 1;
565  }
566 
567  if (iz0fit <= -(1 << (settings_.nbitsz0() - 1))) {
568  iz0fit = 1 - (1 << (settings_.nbitsz0() - 1));
569  }
570 
571  fpgafitpars_.z0().set(iz0fit, settings_.nbitsz0(), false, __LINE__, __FILE__);
572  ichisqrphifit_.set(ichisqrphifit, 8, true, __LINE__, __FILE__);
573  ichisqrzfit_.set(ichisqrzfit, 8, true, __LINE__, __FILE__);
574 
575  hitpattern_ = hitpattern;
576 
577  fpgatrack_ = std::make_unique<Track>(makeTrack(l1stubs));
578 }
double d0fitexact() const
Definition: Tracklet.h:147
const FPGAWord & iz0fit() const
Definition: Tracklet.h:155
double rinvfitexact() const
Definition: Tracklet.h:145
double d0fit() const
Definition: Tracklet.h:140
double tfit() const
Definition: Tracklet.h:141
double chisqrzfit_
Definition: Tracklet.h:260
double chisqrzfitexact_
Definition: Tracklet.h:264
const FPGAWord & iphi0fit() const
Definition: Tracklet.h:152
Settings const & settings_
Definition: Tracklet.h:274
FPGAWord ichisqrzfit_
Definition: Tracklet.h:256
FPGAWord ichisqrphifit_
Definition: Tracklet.h:255
TrackPars< double > fitpars_
Definition: Tracklet.h:258
double z0fitexact() const
Definition: Tracklet.h:149
const FPGAWord & id0fit() const
Definition: Tracklet.h:153
TrackPars< FPGAWord > fpgafitpars_
Definition: Tracklet.h:254
std::unique_ptr< Track > fpgatrack_
Definition: Tracklet.h:268
double tfitexact() const
Definition: Tracklet.h:148
double phi0fitexact() const
Definition: Tracklet.h:146
double z0fit() const
Definition: Tracklet.h:142
void set(int value, int nbits, bool positive=true, int line=-1, const char *file=nullptr)
Definition: FPGAWord.cc:14
TrackPars< double > fitparsexact_
Definition: Tracklet.h:262
const FPGAWord & itfit() const
Definition: Tracklet.h:154
Track makeTrack(const std::vector< const L1TStub *> &l1stubs)
Definition: Tracklet.cc:750
int nbitsz0() const
Definition: Settings.h:377
double chisqrphifitexact_
Definition: Tracklet.h:263
const FPGAWord & irinvfit() const
Definition: Tracklet.h:151
double phi0fit() const
Definition: Tracklet.h:139
double rinvfit() const
Definition: Tracklet.h:138
double chisqrphifit_
Definition: Tracklet.h:259
void init(T rinv, T phi0, T d0, T t, T z0)
Definition: TrackPars.h:21

◆ setTCIndex()

void trklet::Tracklet::setTCIndex ( int  index)
inline

◆ setTrackIndex()

void Tracklet::setTrackIndex ( int  index)

Definition at line 823 of file Tracklet.cc.

References cms::cuda::assert(), trklet::Settings::ntrackletmax(), settings_, and trackIndex_.

Referenced by trklet::FitTrack::execute().

823  {
824  trackIndex_ = index;
825  assert(index <= (int)settings_.ntrackletmax());
826 }
assert(be >=bs)
Settings const & settings_
Definition: Tracklet.h:274
unsigned int ntrackletmax() const
Definition: Settings.h:371

◆ setTrackletIndex()

void Tracklet::setTrackletIndex ( unsigned int  index)

◆ stubtruthmatch()

bool Tracklet::stubtruthmatch ( const L1TStub stub)

Definition at line 138 of file Tracklet.cc.

References funct::abs(), innerFPGAStub_, trklet::Stub::l1tstub(), outerFPGAStub_, cmsswSequenceInfo::tp, and trklet::L1TStub::tps().

Referenced by trklet::MatchCalculator::execute(), and trklet::MatchProcessor::matchCalculator().

138  {
139  set<int> tpset;
140  set<int> tpsetstub;
141  set<int> tpsetstubinner;
142  set<int> tpsetstubouter;
143 
144  vector<int> tps = stub->tps();
145  for (auto tp : tps) {
146  if (tp != 0) {
147  tpsetstub.insert(tp);
148  tpset.insert(abs(tp));
149  }
150  }
151  tps = innerFPGAStub_->l1tstub()->tps();
152  for (auto tp : tps) {
153  if (tp != 0) {
154  tpsetstubinner.insert(tp);
155  tpset.insert(abs(tp));
156  }
157  }
158  tps = outerFPGAStub_->l1tstub()->tps();
159  for (auto tp : tps) {
160  if (tp != 0) {
161  tpsetstubouter.insert(tp);
162  tpset.insert(abs(tp));
163  }
164  }
165 
166  for (auto tp : tpset) {
167  if (tpsetstub.find(tp) != tpsetstub.end() && tpsetstub.find(-tp) != tpsetstub.end() &&
168  tpsetstubinner.find(tp) != tpsetstubinner.end() && tpsetstubinner.find(-tp) != tpsetstubinner.end() &&
169  tpsetstubouter.find(tp) != tpsetstubouter.end() && tpsetstubouter.find(-tp) != tpsetstubouter.end()) {
170  return true;
171  }
172  }
173 
174  return false;
175 }
Abs< T >::type abs(const T &t)
Definition: Abs.h:22
L1TStub * l1tstub()
Definition: Stub.h:83
const Stub * outerFPGAStub_
Definition: Tracklet.h:237
const Stub * innerFPGAStub_
Definition: Tracklet.h:235
std::vector< int > tps() const
Definition: L1TStub.h:81

◆ t()

double trklet::Tracklet::t ( ) const
inline

◆ tapprox()

double trklet::Tracklet::tapprox ( ) const
inline

Definition at line 129 of file Tracklet.h.

References trklet::TrackPars< T >::t(), and trackparsapprox_.

Referenced by trklet::FitTrack::trackFitChisq(), trklet::FitTrack::trackFitFake(), and Tracklet().

129 { return trackparsapprox_.t(); }
TrackPars< double > trackparsapprox_
Definition: Tracklet.h:247
const T & t() const
Definition: TrackPars.h:32

◆ TCID()

int trklet::Tracklet::TCID ( ) const
inline

◆ TCIndex()

int trklet::Tracklet::TCIndex ( ) const
inline

Definition at line 212 of file Tracklet.h.

References TCIndex_.

212 { return TCIndex_; }

◆ tfit()

double trklet::Tracklet::tfit ( ) const
inline

Definition at line 141 of file Tracklet.h.

References fitpars_, and trklet::TrackPars< T >::t().

Referenced by setFitPars().

141 { return fitpars_.t(); }
TrackPars< double > fitpars_
Definition: Tracklet.h:258
const T & t() const
Definition: TrackPars.h:32

◆ tfitexact()

double trklet::Tracklet::tfitexact ( ) const
inline

Definition at line 148 of file Tracklet.h.

References fitparsexact_, and trklet::TrackPars< T >::t().

Referenced by setFitPars().

148 { return fitparsexact_.t(); }
TrackPars< double > fitparsexact_
Definition: Tracklet.h:262
const T & t() const
Definition: TrackPars.h:32

◆ tpseed()

int Tracklet::tpseed ( )

Definition at line 107 of file Tracklet.cc.

References funct::abs(), innerFPGAStub_, trklet::Stub::l1tstub(), outerFPGAStub_, cmsswSequenceInfo::tp, and trklet::L1TStub::tps().

Referenced by trklet::TrackletCalculatorBase::barrelSeeding().

107  {
108  set<int> tpset;
109 
110  set<int> tpsetstubinner;
111  set<int> tpsetstubouter;
112 
113  vector<int> tps = innerFPGAStub_->l1tstub()->tps();
114  for (auto tp : tps) {
115  if (tp != 0) {
116  tpsetstubinner.insert(tp);
117  tpset.insert(abs(tp));
118  }
119  }
120 
121  tps = outerFPGAStub_->l1tstub()->tps();
122  for (auto tp : tps) {
123  if (tp != 0) {
124  tpsetstubouter.insert(tp);
125  tpset.insert(abs(tp));
126  }
127  }
128 
129  for (auto& tp : tpset) {
130  if (tpsetstubinner.find(tp) != tpsetstubinner.end() && tpsetstubinner.find(-tp) != tpsetstubinner.end() &&
131  tpsetstubouter.find(tp) != tpsetstubouter.end() && tpsetstubouter.find(-tp) != tpsetstubouter.end()) {
132  return tp;
133  }
134  }
135  return 0;
136 }
Abs< T >::type abs(const T &t)
Definition: Abs.h:22
L1TStub * l1tstub()
Definition: Stub.h:83
const Stub * outerFPGAStub_
Definition: Tracklet.h:237
const Stub * innerFPGAStub_
Definition: Tracklet.h:235
std::vector< int > tps() const
Definition: L1TStub.h:81

◆ trackfitstr()

std::string Tracklet::trackfitstr ( ) const

Definition at line 628 of file Tracklet.cc.

References diskstubstr(), fpgapars_, getISeed(), mps_fire::i, innerFPGAStub(), layerstubstr(), trklet::Settings::nbitsseed(), outerFPGAStub(), seedIndex(), settings_, trklet::FPGAWord::str(), AlCaHLTBitMon_QueryRunRegistry::string, trklet::Stub::stubindex(), createJobs::tmp, and trklet::Settings::writeoutReal().

628  {
629  const unsigned maxNHits = 8;
630  const unsigned nBitsPerHit = 3;
631  vector<string> stub(maxNHits, "0");
632  string hitmap(maxNHits * nBitsPerHit, '0');
633 
634  // Assign stub strings for each of the possible projections for each seed.
635  // The specific layers/disks for a given seed are determined by the wiring.
636  switch (seedIndex()) {
637  case 0: // L1L2
638  stub[0] = layerstubstr(2); // L3
639  stub[1] = layerstubstr(3); // L4
640  stub[2] = layerstubstr(4); // L5
641  stub[3] = layerstubstr(5); // L6
642 
643  stub[4] = diskstubstr(0); // D1
644  stub[5] = diskstubstr(1); // D2
645  stub[6] = diskstubstr(2); // D3
646  stub[7] = diskstubstr(3); // D4
647 
648  break;
649 
650  case 1: // L2L3
651  stub[0] = layerstubstr(0); // L1
652  stub[1] = layerstubstr(3); // L4
653  stub[2] = layerstubstr(4); // L5
654 
655  stub[3] = diskstubstr(0); // D1
656  stub[4] = diskstubstr(1); // D2
657  stub[5] = diskstubstr(2); // D3
658  stub[6] = diskstubstr(3); // D4
659 
660  break;
661 
662  case 2: // L3L4
663  stub[0] = layerstubstr(0); // L1
664  stub[1] = layerstubstr(1); // L2
665  stub[2] = layerstubstr(4); // L5
666  stub[3] = layerstubstr(5); // L6
667 
668  stub[4] = diskstubstr(0); // D1
669  stub[5] = diskstubstr(1); // D2
670 
671  break;
672 
673  case 3: // L5L6
674  stub[0] = layerstubstr(0); // L1
675  stub[1] = layerstubstr(1); // L2
676  stub[2] = layerstubstr(2); // L3
677  stub[3] = layerstubstr(3); // L4
678 
679  break;
680 
681  case 4: // D1D2
682  stub[0] = layerstubstr(0); // L1
683  stub[1] = layerstubstr(1); // L2
684 
685  stub[2] = diskstubstr(2); // D3
686  stub[3] = diskstubstr(3); // D4
687  stub[4] = diskstubstr(4); // D5
688 
689  break;
690 
691  case 5: // D3D4
692  stub[0] = layerstubstr(0); // L1
693 
694  stub[1] = diskstubstr(0); // D1
695  stub[2] = diskstubstr(1); // D2
696  stub[3] = diskstubstr(4); // D5
697 
698  break;
699 
700  case 6: // L1D1
701  stub[0] = diskstubstr(1); // D2
702  stub[1] = diskstubstr(2); // D3
703  stub[2] = diskstubstr(3); // D4
704  stub[3] = diskstubstr(4); // D5
705 
706  break;
707 
708  case 7: // L2D1
709  stub[0] = layerstubstr(0); // L1
710 
711  stub[1] = diskstubstr(1); // D2
712  stub[2] = diskstubstr(2); // D3
713  stub[3] = diskstubstr(3); // D4
714 
715  break;
716  }
717 
718  // Only one hit per layer/disk is allowed currently, so the hit map for a
719  // given layer/disk is just equal to the valid bit of the corresponding stub
720  // string, which is the first character.
721  for (unsigned i = 0; i < maxNHits; i++)
722  hitmap[i * nBitsPerHit + 2] = stub[i][0];
723 
724  std::string oss("");
725  //Binary print out
726  if (!settings_.writeoutReal()) {
727  const FPGAWord tmp(getISeed(), settings_.nbitsseed(), true, __LINE__, __FILE__);
728 
729  oss += "1|"; // valid bit
730  oss += tmp.str() + "|";
731  oss += innerFPGAStub()->stubindex().str() + "|";
732  oss += outerFPGAStub()->stubindex().str() + "|";
733  oss += fpgapars_.rinv().str() + "|";
734  oss += fpgapars_.phi0().str() + "|";
735  oss += fpgapars_.z0().str() + "|";
736  oss += fpgapars_.t().str() + "|";
737  oss += hitmap;
738  for (unsigned i = 0; i < maxNHits; i++)
739  // If a valid stub string was never assigned, then that stub is not
740  // included in the output.
741  if (stub[i] != "0")
742  oss += "|" + stub[i];
743  }
744 
745  return oss;
746 }
TrackPars< FPGAWord > fpgapars_
Definition: Tracklet.h:244
unsigned int seedIndex() const
Definition: Tracklet.h:224
const std::string layerstubstr(const unsigned layer) const
Definition: Tracklet.cc:580
unsigned int nbitsseed() const
Definition: Settings.h:313
Settings const & settings_
Definition: Tracklet.h:274
const Stub * outerFPGAStub() const
Definition: Tracklet.h:65
const FPGAWord & stubindex() const
Definition: Stub.h:72
const std::string diskstubstr(const unsigned disk) const
Definition: Tracklet.cc:603
int getISeed() const
Definition: Tracklet.cc:811
bool writeoutReal() const
Definition: Settings.h:217
tmp
align.sh
Definition: createJobs.py:716
std::string str() const
Definition: FPGAWord.cc:54
const Stub * innerFPGAStub() const
Definition: Tracklet.h:61

◆ trackIndex()

int Tracklet::trackIndex ( ) const

Definition at line 828 of file Tracklet.cc.

References trackIndex_.

828 { return trackIndex_; }

◆ trackletIndex()

int trklet::Tracklet::trackletIndex ( ) const
inline

Definition at line 208 of file Tracklet.h.

References trackletIndex_.

Referenced by trklet::FullMatchMemory::addMatch().

208 { return trackletIndex_; }

◆ trackletparstr()

std::string Tracklet::trackletparstr ( )

Definition at line 188 of file Tracklet.cc.

References trklet::Settings::combined(), fpgapars_, innerFPGAStub_, trklet::Settings::kd0pars(), trklet::Settings::kphi0pars(), trklet::Settings::krinvpars(), trklet::Settings::ktpars(), trklet::Settings::kz(), trklet::L1D1, trklet::L2D1, middleFPGAStub_, outerFPGAStub_, trklet::Stub::phiregionstr(), seedIndex(), settings_, trklet::FPGAWord::str(), str, AlCaHLTBitMon_QueryRunRegistry::string, trklet::Stub::stubindex(), to_string(), and trklet::Settings::writeoutReal().

188  {
189  if (settings_.writeoutReal()) {
190  std::string oss = std::to_string(fpgapars_.rinv().value() * settings_.krinvpars()) + " " +
191  std::to_string(fpgapars_.phi0().value() * settings_.kphi0pars()) + " " +
192  std::to_string(fpgapars_.d0().value() * settings_.kd0pars()) + " " +
193  std::to_string(fpgapars_.z0().value() * settings_.kz()) + " " +
194  std::to_string(fpgapars_.t().value() * settings_.ktpars());
195  return oss;
196  } else {
197  std::string str = "";
198  if (settings_.combined()) {
199  if (seedIndex() == Seed::L1D1 || seedIndex() == Seed::L2D1) {
200  str += outerFPGAStub_->phiregionstr() + "|";
201  } else {
202  str += innerFPGAStub_->phiregionstr() + "|";
203  }
204  }
205  str += innerFPGAStub_->stubindex().str() + "|";
206  if (middleFPGAStub_) {
207  str += middleFPGAStub_->stubindex().str() + "|";
208  }
209  str += outerFPGAStub_->stubindex().str() + "|" + fpgapars_.rinv().str() + "|" + fpgapars_.phi0().str() + "|";
210  if (middleFPGAStub_)
211  str += fpgapars_.d0().str() + "|";
212  str += fpgapars_.z0().str() + "|" + fpgapars_.t().str();
213  return str;
214  }
215 }
TrackPars< FPGAWord > fpgapars_
Definition: Tracklet.h:244
unsigned int seedIndex() const
Definition: Tracklet.h:224
double kz() const
Definition: Settings.h:342
bool combined() const
Definition: Settings.h:270
double kd0pars() const
Definition: Settings.h:432
double ktpars() const
Definition: Settings.h:430
double krinvpars() const
Definition: Settings.h:425
static std::string to_string(const XMLCh *ch)
Settings const & settings_
Definition: Tracklet.h:274
double kphi0pars() const
Definition: Settings.h:429
const FPGAWord & stubindex() const
Definition: Stub.h:72
bool writeoutReal() const
Definition: Settings.h:217
const Stub * outerFPGAStub_
Definition: Tracklet.h:237
const Stub * innerFPGAStub_
Definition: Tracklet.h:235
const Stub * middleFPGAStub_
Definition: Tracklet.h:236
#define str(s)
std::string str() const
Definition: FPGAWord.cc:54
std::string phiregionstr() const
Definition: Stub.cc:125

◆ trackletprojstr()

std::string Tracklet::trackletprojstr ( int  layer) const

Definition at line 267 of file Tracklet.cc.

References cms::cuda::assert(), Exception, trklet::Projection::fpgaphiproj(), trklet::Projection::fpgaphiprojder(), trklet::Projection::fpgarzproj(), trklet::Projection::fpgarzprojder(), layer(), trklet::N_LAYER, trklet::Settings::nbitstcindex(), trklet::Settings::nbitstrackletindex(), trklet::Settings::ntrackletmax(), proj_, trklet::FPGAWord::set(), settings_, trklet::FPGAWord::str(), AlCaHLTBitMon_QueryRunRegistry::string, TCIndex_, createJobs::tmp, and trackletIndex_.

Referenced by trackletprojstrlayer().

267  {
268  assert(layer > 0 && layer <= N_LAYER);
269  FPGAWord tmp;
270  if (trackletIndex_ < 0 || trackletIndex_ > (int)settings_.ntrackletmax()) {
271  throw cms::Exception("BadConfig") << __FILE__ << " " << __LINE__ << " trackletIndex_ = " << trackletIndex_;
272  }
273  tmp.set(trackletIndex_, settings_.nbitstrackletindex(), true, __LINE__, __FILE__);
274  FPGAWord tcid;
275  tcid.set(TCIndex_, settings_.nbitstcindex(), true, __LINE__, __FILE__);
276 
277  std::string oss = tcid.str() + "|" + tmp.str() + "|" + proj_[layer - 1].fpgaphiproj().str() + "|" +
278  proj_[layer - 1].fpgarzproj().str() + "|" + proj_[layer - 1].fpgaphiprojder().str() + "|" +
279  proj_[layer - 1].fpgarzprojder().str();
280  return oss;
281 }
Projection proj_[N_LAYER+N_DISK]
Definition: Tracklet.h:270
unsigned int nbitstrackletindex() const
Definition: Settings.h:309
const FPGAWord & fpgarzprojder() const
Definition: Projection.h:54
assert(be >=bs)
const FPGAWord & fpgaphiproj() const
Definition: Projection.h:39
Settings const & settings_
Definition: Tracklet.h:274
const FPGAWord & fpgaphiprojder() const
Definition: Projection.h:49
unsigned int nbitstcindex() const
Definition: Settings.h:314
void set(int value, int nbits, bool positive=true, int line=-1, const char *file=nullptr)
Definition: FPGAWord.cc:14
const FPGAWord & fpgarzproj() const
Definition: Projection.h:44
unsigned int ntrackletmax() const
Definition: Settings.h:371
int layer() const
Definition: Tracklet.cc:783
tmp
align.sh
Definition: createJobs.py:716
std::string str() const
Definition: FPGAWord.cc:54
constexpr int N_LAYER
Definition: Settings.h:25

◆ trackletprojstrD()

std::string Tracklet::trackletprojstrD ( int  disk) const

Definition at line 283 of file Tracklet.cc.

References funct::abs(), cms::cuda::assert(), disk(), Exception, trklet::Settings::extended(), trklet::Projection::fpgaphiproj(), trklet::Projection::fpgaphiprojder(), trklet::Projection::fpgarzproj(), trklet::Projection::fpgarzprojder(), trklet::N_DISK, trklet::N_LAYER, trklet::Settings::nbitstrackletindex(), trklet::Settings::ntrackletmax(), proj_, trklet::FPGAWord::set(), settings_, trklet::FPGAWord::str(), AlCaHLTBitMon_QueryRunRegistry::string, TCIndex_, createJobs::tmp, and trackletIndex_.

Referenced by trackletprojstrdisk().

283  {
284  assert(abs(disk) <= N_DISK);
285  FPGAWord tmp;
286  if (trackletIndex_ < 0 || trackletIndex_ > (int)settings_.ntrackletmax()) {
287  throw cms::Exception("BadConfig") << __FILE__ << " " << __LINE__ << " trackletIndex_ = " << trackletIndex_;
288  }
289  tmp.set(trackletIndex_, settings_.nbitstrackletindex(), true, __LINE__, __FILE__);
290  FPGAWord tcid;
291  if (settings_.extended()) {
292  tcid.set(TCIndex_, 8, true, __LINE__, __FILE__);
293  } else {
294  tcid.set(TCIndex_, 7, true, __LINE__, __FILE__);
295  }
296  std::string oss = tcid.str() + "|" + tmp.str() + "|" + proj_[N_LAYER + abs(disk) - 1].fpgaphiproj().str() + "|" +
297  proj_[N_LAYER + abs(disk) - 1].fpgarzproj().str() + "|" +
298  proj_[N_LAYER + abs(disk) - 1].fpgaphiprojder().str() + "|" +
299  proj_[N_LAYER + abs(disk) - 1].fpgarzprojder().str();
300  return oss;
301 }
Projection proj_[N_LAYER+N_DISK]
Definition: Tracklet.h:270
constexpr int N_DISK
Definition: Settings.h:26
int disk() const
Definition: Tracklet.cc:792
unsigned int nbitstrackletindex() const
Definition: Settings.h:309
const FPGAWord & fpgarzprojder() const
Definition: Projection.h:54
assert(be >=bs)
const FPGAWord & fpgaphiproj() const
Definition: Projection.h:39
Settings const & settings_
Definition: Tracklet.h:274
Abs< T >::type abs(const T &t)
Definition: Abs.h:22
const FPGAWord & fpgaphiprojder() const
Definition: Projection.h:49
void set(int value, int nbits, bool positive=true, int line=-1, const char *file=nullptr)
Definition: FPGAWord.cc:14
const FPGAWord & fpgarzproj() const
Definition: Projection.h:44
bool extended() const
Definition: Settings.h:268
unsigned int ntrackletmax() const
Definition: Settings.h:371
tmp
align.sh
Definition: createJobs.py:716
std::string str() const
Definition: FPGAWord.cc:54
constexpr int N_LAYER
Definition: Settings.h:25

◆ trackletprojstrdisk()

std::string trklet::Tracklet::trackletprojstrdisk ( int  disk) const
inline

Definition at line 80 of file Tracklet.h.

References disk(), and trackletprojstrD().

80 { return trackletprojstrD(disk); }
int disk() const
Definition: Tracklet.cc:792
std::string trackletprojstrD(int disk) const
Definition: Tracklet.cc:283

◆ trackletprojstrlayer()

std::string trklet::Tracklet::trackletprojstrlayer ( int  layer) const
inline

Definition at line 79 of file Tracklet.h.

References layer(), and trackletprojstr().

79 { return trackletprojstr(layer); }
std::string trackletprojstr(int layer) const
Definition: Tracklet.cc:267
int layer() const
Definition: Tracklet.cc:783

◆ validProj()

bool trklet::Tracklet::validProj ( int  layerdisk) const
inline

◆ vmstrdisk()

std::string Tracklet::vmstrdisk ( int  disk,
unsigned int  allstubindex 
)

Definition at line 252 of file Tracklet.cc.

References disk(), trklet::Projection::fpgafinephivm(), trklet::Projection::fpgafinerzvm(), trklet::Projection::fpgarzbin1projvm(), trklet::Projection::fpgarzbin2projvm(), trklet::Projection::getBendIndex(), trklet::N_LAYER, proj_, trklet::FPGAWord::str(), and AlCaHLTBitMon_QueryRunRegistry::string.

252  {
253  FPGAWord index;
254  if (allstubindex >= (1 << 7)) {
255  edm::LogPrint("Tracklet") << "Warning projection number too large!";
256  index.set((1 << 7) - 1, 7, true, __LINE__, __FILE__);
257  } else {
258  index.set(allstubindex, 7, true, __LINE__, __FILE__);
259  }
260  std::string oss =
261  index.str() + "|" + proj_[N_LAYER + disk - 1].fpgarzbin1projvm().str() + "|" +
262  proj_[N_LAYER + disk - 1].fpgarzbin2projvm().str() + "|" + proj_[N_LAYER + disk - 1].fpgafinerzvm().str() + "|" +
263  proj_[N_LAYER + disk - 1].fpgafinephivm().str() + "|" + proj_[N_LAYER + disk - 1].getBendIndex().str();
264  return oss;
265 }
const FPGAWord & fpgafinerzvm() const
Definition: Projection.h:69
Projection proj_[N_LAYER+N_DISK]
Definition: Tracklet.h:270
int disk() const
Definition: Tracklet.cc:792
const FPGAWord & fpgarzbin2projvm() const
Definition: Projection.h:64
const FPGAWord & getBendIndex() const
Definition: Projection.h:121
Log< level::Warning, true > LogPrint
const FPGAWord & fpgarzbin1projvm() const
Definition: Projection.h:59
const FPGAWord & fpgafinephivm() const
Definition: Projection.h:74
std::string str() const
Definition: FPGAWord.cc:54
constexpr int N_LAYER
Definition: Settings.h:25

◆ vmstrlayer()

std::string Tracklet::vmstrlayer ( int  layer,
unsigned int  allstubindex 
)

Definition at line 217 of file Tracklet.cc.

References cms::cuda::assert(), trklet::Settings::extended(), trklet::Projection::fpgafinephivm(), trklet::Projection::fpgafinerzvm(), trklet::Projection::fpgaphiprojder(), trklet::Projection::fpgarzbin1projvm(), trklet::Projection::fpgarzbin2projvm(), layer(), trklet::FPGAWord::nbits(), proj_, PSseed(), settings_, trklet::FPGAWord::str(), AlCaHLTBitMon_QueryRunRegistry::string, createJobs::tmp, to_string(), and trklet::FPGAWord::value().

217  {
218  FPGAWord index;
219  if (allstubindex >= (1 << 7)) {
220  edm::LogPrint("Tracklet") << "Warning projection number too large!";
221  index.set((1 << 7) - 1, 7, true, __LINE__, __FILE__);
222  } else {
223  index.set(allstubindex, 7, true, __LINE__, __FILE__);
224  }
225 
226  // This is a shortcut.
227  //int irinvvm=16+(fpgarinv().value()>>(fpgarinv().nbits()-5));
228  // rinv is not directly available in the TrackletProjection.
229  // can be inferred from phi derivative: rinv = - phider * 2
230  int tmp_irinv = proj_[layer - 1].fpgaphiprojder().value() * (-2);
231  int nbits_irinv = proj_[layer - 1].fpgaphiprojder().nbits() + 1;
232 
233  // irinv in VMProjection:
234  // top 5 bits of rinv and shifted to be positive
235  int irinvvm = 16 + (tmp_irinv >> (nbits_irinv - 5));
236 
237  if (settings_.extended() && (irinvvm > 31)) { //TODO - displaced tracking should protect against this
238  edm::LogPrint("Tracklet") << "Warning irinvvm too large:" << irinvvm;
239  irinvvm = 31;
240  }
241 
242  assert(irinvvm >= 0);
243  assert(irinvvm < 32);
244  FPGAWord tmp;
245  tmp.set(irinvvm, 5, true, __LINE__, __FILE__);
246  std::string oss = index.str() + "|" + proj_[layer - 1].fpgarzbin1projvm().str() + "|" +
247  proj_[layer - 1].fpgarzbin2projvm().str() + "|" + proj_[layer - 1].fpgafinerzvm().str() + "|" +
248  proj_[layer - 1].fpgafinephivm().str() + "|" + tmp.str() + "|" + std::to_string(PSseed());
249  return oss;
250 }
const FPGAWord & fpgafinerzvm() const
Definition: Projection.h:69
Projection proj_[N_LAYER+N_DISK]
Definition: Tracklet.h:270
const FPGAWord & fpgarzbin2projvm() const
Definition: Projection.h:64
assert(be >=bs)
static std::string to_string(const XMLCh *ch)
Settings const & settings_
Definition: Tracklet.h:274
int value() const
Definition: FPGAWord.h:24
Log< level::Warning, true > LogPrint
const FPGAWord & fpgarzbin1projvm() const
Definition: Projection.h:59
const FPGAWord & fpgaphiprojder() const
Definition: Projection.h:49
int nbits() const
Definition: FPGAWord.h:25
bool extended() const
Definition: Settings.h:268
const FPGAWord & fpgafinephivm() const
Definition: Projection.h:74
int layer() const
Definition: Tracklet.cc:783
unsigned int PSseed() const
Definition: Tracklet.h:222
tmp
align.sh
Definition: createJobs.py:716
std::string str() const
Definition: FPGAWord.cc:54

◆ z0()

double trklet::Tracklet::z0 ( ) const
inline

◆ z0approx()

double trklet::Tracklet::z0approx ( ) const
inline

Definition at line 130 of file Tracklet.h.

References trackparsapprox_, and trklet::TrackPars< T >::z0().

Referenced by trklet::FitTrack::trackFitChisq(), trklet::FitTrack::trackFitFake(), and Tracklet().

130 { return trackparsapprox_.z0(); }
const T & z0() const
Definition: TrackPars.h:33
TrackPars< double > trackparsapprox_
Definition: Tracklet.h:247

◆ z0fit()

double trklet::Tracklet::z0fit ( ) const
inline

Definition at line 142 of file Tracklet.h.

References fitpars_, and trklet::TrackPars< T >::z0().

Referenced by setFitPars().

142 { return fitpars_.z0(); }
const T & z0() const
Definition: TrackPars.h:33
TrackPars< double > fitpars_
Definition: Tracklet.h:258

◆ z0fitexact()

double trklet::Tracklet::z0fitexact ( ) const
inline

Definition at line 149 of file Tracklet.h.

References fitparsexact_, and trklet::TrackPars< T >::z0().

Referenced by setFitPars().

149 { return fitparsexact_.z0(); }
const T & z0() const
Definition: TrackPars.h:33
TrackPars< double > fitparsexact_
Definition: Tracklet.h:262

Member Data Documentation

◆ barrel_

bool trklet::Tracklet::barrel_
private

Definition at line 230 of file Tracklet.h.

Referenced by getStubIDs(), isBarrel(), and Tracklet().

◆ chisqrphifit_

double trklet::Tracklet::chisqrphifit_
private

Definition at line 259 of file Tracklet.h.

Referenced by chiSqfit(), makeTrack(), and setFitPars().

◆ chisqrphifitexact_

double trklet::Tracklet::chisqrphifitexact_
private

Definition at line 263 of file Tracklet.h.

Referenced by setFitPars().

◆ chisqrzfit_

double trklet::Tracklet::chisqrzfit_
private

Definition at line 260 of file Tracklet.h.

Referenced by chiSqfit(), makeTrack(), and setFitPars().

◆ chisqrzfitexact_

double trklet::Tracklet::chisqrzfitexact_
private

Definition at line 264 of file Tracklet.h.

Referenced by setFitPars().

◆ disk_

bool trklet::Tracklet::disk_
private

Definition at line 231 of file Tracklet.h.

Referenced by getStubIDs(), isDisk(), and Tracklet().

◆ fitpars_

TrackPars<double> trklet::Tracklet::fitpars_
private

Definition at line 258 of file Tracklet.h.

Referenced by d0fit(), phi0fit(), rinvfit(), setFitPars(), tfit(), and z0fit().

◆ fitparsexact_

TrackPars<double> trklet::Tracklet::fitparsexact_
private

Definition at line 262 of file Tracklet.h.

Referenced by d0fitexact(), phi0fitexact(), rinvfitexact(), setFitPars(), tfitexact(), and z0fitexact().

◆ fpgafitpars_

TrackPars<FPGAWord> trklet::Tracklet::fpgafitpars_
private

Definition at line 254 of file Tracklet.h.

Referenced by id0fit(), iphi0fit(), irinvfit(), itfit(), iz0fit(), makeTrack(), and setFitPars().

◆ fpgapars_

TrackPars<FPGAWord> trklet::Tracklet::fpgapars_
private

Definition at line 244 of file Tracklet.h.

Referenced by fpgad0(), fpgaphi0(), fpgarinv(), fpgat(), fpgaz0(), trackfitstr(), Tracklet(), and trackletparstr().

◆ fpgatrack_

std::unique_ptr<Track> trklet::Tracklet::fpgatrack_
private

Definition at line 268 of file Tracklet.h.

Referenced by getTrack(), setFitPars(), and Tracklet().

◆ hitpattern_

int trklet::Tracklet::hitpattern_
private

Definition at line 266 of file Tracklet.h.

Referenced by makeTrack(), and setFitPars().

◆ ichisqrphifit_

FPGAWord trklet::Tracklet::ichisqrphifit_
private

Definition at line 255 of file Tracklet.h.

Referenced by fit(), ichiSqfit(), makeTrack(), setFitPars(), and Tracklet().

◆ ichisqrzfit_

FPGAWord trklet::Tracklet::ichisqrzfit_
private

Definition at line 256 of file Tracklet.h.

Referenced by ichiSqfit(), makeTrack(), setFitPars(), and Tracklet().

◆ innerFPGAStub_

const Stub* trklet::Tracklet::innerFPGAStub_
private

◆ middleFPGAStub_

const Stub* trklet::Tracklet::middleFPGAStub_
private

◆ outerFPGAStub_

const Stub* trklet::Tracklet::outerFPGAStub_
private

◆ overlap_

bool trklet::Tracklet::overlap_
private

Definition at line 232 of file Tracklet.h.

Referenced by getStubIDs(), isOverlap(), and Tracklet().

◆ proj_

Projection trklet::Tracklet::proj_[N_LAYER+N_DISK]
private

◆ projdisk_

int trklet::Tracklet::projdisk_[N_DISK]
private

Definition at line 251 of file Tracklet.h.

Referenced by Tracklet().

◆ projlayer_

int trklet::Tracklet::projlayer_[N_LAYER - 2]
private

Definition at line 250 of file Tracklet.h.

Referenced by Tracklet().

◆ resid_

Residual trklet::Tracklet::resid_[N_LAYER+N_DISK]
private

◆ seedIndex_

unsigned int trklet::Tracklet::seedIndex_
private

Definition at line 227 of file Tracklet.h.

Referenced by seedIndex(), and Tracklet().

◆ settings_

Settings const& trklet::Tracklet::settings_
private

◆ TCIndex_

int trklet::Tracklet::TCIndex_
private

◆ trackIndex_

int trklet::Tracklet::trackIndex_
private

Definition at line 241 of file Tracklet.h.

Referenced by diskstubstr(), layerstubstr(), setTrackIndex(), and trackIndex().

◆ trackletIndex_

int trklet::Tracklet::trackletIndex_
private

◆ trackpars_

TrackPars<double> trklet::Tracklet::trackpars_
private

Definition at line 246 of file Tracklet.h.

Referenced by d0(), phi0(), rinv(), t(), Tracklet(), and z0().

◆ trackparsapprox_

TrackPars<double> trklet::Tracklet::trackparsapprox_
private

Definition at line 247 of file Tracklet.h.

Referenced by d0approx(), phi0approx(), rinvapprox(), tapprox(), Tracklet(), and z0approx().

◆ triplet_

bool trklet::Tracklet::triplet_
private

Definition at line 233 of file Tracklet.h.

Referenced by Tracklet().