CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
CAConstants.h
Go to the documentation of this file.
1 #ifndef RecoPixelVertexing_PixelTriplets_plugins_CAConstants_h
2 #define RecoPixelVertexing_PixelTriplets_plugins_CAConstants_h
3 
4 #include <cstdint>
5 
6 #include <cuda_runtime.h>
7 
12 
13 //#define ONLY_PHICUT
14 
15 // Cellular automaton constants
16 namespace caConstants {
17 
18  // constants
19 #ifdef ONLY_PHICUT
20  constexpr uint32_t maxCellNeighbors = 64;
21  constexpr uint32_t maxCellTracks = 64;
22  constexpr uint32_t maxNumberOfTuples = 48 * 1024;
23  constexpr uint32_t maxNumberOfDoublets = 2 * 1024 * 1024;
24  constexpr uint32_t maxCellsPerHit = 8 * 128;
25 #else // ONLY_PHICUT
26  constexpr uint32_t maxCellNeighbors = 36;
27  constexpr uint32_t maxCellTracks = 48;
28 #ifdef GPU_SMALL_EVENTS
29  // kept for testing and debugging
30  constexpr uint32_t maxNumberOfTuples = 3 * 1024;
31  constexpr uint32_t maxNumberOfDoublets = 128 * 1024;
32  constexpr uint32_t maxCellsPerHit = 128 / 2;
33 #else // GPU_SMALL_EVENTS
34  // tested on MC events with 55-75 pileup events
35  // and extended for Heavy Ions operations (24k -> 32k tuples, 128 -> 256 cells)
36  constexpr uint32_t maxNumberOfTuples = 32 * 1024;
37  constexpr uint32_t maxNumberOfDoublets = 512 * 1024;
38  constexpr uint32_t maxCellsPerHit = 256;
39 #endif // GPU_SMALL_EVENTS
40 #endif // ONLY_PHICUT
41  constexpr uint32_t maxNumOfActiveDoublets = maxNumberOfDoublets / 8;
43 
44  constexpr uint32_t maxNumberOfLayerPairs = 20;
45  constexpr uint32_t maxNumberOfLayers = 10;
46  constexpr uint32_t maxTuples = maxNumberOfTuples;
47  constexpr int32_t maxHitsOnTrack = 10;
48 
49  // Modules constants
50  constexpr uint32_t max_ladder_bpx0 = 12;
51  constexpr uint32_t first_ladder_bpx0 = 0;
52  constexpr float module_length_bpx0 = 6.7f;
53  constexpr float module_tolerance_bpx0 = 0.4f; // projection to cylinder is inaccurate on BPIX1
54  constexpr uint32_t max_ladder_bpx4 = 64;
55  constexpr uint32_t first_ladder_bpx4 = 84;
56  constexpr float radius_even_ladder = 15.815f;
57  constexpr float radius_odd_ladder = 16.146f;
58  constexpr float module_length_bpx4 = 6.7f;
59  constexpr float module_tolerance_bpx4 = 0.2f;
60  constexpr float barrel_z_length = 26.f;
61  constexpr float forward_z_begin = 32.f;
62 
63  // Last indexes
64  constexpr uint32_t last_bpix1_detIndex = 96;
65  constexpr uint32_t last_barrel_detIndex = 1184;
66 
67  // types
68  using hindex_type = uint32_t; // FIXME from siPixelRecHitsHeterogeneousProduct
69  using tindex_type = uint16_t; // for tuples
70 
73 
76 
79  using HitToTuple = cms::cuda::OneToManyAssoc<tindex_type, -1, 4 * maxTuples>; // 3.5 should be enough
81 
82  struct OuterHitOfCell {
84  int32_t offset;
85  constexpr auto& operator[](int i) { return container[i - offset]; }
86  constexpr auto const& operator[](int i) const { return container[i - offset]; }
87  };
88 
89 } // namespace caConstants
90 
91 #endif // RecoPixelVertexing_PixelTriplets_plugins_CAConstants_h
constexpr int32_t maxHitsOnTrack
Definition: CAConstants.h:47
constexpr uint32_t first_ladder_bpx4
Definition: CAConstants.h:55
constexpr uint32_t maxNumOfActiveDoublets
Definition: CAConstants.h:41
uint16_t tindex_type
Definition: CAConstants.h:69
uint32_t hindex_type
Definition: CAConstants.h:68
constexpr uint32_t maxNumberOfQuadruplets
Definition: CAConstants.h:42
constexpr uint32_t maxTuples
Definition: CAConstants.h:46
constexpr uint32_t maxNumberOfLayerPairs
Definition: CAConstants.h:44
constexpr uint32_t maxCellTracks
Definition: CAConstants.h:27
constexpr auto & operator[](int i)
Definition: CAConstants.h:85
constexpr uint32_t maxNumberOfLayers
Definition: CAConstants.h:45
constexpr uint32_t max_ladder_bpx4
Definition: CAConstants.h:54
constexpr auto const & operator[](int i) const
Definition: CAConstants.h:86
constexpr float module_length_bpx4
Definition: CAConstants.h:58
constexpr uint32_t maxNumberOfTuples
Definition: CAConstants.h:36
constexpr uint32_t max_ladder_bpx0
Definition: CAConstants.h:50
constexpr float module_length_bpx0
Definition: CAConstants.h:52
constexpr uint32_t maxNumberOfDoublets
Definition: CAConstants.h:37
constexpr float barrel_z_length
Definition: CAConstants.h:60
constexpr uint32_t maxCellNeighbors
Definition: CAConstants.h:26
constexpr uint32_t first_ladder_bpx0
Definition: CAConstants.h:51
constexpr float forward_z_begin
Definition: CAConstants.h:61
constexpr float radius_odd_ladder
Definition: CAConstants.h:57
constexpr float module_tolerance_bpx0
Definition: CAConstants.h:53
constexpr uint32_t maxCellsPerHit
Definition: CAConstants.h:38
constexpr uint32_t last_bpix1_detIndex
Definition: CAConstants.h:64
constexpr uint32_t last_barrel_detIndex
Definition: CAConstants.h:65
constexpr float radius_even_ladder
Definition: CAConstants.h:56
OuterHitOfCellContainer * container
Definition: CAConstants.h:83
constexpr float module_tolerance_bpx4
Definition: CAConstants.h:59