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 // system include files
19 #include <memory>
20 
21 // user include files
23 
26 
29 
32 
33  //
34  // class decleration
35  //
36 
37 namespace edm {
38  class LogErrorHarvester : public EDProducer {
39  public:
40  explicit LogErrorHarvester(ParameterSet const&);
42  static void fillDescriptions(ConfigurationDescriptions& descriptions);
43 
44  private:
45  virtual void beginJob();
46  virtual void produce(Event&, EventSetup const&);
47  virtual void endJob() ;
48  };
49 
51  produces<std::vector<ErrorSummaryEntry> >();
52  }
53 
55 
56  void
58  if (!FreshErrorsExist()) {
59  std::auto_ptr<std::vector<ErrorSummaryEntry> > errors(new std::vector<ErrorSummaryEntry>());
60  iEvent.put(errors);
61  } else {
62  std::auto_ptr<std::vector<ErrorSummaryEntry> > errors(new std::vector<ErrorSummaryEntry>(LoggedErrorsSummary()));
63  iEvent.put(errors);
64  }
65  }
66 
67  // ------------ method called once each job just before starting event loop ------------
68  void
71  }
72 
73  // ------------ method called once each job just after ending the event loop ------------
74  void
77  }
78 
79 
80  // ------------ method called once each job for validation ------------
81  void
84  descriptions.add("logErrorHarvester", desc);
85  }
86 }
87 
88 //define this as a plug-in
static void fillDescriptions(ConfigurationDescriptions &descriptions)
bool EnableLoggedErrorsSummary()
#define DEFINE_FWK_MODULE(type)
Definition: MakerMacros.h:17
bool DisableLoggedErrorsSummary()
std::vector< ErrorSummaryEntry > LoggedErrorsSummary()
int iEvent
Definition: GenABIO.cc:243
OrphanHandle< PROD > put(std::auto_ptr< PROD > product)
Put a new product.
Definition: Event.h:84
virtual void produce(Event &, EventSetup const &)
bool FreshErrorsExist()
void add(std::string const &label, ParameterSetDescription const &psetDescription)
LogErrorHarvester(ParameterSet const &)