CMS 3D CMS Logo

List of all members | Public Member Functions | Static Public Member Functions | Private Attributes
ClusterCheckerEDProducer Class Reference
Inheritance diagram for ClusterCheckerEDProducer:
edm::stream::EDProducer<>

Public Member Functions

 ClusterCheckerEDProducer (const edm::ParameterSet &iConfig)
 
void produce (edm::Event &iEvent, const edm::EventSetup &iSetup) override
 
 ~ClusterCheckerEDProducer () override=default
 
- Public Member Functions inherited from edm::stream::EDProducer<>
 EDProducer ()=default
 
bool hasAbilityToProduceInLumis () const final
 
bool hasAbilityToProduceInRuns () const final
 

Static Public Member Functions

static void fillDescriptions (edm::ConfigurationDescriptions &descriptions)
 

Private Attributes

ClusterChecker theClusterCheck
 
bool theSilentOnClusterCheck
 

Additional Inherited Members

- Public Types inherited from edm::stream::EDProducer<>
typedef CacheContexts< T... > CacheTypes
 
typedef CacheTypes::GlobalCache GlobalCache
 
typedef AbilityChecker< T... > HasAbility
 
typedef CacheTypes::LuminosityBlockCache LuminosityBlockCache
 
typedef LuminosityBlockContextT< LuminosityBlockCache, RunCache, GlobalCacheLuminosityBlockContext
 
typedef CacheTypes::LuminosityBlockSummaryCache LuminosityBlockSummaryCache
 
typedef CacheTypes::RunCache RunCache
 
typedef RunContextT< RunCache, GlobalCacheRunContext
 
typedef CacheTypes::RunSummaryCache RunSummaryCache
 

Detailed Description

Definition at line 9 of file ClusterCheckerEDProducer.cc.

Constructor & Destructor Documentation

ClusterCheckerEDProducer::ClusterCheckerEDProducer ( const edm::ParameterSet iConfig)

Definition at line 24 of file ClusterCheckerEDProducer.cc.

24  :
25  theClusterCheck(iConfig, consumesCollector()),
26  theSilentOnClusterCheck(iConfig.getUntrackedParameter<bool>("silentClusterCheck"))
27 {
28  produces<bool>();
29 }
T getUntrackedParameter(std::string const &, T const &) const
ClusterCheckerEDProducer::~ClusterCheckerEDProducer ( )
overridedefault

Member Function Documentation

void ClusterCheckerEDProducer::fillDescriptions ( edm::ConfigurationDescriptions descriptions)
static

Definition at line 31 of file ClusterCheckerEDProducer.cc.

References edm::ConfigurationDescriptions::add(), edm::ParameterSetDescription::addUntracked(), and ClusterChecker::fillDescriptions().

31  {
34  desc.addUntracked<bool>("silentClusterCheck", false);
35 
36  descriptions.add("trackerClusterCheckDefault", desc);
37 }
ParameterDescriptionBase * addUntracked(U const &iLabel, T const &value)
static void fillDescriptions(edm::ParameterSetDescription &description)
void add(std::string const &label, ParameterSetDescription const &psetDescription)
void ClusterCheckerEDProducer::produce ( edm::Event iEvent,
const edm::EventSetup iSetup 
)
override

Definition at line 39 of file ClusterCheckerEDProducer.cc.

References DEFINE_FWK_MODULE, eostools::move(), edm::Event::put(), theClusterCheck, theSilentOnClusterCheck, and ClusterChecker::tooManyClusters().

39  {
40  auto ret = std::make_unique<bool>(true);
41 
42  //protection for big ass events...
43  size_t clustsOrZero = theClusterCheck.tooManyClusters(iEvent);
44  if (clustsOrZero){
46  edm::LogError("TooManyClusters") << "Found too many clusters (" << clustsOrZero << "), bailing out.";
47  *ret = false;
48  }
49 
50  iEvent.put(std::move(ret));
51 }
OrphanHandle< PROD > put(std::unique_ptr< PROD > product)
Put a new product.
Definition: Event.h:137
size_t tooManyClusters(const edm::Event &e) const
def move(src, dest)
Definition: eostools.py:511

Member Data Documentation

ClusterChecker ClusterCheckerEDProducer::theClusterCheck
private

Definition at line 20 of file ClusterCheckerEDProducer.cc.

Referenced by produce().

bool ClusterCheckerEDProducer::theSilentOnClusterCheck
private

Definition at line 21 of file ClusterCheckerEDProducer.cc.

Referenced by produce().