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 // extra
34 
35 // db trigger/subsystem key access
37 //#include "CondFormats/L1TObjects/interface/L1TriggerKeyList.h"
39 //#include "CondFormats/DataRecord/interface/L1TriggerKeyListRcd.h"
40 
41 template <class T> class DEcompare;
42 
43 class L1Comparator : public edm::EDProducer {
44 
45 public:
46 
47  explicit L1Comparator(const edm::ParameterSet&);
48  ~L1Comparator();
49 
50 private:
51 
52  virtual void beginJob(void);
53  virtual void beginRun(edm::Run&, const edm::EventSetup&);
54  virtual void produce (edm::Event&, const edm::EventSetup&);
55  virtual void endJob();
56 
57  template <class T>
58  void process( T const*, T const*, const int, const int);
59  template <class T>
60  void process(const edm::Handle<T> data, const edm::Handle<T> emul,
61  const int sys, const int cid) {
62  if(data.isValid()&&emul.isValid())
63  process(data.product(),emul.product(),sys, cid);
64  }
65 
66  // gt, fedraw, extra
74  edm::Handle<FEDRawDataCollection> emul, int fedid);
75  template <class T> bool CompareCollections(edm::Handle<T> data, edm::Handle<T> emul);
76  template <class T> bool dumpCandidate(const T& dt, const T& em, std::ostream& s);
77 
78  int verbose() {return verbose_;}
79 
80  private:
81 
82  int nevt_;
83  int evtNum_;
84  int runNum_;
85  int verbose_;
86  bool dumpEvent_;
87 
90  std::string m_dumpFileName;
91  std::ofstream m_dumpFile;
93  bool m_match;
97 
98  int m_fedId;
100 
101 };
102 
103 #endif
float dt
Definition: AMPTWrapper.h:126
const int DEnsys
Definition: DEtrait.h:38
int DEncand[dedefs::DEnsys][2]
Definition: L1Comparator.h:95
L1Comparator(const edm::ParameterSet &)
Definition: L1Comparator.cc:6
virtual void beginJob(void)
std::string m_dumpFileName
Definition: L1Comparator.h:90
std::vector< L1DataEmulDigi > L1DEDigiCollection
Definition: DEtrait.h:79
virtual void produce(edm::Event &, const edm::EventSetup &)
edm::InputTag m_FEDsource[2]
Definition: L1Comparator.h:99
edm::InputTag m_DEsource[dedefs::DEnsys][4]
Definition: L1Comparator.h:88
virtual void endJob()
bool compareCollections(edm::Handle< L1GlobalTriggerReadoutRecord > data, edm::Handle< L1GlobalTriggerReadoutRecord > emul)
bool isValid() const
Definition: HandleBase.h:76
bool compareFedRawCollections(edm::Handle< FEDRawDataCollection > data, edm::Handle< FEDRawDataCollection > emul, int fedid)
virtual void beginRun(edm::Run &, const edm::EventSetup &)
T const * product() const
Definition: Handle.h:74
bool DEmatchEvt[dedefs::DEnsys]
Definition: L1Comparator.h:94
L1DEDigiCollection m_dedigis
Definition: L1Comparator.h:96
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:91
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:60
long double T
void process(T const *, T const *, const int, const int)
Definition: Run.h:33
bool m_doSys[dedefs::DEnsys]
Definition: L1Comparator.h:89