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>
25 
26 // l1 dataformats, d|e record includes
28 
29 // comparator template
31 
32 // db trigger/subsystem key access
34 //#include "CondFormats/L1TObjects/interface/L1TriggerKeyList.h"
36 //#include "CondFormats/DataRecord/interface/L1TriggerKeyListRcd.h"
37 
38 template <class T> class DEcompare;
39 
40 class L1Comparator : public edm::EDProducer {
41 
42 public:
43 
44  explicit L1Comparator(const edm::ParameterSet&);
45  ~L1Comparator();
46 
47 private:
48 
49  virtual void beginJob(void);
50  virtual void beginRun(edm::Run const&, const edm::EventSetup&) override final;
51  virtual void produce (edm::Event&, const edm::EventSetup&);
52  virtual void endJob();
53 
54  template <class T>
55  void process( T const*, T const*, const int, const int);
56  template <class T>
57  void process(const edm::Handle<T> data, const edm::Handle<T> emul,
58  const int sys, const int cid) {
59  if(data.isValid()&&emul.isValid())
60  process(data.product(),emul.product(),sys, cid);
61  }
62 
63  template <class T> bool CompareCollections(edm::Handle<T> data, edm::Handle<T> emul);
64  template <class T> bool dumpCandidate(const T& dt, const T& em, std::ostream& s);
65 
66  int verbose() {return verbose_;}
67 
68  private:
69 
70  int nevt_;
71  int evtNum_;
72  int runNum_;
73  int verbose_;
74  bool dumpEvent_;
75 
79  std::ofstream m_dumpFile;
81  bool m_match;
85 
86 };
87 
88 #endif
float dt
Definition: AMPTWrapper.h:126
const int DEnsys
Definition: DEtrait.h:38
int DEncand[dedefs::DEnsys][2]
Definition: L1Comparator.h:83
L1Comparator(const edm::ParameterSet &)
Definition: L1Comparator.cc:6
virtual void beginJob(void)
std::string m_dumpFileName
Definition: L1Comparator.h:78
std::vector< L1DataEmulDigi > L1DEDigiCollection
Definition: DEtrait.h:79
virtual void produce(edm::Event &, const edm::EventSetup &)
edm::InputTag m_DEsource[dedefs::DEnsys][4]
Definition: L1Comparator.h:76
virtual void endJob()
bool isValid() const
Definition: HandleBase.h:76
T const * product() const
Definition: Handle.h:81
bool DEmatchEvt[dedefs::DEnsys]
Definition: L1Comparator.h:82
L1DEDigiCollection m_dedigis
Definition: L1Comparator.h:84
bool dumpCandidate(const T &dt, const T &em, std::ostream &s)
char data[epos_bytes_allocation]
Definition: EPOS_Wrapper.h:82
std::ofstream m_dumpFile
Definition: L1Comparator.h:79
bool CompareCollections(edm::Handle< T > data, edm::Handle< T > emul)
void process(const edm::Handle< T > data, const edm::Handle< T > emul, const int sys, const int cid)
Definition: L1Comparator.h:57
virtual void beginRun(edm::Run const &, const edm::EventSetup &) overridefinal
long double T
void process(T const *, T const *, const int, const int)
Definition: Run.h:41
bool m_doSys[dedefs::DEnsys]
Definition: L1Comparator.h:77