CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
CastorInvalidDataFilter.cc
Go to the documentation of this file.
1 // -*- C++ -*-
2 //
3 // Package: CastorInvalidDataFilter
4 // Class: CastorInvalidDataFilter
5 //
13 //
14 // Original Author: local user
15 // Created: Thu Apr 21 11:36:52 CEST 2011
16 //
17 //
18 
19 
20 // system include files
21 #include <memory>
22 
23 // user include files
26 
29 
31 
33 
34 //
35 // class declaration
36 //
37 
39  public:
42 
43  static void fillDescriptions(edm::ConfigurationDescriptions& descriptions);
44 
45  private:
46  virtual bool filter(edm::Event&, const edm::EventSetup&) override;
47 
49 };
50 
51 //
52 // constants, enums and typedefs
53 //
54 
55 //
56 // static data member definitions
57 //
58 
59 //
60 // constructors and destructor
61 //
63 {
64  //now do what ever initialization is needed
65  tok_summary_ = consumes<std::vector<edm::ErrorSummaryEntry> >(edm::InputTag("logErrorHarvester"));
66 
67 }
68 
69 
71 {
72 
73  // do anything here that needs to be done at desctruction time
74  // (e.g. close files, deallocate resources etc.)
75 
76 }
77 
78 
79 //
80 // member functions
81 //
82 
83 // ------------ method called on each new Event ------------
84 bool
86 {
87  using namespace edm;
88 
91 
92  bool invalid = false;
93  //std::cout << " logError summary size = " << summary->size() << std::endl;
94  for (size_t i=0;i<summary->size();i++) {
95  ErrorSummaryEntry error = (*summary)[i];
96  //std::cout << " category = " << error.category << " module = " << error.module << " severity = "
97  // << error.severity.getName() << " count = " << error.count << std::endl;
98  if (error.category == "Invalid Data" && error.module == "CastorRawToDigi:castorDigis") invalid = true;
99 
100  }
101 
102  return !invalid;
103 }
104 
105 
106 
107 
108 
109 
110 // ------------ method fills 'descriptions' with the allowed parameters for the module ------------
111 void
113  //The following says we do not know what parameters are allowed so do no validation
114  // Please change this to state exactly what you do use, even if it is no parameters
116  desc.setUnknown();
117  descriptions.addDefault(desc);
118 }
119 //define this as a plug-in
int i
Definition: DBlmapReader.cc:9
bool getByToken(EDGetToken token, Handle< PROD > &result) const
Definition: Event.h:464
#define DEFINE_FWK_MODULE(type)
Definition: MakerMacros.h:17
int iEvent
Definition: GenABIO.cc:230
void addDefault(ParameterSetDescription const &psetDescription)
virtual bool filter(edm::Event &, const edm::EventSetup &) override
edm::EDGetTokenT< std::vector< edm::ErrorSummaryEntry > > tok_summary_
static void fillDescriptions(edm::ConfigurationDescriptions &descriptions)
CastorInvalidDataFilter(const edm::ParameterSet &)