CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
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 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 StubouterFPGAStub ()
 
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 ( 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_, disk(), disk_, fpgapars_, fpgatrack_, mps_fire::i, ichisqrphifit_, ichisqrzfit_, trklet::TrackPars< T >::init(), innerFPGAStub(), innerFPGAStub_, 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_, muon::overlap(), overlap_, proj_, projdisk_, trklet::Settings::projdisks(), projlayer_, trklet::Settings::projlayers(), seedIndex_, trklet::FPGAWord::set(), settings_, TCIndex_, trackletIndex_, trackpars_, trackparsapprox_, and triplet_.

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)
54  assert(innerFPGAStub->l1tstub()->layer() < N_LAYER);
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:242
const Stub * innerFPGAStub()
Definition: Tracklet.h:61
Projection proj_[N_LAYER+N_DISK]
Definition: Tracklet.h:268
constexpr int N_DISK
Definition: Settings.h:22
const Stub * outerFPGAStub()
Definition: Tracklet.h:65
double z0approx() const
Definition: Tracklet.h:130
int nbitst() const
Definition: Settings.h:336
double z0() const
Definition: Tracklet.h:124
int nbitsz0() const
Definition: Settings.h:337
TrackPars< double > trackparsapprox_
Definition: Tracklet.h:245
double phi0approx() const
Definition: Tracklet.h:127
assert(be >=bs)
Settings const & settings_
Definition: Tracklet.h:272
FPGAWord ichisqrzfit_
Definition: Tracklet.h:254
bool overlap(const reco::Muon &muon1, const reco::Muon &muon2, double pullX=1.0, double pullY=1.0, bool checkAdjacentChambers=false)
FPGAWord ichisqrphifit_
Definition: Tracklet.h:253
double tapprox() const
Definition: Tracklet.h:129
const Stub * middleFPGAStub()
Definition: Tracklet.h:63
int projdisk_[N_DISK]
Definition: Tracklet.h:249
unsigned int seedIndex_
Definition: Tracklet.h:225
std::unique_ptr< Track > fpgatrack_
Definition: Tracklet.h:266
int nbitsphi0() const
Definition: Settings.h:335
L1TStub * l1tstub()
Definition: Stub.h:77
int projlayer_[N_LAYER-2]
Definition: Tracklet.h:248
double t() const
Definition: Tracklet.h:123
double d0() const
Definition: Tracklet.h:122
unsigned int nbitsd0() const
Definition: Settings.h:309
double rinv() const
Definition: Tracklet.h:120
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
const Stub * outerFPGAStub_
Definition: Tracklet.h:235
unsigned int layer() const
Definition: L1TStub.h:41
const Stub * innerFPGAStub_
Definition: Tracklet.h:233
int disk() const
Definition: Tracklet.cc:779
int nbitsrinv() const
Definition: Settings.h:334
const Stub * middleFPGAStub_
Definition: Tracklet.h:234
TrackPars< double > trackpars_
Definition: Tracklet.h:244
double phi0() const
Definition: Tracklet.h:121
double rinvapprox() const
Definition: Tracklet.h:126
void init(T rinv, T phi0, T d0, T t, T z0)
Definition: TrackPars.h:21
constexpr int N_LAYER
Definition: Settings.h:21
trklet::Tracklet::~Tracklet ( )
default

Member Function Documentation

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 295 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().

303  {
304  assert(layerdisk < N_LAYER + N_DISK);
305  resid_[layerdisk].init(settings_, layerdisk, ideltaphi, ideltarz, stubid, dphi, drz, dphiapprox, drzapprox, stubptr);
306 }
constexpr int N_DISK
Definition: Settings.h:22
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:272
Residual resid_[N_LAYER+N_DISK]
Definition: Tracklet.h:270
constexpr int N_LAYER
Definition: Settings.h:21
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  {
179  str = innerFPGAStub_->phiregionaddressstr() + "|";
180  if (middleFPGAStub_) {
181  str += middleFPGAStub_->phiregionaddressstr() + "|";
182  }
184 
185  return str;
186 }
std::string phiregionaddressstr() const
Definition: Stub.cc:117
const Stub * outerFPGAStub_
Definition: Tracklet.h:235
const Stub * innerFPGAStub_
Definition: Tracklet.h:233
const Stub * middleFPGAStub_
Definition: Tracklet.h:234
#define str(s)
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:258
double chisqrphifit_
Definition: Tracklet.h:257
double trklet::Tracklet::d0 ( ) const
inline

Definition at line 122 of file Tracklet.h.

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

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

122 { return trackpars_.d0(); }
const T & d0() const
Definition: TrackPars.h:31
TrackPars< double > trackpars_
Definition: Tracklet.h:244
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().

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

Definition at line 140 of file Tracklet.h.

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

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

Definition at line 147 of file Tracklet.h.

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

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

Definition at line 779 of file Tracklet.cc.

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

Referenced by diskstubstr(), trklet::MatchCalculator::execute(), trklet::MatchProcessor::matchCalculator(), PSseed(), trklet::FitTrack::trackFitChisq(), and Tracklet().

779  {
780  int d1 = (innerFPGAStub_ && (innerFPGAStub_->layerdisk() >= N_LAYER)) ? innerFPGAStub_->l1tstub()->disk() : 999,
782  d3 = (outerFPGAStub_ && (outerFPGAStub_->layerdisk() >= N_LAYER)) ? outerFPGAStub_->l1tstub()->disk() : 999,
783  d = 999;
784  if (abs(d1) < min(abs(d2), abs(d3)))
785  d = d1;
786  if (abs(d2) < min(abs(d1), abs(d3)))
787  d = d2;
788  if (abs(d3) < min(abs(d1), abs(d2)))
789  d = d3;
790  return (d < 999 ? d : 0);
791 }
int disk() const
Definition: L1TStub.h:42
tuple d
Definition: ztail.py:151
Abs< T >::type abs(const T &t)
Definition: Abs.h:22
T min(T a, T b)
Definition: MathUtil.h:58
L1TStub * l1tstub()
Definition: Stub.h:77
unsigned int layerdisk() const
Definition: Stub.cc:185
const Stub * outerFPGAStub_
Definition: Tracklet.h:235
const Stub * innerFPGAStub_
Definition: Tracklet.h:233
const Stub * middleFPGAStub_
Definition: Tracklet.h:234
static constexpr float d1
constexpr int N_LAYER
Definition: Settings.h:21
const std::string Tracklet::diskstubstr ( const unsigned  disk) const

