#include <FPGATrackSimSectorSlice.h>
Definition at line 31 of file FPGATrackSimSectorSlice.h.
◆ FPGATrackSimSectorSlice() [1/3]
◆ FPGATrackSimSectorSlice() [2/3]
FPGATrackSimSectorSlice::FPGATrackSimSectorSlice |
( |
const std::string & |
filepath | ) |
|
Definition at line 62 of file FPGATrackSimSectorSlice.cxx.
65 TFile *slice_file = TFile::Open(filepath.c_str());
67 m_bits_phi =
dynamic_cast<TClonesArray*
>(slice_file->Get(
"c_bits_phi"));
68 m_bits_c =
dynamic_cast<TClonesArray*
>(slice_file->Get(
"c_bits_c"));
69 m_bits_d0 =
dynamic_cast<TClonesArray*
>(slice_file->Get(
"c_bits_d"));
70 m_bits_z0 =
dynamic_cast<TClonesArray*
>(slice_file->Get(
"c_bits_z0"));
73 if ((slice_file->Get(
"c_bits_eta")) !=
nullptr)
74 m_bits_eta =
dynamic_cast<TClonesArray*
>(slice_file->Get(
"c_bits_eta"));
76 m_bits_eta =
dynamic_cast<TClonesArray*
>(slice_file->Get(
"c_bits_ctheta"));
79 ANA_MSG_ERROR(
"m_bits_eta is null in FPGATrackSimSectorSlice constructor");
83 TTree *slice_tree =
dynamic_cast<TTree*
>(slice_file->Get(
"bin_info"));
85 ANA_MSG_ERROR(
"slice_tree is null in FPGATrackSimSectorSlice constructor");
89 slice_tree->SetBranchAddress(
"qOverPt_max", &
m_max.
qOverPt);
90 slice_tree->SetBranchAddress(
"d0_max", &
m_max.
d0);
91 slice_tree->SetBranchAddress(
"phi_max", &
m_max.
phi);
92 slice_tree->SetBranchAddress(
"z0_max", &
m_max.
z0);
93 slice_tree->SetBranchAddress(
"eta_max", &
m_max.
eta);
95 slice_tree->SetBranchAddress(
"qOverPt_min", &
m_min.
qOverPt);
96 slice_tree->SetBranchAddress(
"d0_min", &
m_min.
d0);
97 slice_tree->SetBranchAddress(
"phi_min", &
m_min.
phi);
98 slice_tree->SetBranchAddress(
"z0_min", &
m_min.
z0);
99 slice_tree->SetBranchAddress(
"eta_min", &
m_min.
eta);
102 slice_tree->SetBranchAddress(
"d0_bins", &
m_nBins.
d0);
103 slice_tree->SetBranchAddress(
"phi_bins", &
m_nBins.
phi);
104 slice_tree->SetBranchAddress(
"z0_bins", &
m_nBins.
z0);
105 slice_tree->SetBranchAddress(
"eta_bins", &
m_nBins.
eta);
108 if (slice_tree->GetBranch(
"qOverPt_max") ==
nullptr) slice_tree->SetBranchAddress(
"halfInvPt_max", &
m_max.
qOverPt);
109 if (slice_tree->GetBranch(
"qOverPt_min") ==
nullptr) slice_tree->SetBranchAddress(
"halfInvPt_min", &
m_min.
qOverPt);
110 if (slice_tree->GetBranch(
"qOverPt_bins") ==
nullptr) slice_tree->SetBranchAddress(
"halfInvPt_bins", &
m_nBins.
qOverPt);
112 slice_tree->GetEntry(0);
◆ FPGATrackSimSectorSlice() [3/3]
◆ addSectorToSlice()
◆ calcDependentVals()
void FPGATrackSimSectorSlice::calcDependentVals |
( |
| ) |
|
|
private |
◆ checkTrackPars()
◆ getBoundaries()
◆ getBoundary()
void FPGATrackSimSectorSlice::getBoundary |
( |
const TClonesArray * |
bitmasks, |
|
|
double |
x_min, |
|
|
double |
x_max, |
|
|
double & |
bound_min, |
|
|
double & |
bound_max, |
|
|
bool |
wraps, |
|
|
const char * |
debug |
|
) |
| const |
|
private |
Given a range [x_min, x_max] split in bins corresponding to the size of bitmasks
, finds a tighter range of x values for where the bitmasks are non-empty.
- Parameters
-
bitmasks | - A TBits vector with sector bitmasks for each bin. |
bound_min | - Return value for the boundary min x |
bound_max | - Return value for the boundary max x |
Definition at line 276 of file FPGATrackSimSectorSlice.cxx.
279 int nbin = bitmasks->GetEntries();
282 int i_lower, i_upper;
285 for (i_lower = 0; i_lower < nbin-1; i_lower++)
286 if (
dynamic_cast<TBits
const *
>(bitmasks->UncheckedAt(i_lower))->CountBits() > 0)
break;
287 for (i_upper = nbin-1; i_upper > 0; i_upper--)
288 if (
dynamic_cast<TBits
const *
>(bitmasks->UncheckedAt(i_upper))->CountBits() > 0)
break;
293 std::vector<bool> good_bins(nbin);
294 for (
int j = 0; j < nbin; j++)
296 if (
dynamic_cast<TBits
const *
>(bitmasks->UncheckedAt(j))->CountBits() > 0)
300 good_bins[(j+nbin-1) % nbin] =
true;
302 good_bins[(j+1) % nbin] =
true;
310 if (i_lower >= i_upper)
ANA_MSG_WARNING(
"getBoundary() Completely empty bitmask array");
311 bound_min = x_min + ((x_max-x_min) * i_lower) / nbin;
312 bound_max = x_min + ((x_max-x_min) * (i_upper+1)) / nbin;
315 <<
" range=[" << x_min <<
", " << x_max
316 <<
"], index=[" << i_lower <<
", " << i_upper
317 <<
"], result=[" << bound_min <<
", " << bound_max <<
"]");
◆ operator=()
◆ saveSlices()
void FPGATrackSimSectorSlice::saveSlices |
( |
const std::string & |
filepath | ) |
|
Definition at line 156 of file FPGATrackSimSectorSlice.cxx.
158 TFile
ofile(filepath.c_str(),
"recreate");
160 m_bits_phi->Write(
"c_bits_phi", TObject::kSingleKey);
161 m_bits_c->Write(
"c_bits_c", TObject::kSingleKey);
162 m_bits_d0->Write(
"c_bits_d", TObject::kSingleKey);
163 m_bits_z0->Write(
"c_bits_z0", TObject::kSingleKey);
164 m_bits_eta->Write(
"c_bits_eta", TObject::kSingleKey);
166 TTree *slice_tree =
new TTree(
"bin_info",
"Slice binning information");
169 slice_tree->Branch(
"d0_max", &
m_max.
d0);
170 slice_tree->Branch(
"phi_max", &
m_max.
phi);
171 slice_tree->Branch(
"z0_max", &
m_max.
z0);
172 slice_tree->Branch(
"eta_max", &
m_max.
eta);
175 slice_tree->Branch(
"d0_min", &
m_min.
d0);
176 slice_tree->Branch(
"phi_min", &
m_min.
phi);
177 slice_tree->Branch(
"z0_min", &
m_min.
z0);
178 slice_tree->Branch(
"eta_min", &
m_min.
eta);
181 slice_tree->Branch(
"d0_bins", &
m_nBins.
d0);
183 slice_tree->Branch(
"z0_bins", &
m_nBins.
z0);
◆ searchSectors()
Definition at line 216 of file FPGATrackSimSectorSlice.cxx.
218 std::vector<sector_t> sectors;
235 unsigned int curPos = result_bits.FirstSetBit(0);
236 while (curPos != result_bits.GetNbits())
238 sectors.push_back(
static_cast<sector_t>(curPos));
239 curPos = result_bits.FirstSetBit(curPos + 1);
◆ m_bits_c
TClonesArray* FPGATrackSimSectorSlice::m_bits_c = nullptr |
|
private |
◆ m_bits_d0
TClonesArray* FPGATrackSimSectorSlice::m_bits_d0 = nullptr |
|
private |
◆ m_bits_eta
TClonesArray* FPGATrackSimSectorSlice::m_bits_eta = nullptr |
|
private |
◆ m_bits_phi
TClonesArray* FPGATrackSimSectorSlice::m_bits_phi = nullptr |
|
private |
◆ m_bits_z0
TClonesArray* FPGATrackSimSectorSlice::m_bits_z0 = nullptr |
|
private |
◆ m_max
◆ m_min
◆ m_nBins
◆ m_step
The documentation for this class was generated from the following files:
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...