Reconstruct the tracks of one event on the server.
28 {
29
30
32 inputData["CELLS"] = std::make_pair(
33 std::vector<int64_t>{static_cast<int64_t>(cellBytes.size())},
34 cellBytes);
35
36
37
38
39 const EventIDBase& eventID = ctx.eventID();
40 std::vector<int64_t>
iov{
41 eventID.run_number(), eventID.lumi_block(), eventID.time_stamp(),
42 eventID.time_stamp_ns_offset(),
44 ATH_MSG_DEBUG(
"Sending event IOV run " << iov[0] <<
" lb " << iov[1]
45 << " time stamp " << iov[2] << "." << iov[3]
46 << " conditions run " << iov[4]);
47 inputData["EVENT_IOV"] = std::make_pair(
48 std::vector<int64_t>{
static_cast<int64_t
>(
iov.size())}, std::move(iov));
49
50
52 for (const char* name : {"MEASUREMENTS", "CLUSTERS", "TRACKS", "TRACK_STATES"}) {
53 outputData[
name] = std::make_pair(
54 std::vector<int64_t>{-1}, std::vector<uint8_t>{});
55 }
56
57 auto start_inference = std::chrono::high_resolution_clock::now();
59 auto end_inference = std::chrono::high_resolution_clock::now();
60 std::chrono::duration<double, std::milli> inference_time = end_inference - start_inference;
61 ATH_MSG_INFO(
"Traccc Triton inference time: " << inference_time.count() <<
" ms");
62
63 auto take = [&outputData](
const char*
name) {
64 return std::move(std::get<std::vector<uint8_t>>(outputData[name].second));
65 };
66 result.measurements = take(
"MEASUREMENTS");
67 result.clusters = take(
"CLUSTERS");
68 result.tracks = take(
"TRACKS");
69 result.trackStates = take(
"TRACK_STATES");
70
72 <<
result.clusters.size() <<
" + " <<
result.tracks.size()
73 <<
" + " <<
result.trackStates.size()
74 << " bytes of measurements, clusters, tracks and track states");
75
76 return StatusCode::SUCCESS;
77}
#define ATH_CHECK
Evaluate an expression and check for errors.
#define ATH_MSG_DEBUG(x,...)
#define ATH_MSG_INFO(x,...)
EventIDBase::number_type conditionsRun() const
std::map< std::string, InferenceData > OutputDataMap
std::map< std::string, InferenceData > InputDataMap
const ExtendedEventContext & getExtendedEventContext(const EventContext &ctx)
Retrieve an extended context from a context object.