src
TrackingTools
TrajectoryCleaning
src
FastTrajectoryCleaner.cc
Go to the documentation of this file.
1
#include "
TrackingTools/TrajectoryCleaning/interface/FastTrajectoryCleaner.h
"
2
void
FastTrajectoryCleaner::clean
(
TrajectoryPointerContainer
& tc)
const
{
3
edm::LogError
(
"FastTrajectoryCleaner"
) <<
"not implemented for Trajectory"
;
4
assert
(
false
);
5
}
6
7
void
FastTrajectoryCleaner::clean
(
TempTrajectoryContainer
& tc)
const
{
8
if
(tc.size() <= 1)
9
return
;
// nothing to clean
10
float
maxScore
= -
std::numeric_limits<float>::max
();
11
TempTrajectory
* bestTr =
nullptr
;
12
for
(
auto
&
it
: tc) {
13
if
(!
it
.isValid())
14
continue
;
15
auto
const
& pd =
it
.measurements();
16
// count active degree of freedom
17
int
dof
= 0;
18
for
(
auto
const
& im : pd) {
19
if
(
dismissSeed_
& (im.estimate() == 0))
20
continue
;
21
auto
const
&
h
= im.recHitR();
22
if
(!
h
.isValid())
23
continue
;
24
dof
+=
h
.dimension();
25
}
26
float
score
=
validHitBonus_
*
float
(
dof
) -
missingHitPenalty_
*
it
.lostHits() -
it
.chiSquared();
27
if
(
it
.lastMeasurement().updatedState().globalMomentum().perp2() < 0.81f)
28
score
-= 0.5
f
*
validHitBonus_
*
float
(
dof
);
29
else
if
(
it
.dPhiCacheForLoopersReconstruction() == 0 &&
it
.foundHits() > 8)
30
score
+=
validHitBonus_
*
float
(
dof
);
// extra bonus for long tracks
31
if
(
score
>=
maxScore
) {
32
bestTr = &
it
;
33
maxScore
=
score
;
34
}
35
}
36
37
for
(
auto
&
it
: tc) {
38
if
((&
it
) != bestTr)
39
it
.invalidate();
40
}
41
}
42
43
/*
44
auto score = [&](Trajectory const&t)->float {
45
// possible variant under study
46
// auto ns = t.foundHits()-t.trailingFoundHits();
47
//auto penalty = 0.8f*missingHitPenalty_;
48
// return validHitBonus_*(t.foundHits()-0.2f*t.cccBadHits()) - penalty*t.lostHits() - t.chiSquared();
49
// classical score
50
return validHitBonus_*t.foundHits() - missingHitPenalty_*t.lostHits() - t.chiSquared();
51
};
52
*/
offlineSlimmedPrimaryVertices_cfi.score
score
Definition:
offlineSlimmedPrimaryVertices_cfi.py:6
edm::LogError
Log< level::Error, false > LogError
Definition:
MessageLogger.h:129
cms::cuda::assert
assert(be >=bs)
FastTrajectoryCleaner::TempTrajectoryContainer
TrajectoryCleaner::TempTrajectoryContainer TempTrajectoryContainer
Definition:
FastTrajectoryCleaner.h:17
FastTrajectoryCleaner::missingHitPenalty_
float missingHitPenalty_
Definition:
FastTrajectoryCleaner.h:36
nano_mu_digi_cff.float
float
Definition:
nano_mu_digi_cff.py:14
FastTrajectoryCleaner::validHitBonus_
float validHitBonus_
Definition:
FastTrajectoryCleaner.h:35
f
double f[11][100]
Definition:
MuScleFitUtils.cc:78
SiStripPI::max
Definition:
SiStripPayloadInspectorHelper.h:178
FastTrajectoryCleaner::dismissSeed_
bool dismissSeed_
Definition:
FastTrajectoryCleaner.h:37
FastTrajectoryCleaner.h
ALPAKA_ACCELERATOR_NAMESPACE::vertexFinder::it
auto & it
Definition:
splitVertices.h:28
TempTrajectory
Definition:
TempTrajectory.h:40
FastTrajectoryCleaner::TrajectoryPointerContainer
TrajectoryCleaner::TrajectoryPointerContainer TrajectoryPointerContainer
Definition:
FastTrajectoryCleaner.h:16
h
The Signals That Services Can Subscribe To This is based on ActivityRegistry h
Helper function to determine trigger accepts.
Definition:
Activities.doc:4
ALPAKA_ACCELERATOR_NAMESPACE::caHitNtupletGeneratorKernels::maxScore
constexpr float maxScore
Definition:
CAHitNtupletGeneratorKernelsImpl.h:34
FastTrajectoryCleaner::clean
void clean(TempTrajectoryContainer &) const override
Definition:
FastTrajectoryCleaner.cc:7
DOFs::dof
dof
Definition:
AlignPCLThresholdsWriter.cc:39
Generated for CMSSW Reference Manual by
1.8.14