CMS 3D CMS Logo

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

#include <MatchEngineUnit.h>

Public Member Functions

TrackletcurrentProj () const
 
bool empty () const
 
bool idle () const
 
void init (VMStubsMEMemory *vmstubsmemory, unsigned int slot, int projrinv, int projfinerz, int projfinephi, bool usesecond, bool isPSseed, Tracklet *proj)
 
 MatchEngineUnit (bool barrel, std::vector< bool > table, std::vector< bool > tablePS, std::vector< bool > table2S)
 
std::pair< Tracklet *, const Stub * > peek () const
 
std::pair< Tracklet *, const Stub * > read ()
 
void reset ()
 
void step ()
 
 ~MatchEngineUnit ()=default
 

Private Attributes

bool barrel_
 
CircularBuffer< std::pair< Tracklet *, const Stub * > > candmatches_
 
bool idle_
 
bool isPSseed_
 
unsigned int istub_
 
Trackletproj_
 
int projfinephi_
 
int projfinerz_
 
int projrinv_
 
unsigned int slot_
 
std::vector< bool > table2S_
 
std::vector< bool > table_
 
std::vector< bool > tablePS_
 
bool usesecond_
 
VMStubsMEMemoryvmstubsmemory_
 

Detailed Description

Definition at line 18 of file MatchEngineUnit.h.

Constructor & Destructor Documentation

◆ MatchEngineUnit()

MatchEngineUnit::MatchEngineUnit ( bool  barrel,
std::vector< bool >  table,
std::vector< bool >  tablePS,
std::vector< bool >  table2S 
)

Definition at line 6 of file MatchEngineUnit.cc.

7  : candmatches_(5) {
8  idle_ = true;
9  barrel_ = barrel;
10  table_ = table;
11  tablePS_ = tablePS;
12  table2S_ = table2S;
13  slot_ = 1; //This makes it idle until initialized
14 }

References Reference_intrackfit_cff::barrel, barrel_, idle_, slot_, TableParser::table, table2S_, table_, and tablePS_.

◆ ~MatchEngineUnit()

trklet::MatchEngineUnit::~MatchEngineUnit ( )
default

Member Function Documentation

◆ currentProj()

Tracklet* trklet::MatchEngineUnit::currentProj ( ) const
inline

Definition at line 39 of file MatchEngineUnit.h.

39 { return proj_; }

References proj_.

◆ empty()

bool trklet::MatchEngineUnit::empty ( void  ) const
inline

Definition at line 33 of file MatchEngineUnit.h.

33 { return candmatches_.empty(); }

References candmatches_.

◆ idle()

bool trklet::MatchEngineUnit::idle ( ) const
inline

Definition at line 41 of file MatchEngineUnit.h.

41 { return idle_; }

References idle_.

Referenced by step().

◆ init()

void MatchEngineUnit::init ( VMStubsMEMemory vmstubsmemory,
unsigned int  slot,
int  projrinv,
int  projfinerz,
int  projfinephi,
bool  usesecond,
bool  isPSseed,
Tracklet proj 
)

Definition at line 16 of file MatchEngineUnit.cc.

23  {
24  vmstubsmemory_ = vmstubsmemory;
25  idle_ = false;
26  slot_ = slot;
27  istub_ = 0;
28  projrinv_ = projrinv;
29  projfinerz_ = projfinerz;
30  projfinephi_ = projfinephi;
31  usesecond_ = usesecond;
32  isPSseed_ = isPSseed;
33  proj_ = proj;
34 }

References idle_, isPSseed_, istub_, amptDefault_cfi::proj, proj_, projfinephi_, projfinerz_, projrinv_, slot_, usesecond_, and vmstubsmemory_.

◆ peek()

std::pair<Tracklet*, const Stub*> trklet::MatchEngineUnit::peek ( ) const
inline

Definition at line 37 of file MatchEngineUnit.h.

37 { return candmatches_.peek(); }

References candmatches_.

◆ read()

std::pair<Tracklet*, const Stub*> trklet::MatchEngineUnit::read ( )
inline

Definition at line 35 of file MatchEngineUnit.h.

35 { return candmatches_.read(); }

References candmatches_.

Referenced by edmIntegrityCheck.PublishToFileSystem::get().

◆ reset()

void MatchEngineUnit::reset ( void  )

Definition at line 91 of file MatchEngineUnit.cc.

91  {
92  candmatches_.reset();
93  idle_ = true;
94  istub_ = 0;
95 }

References candmatches_, idle_, and istub_.

