Main Page
Namespaces
Classes
Package Documentation
All
Classes
Namespaces
Files
Functions
Variables
Typedefs
Enumerations
Enumerator
Properties
Friends
Macros
Groups
Pages
RecoTauTag
RecoTau
interface
RecoTauCleaningTools.h
Go to the documentation of this file.
1
#ifndef RecoTauTag_RecoTau_RecoTauCleaningTools_h
2
#define RecoTauTag_RecoTau_RecoTauCleaningTools_h
3
4
#include <algorithm>
5
6
namespace
reco::tau
{
7
8
template
<
typename
RankingList,
typename
Type>
9
class
RecoTauLexicographicalRanking
{
10
public
:
11
// Store our list of ranking functions and intialize the vectors
12
// that hold the comparison result
13
explicit
RecoTauLexicographicalRanking
(
const
RankingList& rankers) :
rankers_
(rankers) {}
14
// Predicate to compare a and b
15
bool
operator()
(
const
Type
&
a
,
const
Type
&
b
)
const
{
16
for
(
auto
const
& ranker :
rankers_
) {
17
double
aResult = (*ranker)(
a
);
18
double
bResult = (*ranker)(
b
);
19
if
(aResult != bResult)
20
return
(aResult < bResult);
21
}
22
// If all aare equal return false
23
return
false
;
24
}
25
26
private
:
27
const
RankingList&
rankers_
;
28
};
29
30
template
<
typename
Container,
class
OverlapFunction>
31
Container
cleanOverlaps
(
const
Container
& dirty) {
32
// Output container of clean objects
33
Container
clean
;
34
OverlapFunction overlapChecker;
35
for
(
auto
const
& candidate : dirty) {
36
// Check if this overlaps with a pizero already in the clean list
37
bool
overlaps
=
false
;
38
for
(
auto
cleaned = clean.begin(); cleaned != clean.end() && !
overlaps
; ++cleaned) {
39
overlaps = overlapChecker(candidate, *cleaned);
40
}
41
// If it didn't overlap with anything clean, add it to the clean list
42
if
(!overlaps)
43
clean.insert(clean.end(), candidate);
44
}
45
return
clean
;
46
}
47
48
}
// namespace reco::tau
49
50
#endif
reco::tau::RecoTauLexicographicalRanking::rankers_
const RankingList & rankers_
Definition:
RecoTauCleaningTools.h:27
reco::tau::RecoTauLexicographicalRanking
Definition:
RecoTauCleaningTools.h:9
susybsm::HSCParticleType::Type
Type
Definition:
HSCParticle.h:20
clean
static void clean(char *s)
Definition:
ConnectionManager.cc:13
reco::tau::RecoTauLexicographicalRanking::RecoTauLexicographicalRanking
RecoTauLexicographicalRanking(const RankingList &rankers)
Definition:
RecoTauCleaningTools.h:13
metsig::tau
Definition:
SignAlgoResolutions.h:49
reco::tau::RecoTauLexicographicalRanking::operator()
bool operator()(const Type &a, const Type &b) const
Definition:
RecoTauCleaningTools.h:15
b
double b
Definition:
hdecay.h:118
a
double a
Definition:
hdecay.h:119
analyzePatCleaning_cfg.overlaps
tuple overlaps
Definition:
analyzePatCleaning_cfg.py:9
reco::tau::cleanOverlaps
Container cleanOverlaps(const Container &dirty)
Definition:
RecoTauCleaningTools.h:31
reco::JetExtendedAssociation::Container
edm::AssociationVector< reco::JetRefBaseProd, Values > Container
Definition:
JetExtendedAssociation.h:29
Generated for CMSSW Reference Manual by
1.8.5