ATLAS Offline Software
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 
20 #include <iostream>
21 #include <map>
22 #include <fstream>
23 #include <vector>
24 #include <memory>
25 
27 
28 class 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(); }
54  bool isAbsQOverPtBinning() const { return m_absQOverPtBinning; }
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
FPGATrackSimSectorBank::getNSectors
size_t getNSectors() const
Definition: FPGATrackSimSectorBank.h:38
FPGATrackSimSectorBank::readSectors
void readSectors(std::ifstream &fin)
Definition: FPGATrackSimSectorBank.cxx:64
FPGATrackSimSectorBank::getNLayers
size_t getNLayers() const
Definition: FPGATrackSimSectorBank.h:37
FPGATrackSimSectorBank::m_qOverPtBins
std::vector< double > m_qOverPtBins
Definition: FPGATrackSimSectorBank.h:65
TRTCalib_Extractor.hits
hits
Definition: TRTCalib_Extractor.py:35
FPGATrackSimSectorBank::readHeader
void readHeader(std::ifstream &fin)
Definition: FPGATrackSimSectorBank.cxx:46
FPGATrackSimSectorBank::getQOverPtBins
const std::vector< double > & getQOverPtBins() const
Definition: FPGATrackSimSectorBank.h:52
FPGATrackSimHit
Definition: FPGATrackSimHit.h:41
FPGATrackSimSectorBank::m_m2sMap
std::vector< std::multimap< module_t, sector_t > > m_m2sMap
Definition: FPGATrackSimSectorBank.h:62
python.PyAthena.module
module
Definition: PyAthena.py:131
FPGATrackSimSectorBank::getModules
std::vector< module_t > const & getModules(sector_t sector) const
Definition: FPGATrackSimSectorBank.h:40
FPGATrackSimSectorBank::findSector
sector_t findSector(std::vector< module_t > const &modules) const
Definition: FPGATrackSimSectorBank.cxx:121
module_t
int32_t module_t
Definition: FPGATrackSimTypes.h:20
FPGATrackSimSectorBank::storeQOverPtBinning
void storeQOverPtBinning(const std::vector< double > &qOverPtBins, bool absBinning)
Definition: FPGATrackSimSectorBank.cxx:173
TRT::Hit::layer
@ layer
Definition: HitInfo.h:79
FPGATrackSimSectorBank::getNQOverPtBins
size_t getNQOverPtBins() const
Definition: FPGATrackSimSectorBank.h:53
FPGATrackSimSectorBank
Definition: FPGATrackSimSectorBank.h:32
sector_t
int32_t sector_t
Definition: FPGATrackSimTypes.h:21
FPGATrackSimSectorBank::getSectors
std::vector< sector_t > getSectors(unsigned layer, module_t module) const
Definition: FPGATrackSimSectorBank.cxx:110
FPGATrackSimSectorBank::m_absQOverPtBinning
bool m_absQOverPtBinning
Definition: FPGATrackSimSectorBank.h:66
FPGATrackSimSectorBank::m_nLayers
size_t m_nLayers
Definition: FPGATrackSimSectorBank.h:60
FPGATrackSimSectorBank::m_s2mMap
std::vector< std::vector< module_t > > m_s2mMap
Definition: FPGATrackSimSectorBank.h:61
FPGATrackSimSectorBank::FPGATrackSimSectorBank
FPGATrackSimSectorBank(std::string const &filepath)
Definition: FPGATrackSimSectorBank.cxx:23
FPGATrackSimSectorBank::makeInverseMap
void makeInverseMap()
Definition: FPGATrackSimSectorBank.cxx:96
FPGATrackSimSectorBank::isAbsQOverPtBinning
bool isAbsQOverPtBinning() const
Definition: FPGATrackSimSectorBank.h:54
compute_lumi.fin
fin
Definition: compute_lumi.py:19
FPGATrackSimTypes.h