CMS 3D CMS Logo

L1TValidationEventFilter.cc
Go to the documentation of this file.
1 // -*- C++ -*-
2 //
3 // Package: L1TValidationEventFilter
4 // Class: L1TValidationEventFilter
5 //
12 //
13 // Original Author: Jim Brooke
14 // Created:
15 //
16 //
17 
18 
19 // system include files
20 #include <memory>
21 
22 // user include files
24 
31 
32 #include <string>
33 #include <vector>
34 #include <iostream>
35 
36 
41 
43 
44 
45 //
46 // class declaration
47 //
48 
50 public:
52  ~L1TValidationEventFilter() override;
53 
54 private:
55  void beginJob() override ;
56  bool filter(edm::Event&, const edm::EventSetup&) override;
57  void endJob() override ;
58 
59  // ----------member data ---------------------------
61 
62  int period_; // validation event period
63 
64 };
65 
66 
67 //
68 // constructors and destructor
69 //
71  tcsdRecord_(consumes<TCDSRecord>(iConfig.getParameter<edm::InputTag>("tcdsRecord"))),
72  period_( iConfig.getParameter<int>("period") )
73 {
74  //now do what ever initialization is needed
75 
76 }
77 
78 
80 {
81 
82  // do anything here that needs to be done at desctruction time
83  // (e.g. close files, deallocate resources etc.)
84 
85 }
86 
87 
88 //
89 // member functions
90 //
91 
92 // ------------ method called on each new Event ------------
93 bool
95 {
96  using namespace edm;
97 
99  iEvent.getByToken(tcsdRecord_,record);
100  if (!record.isValid()) {
101  LogError("L1T") << "TCDS data not unpacked: triggerCount not availble in Event.";
102  return false;
103  }
104 
105  bool fatEvent = (record->getTriggerCount() % period_ == 0 );
106 
107  return fatEvent;
108 
109 }
110 
111 // ------------ method called once each job just before starting event loop ------------
112 void
114 {
115 
116 }
117 
118 // ------------ method called once each job just after ending the event loop ------------
119 void
121 
122 }
123 
124 //define this as a plug-in
JetCorrectorParameters::Record record
Definition: classes.h:7
bool getByToken(EDGetToken token, Handle< PROD > &result) const
Definition: Event.h:517
Class to contain information from TCDS FED.
Definition: TCDSRecord.h:21
edm::EDGetTokenT< TCDSRecord > tcsdRecord_
EDGetTokenT< ProductType > consumes(edm::InputTag const &tag)
int iEvent
Definition: GenABIO.cc:224
#define DEFINE_FWK_MODULE(type)
Definition: MakerMacros.h:16
uint64_t getTriggerCount() const
Definition: TCDSRecord.h:95
L1TValidationEventFilter(const edm::ParameterSet &)
bool isValid() const
Definition: HandleBase.h:74
bool filter(edm::Event &, const edm::EventSetup &) override
HLT enums.