Definition at line 595 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, and trackIndex_.

Referenced by trackfitstr().

595  {
596  assert(disk < N_DISK);
597 
598  std::stringstream oss("");
599  if (!resid_[N_LAYER + disk].valid())
600  oss << "0|0000000|0000000000|000000000000|000000000000|0000000";
601  else {
602  if (trackIndex_ < 0 || trackIndex_ > (int)settings_.ntrackletmax()) {
603  cout << "trackIndex_ = " << trackIndex_ << endl;
604  assert(0);
605  }
606  const FPGAWord tmp(trackIndex_, settings_.nbitstrackletindex(), true, __LINE__, __FILE__);
607  const FPGAWord& stubr = resid_[N_LAYER + disk].stubptr()->r();
608  const bool isPS = resid_[N_LAYER + disk].stubptr()->isPSmodule();
609  oss << "1|"; // valid bit
610  oss << tmp.str() << "|";
611  oss << resid_[N_LAYER + disk].fpgastubid().str() << "|";
612  oss << (isPS ? stubr.str() : ("00000000" + stubr.str())) << "|";
613  oss << resid_[N_LAYER + disk].fpgaphiresid().str() << "|";
614  oss << resid_[N_LAYER + disk].fpgarzresid().str();
615  }
616 
617  return oss.str();
618 }
constexpr int N_DISK
Definition: Settings.h:22
const FPGAWord & fpgastubid() const
Definition: Residual.h:42
unsigned int ntrackletmax() const
Definition: Settings.h:331
const Stub * stubptr() const
Definition: Residual.h:67
bool isPSmodule() const
Definition: Stub.h:71
assert(be >=bs)
Settings const & settings_
Definition: Tracklet.h:272
unsigned int nbitstrackletindex() const
Definition: Settings.h:271
const FPGAWord & fpgarzresid() const
Definition: Residual.h:37
Residual resid_[N_LAYER+N_DISK]
Definition: Tracklet.h:270
std::string str() const
Definition: FPGAWord.cc:54
const FPGAWord & r() const
Definition: Stub.h:60
tuple cout
Definition: gather_cfg.py:144
int disk() const
Definition: Tracklet.cc:779
const FPGAWord & fpgaphiresid() const
Definition: Residual.h:32
tmp
align.sh
Definition: createJobs.py:716
constexpr int N_LAYER
Definition: Settings.h:21
bool trklet::Tracklet::fit ( ) const
inline
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:242
const FPGAWord& trklet::Tracklet::fpgaphi0 ( ) const
inline

Definition at line 133 of file Tracklet.h.

References fpgapars_.

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

133 { return fpgapars_.phi0(); }
TrackPars< FPGAWord > fpgapars_
Definition: Tracklet.h:242
const FPGAWord& trklet::Tracklet::fpgarinv ( ) const
inline

Definition at line 132 of file Tracklet.h.

References fpgapars_.

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

132 { return fpgapars_.rinv(); }
TrackPars< FPGAWord > fpgapars_
Definition: Tracklet.h:242
const FPGAWord& trklet::Tracklet::fpgat ( ) const
inline

Definition at line 135 of file Tracklet.h.

References fpgapars_.

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

135 { return fpgapars_.t(); }
TrackPars< FPGAWord > fpgapars_
Definition: Tracklet.h:242
const FPGAWord& trklet::Tracklet::fpgaz0 ( ) const
inline

Definition at line 136 of file Tracklet.h.

References fpgapars_.

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

136 { return fpgapars_.z0(); }
TrackPars< FPGAWord > fpgapars_
Definition: Tracklet.h:242
std::string Tracklet::fullmatchdiskstr ( int  disk)

Definition at line 324 of file Tracklet.cc.

References cms::cuda::assert(), 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_.

324  {
325  assert(disk > 0 && disk <= N_DISK);
326 
327  FPGAWord tmp;
328  if (trackletIndex_ < 0 || trackletIndex_ > (int)settings_.ntrackletmax()) {
329  throw cms::Exception("BadConfig") << __FILE__ << " " << __LINE__ << " trackletIndex_ = " << trackletIndex_;
330  }
331  tmp.set(trackletIndex_, settings_.nbitstrackletindex(), true, __LINE__, __FILE__);
332  FPGAWord tcid;
333  tcid.set(TCIndex_, settings_.nbitstcindex(), true, __LINE__, __FILE__);
334  const FPGAWord& stubr = resid_[N_LAYER + disk - 1].stubptr()->r();
335  const bool isPS = resid_[N_LAYER + disk - 1].stubptr()->isPSmodule();
336  std::string oss = tcid.str() + "|" + tmp.str() + "|" + resid_[N_LAYER + disk - 1].fpgastubid().str() + "|" +
337  (isPS ? stubr.str() : ("00000000" + stubr.str())) + "|" +
338  resid_[N_LAYER + disk - 1].fpgaphiresid().str() + "|" +
339  resid_[N_LAYER + disk - 1].fpgarzresid().str();
340  return oss;
341 }
constexpr int N_DISK
Definition: Settings.h:22
const FPGAWord & fpgastubid() const
Definition: Residual.h:42
unsigned int ntrackletmax() const
Definition: Settings.h:331
const Stub * stubptr() const
Definition: Residual.h:67
bool isPSmodule() const
Definition: Stub.h:71
assert(be >=bs)
Settings const & settings_
Definition: Tracklet.h:272
unsigned int nbitstrackletindex() const
Definition: Settings.h:271
unsigned int nbitstcindex() const
Definition: Settings.h:276
const FPGAWord & fpgarzresid() const
Definition: Residual.h:37
Residual resid_[N_LAYER+N_DISK]
Definition: Tracklet.h:270
void set(int value, int nbits, bool positive=true, int line=-1, const char *file=nullptr)
Definition: FPGAWord.cc:14
std::string str() const
Definition: FPGAWord.cc:54
const FPGAWord & r() const
Definition: Stub.h:60
int disk() const
Definition: Tracklet.cc:779
const FPGAWord & fpgaphiresid() const
Definition: Residual.h:32
tmp
align.sh
Definition: createJobs.py:716
constexpr int N_LAYER
Definition: Settings.h:21
std::string Tracklet::fullmatchstr ( int  layer)

