ATLAS Offline Software
Loading...
Searching...
No Matches
FPGATrackSimBinnedHits.h
Go to the documentation of this file.
1// Copyright (C) 2002-2025 CERN for the benefit of the ATLAS collaboration
2
3#ifndef FPGATrackSimBinnedHits_H
4#define FPGATrackSimBinnedHits_H
5
25
30
31#include "GaudiKernel/StatusCode.h"
32
33#include <GaudiKernel/ToolHandle.h>
34
35#include <string>
36#include <vector>
37#include <bit>
38
39//-------------------------------------------------------------------------------------------------------
40// BinnedHits
41// Nomenclature:
42// parameter = parameter of track e.g. (pT,eta,phi,d0,z0) but could be
43// in different coordinates
44// such at in the keylayer format where its
45// (z_in,z_out,phi_in,phi_out,x_m)
46// bin = a bin in the full parameters space (upto 5-d)
47// subbin = a binning used as part of the total binning e.g. only in
48// (pT,phi) or only in (z_in,z_out)
49//-------------------------------------------------------------------------------------------------------
51public:
52 FPGATrackSimBinnedHits(const std::string &algname, const std::string &name,
53 const IInterface *ifc)
54 : AthAlgTool(algname, name, ifc) {}
55
56 virtual StatusCode initialize() override;
58
59 StatusCode fill(const std::vector<std::shared_ptr<const FPGATrackSimHit>> &hits);
60 void resetBins();
61
62 // access to tool
63 const FPGATrackSimBinTool& getBinTool() const { return *m_bintool.get();}
65
67 // Internal Storage Classes
68
69 // each bin contains a list of StoredHit objects
70 struct BinEntry {
72 void reset();
74 unsigned int lyrCnt() const { return std::popcount(lyrhit); };
75 unsigned int hitsInLyr(unsigned lyr) const;
76 unsigned int hitCnt = 0;
78 std::vector<FPGATrackSimBinUtil::StoredHit> hits{};
79 };
80
81 // access to binned hits..
82 const std::vector<FPGATrackSimBinArray<BinEntry>> &binnedHits() const {
83 return m_binnedHitsStep;
84 }
88
89 // Layer Map
90 // structure is indexed on bin, then layer, then a set of modules
91 void readLayerMap(const std::string & filename);
94
95 // structure is list of hits
96 void readLayerRadii(const std::string & filename);
97 FPGATrackSimBinArray < std::vector < std::pair<double,double> > > m_lyr_radii;
98
99 // Number of layers
100 void setNLayers(const unsigned &nLayers) { m_nLayers = nLayers; }
101 unsigned getNLayers() const {return m_nLayers;}
102
103private:
104 Gaudi::Property<std::string> m_lyrmapFile{this, "layerMapFile",{""}, "use externally defined layer map"};
105 Gaudi::Property<std::string> m_lyrradiiFile{this, "layerRadiiFile",{""}, "define layers in terms of rz radius instead of modules"};
106 ServiceHandle<IFPGATrackSimEventSelectionSvc> m_EvtSel{this, "FPGATrackSimEventSelectionSvc", ""};
107
108 // Vector of BinEntry for each step
109 std::vector<FPGATrackSimBinArray<BinEntry>> m_binnedHitsStep;
110
111 // The tool where the steps are defined
112 ToolHandle<FPGATrackSimBinTool> m_bintool {
113 this, "BinTool", "FPGATrackSimBinTool",
114 "FPGATrackSimBinTool: contains tools describe which parameters are used and each step of binning"};
115
116 // The number of layers, either set externally from pmap or set by the layerMap
117 unsigned m_nLayers{0};
118};
119
120#endif // FPGATrackSimBinnedHits_H
Iterable Multidimensional Array Class for FPGATrackSimBinTool.
Binning Classes for BinTool.
Binning Utilities for GenScanTool.
: FPGATrackSim-specific class to represent an hit in the detector.
uint32_t layer_bitmask_t
AthAlgTool(const std::string &type, const std::string &name, const IInterface *parent)
Constructor with parameters:
FPGATrackSimBinArray< std::vector< std::pair< double, double > > > m_lyr_radii
FPGATrackSimBinTool & getBinTool()
void setNLayers(const unsigned &nLayers)
void readLayerMap(const std::string &filename)
ServiceHandle< IFPGATrackSimEventSelectionSvc > m_EvtSel
const FPGATrackSimBinTool & getBinTool() const
Gaudi::Property< std::string > m_lyrradiiFile
const std::vector< FPGATrackSimBinArray< BinEntry > > & binnedHits() const
virtual StatusCode initialize() override
StatusCode fill(const std::vector< std::shared_ptr< const FPGATrackSimHit > > &hits)
std::vector< FPGATrackSimBinArray< BinEntry > > m_binnedHitsStep
Gaudi::Property< std::string > m_lyrmapFile
FPGATrackSimBinArray< std::map< unsigned, unsigned > > m_mod_to_lyr_map
FPGATrackSimBinnedHits(const std::string &algname, const std::string &name, const IInterface *ifc)
FPGATrackSimBinArray< std::vector< std::set< unsigned > > > m_lyr_to_mod_map
void readLayerRadii(const std::string &filename)
const FPGATrackSimBinArray< BinEntry > & lastStepBinnedHits() const
ToolHandle< FPGATrackSimBinTool > m_bintool
unsigned int hitsInLyr(unsigned lyr) const
void addHit(const FPGATrackSimBinUtil::StoredHit &hit)
std::vector< FPGATrackSimBinUtil::StoredHit > hits