◆ step()

void MatchEngineUnit::step ( )

Definition at line 36 of file MatchEngineUnit.cc.

36  {
37  if (idle() || candmatches_.almostfull())
38  return;
39 
41 
42  bool isPSmodule = vmstub.isPSmodule();
43  int stubfinerz = vmstub.finerz().value();
44  int stubfinephi = vmstub.finephi().value();
45 
46  int deltaphi = stubfinephi - projfinephi_;
47 
48  bool dphicut = (abs(deltaphi) < 3) || (abs(deltaphi) > 5); //TODO - need better implementations
49 
50  int nbits = isPSmodule ? 3 : 4;
51 
52  unsigned int index = (projrinv_ << nbits) + vmstub.bend().value();
53 
54  //Check if stub z position consistent
55  int idrz = stubfinerz - projfinerz_;
56  bool pass;
57 
58  if (barrel_) {
59  if (isPSseed_) {
60  pass = idrz >= -1 && idrz <= 1;
61  } else {
62  pass = idrz >= -5 && idrz <= 5;
63  }
64  } else {
65  if (isPSmodule) {
66  pass = idrz >= -1 && idrz <= 1;
67  } else {
68  pass = idrz >= -3 && idrz <= 3;
69  }
70  }
71 
72  //Check if stub bend and proj rinv consistent
73  if ((pass && dphicut) && (barrel_ ? table_[index] : (isPSmodule ? tablePS_[index] : table2S_[index]))) {
74  std::pair<Tracklet*, const Stub*> tmp(proj_, vmstub.stub());
75  candmatches_.store(tmp);
76  }
77 
78  istub_++;
80  if (usesecond_) {
81  usesecond_ = false;
82  istub_ = 0;
83  slot_++;
84  projfinerz_ -= (1 << NFINERZBITS);
85  } else {
86  idle_ = true;
87  }
88  }
89 }

References funct::abs(), barrel_, trklet::VMStubME::bend(), candmatches_, trklet::VMStubME::finephi(), trklet::VMStubME::finerz(), trklet::VMStubsMEMemory::getVMStubMEBin(), idle(), idle_, trklet::VMStubME::isPSmodule(), isPSseed_, istub_, trklet::NFINERZBITS, trklet::VMStubsMEMemory::nStubsBin(), proj_, projfinephi_, projfinerz_, projrinv_, slot_, trklet::VMStubME::stub(), table2S_, table_, tablePS_, createJobs::tmp, usesecond_, trklet::FPGAWord::value(), and vmstubsmemory_.

Member Data Documentation

◆ barrel_

bool trklet::MatchEngineUnit::barrel_
private

Definition at line 54 of file MatchEngineUnit.h.

Referenced by MatchEngineUnit(), and step().

◆ candmatches_

CircularBuffer<std::pair<Tracklet*, const Stub*> > trklet::MatchEngineUnit::candmatches_
private

Definition at line 72 of file MatchEngineUnit.h.

Referenced by empty(), peek(), read(), reset(), and step().

◆ idle_

bool trklet::MatchEngineUnit::idle_
private

Definition at line 62 of file MatchEngineUnit.h.

Referenced by idle(), init(), MatchEngineUnit(), reset(), and step().

◆ isPSseed_

bool trklet::MatchEngineUnit::isPSseed_
private

Definition at line 59 of file MatchEngineUnit.h.

Referenced by init(), and step().

◆ istub_

unsigned int trklet::MatchEngineUnit::istub_
private

Definition at line 52 of file MatchEngineUnit.h.

Referenced by init(), reset(), and step().

◆ proj_

Tracklet* trklet::MatchEngineUnit::proj_
private

Definition at line 60 of file MatchEngineUnit.h.

Referenced by currentProj(), init(), and step().

◆ projfinephi_

int trklet::MatchEngineUnit::projfinephi_
private

Definition at line 57 of file MatchEngineUnit.h.

Referenced by init(), and step().

◆ projfinerz_

int trklet::MatchEngineUnit::projfinerz_
private

Definition at line 56 of file MatchEngineUnit.h.

Referenced by init(), and step().

◆ projrinv_

int trklet::MatchEngineUnit::projrinv_
private

Definition at line 55 of file MatchEngineUnit.h.

Referenced by init(), and step().

◆ slot_

unsigned int trklet::MatchEngineUnit::slot_
private

Definition at line 51 of file MatchEngineUnit.h.

Referenced by init(), MatchEngineUnit(), and step().

◆ table2S_

std::vector<bool> trklet::MatchEngineUnit::table2S_
private