Definition at line 308 of file Tracklet.cc.

References cms::cuda::assert(), Exception, trklet::Residual::fpgaphiresid(), trklet::Residual::fpgarzresid(), trklet::Residual::fpgastubid(), 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_.

308  {
309  assert(layer > 0 && layer <= N_LAYER);
310 
311  FPGAWord tmp;
312  if (trackletIndex_ < 0 || trackletIndex_ > (int)settings_.ntrackletmax()) {
313  throw cms::Exception("BadConfig") << __FILE__ << " " << __LINE__ << " trackletIndex_ = " << trackletIndex_;
314  }
315  tmp.set(trackletIndex_, settings_.nbitstrackletindex(), true, __LINE__, __FILE__);
316  FPGAWord tcid;
317  tcid.set(TCIndex_, settings_.nbitstcindex(), true, __LINE__, __FILE__);
318  std::string oss = tcid.str() + "|" + tmp.str() + "|" + resid_[layer - 1].fpgastubid().str() + "|" +
319  resid_[layer - 1].stubptr()->r().str() + "|" + resid_[layer - 1].fpgaphiresid().str() + "|" +
320  resid_[layer - 1].fpgarzresid().str();
321  return oss;
322 }
const FPGAWord & fpgastubid() const
Definition: Residual.h:42
unsigned int ntrackletmax() const
Definition: Settings.h:331
const Stub * stubptr() const
Definition: Residual.h:67
assert(be >=bs)
Settings const & settings_
Definition: Tracklet.h:272
unsigned int nbitstrackletindex() const
Definition: Settings.h:271
unsigned int nbitstcindex() const
Definition: Settings.h:276
const FPGAWord & fpgarzresid() const
Definition: Residual.h:37
Residual resid_[N_LAYER+N_DISK]
Definition: Tracklet.h:270
int layer() const
Definition: Tracklet.cc:770
void set(int value, int nbits, bool positive=true, int line=-1, const char *file=nullptr)
Definition: FPGAWord.cc:14
std::string str() const
Definition: FPGAWord.cc:54
const FPGAWord & r() const
Definition: Stub.h:60
const FPGAWord & fpgaphiresid() const
Definition: Residual.h:32
tmp
align.sh
Definition: createJobs.py:716
constexpr int N_LAYER
Definition: Settings.h:21
int Tracklet::getISeed ( ) const
int Tracklet::getITC ( ) const

Definition at line 804 of file Tracklet.cc.

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

804  {
805  const int iSeed = getISeed(), iTC = TCIndex_ - (iSeed << settings_.nbitsitc());
806  assert(iTC >= 0 && iTC <= 14);
807  return iTC;
808 }
int getISeed() const
Definition: Tracklet.cc:798
assert(be >=bs)
Settings const & settings_
Definition: Tracklet.h:272
unsigned int nbitsitc() const
Definition: Settings.h:274
std::vector< const L1TStub * > Tracklet::getL1Stubs ( )

Definition at line 343 of file Tracklet.cc.

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

Referenced by makeTrack().

343  {
344  std::vector<const L1TStub*> tmp;
345 
346  if (innerFPGAStub_)
347  tmp.push_back(innerFPGAStub_->l1tstub());
348  if (middleFPGAStub_)
349  tmp.push_back(middleFPGAStub_->l1tstub());
350  if (outerFPGAStub_)
351  tmp.push_back(outerFPGAStub_->l1tstub());
352 
353  for (const auto& iresid : resid_) {
354  if (iresid.valid())
355  tmp.push_back(iresid.stubptr()->l1tstub());
356  }
357 
358  return tmp;
359 }
L1TStub * l1tstub()
Definition: Stub.h:77
Residual resid_[N_LAYER+N_DISK]
Definition: Tracklet.h:270
const Stub * outerFPGAStub_
Definition: Tracklet.h:235
const Stub * innerFPGAStub_
Definition: Tracklet.h:233
const Stub * middleFPGAStub_
Definition: Tracklet.h:234
tmp
align.sh
Definition: createJobs.py:716
std::map< int, int > Tracklet::getStubIDs ( )

Definition at line 361 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(), middleFPGAStub_, trklet::N_BITSMEMADDRESS, trklet::N_DISK, trklet::N_LAYER, trklet::FPGAWord::nbits(), outerFPGAStub_, overlap_, trklet::Stub::phiregionaddress(), resid_, trklet::Stub::stubindex(), trklet::Residual::valid(), trklet::FPGAWord::value(), and relativeConstraints::value.

Referenced by makeTrack().

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

Definition at line 190 of file Tracklet.h.

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

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

190  {
191  assert(fpgatrack_ != nullptr);
192  return fpgatrack_.get();
193  }
assert(be >=bs)
std::unique_ptr< Track > fpgatrack_
Definition: Tracklet.h:266
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  }
int nbits() const
Definition: FPGAWord.h:25
FPGAWord ichisqrzfit_
Definition: Tracklet.h:254
FPGAWord ichisqrphifit_
Definition: Tracklet.h:253
int value() const
Definition: FPGAWord.h:24
const FPGAWord& trklet::Tracklet::id0fit ( ) const
inline

