CMS 3D CMS Logo

L1Comparator.h
Go to the documentation of this file.
1 #ifndef L1COMPARATOR_H
2 #define L1COMPARATOR_H
3 
4 /*\class L1Comparator
5  *\description L1 trigger data|emulation comparison and validation
6  *\author Nuno Leonardo (CERN)
7  *\date 07.02
8  */
9 
10 // common/system includes
11 #include <memory>
12 #include <string>
13 #include <iostream>
14 #include <fstream>
15 #include <iomanip>
16 #include <vector>
17 #include <algorithm>
26 
27 // l1 dataformats, d|e record includes
29 
30 // comparator template
32 
33 // db trigger/subsystem key access
35 //#include "CondFormats/L1TObjects/interface/L1TriggerKeyList.h"
37 //#include "CondFormats/DataRecord/interface/L1TriggerKeyListRcd.h"
38 
39 template <class T>
40 class DEcompare;
41 
42 class L1Comparator : public edm::EDProducer {
43 public:
44  explicit L1Comparator(const edm::ParameterSet&);
45  ~L1Comparator() override;
46 
47 private:
48  void beginJob(void) override;
49  void beginRun(edm::Run const&, const edm::EventSetup&) final;
50  void produce(edm::Event&, const edm::EventSetup&) override;
51  void endJob() override;
52 
53  template <class T>
54  void process(T const*, T const*, const int, const int);
55  template <class T>
56  void process(const edm::Handle<T> data, const edm::Handle<T> emul, const int sys, const int cid) {
57  if (data.isValid() && emul.isValid())
58  process(data.product(), emul.product(), sys, cid);
59  }
60 
61  template <class T>
63  template <class T>
64  bool dumpCandidate(const T& dt, const T& em, std::ostream& s);
65 
66  int verbose() { return verbose_; }
68 
69 private:
70  int nevt_;
71  int evtNum_;
72  int runNum_;
73  int verbose_;
74  bool dumpEvent_;
75 
99 
102  std::ofstream m_dumpFile;
104  bool m_match;
108 };
109 
110 #endif
edm::EDGetTokenT< L1GctEmCandCollection > tokenGctEmCand_nonIsoEm_[2]
Definition: L1Comparator.h:79
float dt
Definition: AMPTWrapper.h:136
edm::EDGetTokenT< LTCDigiCollection > tokenLTCDigi_[2]
Definition: L1Comparator.h:93
const int DEnsys
Definition: DEtrait.h:38
edm::EDGetTokenT< L1GctEtHadCollection > tokenGctEtHad_[2]
Definition: L1Comparator.h:85
edm::EDGetTokenT< L1MuRegionalCandCollection > tokenMuRegionalCandRPCb_[2]
Definition: L1Comparator.h:95
int DEncand[dedefs::DEnsys][2]
Definition: L1Comparator.h:106
L1Comparator(const edm::ParameterSet &)
Definition: L1Comparator.cc:6
void beginJob(void) override
edm::EDGetTokenT< L1GctJetCountsCollection > tokenGctJetCounts_[2]
Definition: L1Comparator.h:90
edm::EDGetTokenT< L1GctEtMissCollection > tokenGctEtMiss_[2]
Definition: L1Comparator.h:86
edm::EDGetTokenT< L1GctHFBitCountsCollection > tokenGctHFBitCounts_[2]
Definition: L1Comparator.h:88
edm::EDGetTokenT< L1MuDTChambThContainer > tokenMuDTChambTh_[2]
Definition: L1Comparator.h:92
std::string m_dumpFileName
Definition: L1Comparator.h:101
edm::EDGetTokenT< L1GctJetCandCollection > tokenGctJetCand_tauJets_[2]
Definition: L1Comparator.h:82
std::vector< L1DataEmulDigi > L1DEDigiCollection
Definition: DEtrait.h:101
bool m_stage1_layer2_
Definition: L1Comparator.h:67
void produce(edm::Event &, const edm::EventSetup &) override
~L1Comparator() override
edm::EDGetTokenT< L1MuGMTReadoutCollection > tokenMuReadoutCand_[2]
Definition: L1Comparator.h:98
edm::EDGetTokenT< L1GctJetCandCollection > tokenGctJetCand_isoTauJets_[2]
Definition: L1Comparator.h:83
edm::EDGetTokenT< L1MuRegionalCandCollection > tokenMuRegionalCandRPCf_[2]
Definition: L1Comparator.h:96
void beginRun(edm::Run const &, const edm::EventSetup &) final
edm::EDGetTokenT< L1GctEtTotalCollection > tokenGctEtTotal_[2]
Definition: L1Comparator.h:84
edm::EDGetTokenT< L1CaloEmCollection > tokenCaloEm_[2]
Definition: L1Comparator.h:76
bool isValid() const
Definition: HandleBase.h:70
edm::EDGetTokenT< L1MuDTChambPhContainer > tokenMuDTChambPh_[2]
Definition: L1Comparator.h:91
edm::EDGetTokenT< L1GctJetCandCollection > tokenGctJetCand_cenJets_[2]
Definition: L1Comparator.h:80
T const * product() const
Definition: Handle.h:69
edm::EDGetTokenT< L1GctHFRingEtSumsCollection > tokenGctHFRingEtSums_[2]
Definition: L1Comparator.h:87
edm::EDGetTokenT< L1GctJetCandCollection > tokenGctJetCand_forJets_[2]
Definition: L1Comparator.h:81
edm::EDGetTokenT< L1GctHtMissCollection > tokenGctHtMiss_[2]
Definition: L1Comparator.h:89
edm::EDGetTokenT< L1CaloRegionCollection > tokenCaloRegion_[2]
Definition: L1Comparator.h:77
bool DEmatchEvt[dedefs::DEnsys]
Definition: L1Comparator.h:105
void endJob() override
L1DEDigiCollection m_dedigis
Definition: L1Comparator.h:107
bool dumpCandidate(const T &dt, const T &em, std::ostream &s)
char data[epos_bytes_allocation]
Definition: EPOS_Wrapper.h:79
std::ofstream m_dumpFile
Definition: L1Comparator.h:102
bool CompareCollections(edm::Handle< T > data, edm::Handle< T > emul)
edm::EDGetTokenT< L1MuDTTrackContainer > tokenMuDTTrack_[2]
Definition: L1Comparator.h:94
void process(const edm::Handle< T > data, const edm::Handle< T > emul, const int sys, const int cid)
Definition: L1Comparator.h:56
long double T
edm::EDGetTokenT< L1GctEmCandCollection > tokenGctEmCand_isoEm_[2]
Definition: L1Comparator.h:78
void process(T const *, T const *, const int, const int)
Definition: Run.h:45
edm::EDGetTokenT< L1MuGMTCandCollection > tokenMuGMTCand_[2]
Definition: L1Comparator.h:97
bool m_doSys[dedefs::DEnsys]
Definition: L1Comparator.h:100