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
typename
RankingList::const_iterator ranker =
rankers_
.begin();
17
while
(ranker !=
rankers_
.end()) {
18
double
aResult = (*ranker)(
a
);
19
double
bResult = (*ranker)(
b
);
20
if
(aResult != bResult)
21
return
(aResult < bResult);
22
++ranker;
23
}
24
// If all aare equal return false
25
return
false
;
26
}
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(); ++candidate) {
39
// Check if this overlaps with a pizero already in the clean list
40
bool
overlaps
=
false
;
41
for
(
Iterator
cleaned =
clean
.begin(); cleaned !=
clean
.end() && !
overlaps
; ++cleaned) {
42
overlaps
= overlapChecker(*candidate, *cleaned);
43
}
44
// If it didn't overlap with anything clean, add it to the clean list
45
if
(!
overlaps
)
46
clean
.insert(
clean
.end(), *candidate);
47
}
48
return
clean
;
49
}
50
51
template
<
typename
T>
52
class
SortByDescendingPt
{
53
public
:
54
bool
operator()
(
const
T
&
a
,
const
T
&
b
)
const
{
return
a
.pt() >
b
.pt(); }
55
};
56
57
}
// namespace reco::tau
58
59
#endif
Iterator
Definition:
DQMStoreStats.h:94
reco::JetExtendedAssociation::Container
edm::AssociationVector< reco::JetRefBaseProd, Values > Container
Definition:
JetExtendedAssociation.h:29
cms::Iterator
TGeoIterator Iterator
Definition:
DDFilteredView.h:49
reco::tau::cleanOverlaps
Container cleanOverlaps(const Container &dirty)
Definition:
RecoTauCleaningTools.h:33
susybsm::HSCParticleType::Type
Type
Definition:
HSCParticle.h:20
reco::tau::RecoTauLexicographicalRanking::operator()
bool operator()(const Type &a, const Type &b) const
Definition:
RecoTauCleaningTools.h:15
b
double b
Definition:
hdecay.h:118
reco::tau::RecoTauLexicographicalRanking::RecoTauLexicographicalRanking
RecoTauLexicographicalRanking(const RankingList &rankers)
Definition:
RecoTauCleaningTools.h:13
analyzePatCleaning_cfg.overlaps
overlaps
Definition:
analyzePatCleaning_cfg.py:9
a
double a
Definition:
hdecay.h:119
reco::tau::RecoTauLexicographicalRanking
Definition:
RecoTauCleaningTools.h:9
reco::tau::SortByDescendingPt::operator()
bool operator()(const T &a, const T &b) const
Definition:
RecoTauCleaningTools.h:54
T
long double T
Definition:
Basic3DVectorLD.h:48
reco::tau::SortByDescendingPt
Definition:
RecoTauCleaningTools.h:52
clean
static void clean(char *s)
Definition:
ConnectionManager.cc:13
reco::tau
Definition:
PFRecoTauChargedHadron.h:11
reco::tau::RecoTauLexicographicalRanking::rankers_
const RankingList & rankers_
Definition:
RecoTauCleaningTools.h:29
Generated for CMSSW Reference Manual by
1.8.16