Main Page
Namespaces
Classes
Package Documentation
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
#include <functional>
6
7
namespace
reco
{
namespace
tau
{
8
9
template
<
typename
RankingList,
typename
Type>
10
class
RecoTauLexicographicalRanking
:
11
public
std::binary_function<Type, Type, bool> {
12
public
:
13
// Store our list of ranking functions and intialize the vectors
14
// that hold the comparison result
15
explicit
RecoTauLexicographicalRanking
(
const
RankingList& rankers):
16
rankers_
(rankers) {}
17
// Predicate to compare a and b
18
bool
operator()
(
const
Type
&
a
,
const
Type
&
b
)
const
{
19
typename
RankingList::const_iterator ranker =
rankers_
.begin();
20
while
(ranker !=
rankers_
.end()) {
21
double
aResult = (*ranker)(
a
);
22
double
bResult = (*ranker)(
b
);
23
if
(aResult != bResult)
24
return
(aResult < bResult);
25
++ranker;
26
}
27
// If all aare equal return false
28
return
false
;
29
}
30
private
:
31
const
RankingList&
rankers_
;
32
};
33
34
template
<
typename
Container,
class
OverlapFunction>
35
Container
cleanOverlaps
(
const
Container
& dirty) {
36
typedef
typename
Container::const_iterator
Iterator
;
37
// Output container of clean objects
38
Container
clean
;
39
OverlapFunction overlapChecker;
40
for
(Iterator candidate = dirty.begin(); candidate != dirty.end();
41
++candidate) {
42
// Check if this overlaps with a pizero already in the clean list
43
bool
overlaps
=
false
;
44
for
(Iterator cleaned = clean.begin();
45
cleaned != clean.end() && !
overlaps
; ++cleaned) {
46
overlaps = overlapChecker(*candidate, *cleaned);
47
}
48
// If it didn't overlap with anything clean, add it to the clean list
49
if
(!overlaps)
50
clean.insert(clean.end(), *candidate);
51
}
52
return
clean
;
53
}
54
55
template
<
typename
T>
56
class
SortByDescendingPt
{
57
public
:
58
bool
operator()
(
const
T
&
a
,
const
T
&
b
)
const
{
59
return
a.pt() > b.pt();
60
}
61
};
62
63
}}
// end reco::tau namespace
64
65
#endif
reco::tau::SortByDescendingPt::operator()
bool operator()(const T &a, const T &b) const
Definition:
RecoTauCleaningTools.h:58
reco::tau::RecoTauLexicographicalRanking::rankers_
const RankingList & rankers_
Definition:
RecoTauCleaningTools.h:31
reco::tau::RecoTauLexicographicalRanking
Definition:
RecoTauCleaningTools.h:10
susybsm::HSCParticleType::Type
Type
Definition:
HSCParticle.h:20
analyzePatCleaning_cfg.overlaps
overlaps
Definition:
analyzePatCleaning_cfg.py:9
reco::tau::RecoTauLexicographicalRanking::RecoTauLexicographicalRanking
RecoTauLexicographicalRanking(const RankingList &rankers)
Definition:
RecoTauCleaningTools.h:15
metsig::tau
Definition:
SignAlgoResolutions.h:40
reco::tau::RecoTauLexicographicalRanking::operator()
bool operator()(const Type &a, const Type &b) const
Definition:
RecoTauCleaningTools.h:18
clean
std::vector< T * > clean
Definition:
MVATrainer.cc:156
reco::tau::SortByDescendingPt
Definition:
RecoTauCleaningTools.h:56
Iterator
Definition:
DQMStoreStats.h:74
b
double b
Definition:
hdecay.h:120
reco
fixed size matrix
Definition:
AlignmentAlgorithmBase.h:43
a
double a
Definition:
hdecay.h:121
reco::tau::cleanOverlaps
Container cleanOverlaps(const Container &dirty)
Definition:
RecoTauCleaningTools.h:35
T
long double T
Definition:
Basic3DVectorLD.h:66
reco::JetExtendedAssociation::Container
edm::AssociationVector< reco::JetRefBaseProd, Values > Container
Definition:
JetExtendedAssociation.h:29
Generated for CMSSW Reference Manual by
1.8.11