CMS 3D CMS Logo

ClusterCheckerEDProducer.cc
Go to the documentation of this file.
7 
9 
11 public:
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:
22 };
23 
25  : theClusterCheck(iConfig, consumesCollector()),
26  theSilentOnClusterCheck(iConfig.getUntrackedParameter<bool>("silentClusterCheck")) {
27  produces<bool>();
28 }
29 
33  desc.addUntracked<bool>("silentClusterCheck", false);
34 
35  descriptions.add("trackerClusterCheckDefault", desc);
36 }
37 
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) {
45  edm::LogError("TooManyClusters") << "Found too many clusters (" << clustsOrZero << "), bailing out.";
46  *ret = false;
47  }
48 
49  iEvent.put(std::move(ret));
50 }
51 
void produce(edm::Event &iEvent, const edm::EventSetup &iSetup) override
size_t tooManyClusters(const edm::Event &e) const
ret
prodAgent to be discontinued
static void fillDescriptions(edm::ConfigurationDescriptions &descriptions)
static void fillDescriptions(edm::ParameterSetDescription &description)
Log< level::Error, false > LogError
int iEvent
Definition: GenABIO.cc:224
#define DEFINE_FWK_MODULE(type)
Definition: MakerMacros.h:16
~ClusterCheckerEDProducer() override=default
void add(std::string const &label, ParameterSetDescription const &psetDescription)
ClusterCheckerEDProducer(const edm::ParameterSet &iConfig)
def move(src, dest)
Definition: eostools.py:511