CMS 3D CMS Logo

L1Comparator.h

Go to the documentation of this file.
00001 #ifndef L1COMPARATOR_H
00002 #define L1COMPARATOR_H
00003 
00004 /*\class L1Comparator
00005  *\description L1 trigger data|emulation comparison and validation
00006  *\author Nuno Leonardo (CERN)
00007  *\date 07.02
00008  */
00009 
00010 // common/system includes
00011 #include <memory>
00012 #include <string>
00013 #include <iostream>
00014 #include <fstream>
00015 #include <iomanip>
00016 #include <vector>
00017 #include <algorithm>
00018 #include "FWCore/ServiceRegistry/interface/Service.h"
00019 #include "FWCore/Framework/interface/Frameworkfwd.h"
00020 #include "FWCore/Framework/interface/EDProducer.h"
00021 #include "FWCore/Framework/interface/Event.h"
00022 #include "FWCore/Framework/interface/MakerMacros.h"
00023 #include "FWCore/ParameterSet/interface/ParameterSet.h"
00024 #include "FWCore/MessageLogger/interface/MessageLogger.h"
00025 
00026 // l1 dataformats, d|e record includes
00027 #include "L1Trigger/HardwareValidation/interface/DEtrait.h"
00028 
00029 // comparator template
00030 #include "L1Trigger/HardwareValidation/interface/DEcompare.h"
00031 
00032 // extra
00033 #include "DataFormats/FEDRawData/interface/FEDRawDataCollection.h"
00034 
00035 template <class T> class DEcompare;
00036 
00037 class L1Comparator : public edm::EDProducer {
00038 
00039 public:
00040 
00041   explicit L1Comparator(const edm::ParameterSet&);
00042   ~L1Comparator();
00043   
00044 private:
00045 
00046   virtual void beginJob(const edm::EventSetup&);
00047   virtual void produce (edm::Event&, const edm::EventSetup&);
00048   virtual void endJob();
00049 
00050   template <class T> 
00051     void process( T const*, T const*, const int, const int);
00052   template <class T> 
00053     void process(const edm::Handle<T> data, const edm::Handle<T> emul, 
00054                  const int sys, const int cid) {
00055     if(data.isValid()&&emul.isValid())
00056       process(data.product(),emul.product(),sys, cid);
00057   }
00058 
00059   // gt, fedraw, extra
00060   bool compareCollections(edm::Handle<L1GlobalTriggerReadoutRecord>   data, 
00061                           edm::Handle<L1GlobalTriggerReadoutRecord>   emul);
00062   bool compareCollections(edm::Handle<L1GlobalTriggerEvmReadoutRecord>data, 
00063                           edm::Handle<L1GlobalTriggerEvmReadoutRecord>emul);
00064   bool compareCollections(edm::Handle<L1GlobalTriggerObjectMapRecord> data, 
00065                           edm::Handle<L1GlobalTriggerObjectMapRecord> emul);
00066   bool compareFedRawCollections(edm::Handle<FEDRawDataCollection>     data, 
00067                                 edm::Handle<FEDRawDataCollection>     emul, int fedid);
00068   template <class T> bool CompareCollections(edm::Handle<T> data, edm::Handle<T> emul);
00069   template <class T> bool dumpCandidate(const T& dt, const T& em, std::ostream& s);
00070 
00071   int verbose() {return verbose_;}
00072 
00073  private:
00074 
00075   int nevt_;
00076   int evtNum_;
00077   int runNum_;
00078   int verbose_;
00079   bool dumpEvent_;
00080 
00081   edm::InputTag m_DEsource[dedefs::DEnsys][4];
00082   bool m_doSys[dedefs::DEnsys];
00083   std::string m_dumpFileName;
00084   std::ofstream m_dumpFile;
00085   int m_dumpMode;
00086   bool m_match;
00087   bool DEmatchEvt[dedefs::DEnsys]; 
00088   int DEncand[dedefs::DEnsys][2];
00089   L1DEDigiCollection m_dedigis;
00090 
00091   int m_fedId;
00092   edm::InputTag m_FEDsource[2];
00093 
00094 };
00095 
00096 #endif

Generated on Tue Jun 9 17:40:14 2009 for CMSSW by  doxygen 1.5.4