Definition at line 153 of file Tracklet.h.

References fpgafitpars_.

153 { return fpgafitpars_.d0(); }
TrackPars< FPGAWord > fpgafitpars_
Definition: Tracklet.h:252
const Stub* trklet::Tracklet::innerFPGAStub ( )
inline

Definition at line 61 of file Tracklet.h.

References innerFPGAStub_.

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

61 { return innerFPGAStub_; }
const Stub * innerFPGAStub_
Definition: Tracklet.h:233
const FPGAWord& trklet::Tracklet::iphi0fit ( ) const
inline

Definition at line 152 of file Tracklet.h.

References fpgafitpars_.

152 { return fpgafitpars_.phi0(); }
TrackPars< FPGAWord > fpgafitpars_
Definition: Tracklet.h:252
const FPGAWord& trklet::Tracklet::irinvfit ( ) const
inline

Definition at line 151 of file Tracklet.h.

References fpgafitpars_.

151 { return fpgafitpars_.rinv(); }
TrackPars< FPGAWord > fpgafitpars_
Definition: Tracklet.h:252
bool trklet::Tracklet::isBarrel ( ) const
inline

Definition at line 200 of file Tracklet.h.

References barrel_.

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

200 { return barrel_; }
int trklet::Tracklet::isDisk ( ) const
inline

Definition at line 202 of file Tracklet.h.

References disk_.

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

202 { return disk_; }
bool trklet::Tracklet::isOverlap ( ) const
inline

Definition at line 201 of file Tracklet.h.

References overlap_.

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

201 { return overlap_; }
const FPGAWord& trklet::Tracklet::itfit ( ) const
inline

Definition at line 154 of file Tracklet.h.

References fpgafitpars_.

Referenced by getStubIDs().

154 { return fpgafitpars_.t(); }
TrackPars< FPGAWord > fpgafitpars_
Definition: Tracklet.h:252
const FPGAWord& trklet::Tracklet::iz0fit ( ) const
inline

Definition at line 155 of file Tracklet.h.

References fpgafitpars_.

155 { return fpgafitpars_.z0(); }
TrackPars< FPGAWord > fpgafitpars_
Definition: Tracklet.h:252
int Tracklet::layer ( ) const

Definition at line 770 of file Tracklet.cc.

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

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

770  {
771  int l1 = (innerFPGAStub_ && innerFPGAStub_->layerdisk() < N_LAYER) ? innerFPGAStub_->l1tstub()->layerdisk() + 1 : 999,
773  : 999,
775  l = min(min(l1, l2), l3);
776  return (l < 999 ? l : 0);
777 }
int layerdisk() const
Definition: L1TStub.h:104
T min(T a, T b)
Definition: MathUtil.h:58
L1TStub * l1tstub()
Definition: Stub.h:77
unsigned int layerdisk() const
Definition: Stub.cc:185
const Stub * outerFPGAStub_
Definition: Tracklet.h:235
const Stub * innerFPGAStub_
Definition: Tracklet.h:233
const Stub * middleFPGAStub_
Definition: Tracklet.h:234
constexpr int N_LAYER
Definition: Settings.h:21
const std::string Tracklet::layerstubstr ( const unsigned  layer) const

Definition at line 572 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, and trackIndex_.

Referenced by trackfitstr().

572  {
573  assert(layer < N_LAYER);
574 
575  std::stringstream oss("");
576  if (!resid_[layer].valid())
577  oss << "0|0000000|0000000000|0000000|000000000000|000000000";
578  else {
579  if (trackIndex_ < 0 || trackIndex_ > (int)settings_.ntrackletmax()) {
580  cout << "trackIndex_ = " << trackIndex_ << endl;
581  assert(0);
582  }
583  const FPGAWord tmp(trackIndex_, settings_.nbitstrackletindex(), true, __LINE__, __FILE__);
584  oss << "1|"; // valid bit
585  oss << tmp.str() << "|";
586  oss << resid_[layer].fpgastubid().str() << "|";
587  oss << resid_[layer].stubptr()->r().str() << "|";
588  oss << resid_[layer].fpgaphiresid().str() << "|";
589  oss << resid_[layer].fpgarzresid().str();
590  }
591 
592  return oss.str();
593 }
const FPGAWord & fpgastubid() const
Definition: Residual.h:42
unsigned int ntrackletmax() const
Definition: Settings.h:331
const Stub * stubptr() const
Definition: Residual.h:67
assert(be >=bs)
Settings const & settings_
Definition: Tracklet.h:272
unsigned int nbitstrackletindex() const
Definition: Settings.h:271
const FPGAWord & fpgarzresid() const
Definition: Residual.h:37
Residual resid_[N_LAYER+N_DISK]
Definition: Tracklet.h:270
int layer() const
Definition: Tracklet.cc:770
std::string str() const
Definition: FPGAWord.cc:54
const FPGAWord & r() const
Definition: Stub.h:60
tuple cout
Definition: gather_cfg.py:144
const FPGAWord & fpgaphiresid() const
Definition: Residual.h:32
tmp
align.sh
Definition: createJobs.py:716
constexpr int N_LAYER
Definition: Settings.h:21
Track Tracklet::makeTrack ( const std::vector< const L1TStub * > &  l1stubs)

Definition at line 738 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().

