16 const std::vector<std::vector<TTStubRef>>& stubsDTC)
18 enableTruncation_(iConfig.getParameter<
bool>(
"EnableTruncation")),
19 region_(dtcId /
setup.numDTCsPerRegion()),
20 board_(dtcId %
setup.numDTCsPerRegion()),
21 modules_(
setup.dtcModules(dtcId)),
22 input_(
setup.dtcNumRoutingBlocks(),
Stubss(
setup.dtcNumModulesPerRoutingBlock())),
23 lost_(
setup.numOverlappingRegions()) {
25 auto acc = [](
int& sum,
const vector<TTStubRef>& stubsModule) {
return sum += stubsModule.size(); };
26 const int nStubs = accumulate(stubsDTC.begin(), stubsDTC.end(), 0, acc);
29 for (
int modId = 0; modId <
setup.numModulesPerDTC(); modId++) {
30 const vector<TTStubRef>& ttStubRefs = stubsDTC[modId];
31 if (ttStubRefs.empty())
36 const int blockId = modId /
setup.dtcNumModulesPerRoutingBlock();
38 const int channelId = modId %
setup.dtcNumModulesPerRoutingBlock();
41 for (
const TTStubRef& ttStubRef : ttStubRefs) {
46 stubs.push_back(&stub);
49 sort(stubs.begin(), stubs.end(), [](
Stub* lhs,
Stub* rhs) {
return abs(lhs->
bend()) <
abs(rhs->bend()); });
60 stubs.erase(
limit, stubs.end());
70 merge(
input_[routingBlock], blockStubs[routingBlock], lost);
74 copy_if(lost.begin(), lost.end(), back_inserter(
lost_[
region]), inRegion);
78 split(blockStubs, regionStubs);
80 produce(regionStubs, productAccepted);
89 while (!all_of(
inputs.begin(),
inputs.end(), [](
const Stubs& channel) {
return channel.empty(); })
or 90 !all_of(stacks.begin(), stacks.end(), [](
const Stubs& channel) {
return channel.empty(); })) {
92 for (
int iInput = 0; iInput < (
int)
inputs.size(); iInput++) {
102 stack.push_back(stub);
106 bool nothingToRoute(
true);
107 for (
int iInput =
inputs.size() - 1; iInput >= 0; iInput--) {
111 nothingToRoute =
false;
118 output.push_back(
nullptr);
123 copy_if(
limit,
output.end(), back_inserter(lost), [](
Stub* stub) {
return stub; });
134 auto regionMask = [&
region](
Stub* stub) {
return stub && stub->inRegion(
region) ? stub :
nullptr; };
152 auto toFrame = [&channel](
Stub* stub) {
153 return stub ? make_pair(stub->ttStubRef(), stub->frame(channel)) :
TTDTC::Frame();
155 for (
const Stubs& stubs : stubss) {
157 stream.reserve(stubs.size());
165 Stub* stub = deque.front();
int dtcNumRoutingBlocks() const
void produce(TTDTC &accepted, TTDTC &lost)
void split(Stubss &inputs, Stubss &outputs)
std::vector< Stub > stubs_
std::vector< Frame > Stream
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
std::vector< SensorModule * > modules_
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
int dtcDepthMemory() const
Abs< T >::type abs(const T &t)
Class to process and provide run-time constants used by Track Trigger emulators.
std::pair< TTStubRef, BV > Frame
Class to store hardware like structured TTStub Collection used by Track Trigger emulators.
void setStream(int dtcRegion, int dtcBoard, int dtcChannel, const Stream &stream)
int numOverlappingRegions() const
void merge(Stubss &inputs, Stubs &output, Stubs &lost)
std::deque< Stub * > Stubs