Main Page
Namespaces
Classes
Package Documentation
All
Classes
Namespaces
Files
Functions
Variables
Typedefs
Enumerations
Enumerator
Properties
Friends
Macros
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 {
class
EventSetup
; }
10
11
template
<
typename
C,
typename
T,
typename
O>
12
class
OverlapExclusionSelector
{
13
public
:
14
OverlapExclusionSelector
(
const
edm::ParameterSet
& cfg,
edm::ConsumesCollector
&& iC) :
15
OverlapExclusionSelector
(cfg, iC) {};
16
OverlapExclusionSelector
(
const
edm::ParameterSet
& cfg,
edm::ConsumesCollector
& iC);
17
void
newEvent
(
const
edm::Event
&,
const
edm::EventSetup
&)
const
;
18
bool
operator()
(
const
T
&)
const
;
19
private
:
20
edm::EDGetTokenT<C>
srcToken_
;
21
mutable
typename
C::const_iterator
begin_
,
end_
;
22
O
overlap_
;
23
};
24
25
template
<
typename
C,
typename
T,
typename
O>
26
OverlapExclusionSelector<C, T, O>::OverlapExclusionSelector
(
const
edm::ParameterSet
& cfg,
edm::ConsumesCollector
& iC) :
27
srcToken_(iC.consumes<
C
>(cfg.
template
getParameter<edm::InputTag>(
"overlap"
))),
28
overlap_(cfg) {
29
}
30
31
template
<
typename
C,
typename
T,
typename
O>
32
void
OverlapExclusionSelector<C, T, O>::newEvent
(
const
edm::Event
& evt,
const
edm::EventSetup
&)
const
{
33
edm::Handle<C>
h
;
34
evt.
getByToken
(srcToken_, h);
35
begin_ = h->begin();
36
end_ = h->end();
37
}
38
39
template
<
typename
C,
typename
T,
typename
O>
40
bool
OverlapExclusionSelector<C, T, O>::operator()
(
const
T
&
t
)
const
{
41
bool
noOverlap =
true
;
42
for
(
typename
C::const_iterator
i
= begin_;
i
!= end_; ++
i
) {
43
if
(overlap_(*
i
, t)) {
44
noOverlap =
false
;
45
break
;
46
}
47
}
48
return
noOverlap;
49
}
50
51
#include "
CommonTools/UtilAlgos/interface/EventSetupInitTrait.h
"
52
53
EVENTSETUP_STD_INIT_T3
(
OverlapExclusionSelector
);
54
55
#endif
i
int i
Definition:
DBlmapReader.cc:9
OverlapExclusionSelector::operator()
bool operator()(const T &) const
Definition:
OverlapExclusionSelector.h:40
edm::Event::getByToken
bool getByToken(EDGetToken token, Handle< PROD > &result) const
Definition:
Event.h:434
Event.h
OverlapExclusionSelector
Definition:
OverlapExclusionSelector.h:12
funct::C
C
Definition:
Factorize.h:141
Handle.h
edm::Handle
Definition:
AssociativeIterator.h:47
edm::EDGetTokenT< C >
OverlapExclusionSelector::srcToken_
edm::EDGetTokenT< C > srcToken_
Definition:
OverlapExclusionSelector.h:20
ParameterSet.h
OverlapExclusionSelector::newEvent
void newEvent(const edm::Event &, const edm::EventSetup &) const
Definition:
OverlapExclusionSelector.h:32
EVENTSETUP_STD_INIT_T3
#define EVENTSETUP_STD_INIT_T3(SELECTOR)
Definition:
EventSetupInitTrait.h:136
OverlapExclusionSelector::end_
C::const_iterator end_
Definition:
OverlapExclusionSelector.h:21
EventSetup
edmStreamStallGrapher.t
tuple t
Definition:
edmStreamStallGrapher.py:108
OverlapExclusionSelector::begin_
C::const_iterator begin_
Definition:
OverlapExclusionSelector.h:21
h
The Signals That Services Can Subscribe To This is based on ActivityRegistry h
Helper function to determine trigger accepts.
Definition:
Activities.doc:4
edm::EventSetup
Definition:
EventSetup.h:44
InputTag.h
edm::ParameterSet
Definition:
ParameterSet.h:35
OverlapExclusionSelector::OverlapExclusionSelector
OverlapExclusionSelector(const edm::ParameterSet &cfg, edm::ConsumesCollector &&iC)
Definition:
OverlapExclusionSelector.h:14
edm::Event
Definition:
Event.h:62
T
long double T
Definition:
Basic3DVectorLD.h:57
ConsumesCollector.h
OverlapExclusionSelector::overlap_
O overlap_
Definition:
OverlapExclusionSelector.h:22
EventSetupInitTrait.h
svgfig.template
def template
Definition:
svgfig.py:520
edm::ConsumesCollector
Definition:
ConsumesCollector.h:32
Generated for CMSSW Reference Manual by
1.8.5