738  {
739  assert(fit());
740 
741  TrackPars<int> ipars(fpgafitpars_.rinv().value(),
742  fpgafitpars_.phi0().value(),
743  fpgafitpars_.d0().value(),
744  fpgafitpars_.t().value(),
745  fpgafitpars_.z0().value());
746 
747  // If fitter produced no stub list, take it from original tracklet.
748  vector<const L1TStub*> tmp = l1stubs.empty() ? getL1Stubs() : l1stubs;
749 
750  vector<L1TStub> tmp2;
751 
752  tmp2.reserve(tmp.size());
753  for (auto stub : tmp) {
754  tmp2.push_back(*stub);
755  }
756 
757  Track tmpTrack(ipars,
761  chisqrzfit_,
762  hitpattern_,
763  getStubIDs(),
764  tmp2,
765  getISeed());
766 
767  return tmpTrack;
768 }
int getISeed() const
Definition: Tracklet.cc:798
bool fit() const
Definition: Tracklet.h:195
double chisqrzfit_
Definition: Tracklet.h:258
assert(be >=bs)
std::vector< const L1TStub * > getL1Stubs()
Definition: Tracklet.cc:343
FPGAWord ichisqrzfit_
Definition: Tracklet.h:254
FPGAWord ichisqrphifit_
Definition: Tracklet.h:253
int value() const
Definition: FPGAWord.h:24
TrackPars< FPGAWord > fpgafitpars_
Definition: Tracklet.h:252
tmp
align.sh
Definition: createJobs.py:716
double chisqrphifit_
Definition: Tracklet.h:257
std::map< int, int > getStubIDs()
Definition: Tracklet.cc:361
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::trackFitChisq().

105  {
106  assert(layerdisk < N_LAYER + N_DISK);
107  return resid_[layerdisk].valid();
108  }
constexpr int N_DISK
Definition: Settings.h:22
assert(be >=bs)
bool valid() const
Definition: Residual.h:30
Residual resid_[N_LAYER+N_DISK]
Definition: Tracklet.h:270
constexpr int N_LAYER
Definition: Settings.h:21
const Stub* trklet::Tracklet::middleFPGAStub ( )
inline

Definition at line 63 of file Tracklet.h.

References middleFPGAStub_.

Referenced by Tracklet().

63 { return middleFPGAStub_; }
const Stub * middleFPGAStub_
Definition: Tracklet.h:234
const Stub* trklet::Tracklet::outerFPGAStub ( )
inline

Definition at line 65 of file Tracklet.h.

References outerFPGAStub_.

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

65 { return outerFPGAStub_; }
const Stub * outerFPGAStub_
Definition: Tracklet.h:235
double trklet::Tracklet::phi0 ( ) const
inline

Definition at line 121 of file Tracklet.h.

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

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

121 { return trackpars_.phi0(); }
const T & phi0() const
Definition: TrackPars.h:30
TrackPars< double > trackpars_
Definition: Tracklet.h:244
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(), and trklet::FitTrack::trackFitFake().

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

Definition at line 139 of file Tracklet.h.

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

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

Definition at line 146 of file Tracklet.h.

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

146 { return fitparsexact_.phi0(); }
const T & phi0() const
Definition: TrackPars.h:30
TrackPars< double > fitparsexact_
Definition: Tracklet.h:260
Projection& trklet::Tracklet::proj ( int  layerdisk)
inline
unsigned int trklet::Tracklet::PSseed ( ) const
inline

Definition at line 220 of file Tracklet.h.

References disk(), and layer().

Referenced by trklet::MatchEngine::execute(), trklet::MatchProcessor::execute(), and vmstrlayer().

220 { return ((layer() == 1) || (layer() == 2) || (disk() != 0)) ? 1 : 0; }
int layer() const
Definition: Tracklet.cc:770
int disk() const
Definition: Tracklet.cc:779
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, and resid_.

Referenced by 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:22
assert(be >=bs)
Residual resid_[N_LAYER+N_DISK]
Definition: Tracklet.h:270
constexpr int N_LAYER
Definition: Settings.h:21
double trklet::Tracklet::rinv ( ) const
inline
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(), and trklet::FitTrack::trackFitFake().

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

Definition at line 138 of file Tracklet.h.

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

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

Definition at line 145 of file Tracklet.h.

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

145 { return fitparsexact_.rinv(); }
TrackPars< double > fitparsexact_
Definition: Tracklet.h:260
const T & rinv() const
Definition: TrackPars.h:29
unsigned int trklet::Tracklet::seedIndex ( ) const
inline

Definition at line 222 of file Tracklet.h.

References seedIndex_.

Referenced by trklet::PurgeDuplicate::execute(), trklet::PurgeDuplicate::getPhiRes(), and trackfitstr().

222 { return seedIndex_; }
unsigned int seedIndex_
Definition: Tracklet.h:225
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 515 of file Tracklet.cc.

References chisqrphifit_, chisqrphifitexact_, chisqrzfit_, chisqrzfitexact_, fitpars_, fitparsexact_, fpgafitpars_, fpgatrack_, hitpattern_, ichisqrphifit_, ichisqrzfit_, trklet::TrackPars< T >::init(), makeTrack(), trklet::Settings::nbitsz0(), trklet::FPGAWord::set(), and settings_.

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

