CUDADataFormats
Track
interface
TrackSoAHeterogeneousT.h
Go to the documentation of this file.
1
#ifndef CUDADataFormats_Track_TrackHeterogeneousT_H
2
#define CUDADataFormats_Track_TrackHeterogeneousT_H
3
4
#include <string>
5
#include <algorithm>
6
7
#include "
CUDADataFormats/Track/interface/TrajectoryStateSoAT.h
"
8
#include "
HeterogeneousCore/CUDAUtilities/interface/HistoContainer.h
"
9
10
#include "
CUDADataFormats/Common/interface/HeterogeneousSoA.h
"
11
12
namespace
pixelTrack
{
13
enum class
Quality
: uint8_t {
bad
= 0,
edup
,
dup
,
loose
,
strict
,
tight
,
highPurity
,
notQuality
};
14
constexpr uint32_t
qualitySize
{uint8_t(
Quality::notQuality
)};
15
const
std::string
qualityName
[
qualitySize
]{
"bad"
,
"edup"
,
"dup"
,
"loose"
,
"strict"
,
"tight"
,
"highPurity"
};
16
inline
Quality
qualityByName
(
std::string
const
&
name
) {
17
auto
qp =
std::find
(
qualityName
,
qualityName
+
qualitySize
,
name
) -
qualityName
;
18
return
static_cast<Quality>(qp);
19
}
20
}
// namespace pixelTrack
21
22
template
<
int
32_t S>
23
class
TrackSoAHeterogeneousT
{
24
public
:
25
static
constexpr int32_t
stride
() {
return
S
; }
26
27
using
Quality
=
pixelTrack::Quality
;
28
using
hindex_type
= uint32_t;
29
using
HitContainer
=
cms::cuda::OneToManyAssoc<hindex_type, S + 1, 5 * S>
;
30
31
// Always check quality is at least loose!
32
// CUDA does not support enums in __lgc ...
33
private
:
34
eigenSoA::ScalarSoA<uint8_t, S>
quality_
;
35
36
public
:
37
constexpr
Quality
quality
(int32_t
i
)
const
{
return
(
Quality
)(
quality_
(
i
)); }
38
constexpr
Quality
&
quality
(int32_t
i
) {
return
(
Quality
&)(
quality_
(
i
)); }
39
constexpr
Quality
const
*
qualityData
()
const
{
return
(
Quality
const
*)(
quality_
.
data
()); }
40
constexpr
Quality
*
qualityData
() {
return
(
Quality
*)(
quality_
.
data
()); }
41
42
// this is chi2/ndof as not necessarely all hits are used in the fit
43
eigenSoA::ScalarSoA<float, S>
chi2
;
44
45
constexpr
int
nHits
(
int
i
)
const
{
return
detIndices
.size(
i
); }
46
47
// State at the Beam spot
48
// phi,tip,1/pt,cotan(theta),zip
49
TrajectoryStateSoAT<S>
stateAtBS
;
50
eigenSoA::ScalarSoA<float, S>
eta
;
51
eigenSoA::ScalarSoA<float, S>
pt
;
52
constexpr
float
charge
(int32_t
i
)
const
{
return
std::copysign(1.
f
,
stateAtBS
.state(
i
)(2)); }
53
constexpr
float
phi
(int32_t
i
)
const
{
return
stateAtBS
.state(
i
)(0); }
54
constexpr
float
tip
(int32_t
i
)
const
{
return
stateAtBS
.state(
i
)(1); }
55
constexpr
float
zip
(int32_t
i
)
const
{
return
stateAtBS
.state(
i
)(4); }
56
57
// state at the detector of the outermost hit
58
// representation to be decided...
59
// not yet filled on GPU
60
// TrajectoryStateSoA<S> stateAtOuterDet;
61
62
HitContainer
hitIndices
;
63
HitContainer
detIndices
;
64
};
65
66
namespace
pixelTrack
{
67
68
#ifdef GPU_SMALL_EVENTS
69
// kept for testing and debugging
70
constexpr uint32_t
maxNumber
() {
return
2 * 1024; }
71
#else
72
// tested on MC events with 55-75 pileup events
73
constexpr uint32_t
maxNumber
() {
return
32 * 1024; }
74
#endif
75
76
using
TrackSoA
=
TrackSoAHeterogeneousT
<
maxNumber
()>;
77
using
TrajectoryState
=
TrajectoryStateSoAT
<
maxNumber
()>;
78
using
HitContainer
=
TrackSoA::HitContainer
;
79
80
}
// namespace pixelTrack
81
82
#endif // CUDADataFormats_Track_TrackHeterogeneousT_H
mps_fire.i
i
Definition:
mps_fire.py:428
TrackSoAHeterogeneousT::eta
eigenSoA::ScalarSoA< float, S > eta
Definition:
TrackSoAHeterogeneousT.h:50
f
double f[11][100]
Definition:
MuScleFitUtils.cc:78
eigenSoA::ScalarSoA< uint8_t, S >
pixelTrack::Quality::bad
pixelTrack::Quality::strict
TrackSoAHeterogeneousT::pt
eigenSoA::ScalarSoA< float, S > pt
Definition:
TrackSoAHeterogeneousT.h:51
spr::find
void find(edm::Handle< EcalRecHitCollection > &hits, DetId thisDet, std::vector< EcalRecHitCollection::const_iterator > &hit, bool debug=false)
Definition:
FindCaloHit.cc:19
pixelTrack::maxNumber
constexpr uint32_t maxNumber()
Definition:
TrackSoAHeterogeneousT.h:73
cms::cuda::OneToManyAssoc
Definition:
OneToManyAssoc.h:143
pixelTrack::Quality::dup
TrackSoAHeterogeneousT::stride
static constexpr int32_t stride()
Definition:
TrackSoAHeterogeneousT.h:25
TrackSoAHeterogeneousT::qualityData
constexpr Quality * qualityData()
Definition:
TrackSoAHeterogeneousT.h:40
TrackSoAHeterogeneousT::phi
constexpr float phi(int32_t i) const
Definition:
TrackSoAHeterogeneousT.h:53
TrackSoAHeterogeneousT::hindex_type
uint32_t hindex_type
Definition:
TrackSoAHeterogeneousT.h:28
pixelTrack::Quality
Quality
Definition:
TrackSoAHeterogeneousT.h:13
pixelTrack::Quality::edup
TrackSoAHeterogeneousT::quality
constexpr Quality quality(int32_t i) const
Definition:
TrackSoAHeterogeneousT.h:37
HeterogeneousSoA.h
TrackSoAHeterogeneousT::quality_
eigenSoA::ScalarSoA< uint8_t, S > quality_
Definition:
TrackSoAHeterogeneousT.h:34
TrackSoAHeterogeneousT::chi2
eigenSoA::ScalarSoA< float, S > chi2
Definition:
TrackSoAHeterogeneousT.h:43
pixelTrack::qualityName
const std::string qualityName[qualitySize]
Definition:
TrackSoAHeterogeneousT.h:15
pixelTrack::Quality::tight
S
double S(const TLorentzVector &, const TLorentzVector &)
Definition:
Particle.cc:97
TrackSoAHeterogeneousT
Definition:
TrackSoAHeterogeneousT.h:23
TrackSoAHeterogeneousT::zip
constexpr float zip(int32_t i) const
Definition:
TrackSoAHeterogeneousT.h:55
TrajectoryStateSoAT.h
TrackSoAHeterogeneousT::tip
constexpr float tip(int32_t i) const
Definition:
TrackSoAHeterogeneousT.h:54
TrackSoAHeterogeneousT::stateAtBS
TrajectoryStateSoAT< S > stateAtBS
Definition:
TrackSoAHeterogeneousT.h:49
TrackSoAHeterogeneousT::HitContainer
cms::cuda::OneToManyAssoc< hindex_type, S+1, 5 *S > HitContainer
Definition:
TrackSoAHeterogeneousT.h:29
AlCaHLTBitMon_QueryRunRegistry.string
string string
Definition:
AlCaHLTBitMon_QueryRunRegistry.py:256
HistoContainer.h
TrackSoAHeterogeneousT::quality
constexpr Quality & quality(int32_t i)
Definition:
TrackSoAHeterogeneousT.h:38
TrajectoryStateSoAT
Definition:
TrajectoryStateSoAT.h:8
pixelTrack::Quality::highPurity
TrackSoAHeterogeneousT::hitIndices
HitContainer hitIndices
Definition:
TrackSoAHeterogeneousT.h:62
Skims_PA_cff.name
name
Definition:
Skims_PA_cff.py:17
eigenSoA::ScalarSoA::data
__host__ constexpr __device__ Scalar * data()
Definition:
eigenSoA.h:26
pixelTrack
Definition:
TrackSoAHeterogeneousT.h:12
TrackSoAHeterogeneousT::qualityData
constexpr const Quality * qualityData() const
Definition:
TrackSoAHeterogeneousT.h:39
pixelTrack::qualityByName
Quality qualityByName(std::string const &name)
Definition:
TrackSoAHeterogeneousT.h:16
TrackSoAHeterogeneousT::charge
constexpr float charge(int32_t i) const
Definition:
TrackSoAHeterogeneousT.h:52
TrackSoAHeterogeneousT::detIndices
HitContainer detIndices
Definition:
TrackSoAHeterogeneousT.h:63
pixelTrack::qualitySize
constexpr uint32_t qualitySize
Definition:
TrackSoAHeterogeneousT.h:14
pixelTrack::Quality::loose
pixelTrack::Quality::notQuality
TrackSoAHeterogeneousT::nHits
constexpr int nHits(int i) const
Definition:
TrackSoAHeterogeneousT.h:45
Generated for CMSSW Reference Manual by
1.8.16