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
#include "
FWCore/MessageLogger/interface/MessageLogger.h
"
7
8
#include "
RecoTracker/TkSeedGenerator/interface/ClusterChecker.h
"
9
10
class
ClusterCheckerEDProducer
:
public
edm::stream::EDProducer
<> {
11
public
:
12
ClusterCheckerEDProducer
(
const
edm::ParameterSet
& iConfig);
13
~ClusterCheckerEDProducer
()
override
=
default
;
14
15
static
void
fillDescriptions
(
edm::ConfigurationDescriptions
& descriptions);
16
17
void
produce
(
edm::Event
&
iEvent
,
const
edm::EventSetup
& iSetup)
override
;
18
19
private
:
20
ClusterChecker
theClusterCheck
;
21
bool
theSilentOnClusterCheck
;
22
};
23
24
ClusterCheckerEDProducer::ClusterCheckerEDProducer
(
const
edm::ParameterSet
& iConfig)
25
: theClusterCheck(iConfig, consumesCollector()),
26
theSilentOnClusterCheck(iConfig.getUntrackedParameter<
bool
>(
"silentClusterCheck"
)) {
27
produces<bool>();
28
}
29
30
void
ClusterCheckerEDProducer::fillDescriptions
(
edm::ConfigurationDescriptions
& descriptions) {
31
edm::ParameterSetDescription
desc
;
32
ClusterChecker::fillDescriptions
(
desc
);
33
desc
.addUntracked<
bool
>(
"silentClusterCheck"
,
false
);
34
35
descriptions.
add
(
"trackerClusterCheckDefault"
,
desc
);
36
}
37
38
void
ClusterCheckerEDProducer::produce
(
edm::Event
&
iEvent
,
const
edm::EventSetup
& iSetup) {
39
auto
ret
= std::make_unique<bool>(
true
);
40
41
//protection for big ass events...
42
size_t
clustsOrZero =
theClusterCheck
.
tooManyClusters
(
iEvent
);
43
if
(clustsOrZero) {
44
if
(!
theSilentOnClusterCheck
)
45
edm::LogError
(
"TooManyClusters"
) <<
"Found too many clusters ("
<< clustsOrZero <<
"), bailing out."
;
46
*
ret
=
false
;
47
}
48
49
iEvent
.put(
std::move
(
ret
));
50
}
51
52
#include "
FWCore/Framework/interface/MakerMacros.h
"
53
DEFINE_FWK_MODULE
(
ClusterCheckerEDProducer
);
ConfigurationDescriptions.h
runTheMatrix.ret
ret
prodAgent to be discontinued
Definition:
runTheMatrix.py:543
ClusterCheckerEDProducer::produce
void produce(edm::Event &iEvent, const edm::EventSetup &iSetup) override
Definition:
ClusterCheckerEDProducer.cc:38
electrons_cff.bool
bool
Definition:
electrons_cff.py:366
MessageLogger.h
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:21
edm::ConfigurationDescriptions::add
void add(std::string const &label, ParameterSetDescription const &psetDescription)
Definition:
ConfigurationDescriptions.cc:57
ClusterCheckerEDProducer::theClusterCheck
ClusterChecker theClusterCheck
Definition:
ClusterCheckerEDProducer.cc:20
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:36
edm::EventSetup
Definition:
EventSetup.h:58
edm::LogError
Log< level::Error, false > LogError
Definition:
MessageLogger.h:123
ClusterChecker.h
ClusterCheckerEDProducer
Definition:
ClusterCheckerEDProducer.cc:10
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:30
ClusterCheckerEDProducer::~ClusterCheckerEDProducer
~ClusterCheckerEDProducer() override=default
ClusterCheckerEDProducer::ClusterCheckerEDProducer
ClusterCheckerEDProducer(const edm::ParameterSet &iConfig)
Definition:
ClusterCheckerEDProducer.cc:24
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