Definition at line 69 of file MatchEngineUnit.h.

Referenced by MatchEngineUnit(), and step().

◆ table_

std::vector<bool> trklet::MatchEngineUnit::table_
private

Definition at line 65 of file MatchEngineUnit.h.

Referenced by MatchEngineUnit(), and step().

◆ tablePS_

std::vector<bool> trklet::MatchEngineUnit::tablePS_
private

Definition at line 68 of file MatchEngineUnit.h.

Referenced by MatchEngineUnit(), and step().

◆ usesecond_

bool trklet::MatchEngineUnit::usesecond_
private

Definition at line 58 of file MatchEngineUnit.h.

Referenced by init(), and step().

◆ vmstubsmemory_

VMStubsMEMemory* trklet::MatchEngineUnit::vmstubsmemory_
private

Definition at line 48 of file MatchEngineUnit.h.

Referenced by init(), and step().

Reference_intrackfit_cff.barrel
list barrel
Definition: Reference_intrackfit_cff.py:37
trklet::VMStubME::isPSmodule
bool isPSmodule() const
Definition: VMStubME.h:30
trklet::VMStubsMEMemory::getVMStubMEBin
const VMStubME & getVMStubMEBin(unsigned int bin, unsigned int i) const
Definition: VMStubsMEMemory.h:35
trklet::MatchEngineUnit::projrinv_
int projrinv_
Definition: MatchEngineUnit.h:55
trklet::MatchEngineUnit::tablePS_
std::vector< bool > tablePS_
Definition: MatchEngineUnit.h:68
trklet::VMStubME::bend
const FPGAWord & bend() const
Definition: VMStubME.h:26
createJobs.tmp
tmp
align.sh
Definition: createJobs.py:716
trklet::MatchEngineUnit::istub_
unsigned int istub_
Definition: MatchEngineUnit.h:52
trklet::MatchEngineUnit::table_
std::vector< bool > table_
Definition: MatchEngineUnit.h:65
trklet::VMStubME::stub
const Stub * stub() const
Definition: VMStubME.h:28
trklet::MatchEngineUnit::candmatches_
CircularBuffer< std::pair< Tracklet *, const Stub * > > candmatches_
Definition: MatchEngineUnit.h:72
trklet::MatchEngineUnit::table2S_
std::vector< bool > table2S_
Definition: MatchEngineUnit.h:69
trklet::MatchEngineUnit::barrel_
bool barrel_
Definition: MatchEngineUnit.h:54
amptDefault_cfi.proj
proj
Definition: amptDefault_cfi.py:13
trklet::MatchEngineUnit::proj_
Tracklet * proj_
Definition: MatchEngineUnit.h:60
trklet::MatchEngineUnit::idle_
bool idle_
Definition: MatchEngineUnit.h:62
trklet::MatchEngineUnit::vmstubsmemory_
VMStubsMEMemory * vmstubsmemory_
Definition: MatchEngineUnit.h:48
trklet::FPGAWord::value
int value() const
Definition: FPGAWord.h:24
trklet::MatchEngineUnit::isPSseed_
bool isPSseed_
Definition: MatchEngineUnit.h:59
trklet::NFINERZBITS
constexpr unsigned int NFINERZBITS
Definition: Settings.h:27
trklet::MatchEngineUnit::usesecond_
bool usesecond_
Definition: MatchEngineUnit.h:58
trklet::MatchEngineUnit::projfinephi_
int projfinephi_
Definition: MatchEngineUnit.h:57
AlignmentPI::index
index
Definition: AlignmentPayloadInspectorHelper.h:46
trklet::MatchEngineUnit::projfinerz_
int projfinerz_
Definition: MatchEngineUnit.h:56
trklet::MatchEngineUnit::idle
bool idle() const
Definition: MatchEngineUnit.h:41
trklet::VMStubME::finerz
const FPGAWord & finerz() const
Definition: VMStubME.h:24
funct::abs
Abs< T >::type abs(const T &t)
Definition: Abs.h:22
trklet::VMStubME::finephi
const FPGAWord & finephi() const
Definition: VMStubME.h:23
TableParser.table
table
Definition: TableParser.py:111
trklet::VMStubME
Definition: VMStubME.h:15
trklet::VMStubsMEMemory::nStubsBin
unsigned int nStubsBin(unsigned int bin) const
Definition: VMStubsMEMemory.h:30
trklet::MatchEngineUnit::slot_
unsigned int slot_
Definition: MatchEngineUnit.h:51