22 : enableTruncation_(iConfig.getParameter<
bool>(
"EnableTruncation")),
24 dataFormats_(dataFormats),
33 auto validFrame = [](
int& sum,
const FrameStub&
frame) {
return sum +=
frame.first.isNonnull() ? 1 : 0; };
37 nStubsGP += accumulate(
stream.begin(),
stream.end(), 0, validFrame);
46 if (
frame.first.isNonnull()) {
56 for (deque<StubGP*>& stubs :
input)
57 for (
auto it = stubs.end(); it != stubs.begin();)
58 it = (*--it) ? stubs.begin() : stubs.erase(it);
59 auto validStub = [](
int& sum,
StubGP* stub) {
return sum += stub ? 1 : 0; };
62 for (
const deque<StubGP*>&
sector : binInv2R)
63 nStubsHT += accumulate(
sector.begin(),
sector.end(), 0, validStub);
71 deque<StubHT*> acceptedAll;
72 deque<StubHT*> lostAll;
73 for (deque<StubGP*>& inputSector :
input_[binInv2R]) {
74 const int size = inputSector.size();
75 vector<StubHT*> acceptedSector;
76 vector<StubHT*> lostSector;
77 acceptedSector.reserve(
size);
78 lostSector.reserve(
size);
80 fillIn(
inv2R, inputSector, acceptedSector, lostSector);
82 acceptedSector.erase(
remove(acceptedSector.begin(), acceptedSector.end(),
nullptr), acceptedSector.end());
84 readOut(acceptedSector, lostSector, acceptedAll, lostAll);
90 copy_if(
limit, acceptedAll.end(), back_inserter(lostAll), [](
StubHT* stub) {
return stub; });
91 acceptedAll.erase(
limit, acceptedAll.end());
94 stream.reserve(stubs.size());
99 put(acceptedAll, accepted[
offset + binInv2R]);
107 deque<StubGP*>& inputSector,
108 vector<StubHT*>& acceptedSector,
109 vector<StubHT*>& lostSector) {
111 deque<StubHT*>
stack;
113 while (!inputSector.empty() || !
stack.empty()) {
128 const int minor = chi >= 0. ? major + 1 : major - 1;
146 : acceptedSector.end();
147 copy_if(
limit, acceptedSector.end(), back_inserter(lostSector), [](
StubHT* stub) {
return stub; });
148 acceptedSector.erase(
limit, acceptedSector.end());
153 const vector<StubHT*>& lostSector,
154 deque<StubHT*>& acceptedAll,
155 deque<StubHT*>& lostAll)
const {
161 vector<int> binsPhiT;
166 auto samePhiT = [
phiT](
int& sum,
StubHT* stub) {
return sum += stub->phiT() ==
phiT; };
167 const int numAccepted = accumulate(acceptedSector.begin(), acceptedSector.end(), 0, samePhiT);
168 const int numLost = accumulate(lostSector.begin(), lostSector.end(), 0, samePhiT);
169 tracks[binPhiT].reserve(numAccepted + numLost);
171 for (
StubHT* stub : acceptedSector) {
175 tracks[binPhiT].push_back(stub);
178 trkFoundPhiTs.set(binPhiT);
179 binsPhiT.push_back(binPhiT);
183 for (
int binPhiT : binsPhiT) {
185 acceptedAll.insert(acceptedAll.end(),
track.begin(),
track.end());
188 for (
StubHT* stub : lostSector) {
190 if (!trkFoundPhiTs[binPhiT])
191 tracks[binPhiT].push_back(stub);
193 for (
int binPhiT : trkFoundPhiTs.ids(
false)) {
196 auto toLayer = [](
StubHT* stub) {
return stub->layer(); };
199 lostAll.insert(lostAll.end(),
track.begin(),
track.end());
bool inInv2RBin(int inv2RBin) const
int numSectorsPhi() const
Bit vector used by Track Trigger emulators. Mainly used to convert integers into arbitrary (within ma...
std::pair< TTStubRef, Frame > FrameStub
Class to process and provide run-time constants used by Track Trigger emulators.
std::vector< StreamStub > StreamsStub
std::vector< FrameStub > StreamStub
uint32_t T const *__restrict__ uint32_t const *__restrict__ int32_t int Histo::index_type cudaStream_t stream
static std::string const input
int htDepthMemory() const
Abs< T >::type abs(const T &t)
deadvectors [0] push_back({0.0175431, 0.538005, 6.80997, 13.29})
int htNumBinsPhiT() const