11 namespace trackerDTC {
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);
30 const vector<TTStubRef>& ttStubRefs = stubsDTC[modId];
31 if (ttStubRefs.empty())
41 for (
const TTStubRef& ttStubRef : ttStubRefs) {
42 stubs_.emplace_back(iConfig, setup, module, ttStubRef);
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);
87 Stubss stacks(inputs.size());
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; });
124 output.erase(
limit, output.end());
127 for (
auto it = output.end(); it != output.begin();)
128 it = (*--it) ? output.begin() : output.erase(it);
134 auto regionMask = [&
region](
Stub* stub) {
return stub && stub->inRegion(region) ? stub :
nullptr; };
137 Stubss streams(inputs.size());
142 for (
auto it = stream.end(); it != stream.begin();)
143 it = (*--it) ? stream.begin() : stream.erase(it);
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());
158 transform(stubs.begin(), stubs.end(), back_inserter(stream), toFrame);
165 Stub* stub = deque.front();
int numModulesPerDTC() const
int dtcNumRoutingBlocks() const
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::EventIDconst &, edm::Timestampconst & > We also list in braces which AR_WATCH_USING_METHOD_ is used for those or
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_
int dtcDepthMemory() const
Abs< T >::type abs(const T &t)
int dtcNumModulesPerRoutingBlock() const
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