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 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 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_
 
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 38 of file MatchEngineUnit.h.

38 { return proj_; }

References proj_.

◆ empty()

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

Definition at line 32 of file MatchEngineUnit.h.

32 { return candmatches_.empty(); }

References candmatches_.

◆ idle()

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

Definition at line 40 of file MatchEngineUnit.h.

40 { return idle_; }

References idle_.

Referenced by step().

◆ init()

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

Definition at line 16 of file MatchEngineUnit.cc.

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

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

◆ peek()

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

Definition at line 36 of file MatchEngineUnit.h.

36 { return candmatches_.peek(); }

References candmatches_.

◆ read()

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

Definition at line 34 of file MatchEngineUnit.h.

34 { return candmatches_.read(); }

References candmatches_.

Referenced by edmIntegrityCheck.PublishToFileSystem::get().

◆ step()

void MatchEngineUnit::step ( )

Definition at line 34 of file MatchEngineUnit.cc.

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

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::VMStubsMEMemory::nStubsBin(), proj_, projfinephi_, projfinerz_, projrinv_, slot_, trklet::VMStubME::stub(), table2S_, table_, tablePS_, createJobs::tmp, trklet::FPGAWord::value(), and vmstubsmemory_.

Member Data Documentation

◆ barrel_

bool trklet::MatchEngineUnit::barrel_
private

Definition at line 51 of file MatchEngineUnit.h.

Referenced by MatchEngineUnit(), and step().

◆ candmatches_

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

Definition at line 68 of file MatchEngineUnit.h.

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

◆ idle_

bool trklet::MatchEngineUnit::idle_
private

Definition at line 58 of file MatchEngineUnit.h.

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

◆ isPSseed_

bool trklet::MatchEngineUnit::isPSseed_
private

Definition at line 55 of file MatchEngineUnit.h.

Referenced by init(), and step().

◆ istub_

unsigned int trklet::MatchEngineUnit::istub_
private

Definition at line 49 of file MatchEngineUnit.h.

Referenced by init(), and step().

◆ proj_

Tracklet* trklet::MatchEngineUnit::proj_
private

Definition at line 56 of file MatchEngineUnit.h.

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

◆ projfinephi_

int trklet::MatchEngineUnit::projfinephi_
private

Definition at line 54 of file MatchEngineUnit.h.

Referenced by init(), and step().

◆ projfinerz_

int trklet::MatchEngineUnit::projfinerz_
private

Definition at line 53 of file MatchEngineUnit.h.

Referenced by init(), and step().

◆ projrinv_

int trklet::MatchEngineUnit::projrinv_
private

Definition at line 52 of file MatchEngineUnit.h.

Referenced by init(), and step().

◆ slot_

unsigned int trklet::MatchEngineUnit::slot_
private

Definition at line 48 of file MatchEngineUnit.h.

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

◆ table2S_

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

Definition at line 65 of file MatchEngineUnit.h.

Referenced by MatchEngineUnit(), and step().

◆ table_

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

Definition at line 61 of file MatchEngineUnit.h.

Referenced by MatchEngineUnit(), and step().

◆ tablePS_

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

Definition at line 64 of file MatchEngineUnit.h.

Referenced by MatchEngineUnit(), and step().

◆ vmstubsmemory_

VMStubsMEMemory* trklet::MatchEngineUnit::vmstubsmemory_
private

Definition at line 45 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:33
trklet::MatchEngineUnit::projrinv_
int projrinv_
Definition: MatchEngineUnit.h:52
trklet::MatchEngineUnit::tablePS_
std::vector< bool > tablePS_
Definition: MatchEngineUnit.h:64
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:49
trklet::MatchEngineUnit::table_
std::vector< bool > table_
Definition: MatchEngineUnit.h:61
trklet::VMStubME::stub
const Stub * stub() const
Definition: VMStubME.h:28
trklet::MatchEngineUnit::candmatches_
CircularBuffer< std::pair< Tracklet *, const Stub * > > candmatches_
Definition: MatchEngineUnit.h:68
trklet::MatchEngineUnit::table2S_
std::vector< bool > table2S_
Definition: MatchEngineUnit.h:65
trklet::MatchEngineUnit::barrel_
bool barrel_
Definition: MatchEngineUnit.h:51
amptDefault_cfi.proj
proj
Definition: amptDefault_cfi.py:13
trklet::MatchEngineUnit::proj_
Tracklet * proj_
Definition: MatchEngineUnit.h:56
trklet::MatchEngineUnit::idle_
bool idle_
Definition: MatchEngineUnit.h:58
trklet::MatchEngineUnit::vmstubsmemory_
VMStubsMEMemory * vmstubsmemory_
Definition: MatchEngineUnit.h:45
trklet::FPGAWord::value
int value() const
Definition: FPGAWord.h:24
trklet::MatchEngineUnit::isPSseed_
bool isPSseed_
Definition: MatchEngineUnit.h:55
trklet::MatchEngineUnit::projfinephi_
int projfinephi_
Definition: MatchEngineUnit.h:54
AlignmentPI::index
index
Definition: AlignmentPayloadInspectorHelper.h:46
trklet::MatchEngineUnit::projfinerz_
int projfinerz_
Definition: MatchEngineUnit.h:53
trklet::MatchEngineUnit::idle
bool idle() const
Definition: MatchEngineUnit.h:40
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:28
trklet::MatchEngineUnit::slot_
unsigned int slot_
Definition: MatchEngineUnit.h:48