ATLAS Offline Software
Loading...
Searching...
No Matches
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
21
23#include "FPGATrackSimObjects/FPGATrackSimTypes.h" //typedef for sector_t
24#include <vector>
25#include <utility> //for std::pair
26class 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
Structs that store the 5 track parameters.
int32_t sector_t
const bool debug
static const std::vector< std::string > bins
#define min(a, b)
Definition cfImp.cxx:40
#define max(a, b)
Definition cfImp.cxx:41
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...
FPGATrackSimSectorSlice(const FPGATrackSimSectorSlice &)=delete
std::pair< FPGATrackSimTrackPars, FPGATrackSimTrackPars > getBoundaries() const
void addSectorToSlice(sector_t sector, FPGATrackSimTrackParsI const &bins)
std::vector< sector_t > searchSectors(FPGATrackSimTrackPars const &pars) const
FPGATrackSimTrackParsI m_nBins
void saveSlices(const std::string &filepath)
bool checkTrackPars(FPGATrackSimTrackPars const &pars) const
FPGATrackSimSectorSlice & operator=(const FPGATrackSimSectorSlice &)=delete
FPGATrackSimSectorSlice(size_t nSectors, FPGATrackSimTrackParsI const &nBins, FPGATrackSimTrackPars const &min, FPGATrackSimTrackPars const &max)