test
CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
LogErrorHarvester.cc
Go to the documentation of this file.
1 //
2 // Package: LogErrorHarvester
3 // Class: LogErrorHarvester
4 
13 //
14 // Original Author: Giovanni Petrucciani
15 // Created: Thu Dec 4 16:22:40 CET 2008
16 //
17 
18 // user include files
26 
27 // system include files
28 #include <memory>
29 
30 //
31 // class decleration
32 //
33 
34 namespace edm {
35  class LogErrorHarvester : public EDProducer {
36  public:
37  explicit LogErrorHarvester(ParameterSet const&);
39  static void fillDescriptions(ConfigurationDescriptions& descriptions);
40 
41  private:
42  virtual void beginJob() override;
43  virtual void produce(Event&, EventSetup const&) override;
44  virtual void endJob() override ;
45  };
46 
48  produces<std::vector<ErrorSummaryEntry> >();
49  }
50 
52  }
53 
54  void
56  const auto index = iEvent.streamID().value();
57  if(!FreshErrorsExist(index)) {
58  iEvent.put(std::make_unique<std::vector<ErrorSummaryEntry>>());
59  } else {
60  iEvent.put(std::make_unique<std::vector<ErrorSummaryEntry>>(LoggedErrorsSummary(index)));
61  }
62  }
63 
64  // ------------ method called once each job just before starting event loop ------------
65  void
68  }
69 
70  // ------------ method called once each job just after ending the event loop ------------
71  void
74  }
75 
76 
77  // ------------ method called once each job for validation ------------
78  void
81  descriptions.add("logErrorHarvester", desc);
82  }
83 }
84 
85 //define this as a plug-in
static void fillDescriptions(ConfigurationDescriptions &descriptions)
OrphanHandle< PROD > put(std::unique_ptr< PROD > product)
Put a new product.
Definition: Event.h:122
bool EnableLoggedErrorsSummary()
#define DEFINE_FWK_MODULE(type)
Definition: MakerMacros.h:17
virtual void endJob() override
virtual void produce(Event &, EventSetup const &) override
bool FreshErrorsExist(unsigned int iStreamID)
bool DisableLoggedErrorsSummary()
int iEvent
Definition: GenABIO.cc:230
unsigned int value() const
Definition: StreamID.h:46
void add(std::string const &label, ParameterSetDescription const &psetDescription)
StreamID streamID() const
Definition: Event.h:81
std::vector< ErrorSummaryEntry > LoggedErrorsSummary(unsigned int iStreamID)
LogErrorHarvester(ParameterSet const &)
virtual void beginJob() override