ATLAS Offline Software
Functions
FPGATrackSimMatrixIO.cxx File Reference
#include "FPGATrackSimMatrixIO.h"
Include dependency graph for FPGATrackSimMatrixIO.cxx:

Go to the source code of this file.

Functions

void readTree (AccumulateMap &map, TTree *tree, size_t nLayers, size_t nCoords)
 Reads a matrix tree, accumulating its entries into a map. More...
 
std::vector< std::pair< std::vector< module_t >, FPGATrackSimMatrixAccumulator > > readTree (TTree *tree, size_t nLayers, size_t nCoords)
 Reads a matrix tree, accumulating its entries into a vector, in the order they are read. More...
 
void fillTree (AccumulateMap &map, TTree *tree, int nLayers, int nCoords)
 Writes the contents of an AccumulateMap into the supplied tree (one entry per sector). More...
 

Detailed Description

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

Definition in file FPGATrackSimMatrixIO.cxx.

Function Documentation

◆ fillTree()

void fillTree ( AccumulateMap map,
TTree *  tree,
int  nLayers,
int  nCoords 
)

Writes the contents of an AccumulateMap into the supplied tree (one entry per sector).

Parameters
map- map to be written
tree- tree to be written to; this function will create the branches
nLayers- number of logical layers
nCoords- number of hit coordinates in a full (13/13) track

Definition at line 225 of file FPGATrackSimMatrixIO.cxx.

226 {
227  fillTree(map.begin(), map.end(), tree, nLayers, nCoords);
228 }

◆ readTree() [1/2]

void readTree ( AccumulateMap map,
TTree *  tree,
size_t  nLayers,
size_t  nCoords 
)

Reads a matrix tree, accumulating its entries into a map.

Note this functions sets and resets branch addresses.

Parameters
map- map to be added to
tree- tree to be read
nLayers- number of logical layers
nCoords- number of hit coordinates in a full (13/13) track

Definition at line 92 of file FPGATrackSimMatrixIO.cxx.

93 {
94  FPGATrackSimMatrixReader reader(tree, nLayers, nCoords);
95  while (reader.nextEntry())
96  accumulate(map, reader.getModules(), reader.getAccumulator());
97 }

◆ readTree() [2/2]

std::vector<std::pair<std::vector<module_t>, FPGATrackSimMatrixAccumulator> > readTree ( TTree *  tree,
size_t  nLayers,
size_t  nCoords 
)

Reads a matrix tree, accumulating its entries into a vector, in the order they are read.

Note this functions sets and resets branch addresses.

Parameters
tree- tree to be read
nLayers- number of logical layers
nCoords- number of hit coordinates in a full (13/13) track

Definition at line 108 of file FPGATrackSimMatrixIO.cxx.

109 {
110  std::vector<std::pair<std::vector<module_t>, FPGATrackSimMatrixAccumulator>> matrices;
111 
112  FPGATrackSimMatrixReader reader(tree, nLayers, nCoords);
113  while (reader.nextEntry())
114  matrices.push_back({ reader.getModules(), reader.getAccumulator() });
115 
116  return matrices;
117 }
accumulate
bool accumulate(AccumulateMap &map, std::vector< module_t > const &modules, FPGATrackSimMatrixAccumulator const &acc)
Accumulates an accumulator (e.g.
Definition: FPGATrackSimMatrixAccumulator.cxx:22
tree
TChain * tree
Definition: tile_monitor.h:30
fillTree
void fillTree(AccumulateMap &map, TTree *tree, int nLayers, int nCoords)
Writes the contents of an AccumulateMap into the supplied tree (one entry per sector).
Definition: FPGATrackSimMatrixIO.cxx:225
FPGATrackSimMatrixAccumulator
Definition: FPGATrackSimMatrixAccumulator.h:36
FPGATrackSimMatrixReader
Definition: FPGATrackSimMatrixIO.h:41
collisions.reader
reader
read the goodrunslist xml file(s)
Definition: collisions.py:22