Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix types of some parameters and expose the last one #5

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -13,20 +13,26 @@
lateFishbone = cms.bool(False),
fillStatistics = cms.bool(False),
minHitsPerNtuplet = cms.uint32(4),
cellMinz = cms.vint32(
cellMinz = cms.vdouble(
-16, 4, -22, -17, 6,-22, -18, 11, -22, 23, 30, 39, 50,
65, 82, 109, -28, -35, -44, -55, -70, -87, -113, -16,
7, -22, 11,-22, -17, 9,-22, 13, -22, 137, 173, 199, 229,
-142, -177, -203, -233, 23, 30, 39, 50, 65, 82, 109, -28,
-35, -44, -55, -70, -87, -113
),
cellMaxz = cms.vint32(
cellMaxz = cms.vdouble(
17, 22, -4, 17, 22, -6, 18, 22, -11, 28, 35, 44, 55, 70,
87, 113, -23, -30, -39, -50, -65, -82, -109, 17, 22, -7,
22, -10, 17, 22, -9, 22, -13, 142, 177, 203, 233, -137,
-173, -199, -229, 28, 35, 44, 55, 70, 87, 113, -23, -30,
-39, -50, -65, -82, -109
),
cellMaxr = cms.vdouble(
5.0, 5.0, 5.0, 7.0, 8.0, 8.0, 7.0, 7.0, 7.0, 6.0, 6.0, 6.0, 6.0, 5.0,
6.0, 5.0, 6.0, 6.0, 6.0, 6.0, 5.0, 6.0, 5.0, 5.0, 5.0, 5.0, 5.0, 5.0,
5.0, 8.0, 8.0, 8.0, 8.0, 6.0, 5.0, 5.0, 5.0, 6.0, 5.0, 5.0, 5.0, 9.0,
9.0, 9.0, 8.0, 8.0, 8.0, 11.0, 9.0, 9.0, 9.0, 8.0, 8.0, 8.0, 11.0
),
cellMinYSizeB1 = cms.int32(25),
cellMinYSizeB2 = cms.int32(15),
cellZ0Cut = cms.double(7.5),
Expand Down
10 changes: 6 additions & 4 deletions RecoTracker/PixelSeeding/plugins/alpaka/CAHitNtupletGenerator.cc
Original file line number Diff line number Diff line change
Expand Up @@ -61,8 +61,9 @@ namespace ALPAKA_ACCELERATOR_NAMESPACE {
desc.add<bool>("doSharedHitCut", true)->setComment("Sharing hit nTuples cleaning");
desc.add<bool>("dupPassThrough", false)->setComment("Do not reject duplicate");
desc.add<bool>("useSimpleTripletCleaner", true)->setComment("use alternate implementation");
desc.add<std::vector<int>>("cellMinz", std::vector<int>(55, -20))->setComment("Minimum z for each layer pair");
desc.add<std::vector<int>>("cellMaxz", std::vector<int>(55, 20))->setComment("Maximum z for each layer pair");
desc.add<std::vector<double>>("cellMinz", std::vector<double>(55, -20.))->setComment("Minimum z for each layer pair");
desc.add<std::vector<double>>("cellMaxz", std::vector<double>(55, 20.))->setComment("Maximum z for each layer pair");
desc.add<std::vector<double>>("cellMaxr", std::vector<double>(55, 0.))->setComment("Maximum r for each layer pair");
desc.add<int>("cellMinYSizeB1", 25)->setComment("Minimum cluster size for B1");
desc.add<int>("cellMinYSizeB2", 15)->setComment("Minimum cluster size for B2");
desc.add<int>("cellMaxDYSize12", 12)->setComment("Maximum cluster size difference for B1/B2");
Expand Down Expand Up @@ -163,8 +164,9 @@ namespace ALPAKA_ACCELERATOR_NAMESPACE {
cfg.getParameter<int>("cellMaxDYSize"),
cfg.getParameter<int>("cellMaxDYPred"),
cfg.getParameter<std::vector<int>>("phiCuts"),
cfg.getParameter<std::vector<int>>("cellMinz"),
cfg.getParameter<std::vector<int>>("cellMaxz")};
cfg.getParameter<std::vector<double>>("cellMinz"),
cfg.getParameter<std::vector<double>>("cellMaxz"),
cfg.getParameter<std::vector<double>>("cellMaxr")};
}

} // namespace
Expand Down
24 changes: 14 additions & 10 deletions RecoTracker/PixelSeeding/plugins/alpaka/CAPixelDoubletsAlgos.h
Original file line number Diff line number Diff line change
Expand Up @@ -58,8 +58,9 @@ namespace ALPAKA_ACCELERATOR_NAMESPACE::caPixelDoublets {
const int maxDYSize,
const int maxDYPred,
const std::vector<int>& phiCutsV,
const std::vector<int>& minzCutV,
const std::vector<int>& maxzCutV)
const std::vector<double>& minzCutV,
const std::vector<double>& maxzCutV,
const std::vector<double>& cellMaxrCutV)
: doClusterCut_(doClusterCut),
doZ0Cut_(doZ0Cut),
doPtCut_(doPtCut),
Expand All @@ -72,11 +73,13 @@ namespace ALPAKA_ACCELERATOR_NAMESPACE::caPixelDoublets {
maxDYSize_(maxDYSize),
maxDYPred_(maxDYPred) {
assert(phiCutsV.size() == T::nPairs);
std::copy(phiCutsV.begin(), phiCutsV.end(), &phiCuts[0]);
std::copy(phiCutsV.begin(), phiCutsV.end(), &phiCuts_[0]);
assert(minzCutV.size() == T::nPairs);
std::copy(minzCutV.begin(), minzCutV.end(), &minzCut_[0]);
assert(maxzCutV.size() == T::nPairs);
std::copy(maxzCutV.begin(), maxzCutV.end(), &maxzCut_[0]);
assert(cellMaxrCutV.size() == T::nPairs);
std::copy(cellMaxrCutV.begin(), cellMaxrCutV.end(), &cellMaxrCut_[0]);
}

const bool doClusterCut_;
Expand All @@ -94,9 +97,10 @@ namespace ALPAKA_ACCELERATOR_NAMESPACE::caPixelDoublets {
const int maxDYSize_;
const int maxDYPred_;

int phiCuts[T::nPairs];
int minzCut_[T::nPairs];
int maxzCut_[T::nPairs];
int phiCuts_[T::nPairs];
double minzCut_[T::nPairs];
double maxzCut_[T::nPairs];
double cellMaxrCut_[T::nPairs];

template <typename TAcc>
ALPAKA_FN_ACC ALPAKA_FN_INLINE bool __attribute__((always_inline)) zSizeCut(const TAcc& acc,
Expand Down Expand Up @@ -265,10 +269,10 @@ namespace ALPAKA_ACCELERATOR_NAMESPACE::caPixelDoublets {
auto zo = hh[j].zGlobal();
auto ro = hh[j].rGlobal();
auto dr = ro - mer;
return dr > TrackerTraits::maxr[pairLayerId] || dr < 0 || std::abs((mez * ro - mer * zo)) > z0cut * dr;
return dr > cuts.cellMaxrCut_[pairLayerId] || dr < 0 || std::abs((mez * ro - mer * zo)) > z0cut * dr;
};

auto iphicut = cuts.phiCuts[pairLayerId];
auto iphicut = cuts.phiCuts_[pairLayerId];

auto kl = PhiBinner::bin(int16_t(mep - iphicut));
auto kh = PhiBinner::bin(int16_t(mep + iphicut));
Expand Down Expand Up @@ -343,8 +347,8 @@ namespace ALPAKA_ACCELERATOR_NAMESPACE::caPixelDoublets {
tot,
tooMany,
iphicut,
TrackerTraits::minz[pairLayerId],
TrackerTraits::maxz[pairLayerId],
cell.minzCut_[pairLayerId],
cell.maxzCut_[pairLayerId],
tooMany > 0 ? "FULL!!" : "not full.");
#endif
} // loop in block...
Expand Down