CommonTools
UtilAlgos
interface
OverlapExclusionSelector.h
Go to the documentation of this file.
1
#ifndef CommonTools_UtilAlgos_OverlapExclusionSelector_h
2
#define CommonTools_UtilAlgos_OverlapExclusionSelector_h
3
#include "
FWCore/ParameterSet/interface/ParameterSet.h
"
4
#include "
FWCore/Utilities/interface/InputTag.h
"
5
#include "
FWCore/Framework/interface/Event.h
"
6
#include "
FWCore/Framework/interface/ConsumesCollector.h
"
7
#include "
DataFormats/Common/interface/Handle.h
"
8
9
namespace
edm
{
10
class
EventSetup
;
11
}
12
13
template
<
typename
C,
typename
T,
typename
O>
14
class
OverlapExclusionSelector
{
15
public
:
16
OverlapExclusionSelector
(
const
edm::ParameterSet
&
cfg
,
edm::ConsumesCollector
&& iC)
17
:
OverlapExclusionSelector
(
cfg
, iC){};
18
OverlapExclusionSelector
(
const
edm::ParameterSet
&
cfg
,
edm::ConsumesCollector
& iC);
19
void
newEvent
(
const
edm::Event
&,
const
edm::EventSetup
&)
const
;
20
bool
operator()
(
const
T
&)
const
;
21
22
private
:
23
edm::EDGetTokenT<C>
srcToken_
;
24
mutable
typename
C::const_iterator
begin_
,
end_
;
25
O
overlap_
;
26
};
27
28
template
<
typename
C,
typename
T,
typename
O>
29
OverlapExclusionSelector<C, T, O>::OverlapExclusionSelector
(
const
edm::ParameterSet
&
cfg
,
edm::ConsumesCollector
& iC)
30
: srcToken_(iC.consumes<
C
>(
cfg
.
template
getParameter<
edm
::
InputTag
>(
"overlap"
))), overlap_(
cfg
) {}
31
32
template
<
typename
C,
typename
T,
typename
O>
33
void
OverlapExclusionSelector<C, T, O>::newEvent
(
const
edm::Event
& evt,
const
edm::EventSetup
&)
const
{
34
edm::Handle<C>
h
;
35
evt.
getByToken
(srcToken_,
h
);
36
begin_ =
h
->begin();
37
end_ =
h
->end();
38
}
39
40
template
<
typename
C,
typename
T,
typename
O>
41
bool
OverlapExclusionSelector<C, T, O>::operator()
(
const
T
&
t
)
const
{
42
bool
noOverlap =
true
;
43
for
(
typename
C::const_iterator
i
= begin_;
i
!= end_; ++
i
) {
44
if
(overlap_(*
i
,
t
)) {
45
noOverlap =
false
;
46
break
;
47
}
48
}
49
return
noOverlap;
50
}
51
52
#include "
CommonTools/UtilAlgos/interface/EventSetupInitTrait.h
"
53
54
EVENTSETUP_STD_INIT_T3
(
OverlapExclusionSelector
);
55
56
#endif
Handle.h
mps_fire.i
i
Definition:
mps_fire.py:355
OverlapExclusionSelector
Definition:
OverlapExclusionSelector.h:14
edm::EDGetTokenT< C >
edm
HLT enums.
Definition:
AlignableModifier.h:19
h
FWCore Framework interface EventSetupRecordImplementation h
Helper function to determine trigger accepts.
Definition:
L1TUtmAlgorithmRcd.h:4
OverlapExclusionSelector::operator()
bool operator()(const T &) const
Definition:
OverlapExclusionSelector.h:41
OverlapExclusionSelector::newEvent
void newEvent(const edm::Event &, const edm::EventSetup &) const
Definition:
OverlapExclusionSelector.h:33
EventSetupInitTrait.h
edm::Handle
Definition:
AssociativeIterator.h:50
EVENTSETUP_STD_INIT_T3
#define EVENTSETUP_STD_INIT_T3(SELECTOR)
Definition:
EventSetupInitTrait.h:136
OverlapExclusionSelector::srcToken_
edm::EDGetTokenT< C > srcToken_
Definition:
OverlapExclusionSelector.h:23
edm::Event::getByToken
bool getByToken(EDGetToken token, Handle< PROD > &result) const
Definition:
Event.h:528
h
OrderedSet.t
t
Definition:
OrderedSet.py:90
HLT_2018_cff.InputTag
InputTag
Definition:
HLT_2018_cff.py:79016
edm::ParameterSet
Definition:
ParameterSet.h:36
Event.h
OverlapExclusionSelector::overlap_
O overlap_
Definition:
OverlapExclusionSelector.h:25
edm::EventSetup
Definition:
EventSetup.h:57
svgfig.template
def template(fileName, svg, replaceme="REPLACEME")
Definition:
svgfig.py:521
InputTag.h
looper.cfg
cfg
Definition:
looper.py:297
gen::C
C
Definition:
PomwigHadronizer.cc:76
T
long double T
Definition:
Basic3DVectorLD.h:48
OverlapExclusionSelector::begin_
C::const_iterator begin_
Definition:
OverlapExclusionSelector.h:24
OverlapExclusionSelector::end_
C::const_iterator end_
Definition:
OverlapExclusionSelector.h:24
ConsumesCollector.h
EventSetup
ParameterSet.h
OverlapExclusionSelector::OverlapExclusionSelector
OverlapExclusionSelector(const edm::ParameterSet &cfg, edm::ConsumesCollector &&iC)
Definition:
OverlapExclusionSelector.h:16
edm::Event
Definition:
Event.h:73
edm::ConsumesCollector
Definition:
ConsumesCollector.h:39
Generated for CMSSW Reference Manual by
1.8.16