CMS 3D CMS Logo

/data/refman/pasoursint/CMSSW_5_3_0/src/DQM/L1TMonitor/interface/L1GtHwValidation.h

Go to the documentation of this file.
00001 #ifndef DQM_L1TMonitor_L1GtHwValidation_h
00002 #define DQM_L1TMonitor_L1GtHwValidation_h
00003 
00021 // system include files
00022 #include <memory>
00023 #include <string>
00024 
00025 // user include files
00026 #include "FWCore/Framework/interface/Frameworkfwd.h"
00027 #include "FWCore/Framework/interface/EDAnalyzer.h"
00028 
00029 #include "FWCore/Framework/interface/Event.h"
00030 #include "FWCore/Framework/interface/MakerMacros.h"
00031 
00032 #include "FWCore/ParameterSet/interface/ParameterSet.h"
00033 #include "FWCore/Utilities/interface/InputTag.h"
00034 
00035 #include "DQMServices/Core/interface/DQMStore.h"
00036 #include "DQMServices/Core/interface/MonitorElement.h"
00037 
00038 #include "DataFormats/L1GlobalTrigger/interface/L1GtObject.h"
00039 #include "CondFormats/L1TObjects/interface/L1GtDefinitions.h"
00040 
00041 // forward declarations
00042 class L1GtfeWord;
00043 class L1GtFdlWord;
00044 class L1GtPsbWord;
00045 class L1TcsWord;
00046 class L1GtTriggerMenu;
00047 class L1GtPrescaleFactors;
00048 class L1GtTriggerMask;
00049 
00050 // class declaration
00051 
00052 class L1GtHwValidation: public edm::EDAnalyzer
00053 {
00054 
00055 public:
00056     explicit L1GtHwValidation(const edm::ParameterSet&);
00057     virtual ~L1GtHwValidation();
00058 
00059 private:
00060 
00062     virtual void compareGTFE(const edm::Event&, const edm::EventSetup&,
00063             const L1GtfeWord&, const L1GtfeWord&, const int);
00064 
00066     virtual void compareFDL(const edm::Event&, const edm::EventSetup&,
00067             const L1GtFdlWord&, const L1GtFdlWord&, const int);
00068 
00070     virtual void comparePSB(const edm::Event&, const edm::EventSetup&,
00071             const L1GtPsbWord&, const L1GtPsbWord&);
00072 
00074     virtual void compareTCS(const edm::Event&, const edm::EventSetup&,
00075             const L1TcsWord&, const L1TcsWord&);
00076 
00078     virtual void compareDaqRecord(const edm::Event&, const edm::EventSetup&);
00079 
00081     virtual void compareEvmRecord(const edm::Event&, const edm::EventSetup&);
00082 
00085     virtual void compareGt_Gct(const edm::Event&, const edm::EventSetup&);
00086 
00088     void bookHistograms();
00089 
00092     bool matchCondCategory(const L1GtConditionCategory&, const L1GtConditionCategory&);
00093 
00096     bool matchCondType(const L1GtConditionType&, const L1GtConditionType&);
00097 
00100     bool matchCondL1GtObject(const std::vector<L1GtObject>&, const L1GtObject&);
00101 
00103     void excludedAlgoList();
00104 
00106     bool excludedAlgo(const int&) const;
00107 
00108     virtual void beginJob();
00109     void beginRun(const edm::Run& run, const edm::EventSetup& c);
00110 
00111     virtual void analyze(const edm::Event&, const edm::EventSetup&);
00112 
00113     void endRun(const edm::Run& run, const edm::EventSetup& c);
00114     virtual void endJob();
00115 
00116 private:
00117 
00119     edm::InputTag m_l1GtDataDaqInputTag;
00120 
00122     edm::InputTag m_l1GtDataEvmInputTag;
00123 
00125     edm::InputTag m_l1GtEmulDaqInputTag;
00126 
00128     edm::InputTag m_l1GtEmulEvmInputTag;
00129 
00131     edm::InputTag m_l1GctDataInputTag;
00132 
00134     std::string m_dirName;
00135 
00138     std::vector<edm::ParameterSet> m_excludeCondCategTypeObject;
00139 
00141     std::vector<std::string> m_excludeAlgoTrigByName;
00142 
00144     std::vector<int> m_excludeAlgoTrigByBit;
00145 
00146 
00147 private:
00148 
00150     std::vector<L1GtConditionCategory> m_excludedCondCategory;
00151 
00153     std::vector<L1GtConditionType> m_excludedCondType;
00154 
00156     std::vector<L1GtObject> m_excludedL1GtObject;
00157 
00160     std::ostringstream m_myCoutStream;
00161 
00163     int m_nrDataEventError;
00164     int m_nrEmulEventError;
00165 
00166     // cached stuff
00167 
00169     const L1GtTriggerMenu* m_l1GtMenu;
00170     unsigned long long m_l1GtMenuCacheID;
00171 
00173     const L1GtPrescaleFactors* m_l1GtPfAlgo;
00174     unsigned long long m_l1GtPfAlgoCacheID;
00175 
00176     const L1GtPrescaleFactors* m_l1GtPfTech;
00177     unsigned long long m_l1GtPfTechCacheID;
00178 
00179     const std::vector<std::vector<int> >* m_prescaleFactorsAlgoTrig;
00180     const std::vector<std::vector<int> >* m_prescaleFactorsTechTrig;
00181 
00183     const L1GtTriggerMask* m_l1GtTmAlgo;
00184     unsigned long long m_l1GtTmAlgoCacheID;
00185 
00186     const L1GtTriggerMask* m_l1GtTmTech;
00187     unsigned long long m_l1GtTmTechCacheID;
00188 
00189     std::vector<unsigned int> m_triggerMaskAlgoTrig;
00190     std::vector<unsigned int> m_triggerMaskTechTrig;
00191 
00192 private:
00193 
00195 
00196     DQMStore* m_dbe;
00197 
00198     bool m_agree;
00199     bool m_dataOnly;
00200     bool m_emulOnly;
00201     bool m_dataOnlyMask;
00202     bool m_emulOnlyMask;
00203 
00204 private:
00205 
00206     static const int TotalBxInEvent = 5;
00207     static const int NumberOfGtRecords = 2; // DAQ and EVM
00208 
00210 
00212     MonitorElement* m_gtfeDataEmul[NumberOfGtRecords];
00213 
00215     MonitorElement* m_fdlDataEmul[TotalBxInEvent][NumberOfGtRecords];
00216     //
00217     MonitorElement* m_fdlDataAlgoDecision[TotalBxInEvent][NumberOfGtRecords];
00218     MonitorElement* m_fdlDataAlgoDecisionPrescaled[TotalBxInEvent][NumberOfGtRecords];
00219     MonitorElement* m_fdlDataAlgoDecisionUnprescaled[TotalBxInEvent][NumberOfGtRecords];
00220     MonitorElement* m_fdlDataAlgoDecisionMask[TotalBxInEvent][NumberOfGtRecords];
00221     MonitorElement* m_fdlDataAlgoDecision_NoMatch[TotalBxInEvent][NumberOfGtRecords];
00222     MonitorElement* m_fdlDataAlgoDecisionPrescaled_NoMatch[TotalBxInEvent][NumberOfGtRecords];
00223     MonitorElement* m_fdlDataAlgoDecisionUnprescaled_NoMatch[TotalBxInEvent][NumberOfGtRecords];
00224     MonitorElement* m_fdlDataAlgoDecisionMask_NoMatch[TotalBxInEvent][NumberOfGtRecords];
00225     MonitorElement* m_fdlDataAlgoDecisionPrescaledMask_NoMatch[TotalBxInEvent][NumberOfGtRecords];
00226     MonitorElement* m_fdlDataAlgoDecisionUnprescaledMask_NoMatch[TotalBxInEvent][NumberOfGtRecords];
00227     MonitorElement* m_fdlDataAlgoDecision_Err[NumberOfGtRecords];
00228 
00229     MonitorElement* m_fdlEmulAlgoDecision[TotalBxInEvent][NumberOfGtRecords];
00230     MonitorElement* m_fdlEmulAlgoDecisionPrescaled[TotalBxInEvent][NumberOfGtRecords];
00231     MonitorElement* m_fdlEmulAlgoDecisionUnprescaled[TotalBxInEvent][NumberOfGtRecords];
00232     MonitorElement* m_fdlEmulAlgoDecisionMask[TotalBxInEvent][NumberOfGtRecords];
00233     MonitorElement* m_fdlEmulAlgoDecision_NoMatch[TotalBxInEvent][NumberOfGtRecords];
00234     MonitorElement* m_fdlEmulAlgoDecisionPrescaled_NoMatch[TotalBxInEvent][NumberOfGtRecords];
00235     MonitorElement* m_fdlEmulAlgoDecisionUnprescaled_NoMatch[TotalBxInEvent][NumberOfGtRecords];
00236     MonitorElement* m_fdlEmulAlgoDecisionMask_NoMatch[TotalBxInEvent][NumberOfGtRecords];
00237     MonitorElement* m_fdlEmulAlgoDecisionPrescaledMask_NoMatch[TotalBxInEvent][NumberOfGtRecords];
00238     MonitorElement* m_fdlEmulAlgoDecisionUnprescaledMask_NoMatch[TotalBxInEvent][NumberOfGtRecords];
00239     MonitorElement* m_fdlEmulAlgoDecision_Err[NumberOfGtRecords];
00240 
00241     //
00242     MonitorElement* m_fdlDataEmulAlgoDecision[TotalBxInEvent][NumberOfGtRecords];
00243     MonitorElement* m_fdlDataEmulAlgoDecisionPrescaled[TotalBxInEvent][NumberOfGtRecords];
00244     MonitorElement* m_fdlDataEmulAlgoDecisionUnprescaled[TotalBxInEvent][NumberOfGtRecords];
00245     MonitorElement* m_fdlDataEmulAlgoDecisionUnprescaledAllowed[TotalBxInEvent][NumberOfGtRecords];
00246     MonitorElement* m_fdlDataEmulAlgoDecisionMask[TotalBxInEvent][NumberOfGtRecords];
00247     MonitorElement* m_fdlDataEmulAlgoDecision_Err[NumberOfGtRecords];
00248     MonitorElement* m_fdlDataEmul_Err[NumberOfGtRecords];
00249 
00250     //
00251     MonitorElement* m_fdlDataTechDecision[TotalBxInEvent][NumberOfGtRecords];
00252     MonitorElement* m_fdlDataTechDecisionMask[TotalBxInEvent][NumberOfGtRecords];
00253     MonitorElement* m_fdlDataTechDecision_Err[NumberOfGtRecords];
00254 
00255     MonitorElement* m_fdlEmulTechDecision[TotalBxInEvent][NumberOfGtRecords];
00256     MonitorElement* m_fdlEmulTechDecisionMask[TotalBxInEvent][NumberOfGtRecords];
00257     MonitorElement* m_fdlEmulTechDecision_Err[NumberOfGtRecords];
00258 
00259     MonitorElement* m_fdlDataEmulTechDecision[TotalBxInEvent][NumberOfGtRecords];
00260     MonitorElement* m_fdlDataEmulTechDecisionMask[TotalBxInEvent][NumberOfGtRecords];
00261     MonitorElement* m_fdlDataEmulTechDecision_Err[NumberOfGtRecords];
00262 
00263     MonitorElement* m_excludedAlgorithmsAgreement;
00264 
00266 
00267     // FIXME add PSB comparison
00268 
00270     MonitorElement* m_gtErrorFlag;
00271 
00272 
00274     int m_nrEvJob;
00275     int m_nrEvRun;
00276 
00277 
00278     std::vector<int> m_excludedAlgoList;
00279 
00280 
00281 };
00282 
00283 #endif /*DQM_L1TMonitor_L1GtHwValidation_h*/