Main Page
Namespaces
Classes
Package Documentation
All
Classes
Namespaces
Files
Functions
Variables
Typedefs
Enumerations
Enumerator
Properties
Friends
Macros
Groups
Pages
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
looper.cfg
tuple cfg
Definition:
looper.py:296
mps_fire.i
i
Definition:
mps_fire.py:428
OverlapExclusionSelector::operator()
bool operator()(const T &) const
Definition:
OverlapExclusionSelector.h:41
submitPVValidationJobs.t
string t
Definition:
submitPVValidationJobs.py:644
edm::Event::getByToken
bool getByToken(EDGetToken token, Handle< PROD > &result) const
Definition:
Event.h:539
Event.h
edm::Handle
Definition:
AssociativeIterator.h:50
OverlapExclusionSelector
Definition:
OverlapExclusionSelector.h:14
edm::EDGetTokenT< C >
OverlapExclusionSelector::srcToken_
edm::EDGetTokenT< C > srcToken_
Definition:
OverlapExclusionSelector.h:23
ParameterSet.h
OverlapExclusionSelector::newEvent
void newEvent(const edm::Event &, const edm::EventSetup &) const
Definition:
OverlapExclusionSelector.h:33
EVENTSETUP_STD_INIT_T3
#define EVENTSETUP_STD_INIT_T3(SELECTOR)
Definition:
EventSetupInitTrait.h:136
OverlapExclusionSelector::end_
C::const_iterator end_
Definition:
OverlapExclusionSelector.h:24
EventSetup
OverlapExclusionSelector::begin_
C::const_iterator begin_
Definition:
OverlapExclusionSelector.h:24
edm::EventSetup
Definition:
EventSetup.h:59
HLT_FULL_cff.InputTag
tuple InputTag
Definition:
HLT_FULL_cff.py:86956
gen::C
C
Definition:
Factorize.h:133
InputTag.h
edm::ParameterSet
Definition:
ParameterSet.h:47
OverlapExclusionSelector::OverlapExclusionSelector
OverlapExclusionSelector(const edm::ParameterSet &cfg, edm::ConsumesCollector &&iC)
Definition:
OverlapExclusionSelector.h:16
edm::Event
Definition:
Event.h:73
h
The Signals That Services Can Subscribe To This is based on ActivityRegistry h
Helper function to determine trigger accepts.
Definition:
Activities.doc:4
T
long double T
Definition:
Basic3DVectorLD.h:48
ConsumesCollector.h
OverlapExclusionSelector::overlap_
O overlap_
Definition:
OverlapExclusionSelector.h:25
EventSetupInitTrait.h
svgfig.template
def template
Definition:
svgfig.py:521
edm::ConsumesCollector
Definition:
ConsumesCollector.h:45
Handle.h
Generated for CMSSW Reference Manual by
1.8.5