ATLAS Offline Software
FPGATrackSimSectorSlice.h
Go to the documentation of this file.
1 // Copyright (C) 2002-2024 CERN for the benefit of the ATLAS collaboration
2 
3 #ifndef FPGATrackSimSectorSlice_h
4 #define FPGATrackSimSectorSlice_h
5 
23 #include "FPGATrackSimObjects/FPGATrackSimTypes.h" //typedef for sector_t
24 #include <vector>
25 #include <utility> //for std::pair
26 class TClonesArray;
27 
28 
29 
30 
32 {
33  public:
34 
35  // Create blank bitvectors for writing new slice file
36  FPGATrackSimSectorSlice(size_t nSectors,
38  // Read from file
39  FPGATrackSimSectorSlice(const std::string & filepath);
40 
43 
44 
45  // Slice writing functions
47  void saveSlices(const std::string & filepath);
48 
49 
50  // Finds the parameter boundaries for where bitmasks are non-empty.
51  // Returns (min, max).
52  std::pair<FPGATrackSimTrackPars, FPGATrackSimTrackPars> getBoundaries() const;
53 
54  // Returns a list of sectors that contain pars.
55  std::vector<sector_t> searchSectors(FPGATrackSimTrackPars const & pars) const;
56 
57  private:
58 
59  // TBits bitmask arrays. The use of TClonesArray is probably overkill but whatever, kept from FTK.
60  // I wish ROOT would update these classes to use templating X(
61  TClonesArray *m_bits_phi = nullptr;
62  TClonesArray *m_bits_c = nullptr;
63  TClonesArray *m_bits_d0 = nullptr;
64  TClonesArray *m_bits_z0 = nullptr;
65  TClonesArray *m_bits_eta = nullptr;
66 
67  // Number of bins for each parameter, size of arrays above
69 
70  // Min and max parameters found out in the slice file
73 
74  // Step sizes, (max - min) / nbins
76 
77  // Helper functions
78  void calcDependentVals();
79  void getBoundary(const TClonesArray *bitmasks, double x_min, double x_max,
80  double &autoMin, double &autoMax, bool wraps, const char *debug) const;
81  bool checkTrackPars(FPGATrackSimTrackPars const & pars) const;
82 };
83 
84 #endif // FPGATrackSimSectorSlice_h
85 
make_hlt_rep.pars
pars
Definition: make_hlt_rep.py:90
max
#define max(a, b)
Definition: cfImp.cxx:41
python.App.bins
bins
Definition: App.py:410
FPGATrackSimTrackPars
Definition: FPGATrackSimTrackPars.h:22
FPGATrackSimSectorSlice::FPGATrackSimSectorSlice
FPGATrackSimSectorSlice(size_t nSectors, FPGATrackSimTrackParsI const &nBins, FPGATrackSimTrackPars const &min, FPGATrackSimTrackPars const &max)
Definition: FPGATrackSimSectorSlice.cxx:39
FPGATrackSimSectorSlice::getBoundary
void getBoundary(const TClonesArray *bitmasks, double x_min, double x_max, double &autoMin, double &autoMax, bool wraps, const char *debug) const
Given a range [x_min, x_max] split in bins corresponding to the size of bitmasks, finds a tighter ran...
Definition: FPGATrackSimSectorSlice.cxx:276
FPGATrackSimSectorSlice::calcDependentVals
void calcDependentVals()
Definition: FPGATrackSimSectorSlice.cxx:121
FPGATrackSimSectorSlice::m_bits_d0
TClonesArray * m_bits_d0
Definition: FPGATrackSimSectorSlice.h:63
FPGATrackSimSectorSlice::m_bits_c
TClonesArray * m_bits_c
Definition: FPGATrackSimSectorSlice.h:62
FPGATrackSimSectorSlice::m_step
FPGATrackSimTrackPars m_step
Definition: FPGATrackSimSectorSlice.h:75
FPGATrackSimSectorSlice::m_nBins
FPGATrackSimTrackParsI m_nBins
Definition: FPGATrackSimSectorSlice.h:68
FPGATrackSimSectorSlice::getBoundaries
std::pair< FPGATrackSimTrackPars, FPGATrackSimTrackPars > getBoundaries() const
Definition: FPGATrackSimSectorSlice.cxx:252
FPGATrackSimSectorSlice::m_min
FPGATrackSimTrackPars m_min
Definition: FPGATrackSimSectorSlice.h:71
FPGATrackSimSectorSlice::FPGATrackSimSectorSlice
FPGATrackSimSectorSlice(const FPGATrackSimSectorSlice &)=delete
FPGATrackSimSectorSlice
Definition: FPGATrackSimSectorSlice.h:32
FPGATrackSimSectorSlice::checkTrackPars
bool checkTrackPars(FPGATrackSimTrackPars const &pars) const
Definition: FPGATrackSimSectorSlice.cxx:197
FPGATrackSimSectorSlice::m_max
FPGATrackSimTrackPars m_max
Definition: FPGATrackSimSectorSlice.h:72
min
#define min(a, b)
Definition: cfImp.cxx:40
sector_t
int32_t sector_t
Definition: FPGATrackSimTypes.h:21
dumpTgcDigiJitter.nBins
list nBins
Definition: dumpTgcDigiJitter.py:29
FPGATrackSimSectorSlice::m_bits_eta
TClonesArray * m_bits_eta
Definition: FPGATrackSimSectorSlice.h:65
debug
const bool debug
Definition: MakeUncertaintyPlots.cxx:53
FPGATrackSimSectorSlice::m_bits_phi
TClonesArray * m_bits_phi
Definition: FPGATrackSimSectorSlice.h:61
FPGATrackSimSectorSlice::addSectorToSlice
void addSectorToSlice(sector_t sector, FPGATrackSimTrackParsI const &bins)
Definition: FPGATrackSimSectorSlice.cxx:135
FPGATrackSimSectorSlice::searchSectors
std::vector< sector_t > searchSectors(FPGATrackSimTrackPars const &pars) const
Definition: FPGATrackSimSectorSlice.cxx:216
FPGATrackSimSectorSlice::m_bits_z0
TClonesArray * m_bits_z0
Definition: FPGATrackSimSectorSlice.h:64
FPGATrackSimTrackParsI
Definition: FPGATrackSimTrackPars.h:56
FPGATrackSimSectorSlice::saveSlices
void saveSlices(const std::string &filepath)
Definition: FPGATrackSimSectorSlice.cxx:156
FPGATrackSimTypes.h
FPGATrackSimTrackPars.h
Structs that store the 5 track parameters.
FPGATrackSimSectorSlice::operator=
FPGATrackSimSectorSlice & operator=(const FPGATrackSimSectorSlice &)=delete