18 const std::vector<std::vector<TTStubRef>>& stubsDTC)
20 enableTruncation_(iConfig.getParameter<
bool>(
"EnableTruncation")),
21 region_(dtcId /
setup->numDTCsPerRegion()),
22 board_(dtcId %
setup->numDTCsPerRegion()),
23 modules_(
setup->dtcModules(dtcId)),
24 input_(
setup->dtcNumRoutingBlocks(),
Stubss(
setup->dtcNumModulesPerRoutingBlock())),
25 lost_(
setup->numOverlappingRegions()) {
27 auto acc = [](
int& sum,
const vector<TTStubRef>& stubsModule) {
return sum += stubsModule.size(); };
28 const int nStubs = accumulate(stubsDTC.begin(), stubsDTC.end(), 0, acc);
31 for (
int modId = 0; modId <
setup->numModulesPerDTC(); modId++) {
32 const vector<TTStubRef>& ttStubRefs = stubsDTC[modId];
33 if (ttStubRefs.empty())
38 const int blockId = modId /
setup->dtcNumModulesPerRoutingBlock();
40 const int channelId = modId %
setup->dtcNumModulesPerRoutingBlock();
43 for (
const TTStubRef& ttStubRef : ttStubRefs) {
48 stubs.push_back(&stub);
51 sort(stubs.begin(), stubs.end(), [](
Stub* lhs,
Stub* rhs) {
return abs(lhs->
bend()) <
abs(rhs->bend()); });
62 stubs.erase(
limit, stubs.end());
72 merge(
input_[routingBlock], blockStubs[routingBlock], lost);
76 copy_if(lost.begin(), lost.end(), back_inserter(
lost_[
region]), inRegion);
80 split(blockStubs, regionStubs);
82 produce(regionStubs, productAccepted);
91 while (!all_of(
inputs.begin(),
inputs.end(), [](
const Stubs& channel) {
return channel.empty(); })
or 92 !all_of(stacks.begin(), stacks.end(), [](
const Stubs& channel) {
return channel.empty(); })) {
94 for (
int iInput = 0; iInput < (
int)
inputs.size(); iInput++) {
104 stack.push_back(stub);
108 bool nothingToRoute(
true);
109 for (
int iInput =
inputs.size() - 1; iInput >= 0; iInput--) {
113 nothingToRoute =
false;
120 output.push_back(
nullptr);
125 copy_if(
limit,
output.end(), back_inserter(lost), [](
Stub* stub) {
return stub; });
136 auto regionMask = [&
region](
Stub* stub) {
return stub && stub->inRegion(
region) ? stub :
nullptr; };
154 auto toFrame = [&channel](
Stub* stub) {
155 return stub ? make_pair(stub->ttStubRef(), stub->frame(channel)) :
FrameStub();
157 for (
const Stubs& stubs : stubss) {
159 stream.reserve(stubs.size());
167 Stub* stub = deque.front();
void setStream(int dtcRegion, int dtcBoard, int dtcChannel, const tt::StreamStub &stream)
std::pair< TTStubRef, Frame > FrameStub
void produce(TTDTC &accepted, TTDTC &lost)
Class to process and provide run-time constants used by Track Trigger emulators.
int dtcDepthMemory() const
std::vector< FrameStub > StreamStub
void split(Stubss &inputs, Stubss &outputs)
std::vector< Stub > stubs_
std::vector< Stubs > Stubss
Stub * pop_front(Stubs &stubs)
uint32_t T const *__restrict__ uint32_t const *__restrict__ int32_t int Histo::index_type cudaStream_t stream
static std::string const input
Class to represent an outer tracker Stub.
The Signals That Services Can Subscribe To This is based on ActivityRegistry and is current per Services can connect to the signals distributed by the ActivityRegistry in order to monitor the activity of the application Each possible callback has some defined which we here list in angle e< void, edm::EventID const &, edm::Timestamp const & > We also list in braces which AR_WATCH_USING_METHOD_ is used for those or
Abs< T >::type abs(const T &t)
uint8_t channelId(const VFATFrame &frame)
retrieve this channel identifier
Class to store hardware like structured TTStub Collection used by Track Trigger emulators.
Class to encode layer ids used between DTC and TFP in Hybrid.
int numOverlappingRegions() const
int dtcNumRoutingBlocks() const
std::vector< tt::SensorModule * > modules_
void merge(Stubss &inputs, Stubs &output, Stubs &lost)
std::deque< Stub * > Stubs