CMS 3D CMS Logo

List of all members | Public Member Functions | Private Attributes
trackerTFP::DistServer Class Reference

#include <DistServer.h>

Public Member Functions

std::vector< std::vector< unsigned int > > & addr ()
 
TrackKFOutSAPtrCollection clock (TrackKFOutSAPtrCollection &inputs)
 
 DistServer (unsigned int nInputs, unsigned int nOutputs, unsigned int nInterleaving)
 
TrackKFOutSAPtrCollectionsinputs ()
 
unsigned int nInputs () const
 
unsigned int nInterleaving () const
 
unsigned int nOutputs () const
 
 ~DistServer ()
 

Private Attributes

std::vector< std::vector< unsigned int > > addr_
 
TrackKFOutSAPtrCollections inputs_
 
unsigned int nInputs_
 
unsigned int nInterleaving_
 
unsigned int nOutputs_
 

Detailed Description

Definition at line 10 of file DistServer.h.

Constructor & Destructor Documentation

◆ DistServer()

DistServer::DistServer ( unsigned int  nInputs,
unsigned int  nOutputs,
unsigned int  nInterleaving 
)

Definition at line 10 of file DistServer.cc.

References addr_, nInputs(), and nInterleaving().

12  for (unsigned int iInput = 0; iInput < this->nInputs(); ++iInput) {
13  addr_.emplace_back(this->nInterleaving(), 0);
14  for (unsigned int iInterleave = 0; iInterleave < this->nInterleaving(); ++iInterleave) {
15  addr_[iInput][iInterleave] = iInterleave;
16  }
17  }
18 }
unsigned int nInputs() const
Definition: DistServer.h:17
TrackKFOutSAPtrCollections inputs_
Definition: DistServer.h:28
unsigned int nOutputs_
Definition: DistServer.h:25
std::vector< std::vector< unsigned int > > addr_
Definition: DistServer.h:29
unsigned int nInterleaving_
Definition: DistServer.h:26
unsigned int nInputs_
Definition: DistServer.h:24
unsigned int nInterleaving() const
Definition: DistServer.h:19
unsigned int nOutputs() const
Definition: DistServer.h:18

◆ ~DistServer()

trackerTFP::DistServer::~DistServer ( )
inline

Definition at line 13 of file DistServer.h.

13 {}

Member Function Documentation

◆ addr()

std::vector<std::vector<unsigned int> >& trackerTFP::DistServer::addr ( )
inline

Definition at line 20 of file DistServer.h.

References addr_.

Referenced by clock().

20 { return addr_; }
std::vector< std::vector< unsigned int > > addr_
Definition: DistServer.h:29

◆ clock()

TrackKFOutSAPtrCollection DistServer::clock ( TrackKFOutSAPtrCollection inputs)

Definition at line 20 of file DistServer.cc.

References addr(), data, inputs(), nInputs(), nInterleaving(), nOutputs(), and svgfig::rotate().

20  {
21  for (unsigned int iInput = 0; iInput < nInputs(); ++iInput) {
22  if (data[iInput]->dataValid()) {
23  inputs()[iInput].push_back(data[iInput]);
24  }
25  }
26 
27  vector<vector<bool> > lMap(nInputs(), vector<bool>(nOutputs()));
28 
29  TrackKFOutSAPtrCollection lInputs(nInputs(), std::make_shared<TrackKFOut>());
30 
31  std::vector<std::vector<unsigned int> >& addr = this->addr();
32 
33  for (unsigned int iInput = 0; iInput < nInputs(); ++iInput) {
34  unsigned int lAddr = addr[iInput][0];
35  if (lAddr < inputs()[iInput].size()) {
36  lInputs[iInput] = inputs()[iInput][lAddr];
37  lMap[iInput][lInputs[iInput]->sortKey()] = true;
38  }
39  }
40 
41  for (unsigned int iInput = 0; iInput < nInputs(); ++iInput) {
42  vector<unsigned int>& toRotate = addr[iInput];
43  rotate(toRotate.begin(), toRotate.begin() + 1, toRotate.end());
44  }
45 
46  TrackKFOutSAPtrCollection lOutputs(nOutputs(), std::make_shared<TrackKFOut>());
47 
48  for (unsigned int iOutput = 0; iOutput < lOutputs.size(); ++iOutput) {
49  for (unsigned int iInput = 0; iInput < nInputs(); ++iInput) {
50  if (lMap[iInput][iOutput]) {
51  lOutputs[iOutput] = lInputs[iInput];
52  addr[iInput].back() += this->nInterleaving();
53  break;
54  }
55  }
56  }
57 
58  return lOutputs;
59 }
std::vector< std::vector< unsigned int > > & addr()
Definition: DistServer.h:20
unsigned int nInputs() const
Definition: DistServer.h:17
std::vector< TrackKFOutSAPtr > TrackKFOutSAPtrCollection
Definition: DataFormats.h:1029
char data[epos_bytes_allocation]
Definition: EPOS_Wrapper.h:80
TrackKFOutSAPtrCollections & inputs()
Definition: DistServer.h:21
def rotate(angle, cx=0, cy=0)
Definition: svgfig.py:705
unsigned int nInterleaving() const
Definition: DistServer.h:19
unsigned int nOutputs() const
Definition: DistServer.h:18

◆ inputs()

TrackKFOutSAPtrCollections& trackerTFP::DistServer::inputs ( )
inline

Definition at line 21 of file DistServer.h.

References inputs_.

Referenced by clock().

21 { return inputs_; }
TrackKFOutSAPtrCollections inputs_
Definition: DistServer.h:28

◆ nInputs()

unsigned int trackerTFP::DistServer::nInputs ( ) const
inline

Definition at line 17 of file DistServer.h.

References nInputs_.

Referenced by clock(), and DistServer().

17 { return nInputs_; }
unsigned int nInputs_
Definition: DistServer.h:24

◆ nInterleaving()

unsigned int trackerTFP::DistServer::nInterleaving ( ) const
inline

Definition at line 19 of file DistServer.h.

References nInterleaving_.

Referenced by clock(), and DistServer().

19 { return nInterleaving_; }
unsigned int nInterleaving_
Definition: DistServer.h:26

◆ nOutputs()

unsigned int trackerTFP::DistServer::nOutputs ( ) const
inline

Definition at line 18 of file DistServer.h.

References nOutputs_.

Referenced by clock().

18 { return nOutputs_; }
unsigned int nOutputs_
Definition: DistServer.h:25

Member Data Documentation

◆ addr_

std::vector<std::vector<unsigned int> > trackerTFP::DistServer::addr_
private

Definition at line 29 of file DistServer.h.

Referenced by addr(), and DistServer().

◆ inputs_

TrackKFOutSAPtrCollections trackerTFP::DistServer::inputs_
private

Definition at line 28 of file DistServer.h.

Referenced by inputs().

◆ nInputs_

unsigned int trackerTFP::DistServer::nInputs_
private

Definition at line 24 of file DistServer.h.

Referenced by nInputs().

◆ nInterleaving_

unsigned int trackerTFP::DistServer::nInterleaving_
private

Definition at line 26 of file DistServer.h.

Referenced by nInterleaving().

◆ nOutputs_

unsigned int trackerTFP::DistServer::nOutputs_
private

Definition at line 25 of file DistServer.h.

Referenced by nOutputs().