|
58 | 58 | #include "utils/strtag.h" |
59 | 59 | #include <fstream> |
60 | 60 | #include <numeric> |
| 61 | +#include <random> |
61 | 62 | #include <vector> |
62 | 63 |
|
63 | 64 | using namespace o2::gpu; |
@@ -160,6 +161,40 @@ namespace |
160 | 161 | struct TPCCFDecodeScanTmp { |
161 | 162 | int32_t zsPtrFirst, zsPageFirst, zsPtrLast, zsPageLast, hasData, pageCounter; |
162 | 163 | }; |
| 164 | + |
| 165 | +struct InjectedADC { |
| 166 | + std::array<std::vector<Digit>, GPUCA_ROW_COUNT> digitsByRow; |
| 167 | +}; |
| 168 | + |
| 169 | +// Additional ADC values must be generated at start of clusterizer |
| 170 | +// This is required, so enough memory is allocated for the charge points |
| 171 | +// And ADCs can be injected simply |
| 172 | +// -> copying chargeMap + chargePositions to host |
| 173 | +// -> writing additional adcs to chargeMap + positions |
| 174 | +// -> copying values to device |
| 175 | +InjectedADC GenerateSaturatedSignals() |
| 176 | +{ |
| 177 | + InjectedADC adcs; |
| 178 | + |
| 179 | + const int32_t nHIPs = 1; |
| 180 | + const int32_t firstTB = 0; // Place all HIPs in first fragment for now |
| 181 | + const int32_t lastTB = 4000; |
| 182 | + |
| 183 | + std::mt19937 gen{42}; |
| 184 | + std::uniform_int_distribution<> randomRow(0, GPUCA_ROW_COUNT - 1); |
| 185 | + std::uniform_int_distribution<> randomTB(0, lastTB - 1); |
| 186 | + std::uniform_int_distribution<> randomPad(0, TPC_PADS_PER_ROW - 1); |
| 187 | + |
| 188 | + |
| 189 | + for (int32_t iHIP = 0; iHIP < nHIPs; iHIP++) { |
| 190 | + const int32_t row = randomRow(gen); |
| 191 | + auto &digits = adcs.digitsByRow[row]; |
| 192 | + |
| 193 | + |
| 194 | + } |
| 195 | + |
| 196 | + return adcs; |
| 197 | +} |
163 | 198 | } // namespace |
164 | 199 |
|
165 | 200 | std::pair<uint32_t, uint32_t> GPUChainTracking::TPCClusterizerDecodeZSCount(uint32_t iSector, const CfFragment& fragment) |
|
0 commit comments