537  {
539  chisqrphifit_ = chisqrphifit;
540  chisqrzfit_ = chisqrzfit;
541 
543  chisqrphifitexact_ = chisqrphifitexact;
544  chisqrzfitexact_ = chisqrzfitexact;
545 
546  if (irinvfit > (1 << 14))
547  irinvfit = (1 << 14);
548  if (irinvfit <= -(1 << 14))
549  irinvfit = -(1 << 14) + 1;
550  fpgafitpars_.rinv().set(irinvfit, 15, false, __LINE__, __FILE__);
551  fpgafitpars_.phi0().set(iphi0fit, 19, false, __LINE__, __FILE__);
552  fpgafitpars_.d0().set(id0fit, 19, false, __LINE__, __FILE__);
553  fpgafitpars_.t().set(itfit, 14, false, __LINE__, __FILE__);
554 
555  if (iz0fit >= (1 << (settings_.nbitsz0() - 1))) {
556  iz0fit = (1 << (settings_.nbitsz0() - 1)) - 1;
557  }
558 
559  if (iz0fit <= -(1 << (settings_.nbitsz0() - 1))) {
560  iz0fit = 1 - (1 << (settings_.nbitsz0() - 1));
561  }
562 
563  fpgafitpars_.z0().set(iz0fit, settings_.nbitsz0(), false, __LINE__, __FILE__);
564  ichisqrphifit_.set(ichisqrphifit, 8, true, __LINE__, __FILE__);
565  ichisqrzfit_.set(ichisqrzfit, 8, true, __LINE__, __FILE__);
566 
567  hitpattern_ = hitpattern;
568 
569  fpgatrack_ = std::make_unique<Track>(makeTrack(l1stubs));
570 }
double d0fitexact() const
Definition: Tracklet.h:147
double phi0fitexact() const
Definition: Tracklet.h:146
int nbitsz0() const
Definition: Settings.h:337
Track makeTrack(const std::vector< const L1TStub * > &l1stubs)
Definition: Tracklet.cc:738
double z0fit() const
Definition: Tracklet.h:142
double chisqrzfit_
Definition: Tracklet.h:258
double rinvfit() const
Definition: Tracklet.h:138
double tfitexact() const
Definition: Tracklet.h:148
double chisqrzfitexact_
Definition: Tracklet.h:262
Settings const & settings_
Definition: Tracklet.h:272
FPGAWord ichisqrzfit_
Definition: Tracklet.h:254
FPGAWord ichisqrphifit_
Definition: Tracklet.h:253
TrackPars< double > fitpars_
Definition: Tracklet.h:256
double phi0fit() const
Definition: Tracklet.h:139
TrackPars< FPGAWord > fpgafitpars_
Definition: Tracklet.h:252
double tfit() const
Definition: Tracklet.h:141
std::unique_ptr< Track > fpgatrack_
Definition: Tracklet.h:266
const FPGAWord & id0fit() const
Definition: Tracklet.h:153
double rinvfitexact() const
Definition: Tracklet.h:145
const FPGAWord & irinvfit() const
Definition: Tracklet.h:151
void set(int value, int nbits, bool positive=true, int line=-1, const char *file=nullptr)
Definition: FPGAWord.cc:14
double z0fitexact() const
Definition: Tracklet.h:149
TrackPars< double > fitparsexact_
Definition: Tracklet.h:260
const FPGAWord & itfit() const
Definition: Tracklet.h:154
const FPGAWord & iz0fit() const
Definition: Tracklet.h:155
const FPGAWord & iphi0fit() const
Definition: Tracklet.h:152
double chisqrphifitexact_
Definition: Tracklet.h:261
double chisqrphifit_
Definition: Tracklet.h:257
void init(T rinv, T phi0, T d0, T t, T z0)
Definition: TrackPars.h:21
double d0fit() const
Definition: Tracklet.h:140
void trklet::Tracklet::setTCIndex ( int  index)
inline
void Tracklet::setTrackIndex ( int  index)

Definition at line 810 of file Tracklet.cc.

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

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

810  {
811  trackIndex_ = index;
812  assert(index <= (int)settings_.ntrackletmax());
813 }
unsigned int ntrackletmax() const
Definition: Settings.h:331
assert(be >=bs)
Settings const & settings_
Definition: Tracklet.h:272
void Tracklet::setTrackletIndex ( unsigned int  index)
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:77
const Stub * outerFPGAStub_
Definition: Tracklet.h:235
const Stub * innerFPGAStub_
Definition: Tracklet.h:233
std::vector< int > tps() const
Definition: L1TStub.h:79
double trklet::Tracklet::t ( ) const
inline
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(), and trklet::FitTrack::trackFitFake().

129 { return trackparsapprox_.t(); }
TrackPars< double > trackparsapprox_
Definition: Tracklet.h:245
const T & t() const
Definition: TrackPars.h:32
int trklet::Tracklet::TCID ( ) const
inline
int trklet::Tracklet::TCIndex ( ) const
inline

Definition at line 210 of file Tracklet.h.

References TCIndex_.

Referenced by trklet::MatchEngineUnit::step().

210 { return TCIndex_; }
double trklet::Tracklet::tfit ( ) const
inline

Definition at line 141 of file Tracklet.h.

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

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

Definition at line 148 of file Tracklet.h.

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

148 { return fitparsexact_.t(); }
const T & t() const
Definition: TrackPars.h:32
TrackPars< double > fitparsexact_
Definition: Tracklet.h:260
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:77
const Stub * outerFPGAStub_
Definition: Tracklet.h:235
const Stub * innerFPGAStub_
Definition: Tracklet.h:233
std::vector< int > tps() const
Definition: L1TStub.h:79
std::string Tracklet::trackfitstr ( ) const

Definition at line 620 of file Tracklet.cc.

References diskstubstr(), fpgapars_, getISeed(), mps_fire::i, layerstubstr(), trklet::Settings::nbitsseed(), seedIndex(), settings_, AlCaHLTBitMon_QueryRunRegistry::string, createJobs::tmp, and trklet::Settings::writeoutReal().

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

Definition at line 815 of file Tracklet.cc.

References trackIndex_.

815 { return trackIndex_; }
int trklet::Tracklet::trackletIndex ( ) const
inline

Definition at line 206 of file Tracklet.h.

References trackletIndex_.

Referenced by trklet::FullMatchMemory::addMatch(), and trklet::MatchEngineUnit::step().

206 { return trackletIndex_; }
std::string Tracklet::trackletparstr ( )

Definition at line 188 of file Tracklet.cc.

