test
CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
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> class DEcompare;
40 
41 class L1Comparator : public edm::EDProducer {
42 
43 public:
44 
45  explicit L1Comparator(const edm::ParameterSet&);
46  ~L1Comparator();
47 
48 private:
49 
50  virtual void beginJob(void);
51  virtual void beginRun(edm::Run const&, const edm::EventSetup&) override final;
52  virtual void produce (edm::Event&, const edm::EventSetup&);
53  virtual void endJob();
54 
55  template <class T>
56  void process( T const*, T const*, const int, const int);
57  template <class T>
58  void process(const edm::Handle<T> data, const edm::Handle<T> emul,
59  const int sys, const int cid) {
60  if(data.isValid()&&emul.isValid())
61  process(data.product(),emul.product(),sys, cid);
62  }
63 
64  template <class T> bool CompareCollections(edm::Handle<T> data, edm::Handle<T> emul);
65  template <class T> bool dumpCandidate(const T& dt, const T& em, std::ostream& s);
66 
67  int verbose() {return verbose_;}
69 
70  private:
71 
72  int nevt_;
73  int evtNum_;
74  int runNum_;
75  int verbose_;
76  bool dumpEvent_;
77 
101 
104  std::ofstream m_dumpFile;
106  bool m_match;
110 
111 };
112 
113 #endif
edm::EDGetTokenT< L1GctEmCandCollection > tokenGctEmCand_nonIsoEm_[2]
Definition: L1Comparator.h:81
float dt
Definition: AMPTWrapper.h:126
edm::EDGetTokenT< LTCDigiCollection > tokenLTCDigi_[2]
Definition: L1Comparator.h:95
const int DEnsys
Definition: DEtrait.h:38
edm::EDGetTokenT< L1GctEtHadCollection > tokenGctEtHad_[2]
Definition: L1Comparator.h:87
edm::EDGetTokenT< L1MuRegionalCandCollection > tokenMuRegionalCandRPCb_[2]
Definition: L1Comparator.h:97
int DEncand[dedefs::DEnsys][2]
Definition: L1Comparator.h:108
L1Comparator(const edm::ParameterSet &)
Definition: L1Comparator.cc:6
virtual void beginJob(void)
edm::EDGetTokenT< L1GctJetCountsCollection > tokenGctJetCounts_[2]
Definition: L1Comparator.h:92
edm::EDGetTokenT< L1GctEtMissCollection > tokenGctEtMiss_[2]
Definition: L1Comparator.h:88
edm::EDGetTokenT< L1GctHFBitCountsCollection > tokenGctHFBitCounts_[2]
Definition: L1Comparator.h:90
edm::EDGetTokenT< L1MuDTChambThContainer > tokenMuDTChambTh_[2]
Definition: L1Comparator.h:94
std::string m_dumpFileName
Definition: L1Comparator.h:103
edm::EDGetTokenT< L1GctJetCandCollection > tokenGctJetCand_tauJets_[2]
Definition: L1Comparator.h:84
std::vector< L1DataEmulDigi > L1DEDigiCollection
Definition: DEtrait.h:80
virtual void produce(edm::Event &, const edm::EventSetup &)
bool m_stage1_layer2_
Definition: L1Comparator.h:68
virtual void endJob()
edm::EDGetTokenT< L1MuGMTReadoutCollection > tokenMuReadoutCand_[2]
Definition: L1Comparator.h:100
edm::EDGetTokenT< L1GctJetCandCollection > tokenGctJetCand_isoTauJets_[2]
Definition: L1Comparator.h:85
edm::EDGetTokenT< L1MuRegionalCandCollection > tokenMuRegionalCandRPCf_[2]
Definition: L1Comparator.h:98
edm::EDGetTokenT< L1GctEtTotalCollection > tokenGctEtTotal_[2]
Definition: L1Comparator.h:86
edm::EDGetTokenT< L1CaloEmCollection > tokenCaloEm_[2]
Definition: L1Comparator.h:78
bool isValid() const
Definition: HandleBase.h:75
edm::EDGetTokenT< L1MuDTChambPhContainer > tokenMuDTChambPh_[2]
Definition: L1Comparator.h:93
edm::EDGetTokenT< L1GctJetCandCollection > tokenGctJetCand_cenJets_[2]
Definition: L1Comparator.h:82
T const * product() const
Definition: Handle.h:81
edm::EDGetTokenT< L1GctHFRingEtSumsCollection > tokenGctHFRingEtSums_[2]
Definition: L1Comparator.h:89
edm::EDGetTokenT< L1GctJetCandCollection > tokenGctJetCand_forJets_[2]
Definition: L1Comparator.h:83
edm::EDGetTokenT< L1GctHtMissCollection > tokenGctHtMiss_[2]
Definition: L1Comparator.h:91
edm::EDGetTokenT< L1CaloRegionCollection > tokenCaloRegion_[2]
Definition: L1Comparator.h:79
bool DEmatchEvt[dedefs::DEnsys]
Definition: L1Comparator.h:107
L1DEDigiCollection m_dedigis
Definition: L1Comparator.h:109
bool dumpCandidate(const T &dt, const T &em, std::ostream &s)
std::ofstream m_dumpFile
Definition: L1Comparator.h:104
bool CompareCollections(edm::Handle< T > data, edm::Handle< T > emul)
edm::EDGetTokenT< L1MuDTTrackContainer > tokenMuDTTrack_[2]
Definition: L1Comparator.h:96
void process(const edm::Handle< T > data, const edm::Handle< T > emul, const int sys, const int cid)
Definition: L1Comparator.h:58
virtual void beginRun(edm::Run const &, const edm::EventSetup &) overridefinal
long double T
edm::EDGetTokenT< L1GctEmCandCollection > tokenGctEmCand_isoEm_[2]
Definition: L1Comparator.h:80
void process(T const *, T const *, const int, const int)
Definition: Run.h:43
edm::EDGetTokenT< L1MuGMTCandCollection > tokenMuGMTCand_[2]
Definition: L1Comparator.h:99
bool m_doSys[dedefs::DEnsys]
Definition: L1Comparator.h:102