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  std::unique_ptr<std::vector<ErrorSummaryEntry> > errors(new std::vector<ErrorSummaryEntry>());
59  iEvent.put(std::move(errors));
60  } else {
61  std::unique_ptr<std::vector<ErrorSummaryEntry> > errors(new std::vector<ErrorSummaryEntry>(LoggedErrorsSummary(index)));
62  iEvent.put(std::move(errors));
63  }
64  }
65 
66  // ------------ method called once each job just before starting event loop ------------
67  void
70  }
71 
72  // ------------ method called once each job just after ending the event loop ------------
73  void
76  }
77 
78 
79  // ------------ method called once each job for validation ------------
80  void
83  descriptions.add("logErrorHarvester", desc);
84  }
85 }
86 
87 //define this as a plug-in
static void fillDescriptions(ConfigurationDescriptions &descriptions)
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
OrphanHandle< PROD > put(std::auto_ptr< PROD > product)
Put a new product.
Definition: Event.h:121
def move
Definition: eostools.py:510
unsigned int value() const
Definition: StreamID.h:46
void add(std::string const &label, ParameterSetDescription const &psetDescription)
StreamID streamID() const
Definition: Event.h:80
std::vector< ErrorSummaryEntry > LoggedErrorsSummary(unsigned int iStreamID)
LogErrorHarvester(ParameterSet const &)
virtual void beginJob() override