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

Patatrack integration - Pixel track reconstruction (10/N) #31722

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
103 commits
Select commit Hold shift + click to select a range
ec0cc29
Use the `gpu` modifier to read the pixel clusters from the unpacker (…
fwyzard Mar 1, 2018
a10a72d
Implement Riemann fit for pixel tracks (cms-patatrack#34)
rovere Mar 27, 2018
7dc6682
Implement a Heterogeneous version of Raw2Cluster and RecHit (cms-pata…
makortel Jun 4, 2018
b117d17
Heterogeneous Cellular Automaton for pixel tracks
felicepantaleo Jun 14, 2018
ba46ad5
Clean up `CAHitNtupletHeterogeneousEDProducer` (cms-patatrack#83)
fwyzard Jun 18, 2018
b263509
Port the Riemann fit to CUDA (cms-patatrack#60)
rovere Jun 18, 2018
a2e681d
Synchronise with CMSSW_10_2_0_pre6
fwyzard Jul 4, 2018
bb60075
Customize function to provide a minimal configuration for profiling (…
makortel Jul 30, 2018
a7c22e4
Heterogeneous ClusterTPAssociation (cms-patatrack#105)
VinInn Jul 31, 2018
1a43506
Fix Cluster-to-TrackingParticle matching for pixel tracking CPU workf…
makortel Aug 1, 2018
b6b2fff
Synchronise with CMSSW_10_2_0
fwyzard Aug 1, 2018
ecd1465
Pixel doublets on GPU (cms-patatrack#118)
VinInn Aug 8, 2018
e539007
Cleanup defines, includes, file names, and debug messages (cms-patatr…
fwyzard Aug 9, 2018
979dbdb
Move all CUDA code to the plugins/ directory (cms-patatrack#123)
fwyzard Aug 9, 2018
f5e6831
Remove GPU-CellularAutomaton dependence on CPU doublets (cms-patatrac…
makortel Aug 10, 2018
4f361d1
Cleanup after merging with CMSSW 10.2.2 (cms-patatrack#134)
fwyzard Aug 17, 2018
65ac243
Add optional flags to disable SOA->legacy conversion and GPU->CPU tra…
makortel Aug 17, 2018
3ef1e8a
Reformat the Riemann fit code (cms-patatrack#143)
felicepantaleo Aug 23, 2018
14a9169
Clean up and bugfixes for the Riemann fit (cms-patatrack#148)
fwyzard Aug 30, 2018
c82fc4d
Reduce CA memory need (cms-patatrack#159)
makortel Sep 5, 2018
2396633
Add MTV instance for pixel tracks from PV (cms-patatrack#156)
makortel Sep 12, 2018
f76d1a9
Tune and speed up doublet algo (cms-patatrack#158)
VinInn Sep 12, 2018
9b538fc
Optimise gpuPixelDoublets::doubletsFromHisto() kernel (cms-patatrack#…
fwyzard Sep 13, 2018
0d80e17
Add Rieman fit to the CA (cms-patatrack#169)
rovere Sep 25, 2018
6d9630c
Introduce Cluster Charge Cut, optimize Histogram (bucket sorting) (cm…
VinInn Sep 26, 2018
79fcd95
Clean up Riemann fit in CA (cms-patatrack#178)
fwyzard Sep 27, 2018
f932567
Riemann fit multiple scattering (cms-patatrack#174)
rovere Sep 27, 2018
e1c1a7e
Suppress asserts in the GPU code, unless GPU_DEBUG is defined (cms-pa…
fwyzard Oct 6, 2018
e14fd83
Riemann fit rework (cms-patatrack#190)
fwyzard Nov 8, 2018
eef1ec8
Synchronise with CMSSW_10_4_0_pre2
fwyzard Nov 14, 2018
ffa2d95
Migrate tracker local reconstruction and pixel tracking to Tasks (bac…
fwyzard Nov 28, 2018
adea719
Fix MTV validation of initialStepPreSplitting tracks and add B-hadron…
makortel Nov 29, 2018
15e668c
Address code style and quality issues (cms-patatrack#203)
fwyzard Nov 28, 2018
9e6f88d
Recover pre-10.4.x Riemann fit rework (cms-patatrack#190)
rovere Nov 13, 2018
917c412
Full workflow from raw data to pixel tracks and vertices on GPUs (cms…
VinInn Jan 8, 2019
3deb206
Remove unnecessary pragmas (cms-patatrack#249)
fwyzard Jan 17, 2019
0f2c2e0
Skip CUDA-related tests if no GPU is present (cms-patatrack#252)
fwyzard Jan 17, 2019
64b28b4
Speed up the doublet finder (cms-patatrack#260)
VinInn Jan 24, 2019
5a77d60
Synchronise with CMSSW_10_5_0_pre1
fwyzard Jan 28, 2019
96b2f73
Next prototype of the framework integration (cms-patatrack#100)
makortel Mar 13, 2019
4ed9088
Various updates to pixel track/vertex DQM and MTV (cms-patatrack#285)
makortel Mar 15, 2019
3e828dd
Synchronise with CMSSW_10_6_0_pre2
fwyzard Mar 26, 2019
a74051b
Implementation of the broken line fit (cms-patatrack#340)
fwyzard May 8, 2019
874102c
Rework the Riemann fit and broken line fit (cms-patatrack#338)
VinInn Jan 29, 2019
f07cca0
Improve pixel doublets and CA, and extend debugging functionality (cm…
VinInn Feb 25, 2019
260c0b2
Migrate the pixel rechits producer and CA to the new heterogeneous fr…
VinInn Mar 29, 2019
548f5cf
Clean up by clang-format (cms-patatrack#338)
fwyzard May 14, 2019
47dc7f7
Make GPU CellularAutomaton configurable (cms-patatrack#347)
rovere May 8, 2019
e5372ab
Make doClusterCut, doZCut, doPhiCut configurable (cms-patatrack#347)
felicepantaleo May 10, 2019
daae2fa
Synchronise with CMSSW_10_6_0
fwyzard May 15, 2019
2b385c3
Build seeds directly from cpu product (cms-patatrack#365)
VinInn Aug 2, 2019
9e6ca10
Implement triplets in the pixel ntuplet producer (cms-patatrack#382)
VinInn Jun 20, 2019
0806471
fix bug in (and extend) cluster shape cut (cms-patatrack#383)
VinInn Jul 13, 2019
8df4bc8
Port the whole pixel workflow to new heterogeneous framework (cms-pat…
VinInn Jul 5, 2019
3ae0df1
Implement full Pixel SoA workflow on CPU (cms-patatrack#385)
VinInn Aug 25, 2019
a68be03
Move event and stream caches, and caching allocators out from CUDASer…
makortel Sep 10, 2019
2d6d811
Apply clang-format style formatting
fwyzard Sep 11, 2019
468e9ac
Synchronise with CMSSW_11_0_0_pre7
fwyzard Sep 12, 2019
604a797
Fix clang warnings (cms-patatrack#387)
makortel Oct 23, 2019
80ec6eb
Replace use of API wrapper stream and event with plain CUDA, part 1 (…
makortel Oct 26, 2019
4181007
Replace CUDA API wrapper memory operations with native CUDA calls (cm…
waredjeb Oct 29, 2019
3756786
Synchronize event in the CUDAProductBase destructor (cms-patatrack#391)
makortel Oct 29, 2019
5a135cb
Synchronise with CMSSW_11_0_0_pre11
fwyzard Nov 4, 2019
f532901
Optimize doublet reconstruction and cuts (cms-patatrack#411)
VinInn Nov 26, 2019
2b7e4cb
Migrate cluster track associator (cms-patatrack#409)
VinInn Nov 19, 2019
ae764c5
Drop obsolete heterogenous framework (cms-patatrack#416)
fwyzard Nov 27, 2019
7df797f
Remove last references to CUDA API Wrappers (cms-patatrack#417)
fwyzard Nov 27, 2019
b43a1ed
Apply code checks and code formatting
fwyzard Nov 29, 2019
f77f909
Synchronise with CMSSW_11_0_0_pre13
fwyzard Nov 30, 2019
9ecedf7
Rename exitSansCUDADevices to requireCUDADevices (cms-patatrack#423)
fwyzard Dec 2, 2019
78dc66e
Implement changes from the CUDA framework review (cms-patatrack#429)
makortel Jan 17, 2020
0491687
Synchronise with CMSSW_11_1_0_pre2
fwyzard Jan 27, 2020
712dc8b
Apply feedback from upstream PR (cms-patatrack#441)
fwyzard Feb 11, 2020
3ecdd54
Synchronise with CMSSW_11_1_0_pre4
fwyzard Mar 5, 2020
23bc909
Integrate the comments from the upstream PRs (cms-patatrack#442)
fwyzard Mar 24, 2020
cd2faf1
Synchronise with CMSSW_11_1_0_pre5
fwyzard Mar 26, 2020
668deea
Backport remove unneeded dependencies in Reco subsystems (#29295)
fwyzard Apr 6, 2020
71563e8
Fix use of namespaces (cms-patatrack#446)
fwyzard Apr 7, 2020
2bfeeb9
Synchronise with CMSSW_11_1_0_pre7
fwyzard May 11, 2020
14de161
Use std::isnan (cms-patatrack#456)
fwyzard May 13, 2020
b20bd1b
Replace cub prefix scan with home-brewed one (cms-patatrack#447)
VinInn May 15, 2020
ca80b70
Synchronise with CMSSW_11_1_0_pre8
fwyzard May 23, 2020
ddeaccb
Synchronise with CMSSW_11_2_0_pre2
fwyzard Jul 12, 2020
17accf2
Reduce GPU memory usage (cms-patatrack#509)
VinInn Jul 15, 2020
ceb4e96
Synchronise with CMSSW_11_2_0_pre3
fwyzard Aug 8, 2020
2004cbd
Protect CAHitNtupletCUDA ctor/dtor when CUDA is not available (cms-pa…
fwyzard Aug 27, 2020
e641460
Add customisations for profiling the Pixel-only workflow (cms-patatra…
fwyzard Oct 2, 2020
28d292a
Synchronise with CMSSW_11_2_0_pre7
fwyzard Oct 2, 2020
a817147
Further clean up after merging CMSSW_11_2_0_pre7 (cms-patatrack#556)
fwyzard Oct 5, 2020
c31b20f
Update the RelVal workflows and the CPU customisation (cms-patatrack#…
AdrianoDee Oct 12, 2020
2636448
Move the siPixelClusters.payloadType to the SoA-on-CPU customisation …
fwyzard Oct 22, 2020
c6ac806
Synchronise with CMSSW_11_2_0_pre8
fwyzard Oct 23, 2020
bb61e1c
Synchronise with CMSSW_11_2_0_pre9
fwyzard Nov 16, 2020
7473687
Move hit indexes to 32 bits (cms-patatrack#583)
VinInn Nov 27, 2020
50f697e
Clean up the pixel local reconstruction code (cms-patatrack#593)
fwyzard Dec 18, 2020
e2c52fb
Synchronise with CMSSW_11_3_0_pre1
fwyzard Dec 24, 2020
2455463
Clean up the pixel local reconstruction code (cms-patatrack#602)
fwyzard Dec 30, 2020
2f0c8d4
Exclude the changes related to TP association on GPU
fwyzard Dec 26, 2020
35c6817
Clean up the pixel track reconstruction code (cms-patatrack#606)
ericcano Mar 23, 2021
8d19af6
Further clean up the CA ntuplet generator (cms-patatrack#610)
fwyzard Mar 24, 2021
5bde441
Minor fixes and clean up for the pixel track reconstruction code (cms…
fwyzard Mar 25, 2021
a75ae0b
Synchronise with CMSSW_11_3_0_pre5
fwyzard Mar 23, 2021
16e7fdb
Temporarily revert the python customisation for the Pixel vertices
fwyzard Mar 25, 2021
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
9 changes: 9 additions & 0 deletions CUDADataFormats/Track/BuildFile.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
<use name="cuda"/>
<use name="rootcore"/>
<use name="CUDADataFormats/Common"/>
<use name="DataFormats/Common"/>
<use name="HeterogeneousCore/CUDAUtilities"/>
<use name="eigen"/>
<export>
<lib name="1"/>
</export>
9 changes: 9 additions & 0 deletions CUDADataFormats/Track/interface/PixelTrackHeterogeneous.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
#ifndef CUDADataFormats_Track_PixelTrackHeterogeneous_h
#define CUDADataFormats_Track_PixelTrackHeterogeneous_h

#include "CUDADataFormats/Common/interface/HeterogeneousSoA.h"
#include "CUDADataFormats/Track/interface/TrackSoAHeterogeneousT.h"

using PixelTrackHeterogeneous = HeterogeneousSoA<pixelTrack::TrackSoA>;

#endif // #ifndef CUDADataFormats_Track_PixelTrackHeterogeneous_h
73 changes: 73 additions & 0 deletions CUDADataFormats/Track/interface/TrackSoAHeterogeneousT.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,73 @@
#ifndef CUDADataFormats_Track_TrackHeterogeneousT_H
#define CUDADataFormats_Track_TrackHeterogeneousT_H
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please use an include guard matching the full file name subsystem_package_fileName_h

TrackSoAHeterogeneousT vs TrackHeterogeneousT


#include "CUDADataFormats/Track/interface/TrajectoryStateSoAT.h"
#include "HeterogeneousCore/CUDAUtilities/interface/HistoContainer.h"

#include "CUDADataFormats/Common/interface/HeterogeneousSoA.h"

namespace pixelTrack {
enum class Quality : uint8_t { bad = 0, dup, loose, strict, tight, highPurity };
}

template <int32_t S>
class TrackSoAHeterogeneousT {
public:
static constexpr int32_t stride() { return S; }

using Quality = pixelTrack::Quality;
using hindex_type = uint32_t;
using HitContainer = cms::cuda::OneToManyAssoc<hindex_type, S, 5 * S>;

// Always check quality is at least loose!
// CUDA does not support enums in __lgc ...
private:
eigenSoA::ScalarSoA<uint8_t, S> quality_;

public:
Comment on lines +24 to +27
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

4.25
Each class may have only one each of public, protected, and private sections, which must be declared in that order.

constexpr Quality quality(int32_t i) const { return (Quality)(quality_(i)); }
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

http://cms-sw.github.io/cms_coding_rules.html#4--technical-coding-rules-1
4.15 use C++ style casting

Suggested change
constexpr Quality quality(int32_t i) const { return (Quality)(quality_(i)); }
constexpr Quality quality(int32_t i) const { return static_cast<Quality>(quality_(i)); }

constexpr Quality &quality(int32_t i) { return (Quality &)(quality_(i)); }
constexpr Quality const *qualityData() const { return (Quality const *)(quality_.data()); }
constexpr Quality *qualityData() { return (Quality *)(quality_.data()); }

// this is chi2/ndof as not necessarely all hits are used in the fit
eigenSoA::ScalarSoA<float, S> chi2;

constexpr int nHits(int i) const { return detIndices.size(i); }

// State at the Beam spot
// phi,tip,1/pt,cotan(theta),zip
TrajectoryStateSoAT<S> stateAtBS;
eigenSoA::ScalarSoA<float, S> eta;
eigenSoA::ScalarSoA<float, S> pt;
constexpr float charge(int32_t i) const { return std::copysign(1.f, stateAtBS.state(i)(2)); }
constexpr float phi(int32_t i) const { return stateAtBS.state(i)(0); }
constexpr float tip(int32_t i) const { return stateAtBS.state(i)(1); }
constexpr float zip(int32_t i) const { return stateAtBS.state(i)(4); }

// state at the detector of the outermost hit
// representation to be decided...
// not yet filled on GPU
// TrajectoryStateSoA<S> stateAtOuterDet;

HitContainer hitIndices;
HitContainer detIndices;
};

namespace pixelTrack {

#ifdef GPU_SMALL_EVENTS
// kept for testing and debugging
constexpr uint32_t maxNumber() { return 2 * 1024; }
#else
// tested on MC events with 55-75 pileup events
constexpr uint32_t maxNumber() { return 32 * 1024; }
#endif

using TrackSoA = TrackSoAHeterogeneousT<maxNumber()>;
using TrajectoryState = TrajectoryStateSoAT<maxNumber()>;
using HitContainer = TrackSoA::HitContainer;

} // namespace pixelTrack

#endif // CUDADataFormats_Track_TrackHeterogeneousT_H
59 changes: 59 additions & 0 deletions CUDADataFormats/Track/interface/TrajectoryStateSoAT.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
#ifndef CUDADataFormats_Track_TrajectoryStateSOAT_H
#define CUDADataFormats_Track_TrajectoryStateSOAT_H
Comment on lines +1 to +2
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please use an include guard matching the full file name subsystem_package_fileName_h

TrajectoryStateSoAT is in the file name


#include <Eigen/Dense>
#include "HeterogeneousCore/CUDAUtilities/interface/eigenSoA.h"

template <int32_t S>
struct TrajectoryStateSoAT {
using Vector5f = Eigen::Matrix<float, 5, 1>;
using Vector15f = Eigen::Matrix<float, 15, 1>;

using Vector5d = Eigen::Matrix<double, 5, 1>;
using Matrix5d = Eigen::Matrix<double, 5, 5>;

static constexpr int32_t stride() { return S; }

eigenSoA::MatrixSoA<Vector5f, S> state;
eigenSoA::MatrixSoA<Vector15f, S> covariance;

template <typename V3, typename M3, typename V2, typename M2>
__host__ __device__ inline void copyFromCircle(
V3 const& cp, M3 const& ccov, V2 const& lp, M2 const& lcov, float b, int32_t i) {
state(i) << cp.template cast<float>(), lp.template cast<float>();
state(i)(2) *= b;
auto cov = covariance(i);
cov(0) = ccov(0, 0);
cov(1) = ccov(0, 1);
cov(2) = b * float(ccov(0, 2));
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
cov(2) = b * float(ccov(0, 2));
cov(2) = b * static_cast<float>(ccov(0, 2));

?

cov(4) = cov(3) = 0;
cov(5) = ccov(1, 1);
cov(6) = b * float(ccov(1, 2));
cov(8) = cov(7) = 0;
cov(9) = b * b * float(ccov(2, 2));
cov(11) = cov(10) = 0;
cov(12) = lcov(0, 0);
cov(13) = lcov(0, 1);
cov(14) = lcov(1, 1);
}

template <typename V5, typename M5>
__host__ __device__ inline void copyFromDense(V5 const& v, M5 const& cov, int32_t i) {
state(i) = v.template cast<float>();
for (int j = 0, ind = 0; j < 5; ++j)
for (auto k = j; k < 5; ++k)
covariance(i)(ind++) = cov(j, k);
}

template <typename V5, typename M5>
__host__ __device__ inline void copyToDense(V5& v, M5& cov, int32_t i) const {
v = state(i).template cast<typename V5::Scalar>();
for (int j = 0, ind = 0; j < 5; ++j) {
cov(j, j) = covariance(i)(ind++);
for (auto k = j + 1; k < 5; ++k)
cov(k, j) = cov(j, k) = covariance(i)(ind++);
}
}
};

#endif // CUDADataFormats_Track_TrajectoryStateSOAT_H
9 changes: 9 additions & 0 deletions CUDADataFormats/Track/src/classes.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
#ifndef CUDADataFormats_Track_src_classes_h
#define CUDADataFormats_Track_src_classes_h

#include "CUDADataFormats/Common/interface/Product.h"
#include "CUDADataFormats/Common/interface/HostProduct.h"
#include "CUDADataFormats/Track/interface/TrackSoAHeterogeneousT.h"
#include "DataFormats/Common/interface/Wrapper.h"

#endif // CUDADataFormats_Track_src_classes_h
6 changes: 6 additions & 0 deletions CUDADataFormats/Track/src/classes_def.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
<lcgdict>
<class name="cms::cuda::Product<HeterogeneousSoA<pixelTrack::TrackSoA>>" persistent="false"/>
<class name="edm::Wrapper<cms::cuda::Product<HeterogeneousSoA<pixelTrack::TrackSoA>>>" persistent="false"/>
<class name="HeterogeneousSoA<pixelTrack::TrackSoA>" persistent="false"/>
<class name="edm::Wrapper<HeterogeneousSoA<pixelTrack::TrackSoA>>" persistent="false"/>
</lcgdict>
13 changes: 13 additions & 0 deletions CUDADataFormats/Track/test/BuildFile.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
<use name="HeterogeneousCore/CUDAUtilities"/>

<bin file="TrajectoryStateSOA_t.cpp" name="cpuTrajectoryStateSOA_t">
<use name="eigen"/>
<flags CXXFLAGS="-g -DGPU_DEBUG"/>
</bin>

<bin file="TrajectoryStateSOA_t.cu" name="gpuTrajectoryStateSOA_t">
<use name="eigen"/>
<flags CUDA_FLAGS="-g -DGPU_DEBUG"/>
<flags CXXFLAGS="-g -DGPU_DEBUG"/>
</bin>

1 change: 1 addition & 0 deletions CUDADataFormats/Track/test/TrajectoryStateSOA_t.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
#include "TrajectoryStateSOA_t.h"
1 change: 1 addition & 0 deletions CUDADataFormats/Track/test/TrajectoryStateSOA_t.cu
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
#include "TrajectoryStateSOA_t.h"
75 changes: 75 additions & 0 deletions CUDADataFormats/Track/test/TrajectoryStateSOA_t.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,75 @@
#include "CUDADataFormats/Track/interface/TrajectoryStateSoAT.h"

using Vector5d = Eigen::Matrix<double, 5, 1>;
using Matrix5d = Eigen::Matrix<double, 5, 5>;

__host__ __device__ Matrix5d loadCov(Vector5d const& e) {
Matrix5d cov;
for (int i = 0; i < 5; ++i)
cov(i, i) = e(i) * e(i);
for (int i = 0; i < 5; ++i) {
for (int j = 0; j < i; ++j) {
double v = 0.3 * std::sqrt(cov(i, i) * cov(j, j)); // this makes the matrix pos defined
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

could a comment be added in order to make somehow more clear the meaning of these 0.3, -0.4 and 0.1 ?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's a trick copied from root (to make matrix pos defined as the comment explains)

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

and exists in some legacy test as well

cov(i, j) = (i + j) % 2 ? -0.4 * v : 0.1 * v;
cov(j, i) = cov(i, j);
}
}
return cov;
}

using TS = TrajectoryStateSoAT<128>;

__global__ void testTSSoA(TS* pts, int n) {
assert(n <= 128);

Vector5d par0;
par0 << 0.2, 0.1, 3.5, 0.8, 0.1;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

also these "magic numbers" could be made somehow more self-explaining

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

it's a test. just not zeros

Vector5d e0;
e0 << 0.01, 0.01, 0.035, -0.03, -0.01;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

also these "magic numbers" could be made somehow more self-explaining

auto cov0 = loadCov(e0);

TS& ts = *pts;

int first = threadIdx.x + blockIdx.x * blockDim.x;

for (int i = first; i < n; i += blockDim.x * gridDim.x) {
ts.copyFromDense(par0, cov0, i);
Vector5d par1;
Matrix5d cov1;
ts.copyToDense(par1, cov1, i);
Vector5d delV = par1 - par0;
Matrix5d delM = cov1 - cov0;
for (int j = 0; j < 5; ++j) {
assert(std::abs(delV(j)) < 1.e-5);
for (auto k = j; k < 5; ++k) {
assert(cov0(k, j) == cov0(j, k));
assert(cov1(k, j) == cov1(j, k));
assert(std::abs(delM(k, j)) < 1.e-5);
}
}
}
}

#ifdef __CUDACC__
#include "HeterogeneousCore/CUDAUtilities/interface/requireDevices.h"
#include "HeterogeneousCore/CUDAUtilities/interface/cudaCheck.h"
#endif

int main() {
#ifdef __CUDACC__
cms::cudatest::requireDevices();
#endif

TS ts;

#ifdef __CUDACC__
TS* ts_d;
cudaCheck(cudaMalloc(&ts_d, sizeof(TS)));
testTSSoA<<<1, 64>>>(ts_d, 128);
cudaCheck(cudaGetLastError());
cudaCheck(cudaMemcpy(&ts, ts_d, sizeof(TS), cudaMemcpyDefault));
cudaCheck(cudaDeviceSynchronize());
#else
testTSSoA(&ts, 128);
#endif
}
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,10 @@ def _layers(suffix, quant, histoPostfix):
]

pixelTrackingEffFromHitPattern = DQMEDHarvester("DQMGenericClient",
subDirs = cms.untracked.vstring("Tracking/PixelTrackParameters/HitEffFromHitPattern*"),
subDirs = cms.untracked.vstring("Tracking/PixelTrackParameters/pixelTracks/HitEffFromHitPattern*",
"Tracking/PixelTrackParameters/dzPV0p1/HitEffFromHitPattern*",
"Tracking/PixelTrackParameters/pt_0to1/HitEffFromHitPattern*",
"Tracking/PixelTrackParameters/pt_1/HitEffFromHitPattern*"),
efficiency = cms.vstring(
_layers("PU", "GoodNumVertices", "") +
_layers("BX", "BX", "VsBX") +
Expand Down
92 changes: 73 additions & 19 deletions DQM/TrackingMonitorSource/python/pixelTracksMonitoring_cff.py
Original file line number Diff line number Diff line change
@@ -1,23 +1,77 @@
import FWCore.ParameterSet.Config as cms

import DQM.TrackingMonitor.TrackerCollisionTrackingMonitor_cfi
pixelTracksMonitoring = DQM.TrackingMonitor.TrackerCollisionTrackingMonitor_cfi.TrackerCollisionTrackMon.clone()
pixelTracksMonitoring.FolderName = 'Tracking/PixelTrackParameters'
pixelTracksMonitoring.TrackProducer = 'pixelTracks'
pixelTracksMonitoring.allTrackProducer = 'pixelTracks'
pixelTracksMonitoring.beamSpot = 'offlineBeamSpot'
pixelTracksMonitoring.primaryVertex = 'pixelVertices'
pixelTracksMonitoring.pvNDOF = 1
pixelTracksMonitoring.doAllPlots = True
pixelTracksMonitoring.doLumiAnalysis = True
pixelTracksMonitoring.doProfilesVsLS = True
pixelTracksMonitoring.doDCAPlots = True
pixelTracksMonitoring.doProfilesVsLS = True
pixelTracksMonitoring.doPlotsVsGoodPVtx = True
pixelTracksMonitoring.doEffFromHitPatternVsPU = False
pixelTracksMonitoring.doEffFromHitPatternVsBX = False
pixelTracksMonitoring.doEffFromHitPatternVsLUMI = False
pixelTracksMonitoring.doPlotsVsGoodPVtx = True
pixelTracksMonitoring.doPlotsVsLUMI = True
pixelTracksMonitoring.doPlotsVsBX = True
pixelTracksMonitor = DQM.TrackingMonitor.TrackerCollisionTrackingMonitor_cfi.TrackerCollisionTrackMon.clone()
pixelTracksMonitor.FolderName = 'Tracking/PixelTrackParameters/pixelTracks'
pixelTracksMonitor.TrackProducer = 'pixelTracks'
pixelTracksMonitor.allTrackProducer = 'pixelTracks'
pixelTracksMonitor.beamSpot = 'offlineBeamSpot'
pixelTracksMonitor.primaryVertex = 'pixelVertices'
pixelTracksMonitor.pvNDOF = 1
pixelTracksMonitor.doAllPlots = True
pixelTracksMonitor.doLumiAnalysis = True
pixelTracksMonitor.doProfilesVsLS = True
pixelTracksMonitor.doDCAPlots = True
pixelTracksMonitor.doProfilesVsLS = True
pixelTracksMonitor.doPlotsVsGoodPVtx = True
pixelTracksMonitor.doEffFromHitPatternVsPU = False
pixelTracksMonitor.doEffFromHitPatternVsBX = False
pixelTracksMonitor.doEffFromHitPatternVsLUMI = False
pixelTracksMonitor.doPlotsVsGoodPVtx = True
pixelTracksMonitor.doPlotsVsLUMI = True
pixelTracksMonitor.doPlotsVsBX = True

_trackSelector = cms.EDFilter('TrackSelector',
src = cms.InputTag('pixelTracks'),
cut = cms.string("")
)

pixelTracksPt0to1 = _trackSelector.clone(cut = "pt >= 0 & pt < 1 ")
pixelTracksPt1 = _trackSelector.clone(cut = "pt >= 1 ")
from DQM.TrackingMonitorSource.TrackCollections2monitor_cff import highPurityPV0p1 as _highPurityPV0p1
pixelTracksPV0p1 = _highPurityPV0p1.clone(
src = "pixelTracks",
quality = "",
vertexTag = "goodPixelVertices"
)

pixelTracksMonitorPt0to1 = pixelTracksMonitor.clone(
TrackProducer = "pixelTracksPt0to1",
FolderName = "Tracking/PixelTrackParameters/pt_0to1"
)
pixelTracksMonitorPt1 = pixelTracksMonitor.clone(
TrackProducer = "pixelTracksPt1",
FolderName = "Tracking/PixelTrackParameters/pt_1"
)
pixelTracksMonitorPV0p1 = pixelTracksMonitor.clone(
TrackProducer = "pixelTracksPV0p1",
FolderName = "Tracking/PixelTrackParameters/dzPV0p1"
)


from CommonTools.ParticleFlow.goodOfflinePrimaryVertices_cfi import goodOfflinePrimaryVertices as _goodOfflinePrimaryVertices
goodPixelVertices = _goodOfflinePrimaryVertices.clone(
src = "pixelVertices",
)

from DQM.TrackingMonitor.primaryVertexResolution_cfi import primaryVertexResolution as _primaryVertexResolution
pixelVertexResolution = _primaryVertexResolution.clone(
vertexSrc = "goodPixelVertices",
rootFolder = "OfflinePixelPV/Resolution",
)

pixelTracksMonitoringTask = cms.Task(
goodPixelVertices,
pixelTracksPt0to1,
pixelTracksPt1,
pixelTracksPV0p1,
)

pixelTracksMonitoring = cms.Sequence(
pixelTracksMonitor +
pixelTracksMonitorPt0to1 +
pixelTracksMonitorPt1 +
pixelTracksMonitorPV0p1 +
pixelVertexResolution,
pixelTracksMonitoringTask
)

This file was deleted.

Loading