ATLAS Offline Software
Public Member Functions | Private Attributes | List of all members
Trk::DetailedHitInfo Class Reference

#include <DetailedHitInfo.h>

Collaboration diagram for Trk::DetailedHitInfo:

Public Member Functions

void addHit (Trk::DetectorRegion region, int layer, int etaModule, int hit=1)
 This class containes the detailed information on the contributing layers and regions to the hit count. More...
 
int getHits (Trk::DetectorRegion region, int layer)
 
int getContributionFromRegion (Trk::DetectorRegion region)
 
int getAllContributions ()
 
int getPixelContributions ()
 
int getStripContributions ()
 
int getHitsFromRegion (Trk::DetectorRegion region)
 
int getAllHits ()
 
int getPixelHits ()
 
int getStripHits ()
 
const std::vector< std::pair< Trk::DetectorRegion, std::vector< std::tuple< int, int, int > > > > & getHitInfo ()
 

Private Attributes

std::vector< std::pair< Trk::DetectorRegion, std::vector< std::tuple< int, int, int > > > > m_detailedHitInfo {}
 
int m_prevEta {}
 

Detailed Description

Definition at line 23 of file DetailedHitInfo.h.

Member Function Documentation

◆ addHit()

void Trk::DetailedHitInfo::addHit ( Trk::DetectorRegion  region,
int  layer,
int  etaModule,
int  hit = 1 
)

This class containes the detailed information on the contributing layers and regions to the hit count.

Definition at line 59 of file DetailedHitInfo.cxx.

59  {
60  for (auto& [thisRegion,thisHitInfoVector] : m_detailedHitInfo) {
61  if (thisRegion==region) {
62  for (auto& [thisLayer, nLayers, nHits] : thisHitInfoVector) {
63  if (thisLayer==layer) {
64  // increase the contributing layers only for inclined/endcap modules
65  if (region!=pixelBarrelFlat and region!=stripBarrel and eta_module!=m_prevEta) {
66  nLayers++;
67  m_prevEta = eta_module;
68  }
69  nHits+=hit;
70  return;
71  }
72  }
73  }
74  }
75  // if reaches this point the element is not found, then you add it to m_detailedHitInfo
76  m_prevEta = eta_module;
77  std::vector < std::tuple <int, int, int> > counts = {{layer, 1, hit}};
78  m_detailedHitInfo.emplace_back(region, counts);
79 }

◆ getAllContributions()

int Trk::DetailedHitInfo::getAllContributions ( )

Definition at line 101 of file DetailedHitInfo.cxx.

101  {
102  return std::accumulate(m_detailedHitInfo.begin(), m_detailedHitInfo.end(), 0, addUp<NumLayers>);
103 }

◆ getAllHits()

int Trk::DetailedHitInfo::getAllHits ( )

Definition at line 111 of file DetailedHitInfo.cxx.

111  {
112  return std::accumulate(m_detailedHitInfo.begin(), m_detailedHitInfo.end(), 0, addUp<NumHits>);
113 }

◆ getContributionFromRegion()

int Trk::DetailedHitInfo::getContributionFromRegion ( Trk::DetectorRegion  region)

Definition at line 96 of file DetailedHitInfo.cxx.

96  {
97  return accumulate_if(m_detailedHitInfo.begin(), m_detailedHitInfo.end(), 0, addUp<NumLayers>, fromRegion(region));
98 }

◆ getHitInfo()

const std::vector< std::pair< Trk::DetectorRegion, std::vector< std::tuple< int, int, int > > > > & Trk::DetailedHitInfo::getHitInfo ( )

Definition at line 54 of file DetailedHitInfo.cxx.

54  {
55  return m_detailedHitInfo;
56 }

◆ getHits()

int Trk::DetailedHitInfo::getHits ( Trk::DetectorRegion  region,
int  layer 
)

Definition at line 82 of file DetailedHitInfo.cxx.

82  {
83  for (auto& [thisRegion,thisHitInfoVector] : m_detailedHitInfo) {
84  if (thisRegion==region) {
85  for (auto& [thisLayer, nLayers, nHits] : thisHitInfoVector) {
86  if (thisLayer==layer) {
87  return nHits;
88  }
89  }
90  }
91  }
92  return 0;
93 }

◆ getHitsFromRegion()

int Trk::DetailedHitInfo::getHitsFromRegion ( Trk::DetectorRegion  region)

Definition at line 106 of file DetailedHitInfo.cxx.

106  {
107  return accumulate_if(m_detailedHitInfo.begin(), m_detailedHitInfo.end(), 0, addUp<NumHits>, fromRegion(region));
108 }

◆ getPixelContributions()

int Trk::DetailedHitInfo::getPixelContributions ( )

Definition at line 116 of file DetailedHitInfo.cxx.

116  {
117  return accumulate_if(m_detailedHitInfo.begin(), m_detailedHitInfo.end(), 0, addUp<NumLayers>, fromPixels);
118 }

◆ getPixelHits()

int Trk::DetailedHitInfo::getPixelHits ( )

Definition at line 121 of file DetailedHitInfo.cxx.

121  {
122  return accumulate_if(m_detailedHitInfo.begin(), m_detailedHitInfo.end(), 0, addUp<NumHits>, fromPixels);
123 
124 }

◆ getStripContributions()

int Trk::DetailedHitInfo::getStripContributions ( )

Definition at line 127 of file DetailedHitInfo.cxx.

127  {
128  return accumulate_if(m_detailedHitInfo.begin(), m_detailedHitInfo.end(), 0, addUp<NumLayers>, fromStrips);
129 }

◆ getStripHits()

int Trk::DetailedHitInfo::getStripHits ( )

Definition at line 132 of file DetailedHitInfo.cxx.

132  {
133  return accumulate_if(m_detailedHitInfo.begin(), m_detailedHitInfo.end(), 0, addUp<NumHits>, fromStrips);
134 }

Member Data Documentation

◆ m_detailedHitInfo

std::vector< std::pair < Trk::DetectorRegion, std::vector < std::tuple <int , int , int> > > > Trk::DetailedHitInfo::m_detailedHitInfo {}
private

Definition at line 45 of file DetailedHitInfo.h.

◆ m_prevEta

int Trk::DetailedHitInfo::m_prevEta {}
private

Definition at line 46 of file DetailedHitInfo.h.


The documentation for this class was generated from the following files:
Trk::DetailedHitInfo::m_detailedHitInfo
std::vector< std::pair< Trk::DetectorRegion, std::vector< std::tuple< int, int, int > > > > m_detailedHitInfo
Definition: DetailedHitInfo.h:45
Trk::stripBarrel
@ stripBarrel
Definition: DetailedHitInfo.h:17
accumulate
bool accumulate(AccumulateMap &map, std::vector< module_t > const &modules, FPGATrackSimMatrixAccumulator const &acc)
Accumulates an accumulator (e.g.
Definition: FPGATrackSimMatrixAccumulator.cxx:22
Trk::pixelBarrelFlat
@ pixelBarrelFlat
Definition: DetailedHitInfo.h:14
TRT::Hit::layer
@ layer
Definition: HitInfo.h:79
Trk::DetailedHitInfo::m_prevEta
int m_prevEta
Definition: DetailedHitInfo.h:46