CMS 3D CMS Logo

L1TStage2CaloLayer1.h
Go to the documentation of this file.
1 #ifndef L1TStage2CaloLayer1_H
2 #define L1TStage2CaloLayer1_H
3 
4 // system include files
5 #include <memory>
6 #include <string>
7 #include <array>
8 
9 // user include files
12 
15 
17 
20 
23 
26 
28 
29 namespace ComparisonHelper {
30  // Designed for edm::SortedCollection<T>
31  // Iterators should have a value type that derives from DetID, or
32  // otherwise implements value_type::id().
33  // Compare should be strict weak ordering (e.g. edm::SortedCollection<T>::key_compare)
34  // Mostly http://www.cplusplus.com/reference/algorithm/set_union/
35  // But with both collections saved in std::pair
36  // Is this necessary? Absolutely not... but it was fun to make!
37  template <class InputIterator1, class InputIterator2, class OutputIterator, class Compare>
38  OutputIterator zip (InputIterator1 first1, InputIterator1 last1,
39  InputIterator2 first2, InputIterator2 last2,
40  OutputIterator result, Compare comp) {
41  typedef typename InputIterator1::value_type dummy1;
42  typedef typename InputIterator2::value_type dummy2;
43  while ( first1 != last1 || first2 != last2 ) {
44  if ( first1 == last1 ) {
45  while ( first2 != last2 ) { *result = std::make_pair(dummy1{first2->id()}, *first2); ++first2; ++result; }
46  return result;
47  }
48  if ( first2 == last2 ) {
49  while ( first1 != last1 ) { *result = std::make_pair(*first1, dummy2{first1->id()}); ++first1; ++result; }
50  return result;
51  }
52  if (comp(*first1,*first2)) { *result = std::make_pair(*first1, dummy2{first1->id()}); ++first1; }
53  else if (comp(*first2,*first1)) { *result = std::make_pair(dummy1{first2->id()}, *first2); ++first2; }
54  else { *result = std::make_pair(*first1, *first2); ++first1; ++first2; }
55  ++result;
56  }
57  return result;
58  }
59 }
60 
61 class L1TStage2CaloLayer1 : public one::DQMEDAnalyzer<edm::one::WatchLuminosityBlocks> {
62  public:
64  ~L1TStage2CaloLayer1() override;
65 
66  protected:
67  void analyze(const edm::Event& e, const edm::EventSetup& c) override;
68  void bookHistograms(DQMStore::IBooker &ibooker, const edm::Run&, const edm::EventSetup&) override;
69  void dqmBeginRun(const edm::Run&, const edm::EventSetup&) override;
70  void beginLuminosityBlock(const edm::LuminosityBlock&, const edm::EventSetup&) override;
71  void endLuminosityBlock(const edm::LuminosityBlock&, const edm::EventSetup&) override;
72 
73  private:
74  void updateMismatch(const edm::Event& e, int mismatchType);
75  // Input and config info
88 
95 
110 
114 
133 
137 
139  std::array<std::pair<std::string, int>, 20> last20MismatchArray_;
140  size_t lastMismatchIndex_{0};
141 
146 
150  int maxEvtLinkErrorsECALCurrentLumi_{0};
151  int maxEvtLinkErrorsHCALCurrentLumi_{0};
152 
156  int maxEvtMismatchECALCurrentLumi_{0};
157  int maxEvtMismatchHCALCurrentLumi_{0};
158 
162 
166 
167  // Prevent reallocation per event
168  std::vector<std::pair<EcalTriggerPrimitiveDigi, EcalTriggerPrimitiveDigi> > ecalTPSentRecd_;
169  std::vector<std::pair<HcalTriggerPrimitiveDigi, HcalTriggerPrimitiveDigi> > hcalTPSentRecd_;
170 };
171 
172 #endif
MonitorElement * hcalTPRawEtRecd_
MonitorElement * ecalOccTowerMasked_
MonitorElement * ecalOccRecdNotSent_
MonitorElement * ecalTPRawEtCorrelation_
edm::EDGetTokenT< EcalTrigPrimDigiCollection > ecalTPSourceSent_
std::string hcalTPSourceSentLabel_
std::vector< std::pair< HcalTriggerPrimitiveDigi, HcalTriggerPrimitiveDigi > > hcalTPSentRecd_
MonitorElement * maxEvtMismatchByLumiHCAL_
MonitorElement * maxEvtLinkErrorsByLumi_
MonitorElement * maxEvtMismatchByLumi_
MonitorElement * ecalOccRecdFgVB_
MonitorElement * ecalTPRawEtSentAndRecd_
MonitorElement * ecalOccFgDiscrepancy_
MonitorElement * ecalMismatchByLumi_
MonitorElement * bxidErrors_
edm::EDGetTokenT< EcalTrigPrimDigiCollection > ecalTPSourceRecd_
MonitorElement * maxEvtLinkErrorsByLumiHCAL_
MonitorElement * hcalOccSentFb2_
MonitorElement * HBHEmismatchesPerBx_
edm::EDGetTokenT< HcalTrigPrimDigiCollection > hcalTPSourceRecd_
MonitorElement * hcalOccSentFb_
MonitorElement * hcalOccTowerMasked_
MonitorElement * maxEvtMismatchByLumiECAL_
MonitorElement * ecalOccSentFgVB_
MonitorElement * hcalOccupancy_
MonitorElement * hcalLinkErrorByLumi_
MonitorElement * hcalTPRawEtSentAndRecd_
MonitorElement * hcalMismatchByLumi_
MonitorElement * hcalOccRecdEtWgt_
MonitorElement * ECALmismatchesPerBx_
std::array< std::pair< std::string, int >, 20 > last20MismatchArray_
MonitorElement * ecalOccupancy_
MonitorElement * hcalOccRecdNotSent_
std::string ecalTPSourceRecdLabel_
MonitorElement * hcalOccLinkMasked_
example_stream void analyze(const edm::Event &, const edm::EventSetup &) override
MonitorElement * ecalTPRawEtRecd_
std::string hcalTPSourceRecdLabel_
MonitorElement * ecalTPRawEtDiffNoMatch_
MonitorElement * hcalOccSent_
MonitorElement * ecalOccNoMatch_
std::string ecalTPSourceSentLabel_
MonitorElement * ecalTPRawEtSent_
OutputIterator zip(InputIterator1 first1, InputIterator1 last1, InputIterator2 first2, InputIterator2 last2, OutputIterator result, Compare comp)
MonitorElement * ecalOccSentAndRecd_
MonitorElement * ecalLinkErrorByLumi_
MonitorElement * hcalOccEtDiscrepancy_
MonitorElement * hcalTPRawEtCorrelationHBHE_
MonitorElement * ecalOccSent_
std::vector< std::pair< EcalTriggerPrimitiveDigi, EcalTriggerPrimitiveDigi > > ecalTPSentRecd_
MonitorElement * hcalOccSentAndRecd_
MonitorElement * l1idErrors_
MonitorElement * ecalDiscrepancy_
MonitorElement * hcalOccFbDiscrepancy_
MonitorElement * hcalOccFb2Discrepancy_
example_stream void bookHistograms(DQMStore::IBooker &,@example_stream edm::Run const &,@example_stream edm::EventSetup const &) override
MonitorElement * hcalTPRawEtSent_
MonitorElement * hcalOccRecdFb2_
MonitorElement * hcalTPRawEtCorrelationHF_
MonitorElement * ecalLinkError_
MonitorElement * hcalOccRecdFb_
MonitorElement * last20Mismatches_
MonitorElement * hcalTPRawEtDiffNoMatch_
MonitorElement * ecalOccEtDiscrepancy_
MonitorElement * maxEvtLinkErrorsByLumiECAL_
MonitorElement * ecalOccRecdEtWgt_
edm::EDGetTokenT< HcalTrigPrimDigiCollection > hcalTPSourceSent_
MonitorElement * HFmismatchesPerBx_
MonitorElement * ecalOccLinkMasked_
edm::EDGetTokenT< FEDRawDataCollection > fedRawData_
MonitorElement * hcalOccNoMatch_
MonitorElement * hcalOccSentNotRecd_
MonitorElement * hcalLinkError_
MonitorElement * ecalOccSentNotRecd_
MonitorElement * orbitErrors_
Definition: Run.h:45
MonitorElement * hcalDiscrepancy_