References fpgapars_, innerFPGAStub_, trklet::Settings::kd0pars(), trklet::Settings::kphi0pars(), trklet::Settings::krinvpars(), trklet::Settings::ktpars(), trklet::Settings::kz(), middleFPGAStub_, outerFPGAStub_, settings_, trklet::FPGAWord::str(), str, AlCaHLTBitMon_QueryRunRegistry::string, trklet::Stub::stubindex(), 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 {
198  if (middleFPGAStub_) {
199  str += middleFPGAStub_->stubindex().str() + "|";
200  }
201  str += outerFPGAStub_->stubindex().str() + "|" + fpgapars_.rinv().str() + "|" + fpgapars_.phi0().str() + "|";
202  if (middleFPGAStub_)
203  str += fpgapars_.d0().str() + "|";
204  str += fpgapars_.z0().str() + "|" + fpgapars_.t().str();
205  return str;
206  }
207 }
TrackPars< FPGAWord > fpgapars_
Definition: Tracklet.h:242
const FPGAWord & stubindex() const
Definition: Stub.h:66
double kd0pars() const
Definition: Settings.h:391
Settings const & settings_
Definition: Tracklet.h:272
double ktpars() const
Definition: Settings.h:389
double krinvpars() const
Definition: Settings.h:384
double kphi0pars() const
Definition: Settings.h:388
std::string str() const
Definition: FPGAWord.cc:54
bool writeoutReal() const
Definition: Settings.h:205
const Stub * outerFPGAStub_
Definition: Tracklet.h:235
double kz() const
Definition: Settings.h:302
const Stub * innerFPGAStub_
Definition: Tracklet.h:233
const Stub * middleFPGAStub_
Definition: Tracklet.h:234
#define str(s)
std::string Tracklet::trackletprojstr ( int  layer) const

Definition at line 259 of file Tracklet.cc.

References cms::cuda::assert(), Exception, trklet::Projection::fpgaphiproj(), trklet::Projection::fpgaphiprojder(), trklet::Projection::fpgarzproj(), trklet::Projection::fpgarzprojder(), 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().

259  {
260  assert(layer > 0 && layer <= N_LAYER);
261  FPGAWord tmp;
262  if (trackletIndex_ < 0 || trackletIndex_ > (int)settings_.ntrackletmax()) {
263  throw cms::Exception("BadConfig") << __FILE__ << " " << __LINE__ << " trackletIndex_ = " << trackletIndex_;
264  }
265  tmp.set(trackletIndex_, settings_.nbitstrackletindex(), true, __LINE__, __FILE__);
266  FPGAWord tcid;
267  tcid.set(TCIndex_, settings_.nbitstcindex(), true, __LINE__, __FILE__);
268 
269  std::string oss = tcid.str() + "|" + tmp.str() + "|" + proj_[layer - 1].fpgaphiproj().str() + "|" +
270  proj_[layer - 1].fpgarzproj().str() + "|" + proj_[layer - 1].fpgaphiprojder().str() + "|" +
271  proj_[layer - 1].fpgarzprojder().str();
272  return oss;
273 }
Projection proj_[N_LAYER+N_DISK]
Definition: Tracklet.h:268
const FPGAWord & fpgaphiproj() const
Definition: Projection.h:39
unsigned int ntrackletmax() const
Definition: Settings.h:331
const FPGAWord & fpgaphiprojder() const
Definition: Projection.h:49
assert(be >=bs)
Settings const & settings_
Definition: Tracklet.h:272
const FPGAWord & fpgarzprojder() const
Definition: Projection.h:54
unsigned int nbitstrackletindex() const
Definition: Settings.h:271
unsigned int nbitstcindex() const
Definition: Settings.h:276
int layer() const
Definition: Tracklet.cc:770
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
std::string str() const
Definition: FPGAWord.cc:54
tmp
align.sh
Definition: createJobs.py:716
constexpr int N_LAYER
Definition: Settings.h:21
std::string Tracklet::trackletprojstrD ( int  disk) const

Definition at line 275 of file Tracklet.cc.

References funct::abs(), cms::cuda::assert(), 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().

275  {
276  assert(abs(disk) <= N_DISK);
277  FPGAWord tmp;
278  if (trackletIndex_ < 0 || trackletIndex_ > (int)settings_.ntrackletmax()) {
279  throw cms::Exception("BadConfig") << __FILE__ << " " << __LINE__ << " trackletIndex_ = " << trackletIndex_;
280  }
281  tmp.set(trackletIndex_, settings_.nbitstrackletindex(), true, __LINE__, __FILE__);
282  FPGAWord tcid;
283  if (settings_.extended()) {
284  tcid.set(TCIndex_, 8, true, __LINE__, __FILE__);
285  } else {
286  tcid.set(TCIndex_, 7, true, __LINE__, __FILE__);
287  }
288  std::string oss = tcid.str() + "|" + tmp.str() + "|" + proj_[N_LAYER + abs(disk) - 1].fpgaphiproj().str() + "|" +
289  proj_[N_LAYER + abs(disk) - 1].fpgarzproj().str() + "|" +
290  proj_[N_LAYER + abs(disk) - 1].fpgaphiprojder().str() + "|" +
291  proj_[N_LAYER + abs(disk) - 1].fpgarzprojder().str();
292  return oss;
293 }
Projection proj_[N_LAYER+N_DISK]
Definition: Tracklet.h:268
constexpr int N_DISK
Definition: Settings.h:22
const FPGAWord & fpgaphiproj() const
Definition: Projection.h:39
unsigned int ntrackletmax() const
Definition: Settings.h:331
const FPGAWord & fpgaphiprojder() const
Definition: Projection.h:49
assert(be >=bs)
Settings const & settings_
Definition: Tracklet.h:272
const FPGAWord & fpgarzprojder() const
Definition: Projection.h:54
unsigned int nbitstrackletindex() const
Definition: Settings.h:271
Abs< T >::type abs(const T &t)
Definition: Abs.h:22
bool extended() const
Definition: Settings.h:248
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
std::string str() const
Definition: FPGAWord.cc:54
int disk() const
Definition: Tracklet.cc:779
tmp
align.sh
Definition: createJobs.py:716
constexpr int N_LAYER
Definition: Settings.h:21
std::string trklet::Tracklet::trackletprojstrdisk ( int  disk) const
inline

