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
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):
14
rankers_
(rankers) {}
15
// Predicate to compare a and b
16
bool
operator()
(
const
Type
&
a
,
const
Type
&
b
)
const
{
17
typename
RankingList::const_iterator ranker =
rankers_
.begin();
18
while
(ranker !=
rankers_
.end()) {
19
double
aResult = (*ranker)(
a
);
20
double
bResult = (*ranker)(
b
);
21
if
(aResult != bResult)
22
return
(aResult < bResult);
23
++ranker;
24
}
25
// If all aare equal return false
26
return
false
;
27
}
28
private
:
29
const
RankingList&
rankers_
;
30
};
31
32
template
<
typename
Container,
class
OverlapFunction>
33
Container
cleanOverlaps
(
const
Container
& dirty) {
34
typedef
typename
Container::const_iterator
Iterator
;
35
// Output container of clean objects
36
Container
clean
;
37
OverlapFunction overlapChecker;
38
for
(Iterator candidate = dirty.begin(); candidate != dirty.end();
39
++candidate) {
40
// Check if this overlaps with a pizero already in the clean list
41
bool
overlaps
=
false
;
42
for
(Iterator cleaned = clean.begin();
43
cleaned != clean.end() && !
overlaps
; ++cleaned) {
44
overlaps = overlapChecker(*candidate, *cleaned);
45
}
46
// If it didn't overlap with anything clean, add it to the clean list
47
if
(!overlaps)
48
clean.insert(clean.end(), *candidate);
49
}
50
return
clean
;
51
}
52
53
template
<
typename
T>
54
class
SortByDescendingPt
{
55
public
:
56
bool
operator()
(
const
T
&
a
,
const
T
&
b
)
const
{
57
return
a.pt() > b.pt();
58
}
59
};
60
61
}
// end reco::tau namespace
62
63
#endif
reco::tau::SortByDescendingPt::operator()
bool operator()(const T &a, const T &b) const
Definition:
RecoTauCleaningTools.h:56
reco::tau::RecoTauLexicographicalRanking::rankers_
const RankingList & rankers_
Definition:
RecoTauCleaningTools.h:29
reco::tau::RecoTauLexicographicalRanking
Definition:
RecoTauCleaningTools.h:9
susybsm::HSCParticleType::Type
Type
Definition:
HSCParticle.h:20
analyzePatCleaning_cfg.overlaps
overlaps
Definition:
analyzePatCleaning_cfg.py:9
cms::Iterator
TGeoIterator Iterator
Definition:
DDFilteredView.h:36
reco::tau::RecoTauLexicographicalRanking::RecoTauLexicographicalRanking
RecoTauLexicographicalRanking(const RankingList &rankers)
Definition:
RecoTauCleaningTools.h:13
reco::tau::RecoTauLexicographicalRanking::operator()
bool operator()(const Type &a, const Type &b) const
Definition:
RecoTauCleaningTools.h:16
clean
std::vector< T * > clean
Definition:
MVATrainer.cc:154
reco::tau::SortByDescendingPt
Definition:
RecoTauCleaningTools.h:54
b
double b
Definition:
hdecay.h:120
a
double a
Definition:
hdecay.h:121
reco::tau
Definition:
PFRecoTauChargedHadron.h:10
reco::tau::cleanOverlaps
Container cleanOverlaps(const Container &dirty)
Definition:
RecoTauCleaningTools.h:33
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