20 if (
val.size() != 5) {
21 throw std::invalid_argument(
22 "Not enough parameters in ParSet initialization");
26 ParSet::operator
const std::vector<double>()
const {
27 return std::vector<double>(this->
begin(), this->
end());
31 if (
val.size() != 5) {
32 throw std::invalid_argument(
33 "Not enough parameters in IdxSet initialization");
37 IdxSet::operator
const std::vector<unsigned>()
const {
38 return std::vector<unsigned>(this->
begin(), this->
end());
46 os <<
"lyr: " << hit.
layer <<
" ";
47 os <<
"(" << hit.
hitptr->getR() <<
", " << hit.
hitptr->getGPhi() <<
", " << hit.
hitptr->getZ() <<
") ";
60 std::vector<unsigned>
subVec(
const std::vector<unsigned> &elems,
62 std::vector<unsigned> retv;
63 for (
auto elem : elems) {
64 retv.push_back(invec[elem]);
70 const std::vector<unsigned> &subvecidx) {
72 if (subvecelems.size() != subvecidx.size()) {
73 throw std::invalid_argument(
74 "Setting FPGATrackSimGenScanBinningBase::setIdxSubVec with mismatched "
78 for (
unsigned i = 0;
i < subvecelems.size();
i++) {
79 if (subvecelems[
i] >=
idx.size()) {
80 throw std::invalid_argument(
81 "FPGATrackSimGenScanBinningBase::setIdxSubVec input out of range");
83 idx[subvecelems[
i]] = subvecidx[
i];
94 std::vector<IdxSet> retv;
95 for (
unsigned corners = 0; corners <
unsigned((1 << scanpars.size()));
99 for (
auto &
par : scanpars) {
100 newidx[
par] =
idx[
par] + ((corners >> scanDimCnt) & 1);
103 retv.push_back(newidx);
130 template <
typename T>
131 void StreamManager::StreamManager::writeVar(
const std::string &
var, T
val) {
132 auto emplace_result = m_map.try_emplace(
134 if (!emplace_result.second) {
135 emplace_result.first->second <<
",\n";
137 emplace_result.first->second <<
val;
148 return 2.0 *
atan(
exp(-1.0 * eta));
153 return -
log(
tan(theta / 2.0));
159 double zhit =
pars.z0 +
r /
tan(theta);
160 if (std::abs(
pars.qOverPt) > 0)
174 double r = hit->
getR();
175 double phi_hit = hit->
getGPhi();