Definition at line 80 of file Tracklet.h.

References trackletprojstrD().

80 { return trackletprojstrD(disk); }
std::string trackletprojstrD(int disk) const
Definition: Tracklet.cc:275
int disk() const
Definition: Tracklet.cc:779
std::string trklet::Tracklet::trackletprojstrlayer ( int  layer) const
inline

Definition at line 79 of file Tracklet.h.

References trackletprojstr().

79 { return trackletprojstr(layer); }
std::string trackletprojstr(int layer) const
Definition: Tracklet.cc:259
int layer() const
Definition: Tracklet.cc:770
bool trklet::Tracklet::validProj ( int  layerdisk) const
inline
std::string Tracklet::vmstrdisk ( int  disk,
unsigned int  allstubindex 
)

Definition at line 244 of file Tracklet.cc.

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

244  {
245  FPGAWord index;
246  if (allstubindex >= (1 << 7)) {
247  edm::LogPrint("Tracklet") << "Warning projection number too large!";
248  index.set((1 << 7) - 1, 7, true, __LINE__, __FILE__);
249  } else {
250  index.set(allstubindex, 7, true, __LINE__, __FILE__);
251  }
252  std::string oss =
253  index.str() + "|" + proj_[N_LAYER + disk - 1].fpgarzbin1projvm().str() + "|" +
254  proj_[N_LAYER + disk - 1].fpgarzbin2projvm().str() + "|" + proj_[N_LAYER + disk - 1].fpgafinerzvm().str() + "|" +
255  proj_[N_LAYER + disk - 1].fpgafinephivm().str() + "|" + proj_[N_LAYER + disk - 1].getBendIndex().str();
256  return oss;
257 }
Projection proj_[N_LAYER+N_DISK]
Definition: Tracklet.h:268
const FPGAWord & fpgafinerzvm() const
Definition: Projection.h:69
const FPGAWord & fpgafinephivm() const
Definition: Projection.h:74
const FPGAWord & getBendIndex() const
Definition: Projection.h:121
Log< level::Warning, true > LogPrint
const FPGAWord & fpgarzbin1projvm() const
Definition: Projection.h:59
void set(int value, int nbits, bool positive=true, int line=-1, const char *file=nullptr)
Definition: FPGAWord.cc:14
std::string str() const
Definition: FPGAWord.cc:54
const FPGAWord & fpgarzbin2projvm() const
Definition: Projection.h:64
int disk() const
Definition: Tracklet.cc:779
constexpr int N_LAYER
Definition: Settings.h:21
std::string Tracklet::vmstrlayer ( int  layer,
unsigned int  allstubindex 
)

Definition at line 209 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(), trklet::FPGAWord::nbits(), proj_, PSseed(), trklet::FPGAWord::set(), settings_, trklet::FPGAWord::str(), AlCaHLTBitMon_QueryRunRegistry::string, createJobs::tmp, and trklet::FPGAWord::value().

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

Definition at line 124 of file Tracklet.h.

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

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

124 { return trackpars_.z0(); }
const T & z0() const
Definition: TrackPars.h:33
TrackPars< double > trackpars_
Definition: Tracklet.h:244
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(), and trklet::FitTrack::trackFitFake().

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

Definition at line 142 of file Tracklet.h.

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

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

Definition at line 149 of file Tracklet.h.

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

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

Member Data Documentation

bool trklet::Tracklet::barrel_
private

Definition at line 228 of file Tracklet.h.

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

double trklet::Tracklet::chisqrphifit_
private

Definition at line 257 of file Tracklet.h.

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

double trklet::Tracklet::chisqrphifitexact_
private

Definition at line 261 of file Tracklet.h.

Referenced by setFitPars().

double trklet::Tracklet::chisqrzfit_
private

Definition at line 258 of file Tracklet.h.

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

double trklet::Tracklet::chisqrzfitexact_
private

Definition at line 262 of file Tracklet.h.

Referenced by setFitPars().

bool trklet::Tracklet::disk_
private

Definition at line 229 of file Tracklet.h.

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

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

Definition at line 256 of file Tracklet.h.

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

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

Definition at line 260 of file Tracklet.h.

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

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

Definition at line 252 of file Tracklet.h.

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

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

Definition at line 242 of file Tracklet.h.

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

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

Definition at line 266 of file Tracklet.h.

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

int trklet::Tracklet::hitpattern_
private

Definition at line 264 of file Tracklet.h.

Referenced by makeTrack(), and setFitPars().

FPGAWord trklet::Tracklet::ichisqrphifit_
private

Definition at line 253 of file Tracklet.h.

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

FPGAWord trklet::Tracklet::ichisqrzfit_
private

Definition at line 254 of file Tracklet.h.

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

const Stub* trklet::Tracklet::innerFPGAStub_
private
const Stub* trklet::Tracklet::middleFPGAStub_
private
const Stub* trklet::Tracklet::outerFPGAStub_
private
bool trklet::Tracklet::overlap_
private

Definition at line 230 of file Tracklet.h.

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

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

Definition at line 249 of file Tracklet.h.

Referenced by Tracklet().

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

Definition at line 248 of file Tracklet.h.

Referenced by Tracklet().

Residual trklet::Tracklet::resid_[N_LAYER+N_DISK]
private
unsigned int trklet::Tracklet::seedIndex_
private

Definition at line 225 of file Tracklet.h.

Referenced by seedIndex(), and Tracklet().

Settings const& trklet::Tracklet::settings_
private
int trklet::Tracklet::TCIndex_
private
int trklet::Tracklet::trackIndex_
private

Definition at line 239 of file Tracklet.h.

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

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

Definition at line 244 of file Tracklet.h.

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

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

Definition at line 245 of file Tracklet.h.

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

bool trklet::Tracklet::triplet_
private

Definition at line 231 of file Tracklet.h.

Referenced by Tracklet().