ATLAS Offline Software
Loading...
Searching...
No Matches
FPGATrackSimSectorBank.h
Go to the documentation of this file.
1// Copyright (C) 2002-2024 CERN for the benefit of the ATLAS collaboration
2
3#ifndef FPGATrackSimSECTORBANK_H
4#define FPGATrackSimSECTORBANK_H
5
18
19
20#include <iostream>
21#include <map>
22#include <fstream>
23#include <vector>
24#include <memory>
25
27
28class FPGATrackSimHit;
29
30
32{
33 public:
34
35 FPGATrackSimSectorBank(std::string const & filepath);
36
37 size_t getNLayers() const { return m_nLayers; }
38 size_t getNSectors() const { return m_s2mMap.size(); }
39
40 std::vector<module_t> const & getModules(sector_t sector) const { return m_s2mMap[sector]; }
41 std::vector<sector_t> getSectors(unsigned layer, module_t module) const; // TODO rename find?
42
43 // Returns the sector matching 'modules' exactly (WC must be matched with WC), or -1 if none.
44 sector_t findSector(std::vector<module_t> const & modules) const;
45
46 // Returns the sector matching 'hits' exactly (WC must be matched with WC), or -1 if none.
47 // If multiple hits have different hashIDs, will prefer most popular, then random.
48 sector_t findSector(std::vector<std::vector<std::shared_ptr<const FPGATrackSimHit>>> const & hits) const;
49
50
51 // Helper functions to set and retrieve information about the sector q/pt binning.
52 const std::vector<double>& getQOverPtBins() const { return m_qOverPtBins; }
53 size_t getNQOverPtBins() const {return m_qOverPtBins.size(); }
55 void storeQOverPtBinning(const std::vector<double>& qOverPtBins, bool absBinning);
56
57
58 private:
59
60 size_t m_nLayers = 0UL;
61 std::vector<std::vector<module_t>> m_s2mMap; // sector to module map. index by (sector, layer)
62 std::vector<std::multimap<module_t, sector_t>> m_m2sMap; // module to sector map. index by (layer, module).
63
64 // Store these as part of the sector bank.
65 std::vector<double> m_qOverPtBins;
66 bool m_absQOverPtBinning = false;
67
68 // Helpers
69 void readHeader(std::ifstream & fin);
70 void readSectors(std::ifstream & fin);
71 void makeInverseMap();
72};
73
74
75
76#endif // FPGATrackSimSECTORBANK_H
int32_t module_t
int32_t sector_t
void storeQOverPtBinning(const std::vector< double > &qOverPtBins, bool absBinning)
std::vector< std::vector< module_t > > m_s2mMap
std::vector< sector_t > getSectors(unsigned layer, module_t module) const
void readHeader(std::ifstream &fin)
const std::vector< double > & getQOverPtBins() const
sector_t findSector(std::vector< module_t > const &modules) const
std::vector< double > m_qOverPtBins
std::vector< module_t > const & getModules(sector_t sector) const
std::vector< std::multimap< module_t, sector_t > > m_m2sMap
FPGATrackSimSectorBank(std::string const &filepath)
void readSectors(std::ifstream &fin)