CMS 3D CMS Logo

ClusterCheckerEDProducer.cc
Go to the documentation of this file.
6 
8 
10 public:
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:
21 };
22 
24  : theClusterCheck(iConfig, consumesCollector()),
25  theSilentOnClusterCheck(iConfig.getUntrackedParameter<bool>("silentClusterCheck")) {
26  produces<bool>();
27 }
28 
32  desc.addUntracked<bool>("silentClusterCheck", false);
33 
34  descriptions.add("trackerClusterCheckDefault", desc);
35 }
36 
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) {
44  edm::LogError("TooManyClusters") << "Found too many clusters (" << clustsOrZero << "), bailing out.";
45  *ret = false;
46  }
47 
48  iEvent.put(std::move(ret));
49 }
50 
void produce(edm::Event &iEvent, const edm::EventSetup &iSetup) override
OrphanHandle< PROD > put(std::unique_ptr< PROD > product)
Put a new product.
Definition: Event.h:131
ParameterDescriptionBase * addUntracked(U const &iLabel, T const &value)
ret
prodAgent to be discontinued
static void fillDescriptions(edm::ConfigurationDescriptions &descriptions)
static void fillDescriptions(edm::ParameterSetDescription &description)
int iEvent
Definition: GenABIO.cc:224
#define DEFINE_FWK_MODULE(type)
Definition: MakerMacros.h:16
size_t tooManyClusters(const edm::Event &e) const
~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