ATLAS Offline Software
Functions
FPGATrackSimMatrixAccumulator.cxx File Reference

Helper struct and functions for accumulating sector information for matrix generation. More...

#include "FPGATrackSimMatrixAccumulator.h"
Include dependency graph for FPGATrackSimMatrixAccumulator.cxx:

Go to the source code of this file.

Functions

bool accumulate (AccumulateMap &map, std::vector< module_t > const &modules, FPGATrackSimMatrixAccumulator const &acc)
 Accumulates an accumulator (e.g. More...
 

Detailed Description

Helper struct and functions for accumulating sector information for matrix generation.

Author
Riley Xu - riley.nosp@m..xu@.nosp@m.cern..nosp@m.ch
Date
May 8th, 2020

Definition in file FPGATrackSimMatrixAccumulator.cxx.

Function Documentation

◆ accumulate()

bool accumulate ( AccumulateMap map,
std::vector< module_t > const modules,
FPGATrackSimMatrixAccumulator const acc 
)

Accumulates an accumulator (e.g.

Helper function for adding a track/accumulator to an accumulate map.

a single track) to an accumulate map.

Parameters
map- map to be added to
modules- sector definition of the accumulator to be added
acc- accumulator to be added
Returns
true if a new sector was just added, and false if acc was accumulated into an existing item.

Definition at line 22 of file FPGATrackSimMatrixAccumulator.cxx.

23 {
24  auto it = map.find(modules);
25  if (it == map.end()) // Create new entry
26  {
27  map.insert({ modules, acc });
28  return true;
29  }
30  else // Add/append entries
31  {
32 
33  for (unsigned i = 0; i < FPGATrackSimTrackPars::NPARS; i++)
34  it->second.pars[i] += acc.pars[i];
35 
36  size_t nDim = acc.hit_coords.size();
37  for (unsigned i = 0; i < nDim; i++)
38  {
39  it->second.hit_coords[i] += acc.hit_coords[i];
40  it->second.hit_x_QoP[i] += acc.hit_x_QoP[i];
41  it->second.hit_xG_HIP[i] += acc.hit_xG_HIP[i];
42  it->second.hit_x_d0[i] += acc.hit_x_d0[i];
43  it->second.hit_x_z0[i] += acc.hit_x_z0[i];
44  it->second.hit_x_eta[i] += acc.hit_x_eta[i];
45  it->second.hit_xG_eta[i] += acc.hit_xG_eta[i];
46  it->second.hit_x_phi[i] += acc.hit_x_phi[i];
47 
48  for (unsigned j = i; j < nDim; j++)
49  it->second.covariance[i * nDim + j] += acc.covariance[i * nDim + j];
50  }
51 
52  it->second.track_bins.insert(it->second.track_bins.end(), acc.track_bins.begin(), acc.track_bins.end());
53  return false;
54  }
55 }
skel.it
it
Definition: skel.GENtoEVGEN.py:423
lumiFormat.i
int i
Definition: lumiFormat.py:92
AthenaPoolTestRead.acc
acc
Definition: AthenaPoolTestRead.py:16
FPGATrackSimTrackPars::NPARS
@ NPARS
Definition: FPGATrackSimTrackPars.h:49