CMS 3D CMS Logo

/afs/cern.ch/work/a/aaltunda/public/www/CMSSW_6_2_5/src/L1Trigger/HardwareValidation/interface/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 // db trigger/subsystem key access
00033 #include "CondFormats/L1TObjects/interface/L1TriggerKey.h"         
00034 //#include "CondFormats/L1TObjects/interface/L1TriggerKeyList.h"   
00035 #include "CondFormats/DataRecord/interface/L1TriggerKeyRcd.h"      
00036 //#include "CondFormats/DataRecord/interface/L1TriggerKeyListRcd.h"
00037 
00038 template <class T> class DEcompare;
00039 
00040 class L1Comparator : public edm::EDProducer {
00041 
00042 public:
00043 
00044   explicit L1Comparator(const edm::ParameterSet&);
00045   ~L1Comparator();
00046   
00047 private:
00048 
00049   virtual void beginJob(void);
00050   virtual void beginRun(edm::Run const&, const edm::EventSetup&) override final;
00051    virtual void produce (edm::Event&, const edm::EventSetup&);
00052   virtual void endJob();
00053 
00054   template <class T> 
00055     void process( T const*, T const*, const int, const int);
00056   template <class T> 
00057     void process(const edm::Handle<T> data, const edm::Handle<T> emul, 
00058                  const int sys, const int cid) {
00059     if(data.isValid()&&emul.isValid())
00060       process(data.product(),emul.product(),sys, cid);
00061   }
00062 
00063   template <class T> bool CompareCollections(edm::Handle<T> data, edm::Handle<T> emul);
00064   template <class T> bool dumpCandidate(const T& dt, const T& em, std::ostream& s);
00065 
00066   int verbose() {return verbose_;}
00067 
00068  private:
00069 
00070   int nevt_;
00071   int evtNum_;
00072   int runNum_;
00073   int verbose_;
00074   bool dumpEvent_;
00075 
00076   edm::InputTag m_DEsource[dedefs::DEnsys][4];
00077   bool m_doSys[dedefs::DEnsys];
00078   std::string m_dumpFileName;
00079   std::ofstream m_dumpFile;
00080   int m_dumpMode;
00081   bool m_match;
00082   bool DEmatchEvt[dedefs::DEnsys]; 
00083   int DEncand[dedefs::DEnsys][2];
00084   L1DEDigiCollection m_dedigis;
00085 
00086 };
00087 
00088 #endif