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();
43  virtual void produce(Event&, EventSetup const&);
44  virtual void endJob() ;
45  };
46 
48  produces<std::vector<ErrorSummaryEntry> >();
49  }
50 
52  }
53 
54  void
56  if(!FreshErrorsExist()) {
57  std::auto_ptr<std::vector<ErrorSummaryEntry> > errors(new std::vector<ErrorSummaryEntry>());
58  iEvent.put(errors);
59  } else {
60  std::auto_ptr<std::vector<ErrorSummaryEntry> > errors(new std::vector<ErrorSummaryEntry>(LoggedErrorsSummary()));
61  iEvent.put(errors);
62  }
63  }
64 
65  // ------------ method called once each job just before starting event loop ------------
66  void
69  }
70 
71  // ------------ method called once each job just after ending the event loop ------------
72  void
75  }
76 
77 
78  // ------------ method called once each job for validation ------------
79  void
82  descriptions.add("logErrorHarvester", desc);
83  }
84 }
85 
86 //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:85
virtual void produce(Event &, EventSetup const &)
bool FreshErrorsExist()
void add(std::string const &label, ParameterSetDescription const &psetDescription)
LogErrorHarvester(ParameterSet const &)