Skip to content

Commit

Permalink
Format code
Browse files Browse the repository at this point in the history
  • Loading branch information
ariostas committed Jul 18, 2024
1 parent d33ac32 commit fb12af0
Show file tree
Hide file tree
Showing 7 changed files with 109 additions and 122 deletions.
7 changes: 3 additions & 4 deletions RecoTracker/LSTCore/interface/alpaka/Constants.h
Original file line number Diff line number Diff line change
Expand Up @@ -37,15 +37,14 @@ namespace SDL {

// Wrapper function to reduce code boilerplate for defining grid/block sizes.
ALPAKA_FN_HOST ALPAKA_FN_INLINE Vec3D createVec(int x, int y, int z) {
return Vec3D(
static_cast<Idx>(x), static_cast<Idx>(y), static_cast<Idx>(z));
return Vec3D(static_cast<Idx>(x), static_cast<Idx>(y), static_cast<Idx>(z));
}

// Adjust grid and block sizes based on backend configuration
template <typename Vec>
ALPAKA_FN_HOST ALPAKA_FN_INLINE WorkDiv3D createWorkDiv(const Vec& blocksPerGrid,
const Vec& threadsPerBlock,
const Vec& elementsPerThreadArg) {
const Vec& threadsPerBlock,
const Vec& elementsPerThreadArg) {
Vec adjustedBlocks = blocksPerGrid;
Vec adjustedThreads = threadsPerBlock;

Expand Down
42 changes: 21 additions & 21 deletions RecoTracker/LSTCore/src/alpaka/Event.dev.cc
Original file line number Diff line number Diff line change
Expand Up @@ -151,10 +151,10 @@ void SDL::Event<Acc3D>::resetEvent() {
}

void SDL::Event<Acc3D>::addHitToEvent(std::vector<float> x,
std::vector<float> y,
std::vector<float> z,
std::vector<unsigned int> detId,
std::vector<unsigned int> idxInNtuple) {
std::vector<float> y,
std::vector<float> z,
std::vector<unsigned int> detId,
std::vector<unsigned int> idxInNtuple) {
// Use the actual number of hits instead of a max.
unsigned int nHits = x.size();

Expand Down Expand Up @@ -218,23 +218,23 @@ void SDL::Event<Acc3D>::addHitToEvent(std::vector<float> x,
}

void SDL::Event<Acc3D>::addPixelSegmentToEvent(std::vector<unsigned int> hitIndices0,
std::vector<unsigned int> hitIndices1,
std::vector<unsigned int> hitIndices2,
std::vector<unsigned int> hitIndices3,
std::vector<float> dPhiChange,
std::vector<float> ptIn,
std::vector<float> ptErr,
std::vector<float> px,
std::vector<float> py,
std::vector<float> pz,
std::vector<float> eta,
std::vector<float> etaErr,
std::vector<float> phi,
std::vector<int> charge,
std::vector<unsigned int> seedIdx,
std::vector<int> superbin,
std::vector<int8_t> pixelType,
std::vector<char> isQuad) {
std::vector<unsigned int> hitIndices1,
std::vector<unsigned int> hitIndices2,
std::vector<unsigned int> hitIndices3,
std::vector<float> dPhiChange,
std::vector<float> ptIn,
std::vector<float> ptErr,
std::vector<float> px,
std::vector<float> py,
std::vector<float> pz,
std::vector<float> eta,
std::vector<float> etaErr,
std::vector<float> phi,
std::vector<int> charge,
std::vector<unsigned int> seedIdx,
std::vector<int> superbin,
std::vector<int8_t> pixelType,
std::vector<char> isQuad) {
unsigned int size = ptIn.size();

if (size > N_MAX_PIXEL_SEGMENTS_PER_MODULE) {
Expand Down
88 changes: 44 additions & 44 deletions RecoTracker/LSTCore/src/alpaka/LST.dev.cc
Original file line number Diff line number Diff line change
Expand Up @@ -21,24 +21,24 @@ namespace {

template <>
void SDL::LST<Acc3D>::prepareInput(const std::vector<float> see_px,
const std::vector<float> see_py,
const std::vector<float> see_pz,
const std::vector<float> see_dxy,
const std::vector<float> see_dz,
const std::vector<float> see_ptErr,
const std::vector<float> see_etaErr,
const std::vector<float> see_stateTrajGlbX,
const std::vector<float> see_stateTrajGlbY,
const std::vector<float> see_stateTrajGlbZ,
const std::vector<float> see_stateTrajGlbPx,
const std::vector<float> see_stateTrajGlbPy,
const std::vector<float> see_stateTrajGlbPz,
const std::vector<int> see_q,
const std::vector<std::vector<int>> see_hitIdx,
const std::vector<unsigned int> ph2_detId,
const std::vector<float> ph2_x,
const std::vector<float> ph2_y,
const std::vector<float> ph2_z) {
const std::vector<float> see_py,
const std::vector<float> see_pz,
const std::vector<float> see_dxy,
const std::vector<float> see_dz,
const std::vector<float> see_ptErr,
const std::vector<float> see_etaErr,
const std::vector<float> see_stateTrajGlbX,
const std::vector<float> see_stateTrajGlbY,
const std::vector<float> see_stateTrajGlbZ,
const std::vector<float> see_stateTrajGlbPx,
const std::vector<float> see_stateTrajGlbPy,
const std::vector<float> see_stateTrajGlbPz,
const std::vector<int> see_q,
const std::vector<std::vector<int>> see_hitIdx,
const std::vector<unsigned int> ph2_detId,
const std::vector<float> ph2_x,
const std::vector<float> ph2_y,
const std::vector<float> ph2_z) {
unsigned int count = 0;
auto n_see = see_stateTrajGlbPx.size();
std::vector<float> px_vec;
Expand Down Expand Up @@ -214,9 +214,9 @@ void SDL::LST<Acc3D>::prepareInput(const std::vector<float> see_px,

template <>
std::vector<unsigned int> SDL::LST<Acc3D>::getHitIdxs(const short trackCandidateType,
const unsigned int TCIdx,
const unsigned int* TCHitIndices,
const unsigned int* hitIndices) {
const unsigned int TCIdx,
const unsigned int* TCHitIndices,
const unsigned int* hitIndices) {
std::vector<unsigned int> hits;

unsigned int maxNHits = 0;
Expand Down Expand Up @@ -279,29 +279,29 @@ void SDL::LST<Acc3D>::getOutput(SDL::Event<Acc3D>& event) {
template <>
template <>
void SDL::LST<Acc3D>::run(Queue& queue,
bool verbose,
const LSTESData<Device>* deviceESData,
const std::vector<float> see_px,
const std::vector<float> see_py,
const std::vector<float> see_pz,
const std::vector<float> see_dxy,
const std::vector<float> see_dz,
const std::vector<float> see_ptErr,
const std::vector<float> see_etaErr,
const std::vector<float> see_stateTrajGlbX,
const std::vector<float> see_stateTrajGlbY,
const std::vector<float> see_stateTrajGlbZ,
const std::vector<float> see_stateTrajGlbPx,
const std::vector<float> see_stateTrajGlbPy,
const std::vector<float> see_stateTrajGlbPz,
const std::vector<int> see_q,
const std::vector<std::vector<int>> see_hitIdx,
const std::vector<unsigned int> ph2_detId,
const std::vector<float> ph2_x,
const std::vector<float> ph2_y,
const std::vector<float> ph2_z,
bool no_pls_dupclean,
bool tc_pls_triplets) {
bool verbose,
const LSTESData<Device>* deviceESData,
const std::vector<float> see_px,
const std::vector<float> see_py,
const std::vector<float> see_pz,
const std::vector<float> see_dxy,
const std::vector<float> see_dz,
const std::vector<float> see_ptErr,
const std::vector<float> see_etaErr,
const std::vector<float> see_stateTrajGlbX,
const std::vector<float> see_stateTrajGlbY,
const std::vector<float> see_stateTrajGlbZ,
const std::vector<float> see_stateTrajGlbPx,
const std::vector<float> see_stateTrajGlbPy,
const std::vector<float> see_stateTrajGlbPz,
const std::vector<int> see_q,
const std::vector<std::vector<int>> see_hitIdx,
const std::vector<unsigned int> ph2_detId,
const std::vector<float> ph2_x,
const std::vector<float> ph2_y,
const std::vector<float> ph2_z,
bool no_pls_dupclean,
bool tc_pls_triplets) {
auto event = SDL::Event<Acc3D>(verbose, queue, deviceESData);
prepareInput(see_px,
see_py,
Expand Down
59 changes: 25 additions & 34 deletions RecoTracker/LSTCore/standalone/code/core/AccessHelper.h
Original file line number Diff line number Diff line change
Expand Up @@ -14,32 +14,29 @@ std::tuple<std::vector<unsigned int>, std::vector<unsigned int>> convertHitsToHi
SDLEvent* event, std::vector<unsigned int> hits);

// ----* pLS *----
std::vector<unsigned int> getPixelHitsFrompLS(SDLEvent* event,
unsigned int pLS);
std::vector<unsigned int> getPixelHitIdxsFrompLS(SDLEvent* event,
unsigned int pLS);
std::vector<unsigned int> getPixelHitTypesFrompLS(SDLEvent* event,
unsigned int pLS);
std::tuple<std::vector<unsigned int>, std::vector<unsigned int>> getHitIdxsAndHitTypesFrompLS(
SDLEvent* event, unsigned pLS);
std::vector<unsigned int> getPixelHitsFrompLS(SDLEvent* event, unsigned int pLS);
std::vector<unsigned int> getPixelHitIdxsFrompLS(SDLEvent* event, unsigned int pLS);
std::vector<unsigned int> getPixelHitTypesFrompLS(SDLEvent* event, unsigned int pLS);
std::tuple<std::vector<unsigned int>, std::vector<unsigned int>> getHitIdxsAndHitTypesFrompLS(SDLEvent* event,
unsigned pLS);

// ----* MD *----
std::vector<unsigned int> getHitsFromMD(SDLEvent* event, unsigned int MD);
std::tuple<std::vector<unsigned int>, std::vector<unsigned int>> getHitIdxsAndHitTypesFromMD(
SDLEvent* event, unsigned MD);
std::tuple<std::vector<unsigned int>, std::vector<unsigned int>> getHitIdxsAndHitTypesFromMD(SDLEvent* event,
unsigned MD);

// ----* LS *----
std::vector<unsigned int> getMDsFromLS(SDLEvent* event, unsigned int LS);
std::vector<unsigned int> getHitsFromLS(SDLEvent* event, unsigned int LS);
std::tuple<std::vector<unsigned int>, std::vector<unsigned int>> getHitIdxsAndHitTypesFromLS(
SDLEvent* event, unsigned LS);
std::tuple<std::vector<unsigned int>, std::vector<unsigned int>> getHitIdxsAndHitTypesFromLS(SDLEvent* event,
unsigned LS);

// ----* T3 *----
std::vector<unsigned int> getLSsFromT3(SDLEvent* event, unsigned int T3);
std::vector<unsigned int> getMDsFromT3(SDLEvent* event, unsigned int T3);
std::vector<unsigned int> getHitsFromT3(SDLEvent* event, unsigned int T3);
std::tuple<std::vector<unsigned int>, std::vector<unsigned int>> getHitIdxsAndHitTypesFromT3(
SDLEvent* event, unsigned T3);
std::tuple<std::vector<unsigned int>, std::vector<unsigned int>> getHitIdxsAndHitTypesFromT3(SDLEvent* event,
unsigned T3);

// ----* T5 *----
std::vector<unsigned int> getT3sFromT5(SDLEvent* event, unsigned int T5);
Expand All @@ -49,48 +46,42 @@ std::vector<unsigned int> getHitsFromT5(SDLEvent* event, unsigned int T5);
std::vector<unsigned int> getHitIdxsFromT5(SDLEvent* event, unsigned int T5);
std::vector<unsigned int> getHitTypesFromT5(SDLEvent* event, unsigned int T5);
std::vector<unsigned int> getModuleIdxsFromT5(SDLEvent* event, unsigned int T5);
std::tuple<std::vector<unsigned int>, std::vector<unsigned int>> getHitIdxsAndHitTypesFromT5(
SDLEvent* event, unsigned T5);
std::tuple<std::vector<unsigned int>, std::vector<unsigned int>> getHitIdxsAndHitTypesFromT5(SDLEvent* event,
unsigned T5);

// ----* pT3 *----
unsigned int getPixelLSFrompT3(SDLEvent* event, unsigned int pT3);
unsigned int getT3FrompT3(SDLEvent* event, unsigned int pT3);
std::vector<unsigned int> getLSsFrompT3(SDLEvent* event, unsigned int pT3);
std::vector<unsigned int> getMDsFrompT3(SDLEvent* event, unsigned int pT3);
std::vector<unsigned int> getOuterTrackerHitsFrompT3(SDLEvent* event,
unsigned int pT3);
std::vector<unsigned int> getPixelHitsFrompT3(SDLEvent* event,
unsigned int pT3);
std::vector<unsigned int> getOuterTrackerHitsFrompT3(SDLEvent* event, unsigned int pT3);
std::vector<unsigned int> getPixelHitsFrompT3(SDLEvent* event, unsigned int pT3);
std::vector<unsigned int> getHitsFrompT3(SDLEvent* event, unsigned int pT3);
std::vector<unsigned int> getHitIdxsFrompT3(SDLEvent* event, unsigned int pT3);
std::vector<unsigned int> getHitTypesFrompT3(SDLEvent* event, unsigned int pT3);
std::vector<unsigned int> getModuleIdxsFrompT3(SDLEvent* event,
unsigned int pT3);
std::tuple<std::vector<unsigned int>, std::vector<unsigned int>> getHitIdxsAndHitTypesFrompT3(
SDLEvent* event, unsigned pT3);
std::vector<unsigned int> getModuleIdxsFrompT3(SDLEvent* event, unsigned int pT3);
std::tuple<std::vector<unsigned int>, std::vector<unsigned int>> getHitIdxsAndHitTypesFrompT3(SDLEvent* event,
unsigned pT3);

// ----* pT5 *----
unsigned int getPixelLSFrompT5(SDLEvent* event, unsigned int pT5);
unsigned int getT5FrompT5(SDLEvent* event, unsigned int pT5);
std::vector<unsigned int> getT3sFrompT5(SDLEvent* event, unsigned int pT5);
std::vector<unsigned int> getLSsFrompT5(SDLEvent* event, unsigned int pT5);
std::vector<unsigned int> getMDsFrompT5(SDLEvent* event, unsigned int pT5);
std::vector<unsigned int> getOuterTrackerHitsFrompT5(SDLEvent* event,
unsigned int pT5);
std::vector<unsigned int> getPixelHitsFrompT5(SDLEvent* event,
unsigned int pT5);
std::vector<unsigned int> getOuterTrackerHitsFrompT5(SDLEvent* event, unsigned int pT5);
std::vector<unsigned int> getPixelHitsFrompT5(SDLEvent* event, unsigned int pT5);
std::vector<unsigned int> getHitsFrompT5(SDLEvent* event, unsigned int pT5);
std::vector<unsigned int> getHitIdxsFrompT5(SDLEvent* event, unsigned int pT5);
std::vector<unsigned int> getHitTypesFrompT5(SDLEvent* event, unsigned int pT5);
std::vector<unsigned int> getModuleIdxsFrompT5(SDLEvent* event,
unsigned int pT5);
std::tuple<std::vector<unsigned int>, std::vector<unsigned int>> getHitIdxsAndHitTypesFrompT5(
SDLEvent* event, unsigned pT5);
std::vector<unsigned int> getModuleIdxsFrompT5(SDLEvent* event, unsigned int pT5);
std::tuple<std::vector<unsigned int>, std::vector<unsigned int>> getHitIdxsAndHitTypesFrompT5(SDLEvent* event,
unsigned pT5);

// ----* TC *----
std::vector<unsigned int> getLSsFromTC(SDLEvent* event, unsigned int TC);
std::vector<unsigned int> getHitsFromTC(SDLEvent* event, unsigned int TC);
std::tuple<std::vector<unsigned int>, std::vector<unsigned int>> getHitIdxsAndHitTypesFromTC(
SDLEvent* event, unsigned int TC);
std::tuple<std::vector<unsigned int>, std::vector<unsigned int>> getHitIdxsAndHitTypesFromTC(SDLEvent* event,
unsigned int TC);

#endif
4 changes: 1 addition & 3 deletions RecoTracker/LSTCore/standalone/code/core/trkCore.h
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,7 @@ float runT4(SDLEvent *event);
float runT4x(SDLEvent *event);
float runpT4(SDLEvent *event);
float runT3(SDLEvent *event);
float runTrackCandidate(SDLEvent *event,
bool no_pls_dupclean,
bool tc_pls_triplets);
float runTrackCandidate(SDLEvent *event, bool no_pls_dupclean, bool tc_pls_triplets);
float runQuintuplet(SDLEvent *event);
float runPixelQuintuplet(SDLEvent *event);
float runPixelLineSegment(SDLEvent *event, bool no_pls_dupclean);
Expand Down
Loading

0 comments on commit fb12af0

Please sign in to comment.