45 cfg.getParameter<
unsigned int>(
"minHitsForSharingCut"),
46 cfg.getParameter<
bool>(
"useRiemannFit"),
47 cfg.getParameter<
bool>(
"fitNas4"),
48 cfg.getParameter<
bool>(
"includeJumpingForwardDoublets"),
49 cfg.getParameter<
bool>(
"earlyFishbone"),
50 cfg.getParameter<
bool>(
"lateFishbone"),
51 cfg.getParameter<
bool>(
"fillStatistics"),
52 cfg.getParameter<
bool>(
"doSharedHitCut"),
53 cfg.getParameter<
bool>(
"dupPassThrough"),
54 cfg.getParameter<
bool>(
"useSimpleTripletCleaner")});
58 template <
typename TrackerTraits,
typename Enable =
void>
59 struct topologyCuts {};
61 template <
typename TrackerTraits>
65 (
float)
cfg.getParameter<
double>(
"ptmin"),
66 (
float)
cfg.getParameter<
double>(
"CAThetaCutBarrel"),
67 (
float)
cfg.getParameter<
double>(
"CAThetaCutForward"),
68 (
float)
cfg.getParameter<
double>(
"hardCurvCut"),
69 (
float)
cfg.getParameter<
double>(
"dcaCutInnerTriplet"),
70 (
float)
cfg.getParameter<
double>(
"dcaCutOuterTriplet")}};
74 auto coeff =
pset.getParameter<std::array<double, 2>>(
"chi2Coeff");
75 auto ptMax =
pset.getParameter<
double>(
"chi2MaxPt");
77 coeff[1] = (coeff[1] - coeff[0]) / log2(
ptMax);
79 {(
float)coeff[0], (
float)coeff[1], 0.f, 0.f},
83 (
float)
pset.getParameter<
double>(
"chi2Scale"),
85 {(
float)
pset.getParameter<
double>(
"tripletMaxTip"),
86 (
float)
pset.getParameter<
double>(
"tripletMinPt"),
87 (
float)
pset.getParameter<
double>(
"tripletMaxZip")},
89 {(
float)
pset.getParameter<
double>(
"quadrupletMaxTip"),
90 (
float)
pset.getParameter<
double>(
"quadrupletMinPt"),
91 (
float)
pset.getParameter<
double>(
"quadrupletMaxZip")}};
95 template <
typename TrackerTraits>
99 (
float)
cfg.getParameter<
double>(
"ptmin"),
100 (
float)
cfg.getParameter<
double>(
"CAThetaCutBarrel"),
101 (
float)
cfg.getParameter<
double>(
"CAThetaCutForward"),
102 (
float)
cfg.getParameter<
double>(
"hardCurvCut"),
103 (
float)
cfg.getParameter<
double>(
"dcaCutInnerTriplet"),
104 (
float)
cfg.getParameter<
double>(
"dcaCutOuterTriplet")},
105 {(
bool)
cfg.getParameter<
bool>(
"includeFarForwards")}};
110 (
float)
pset.getParameter<
double>(
"maxChi2"),
111 (
float)
pset.getParameter<
double>(
"minPt"),
112 (
float)
pset.getParameter<
double>(
"maxTip"),
113 (
float)
pset.getParameter<
double>(
"maxZip"),
121 template <
typename TrakterTraits>
124 cfg.getParameter<
bool>(
"doClusterCut"),
125 cfg.getParameter<
bool>(
"doZ0Cut"),
126 cfg.getParameter<
bool>(
"doPtCut"),
127 cfg.getParameter<
bool>(
"idealConditions")};
134 template <
typename TrackerTraits>
137 : m_params(makeCommonParams(
cfg),
138 makeCellCuts<TrackerTraits>(
cfg),
139 topologyCuts<TrackerTraits>::makeQualityCuts(
cfg.
getParameterSet(
"trackQualityCuts")),
140 topologyCuts<TrackerTraits>::makeCACuts(
cfg)) {
141 #ifdef DUMP_GPU_TK_TUPLES 142 printf(
"TK: %s %s %s %s %s %s %s %s %s %s %s %s %s %s %s %s %s\n",
163 template <
typename TrackerTraits>
165 fillDescriptionsCommon(
desc);
167 <<
"Note: this fillDescriptions is a dummy one. Most probably you are missing some parameters. \n" 168 "please implement your TrackerTraits descriptions in CAHitNtupletGeneratorOnGPU. \n";
173 fillDescriptionsCommon(
desc);
175 desc.add<
bool>(
"idealConditions",
true);
176 desc.add<
bool>(
"includeJumpingForwardDoublets",
false);
179 trackQualityCuts.add<
double>(
"chi2MaxPt", 10.)->setComment(
"max pT used to determine the pT-dependent chi2 cut");
180 trackQualityCuts.add<std::vector<double>>(
"chi2Coeff", {0.9, 1.8})->setComment(
"chi2 at 1GeV and at ptMax above");
183 "Factor to multiply the pT-dependent chi2 cut (currently: 8 for the broken line fit, ?? for the Riemann " 185 trackQualityCuts.add<
double>(
"tripletMinPt", 0.5)->setComment(
"Min pT for triplets, in GeV");
186 trackQualityCuts.add<
double>(
"tripletMaxTip", 0.3)->setComment(
"Max |Tip| for triplets, in cm");
187 trackQualityCuts.add<
double>(
"tripletMaxZip", 12.)->setComment(
"Max |Zip| for triplets, in cm");
188 trackQualityCuts.add<
double>(
"quadrupletMinPt", 0.3)->setComment(
"Min pT for quadruplets, in GeV");
189 trackQualityCuts.add<
double>(
"quadrupletMaxTip", 0.5)->setComment(
"Max |Tip| for quadruplets, in cm");
190 trackQualityCuts.add<
double>(
"quadrupletMaxZip", 12.)->setComment(
"Max |Zip| for quadruplets, in cm");
193 "Quality cuts based on the results of the track fit:\n - apply a pT-dependent chi2 cut;\n - apply \"region " 194 "cuts\" based on the fit results (pT, Tip, Zip).");
199 fillDescriptionsCommon(
desc);
201 desc.add<
bool>(
"idealConditions",
false);
202 desc.add<
bool>(
"includeFarForwards",
true);
203 desc.add<
bool>(
"includeJumpingForwardDoublets",
true);
206 trackQualityCuts.add<
double>(
"maxChi2", 5.)->setComment(
"Max normalized chi2");
209 trackQualityCuts.add<
double>(
"maxZip", 12.)->setComment(
"Max |Zip|, in cm");
212 "Quality cuts based on the results of the track fit:\n - apply cuts based on the fit results (pT, Tip, " 216 template <
typename TrackerTraits>
221 desc.add<
double>(
"ptmin", 0.9f)->setComment(
"Cut on minimum pt");
222 desc.add<
double>(
"CAThetaCutBarrel", 0.002f)->setComment(
"Cut on RZ alignement for Barrel");
223 desc.add<
double>(
"CAThetaCutForward", 0.003f)->setComment(
"Cut on RZ alignment for Forward");
224 desc.add<
double>(
"hardCurvCut", 1.f / (0.35 * 87.f))->setComment(
"Cut on minimum curvature");
225 desc.add<
double>(
"dcaCutInnerTriplet", 0.15f)->setComment(
"Cut on origin radius when the inner hit is on BPix1");
226 desc.add<
double>(
"dcaCutOuterTriplet", 0.25f)->setComment(
"Cut on origin radius when the outer hit is on BPix1");
227 desc.add<
bool>(
"earlyFishbone",
true);
228 desc.add<
bool>(
"lateFishbone",
false);
229 desc.add<
bool>(
"fillStatistics",
false);
230 desc.add<
unsigned int>(
"minHitsPerNtuplet", 4);
232 desc.add<
unsigned int>(
"minHitsForSharingCut", 10)
233 ->setComment(
"Maximum number of hits in a tuple to clean also if the shared hit is on bpx1");
235 desc.add<
bool>(
"fitNas4",
false)->setComment(
"fit only 4 hits out of N");
236 desc.add<
bool>(
"doClusterCut",
true);
237 desc.add<
bool>(
"doZ0Cut",
true);
238 desc.add<
bool>(
"doPtCut",
true);
239 desc.add<
bool>(
"useRiemannFit",
false)->setComment(
"true for Riemann, false for BrokenLine");
240 desc.add<
bool>(
"doSharedHitCut",
true)->setComment(
"Sharing hit nTuples cleaning");
241 desc.add<
bool>(
"dupPassThrough",
false)->setComment(
"Do not reject duplicate");
242 desc.add<
bool>(
"useSimpleTripletCleaner",
true)->setComment(
"use alternate implementation");
245 template <
typename TrackerTraits>
247 if (m_params.onGPU_) {
256 memset(m_counters, 0,
sizeof(
Counters));
260 template <
typename TrackerTraits>
262 if (m_params.onGPU_) {
266 if (m_params.doStats_) {
270 cudaFree(m_counters);
273 if (m_params.doStats_) {
280 template <
typename TrackerTraits>
289 GPUKernels kernels(m_params);
290 kernels.setCounters(m_counters);
299 if (m_params.useRiemannFit_) {
306 cudaDeviceSynchronize();
308 std::cout <<
"finished building pixel tracks on GPU" << std::endl;
314 template <
typename TrackerTraits>
316 float bfield)
const {
323 CPUKernels kernels(m_params);
324 kernels.setCounters(m_counters);
325 kernels.allocateOnGPU(hits_h.
nHits(),
nullptr);
328 kernels.launchKernels(hits_h.
view(),
tracks.view(),
nullptr);
330 if (0 == hits_h.
nHits())
337 if (m_params.useRiemannFit_) {
343 kernels.classifyTuples(hits_h.
view(),
tracks.view(),
nullptr);
346 std::cout <<
"finished building pixel tracks on CPU" << std::endl;
static void fillDescriptionsCommon(edm::ParameterSetDescription &desc)
static void printCounters(Counters const *counters)
TrackSoAHost makeTuples(HitsOnHost const &hits_d, float bfield) const
CAHitNtupletGeneratorOnGPU(const edm::ParameterSet &cfg, edm::ConsumesCollector &&iC)
typename std::enable_if< std::is_base_of< Phase2, T >::value >::type isPhase2Topology
caHitNtupletGenerator::Counters Counters
static void fillDescriptions(edm::ParameterSetDescription &desc)
uint32_t T const *__restrict__ uint32_t const *__restrict__ int32_t int Histo::index_type cudaStream_t stream
uint32_t offsetBPIX2() const
void launchRiemannKernelsOnCPU(const HitConstView &hv, uint32_t nhits, uint32_t maxNumberOfTuples)
TrackSoADevice makeTuplesAsync(HitsOnDevice const &hits_d, float bfield, cudaStream_t stream) const
void launchRiemannKernels(const HitConstView &hv, uint32_t nhits, uint32_t maxNumberOfTuples, cudaStream_t cudaStream)
typename std::enable_if< std::is_base_of< Phase1, T >::value >::type isPhase1Topology
void launchBrokenLineKernelsOnCPU(const HitConstView &hv, uint32_t nhits, uint32_t maxNumberOfTuples)
void allocateOnGPU(TupleMultiplicity const *tupleMultiplicity, OutputSoAView &helix_fit_results)
ParameterSet const & getParameterSet(ParameterSetID const &id)
Square< F >::type sqr(const F &f)
#define cudaCheck(ARG,...)
Log< level::Warning, false > LogWarning
uint32_t offsetBPIX2() const
void launchBrokenLineKernels(const HitConstView &hv, uint32_t nhits, uint32_t maxNumberOfTuples, cudaStream_t cudaStream)
static void printCounters(Counters const *counters)