RecoTracker
TkSeedGenerator
plugins
ClusterCheckerEDProducer.cc
Go to the documentation of this file.
1
#include "
FWCore/Framework/interface/stream/EDProducer.h
"
2
#include "
FWCore/Framework/interface/Event.h
"
3
#include "
FWCore/ParameterSet/interface/ParameterSet.h
"
4
#include "
FWCore/ParameterSet/interface/ConfigurationDescriptions.h
"
5
#include "
FWCore/ParameterSet/interface/ParameterSetDescription.h
"
6
7
#include "
RecoTracker/TkSeedGenerator/interface/ClusterChecker.h
"
8
9
class
ClusterCheckerEDProducer
:
public
edm::stream::EDProducer
<> {
10
public
:
11
ClusterCheckerEDProducer
(
const
edm::ParameterSet
& iConfig);
12
~ClusterCheckerEDProducer
()
override
=
default
;
13
14
static
void
fillDescriptions
(
edm::ConfigurationDescriptions
& descriptions);
15
16
void
produce
(
edm::Event
&
iEvent
,
const
edm::EventSetup
& iSetup)
override
;
17
18
private
:
19
ClusterChecker
theClusterCheck
;
20
bool
theSilentOnClusterCheck
;
21
};
22
23
ClusterCheckerEDProducer::ClusterCheckerEDProducer
(
const
edm::ParameterSet
& iConfig)
24
: theClusterCheck(iConfig, consumesCollector()),
25
theSilentOnClusterCheck(iConfig.getUntrackedParameter<
bool
>(
"silentClusterCheck"
)) {
26
produces<bool>();
27
}
28
29
void
ClusterCheckerEDProducer::fillDescriptions
(
edm::ConfigurationDescriptions
& descriptions) {
30
edm::ParameterSetDescription
desc
;
31
ClusterChecker::fillDescriptions
(
desc
);
32
desc
.addUntracked<
bool
>(
"silentClusterCheck"
,
false
);
33
34
descriptions.
add
(
"trackerClusterCheckDefault"
,
desc
);
35
}
36
37
void
ClusterCheckerEDProducer::produce
(
edm::Event
&
iEvent
,
const
edm::EventSetup
& iSetup) {
38
auto
ret
= std::make_unique<bool>(
true
);
39
40
//protection for big ass events...
41
size_t
clustsOrZero =
theClusterCheck
.
tooManyClusters
(
iEvent
);
42
if
(clustsOrZero) {
43
if
(!
theSilentOnClusterCheck
)
44
edm::LogError
(
"TooManyClusters"
) <<
"Found too many clusters ("
<< clustsOrZero <<
"), bailing out."
;
45
*
ret
=
false
;
46
}
47
48
iEvent
.put(
std::move
(
ret
));
49
}
50
51
#include "
FWCore/Framework/interface/MakerMacros.h
"
52
DEFINE_FWK_MODULE
(
ClusterCheckerEDProducer
);
ConfigurationDescriptions.h
runTheMatrix.ret
ret
prodAgent to be discontinued
Definition:
runTheMatrix.py:367
ClusterCheckerEDProducer::produce
void produce(edm::Event &iEvent, const edm::EventSetup &iSetup) override
Definition:
ClusterCheckerEDProducer.cc:37
electrons_cff.bool
bool
Definition:
electrons_cff.py:393
edm::ParameterSetDescription
Definition:
ParameterSetDescription.h:52
EDProducer.h
ClusterChecker::fillDescriptions
static void fillDescriptions(edm::ParameterSetDescription &description)
Definition:
ClusterChecker.cc:32
ClusterChecker
Definition:
ClusterChecker.h:30
MakerMacros.h
DEFINE_FWK_MODULE
#define DEFINE_FWK_MODULE(type)
Definition:
MakerMacros.h:16
ClusterCheckerEDProducer::theSilentOnClusterCheck
bool theSilentOnClusterCheck
Definition:
ClusterCheckerEDProducer.cc:20
edm::ConfigurationDescriptions::add
void add(std::string const &label, ParameterSetDescription const &psetDescription)
Definition:
ConfigurationDescriptions.cc:57
ClusterCheckerEDProducer::theClusterCheck
ClusterChecker theClusterCheck
Definition:
ClusterCheckerEDProducer.cc:19
ParameterSetDescription.h
edm::ConfigurationDescriptions
Definition:
ConfigurationDescriptions.h:28
edm::ParameterSet
Definition:
ParameterSet.h:47
Event.h
iEvent
int iEvent
Definition:
GenABIO.cc:224
edm::stream::EDProducer
Definition:
EDProducer.h:38
edm::EventSetup
Definition:
EventSetup.h:57
edm::LogError
Log< level::Error, false > LogError
Definition:
MessageLogger.h:123
ClusterChecker.h
ClusterCheckerEDProducer
Definition:
ClusterCheckerEDProducer.cc:9
submitPVResolutionJobs.desc
string desc
Definition:
submitPVResolutionJobs.py:251
eostools.move
def move(src, dest)
Definition:
eostools.py:511
ClusterCheckerEDProducer::fillDescriptions
static void fillDescriptions(edm::ConfigurationDescriptions &descriptions)
Definition:
ClusterCheckerEDProducer.cc:29
ClusterCheckerEDProducer::~ClusterCheckerEDProducer
~ClusterCheckerEDProducer() override=default
ClusterCheckerEDProducer::ClusterCheckerEDProducer
ClusterCheckerEDProducer(const edm::ParameterSet &iConfig)
Definition:
ClusterCheckerEDProducer.cc:23
ParameterSet.h
edm::Event
Definition:
Event.h:73
ClusterChecker::tooManyClusters
size_t tooManyClusters(const edm::Event &e) const
Definition:
ClusterChecker.cc:44
Generated for CMSSW Reference Manual by
1.8.16