-
Notifications
You must be signed in to change notification settings - Fork 4.4k
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
CA Extension to strips #47090
base: master
Are you sure you want to change the base?
CA Extension to strips #47090
Changes from 8 commits
402e41a
3ce3dd0
43d60d7
0e1227b
9394a67
508a7fd
d10f8f5
c544928
2046b03
eac1c1d
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
import FWCore.ParameterSet.Config as cms | ||
|
||
# This modifier can be used in combination with pixelNtupletFit to include strip hits in the tracks | ||
|
||
stripNtupletFit = cms.Modifier() |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -4,12 +4,12 @@ | |
#include <cstdint> | ||
|
||
#include <alpaka/alpaka.hpp> | ||
|
||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. please add back the empty line |
||
#include "DataFormats/Common/interface/Uninitialized.h" | ||
#include "DataFormats/Portable/interface/PortableHostCollection.h" | ||
#include "DataFormats/TrackSoA/interface/TrackDefinitions.h" | ||
#include "DataFormats/TrackSoA/interface/TracksSoA.h" | ||
#include "Geometry/CommonTopologies/interface/SimplePixelTopology.h" | ||
#include "Geometry/CommonTopologies/interface/SimpleSeedingLayersTopology.h" | ||
|
||
// TODO: The class is created via inheritance of the PortableHostCollection. | ||
// This is generally discouraged, and should be done via composition. | ||
|
@@ -42,6 +42,7 @@ namespace pixelTrack { | |
using TracksHostPhase1 = TracksHost<pixelTopology::Phase1>; | ||
using TracksHostPhase2 = TracksHost<pixelTopology::Phase2>; | ||
using TracksHostHIonPhase1 = TracksHost<pixelTopology::HIonPhase1>; | ||
using TracksHostPhase1Strip = TracksHost<pixelTopology::Phase1Strip>; | ||
|
||
} // namespace pixelTrack | ||
|
||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -7,6 +7,7 @@ | |
|
||
#include "HeterogeneousCore/AlpakaInterface/interface/OneToManyAssoc.h" | ||
#include "Geometry/CommonTopologies/interface/SimplePixelTopology.h" | ||
#include "Geometry/CommonTopologies/interface/SimpleSeedingLayersTopology.h" | ||
#include "DataFormats/SoATemplate/interface/SoALayout.h" | ||
#include "DataFormats/TrackSoA/interface/TrackDefinitions.h" | ||
|
||
|
@@ -66,33 +67,39 @@ namespace reco { | |
struct IsTrackSoAConstView<TrackSoAConstView<pixelTopology::HIonPhase1>> : std::true_type {}; | ||
template <> | ||
struct IsTrackSoAConstView<TrackSoAView<pixelTopology::HIonPhase1>> : std::true_type {}; | ||
template <> | ||
struct IsTrackSoAConstView<TrackSoAConstView<pixelTopology::Phase1Strip>> : std::true_type {}; | ||
template <> | ||
struct IsTrackSoAConstView<TrackSoAView<pixelTopology::Phase1Strip>> : std::true_type {}; | ||
|
||
template <typename T> | ||
constexpr bool isTrackSoAConstView = IsTrackSoAConstView<T>::value; | ||
|
||
template <typename ConstView, typename = std::enable_if_t<isTrackSoAConstView<ConstView>>> | ||
// enable_if should be used when there is another implementation, | ||
// please use static_assert to report invalid template arguments | ||
Comment on lines
+78
to
+79
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I guess we disagree on how to write C++ code. |
||
template <typename ConstView> //, typename = std::enable_if_t<isTrackSoAConstView<ConstView>>> | ||
ALPAKA_FN_HOST_ACC ALPAKA_FN_INLINE constexpr float charge(ConstView const& tracks, int32_t i) { | ||
//was: std::copysign(1.f, tracks[i].state()(2)). Will be constexpr with C++23 | ||
float v = tracks[i].state()(2); | ||
return float((0.0f < v) - (v < 0.0f)); | ||
} | ||
|
||
template <typename ConstView, typename = std::enable_if_t<isTrackSoAConstView<ConstView>>> | ||
template <typename ConstView> //, typename = std::enable_if_t<isTrackSoAConstView<ConstView>>> | ||
ALPAKA_FN_HOST_ACC ALPAKA_FN_INLINE constexpr float phi(ConstView const& tracks, int32_t i) { | ||
return tracks[i].state()(0); | ||
} | ||
|
||
template <typename ConstView, typename = std::enable_if_t<isTrackSoAConstView<ConstView>>> | ||
template <typename ConstView> //, typename = std::enable_if_t<isTrackSoAConstView<ConstView>>> | ||
ALPAKA_FN_HOST_ACC ALPAKA_FN_INLINE constexpr float tip(ConstView const& tracks, int32_t i) { | ||
return tracks[i].state()(1); | ||
} | ||
|
||
template <typename ConstView, typename = std::enable_if_t<isTrackSoAConstView<ConstView>>> | ||
template <typename ConstView> //, typename = std::enable_if_t<isTrackSoAConstView<ConstView>>> | ||
ALPAKA_FN_HOST_ACC ALPAKA_FN_INLINE constexpr float zip(ConstView const& tracks, int32_t i) { | ||
return tracks[i].state()(4); | ||
} | ||
|
||
template <typename ConstView, typename = std::enable_if_t<isTrackSoAConstView<ConstView>>> | ||
template <typename ConstView> //, typename = std::enable_if_t<isTrackSoAConstView<ConstView>>> | ||
ALPAKA_FN_HOST_ACC ALPAKA_FN_INLINE constexpr bool isTriplet(ConstView const& tracks, int32_t i) { | ||
return tracks[i].nLayers() == 3; | ||
} | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -140,6 +140,7 @@ namespace pixelTrack { | |
|
||
float pt = std::min<float>(tracks.pt(it), chi2MaxPt); | ||
float chi2Cut = chi2Scale * (chi2Coeff[0] + roughLog(pt) * chi2Coeff[1]); | ||
//chi2Cut = chi2Scale; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. what does this comment mean ? |
||
if (tracks.chi2(it) >= chi2Cut) { | ||
#ifdef NTUPLE_FIT_DEBUG | ||
printf("Bad chi2 %d pt %f eta %f chi2 %f\n", it, tracks.pt(it), tracks.eta(it), tracks.chi2(it)); | ||
|
@@ -173,6 +174,7 @@ namespace pixelTrack { | |
|
||
// TODO: Should those be placed in the ALPAKA_ACCELERATOR_NAMESPACE | ||
template struct TracksUtilities<pixelTopology::Phase1>; | ||
template struct TracksUtilities<pixelTopology::Phase1Strip>; | ||
template struct TracksUtilities<pixelTopology::Phase2>; | ||
|
||
#endif // DataFormats_TrackSoA_interface_alpaka_TrackUtilities_h |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -13,4 +13,9 @@ | |
<class name="alpaka_rocm_async::pixelTrack::TracksSoACollectionPhase2" persistent="false"/> | ||
<class name="edm::DeviceProduct<alpaka_rocm_async::pixelTrack::TracksSoACollectionPhase2>" persistent="false"/> | ||
<class name="edm::Wrapper<edm::DeviceProduct<alpaka_rocm_async::pixelTrack::TracksSoACollectionPhase2>>" persistent="false"/> | ||
|
||
<class name="alpaka_rocm_async::PortableCollection<reco::TrackLayout<pixelTopology::Phase1Strip>>" persistent="false"/> | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. indentation |
||
<class name="alpaka_rocm_async::pixelTrack::TracksSoACollectionPhase1Strip" persistent="false"/> | ||
<class name="edm::DeviceProduct<alpaka_rocm_async::pixelTrack::TracksSoACollectionPhase1Strip>" persistent="false"/> | ||
<class name="edm::Wrapper<edm::DeviceProduct<alpaka_rocm_async::pixelTrack::TracksSoACollectionPhase1Strip>>" persistent="false"/> | ||
</lcgdict> |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,10 @@ | ||
#include "DataFormats/Portable/interface/PortableHostCollectionReadRules.h" | ||
#include "DataFormats/TrackSoA/interface/TracksSoA.h" | ||
#include "Geometry/CommonTopologies/interface/SimplePixelTopology.h" | ||
#include "Geometry/CommonTopologies/interface/SimpleSeedingLayersTopology.h" | ||
|
||
using namespace reco; | ||
|
||
SET_PORTABLEHOSTCOLLECTION_READ_RULES(PortableHostCollection<TrackLayout<pixelTopology::Phase1>>); | ||
SET_PORTABLEHOSTCOLLECTION_READ_RULES(PortableHostCollection<TrackLayout<pixelTopology::Phase2>>); | ||
// SET_PORTABLEHOSTCOLLECTION_READ_RULES(PortableHostCollection<TrackLayout<pixelTopology::HIonPhase1>>); //TODO: For the moment we live without HIons | ||
SET_PORTABLEHOSTCOLLECTION_READ_RULES(PortableHostCollection<TrackLayout<pixelTopology::Phase1Strip>>); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.