diff --git a/DQM/L1TMonitor/doc/gitWorkflow.txt b/DQM/L1TMonitor/doc/gitWorkflow.txt new file mode 100644 index 0000000000000..e69de29bb2d1d diff --git a/DQMOffline/L1Trigger/interface/L1TBeamConfiguration.h b/DQMOffline/L1Trigger/interface/L1TBeamConfiguration.h index 6db678026bde5..3612e27c53bd9 100644 --- a/DQMOffline/L1Trigger/interface/L1TBeamConfiguration.h +++ b/DQMOffline/L1Trigger/interface/L1TBeamConfiguration.h @@ -1,7 +1,7 @@ #ifndef DQMOffline_L1Trigger_L1TBeamConfiguration_h #define DQMOffline_L1Trigger_L1TBeamConfiguration_h -/* +/** * \class L1TBeamConfiguration * * diff --git a/DQMOffline/L1Trigger/interface/L1TEfficiencyEG_Offline.h b/DQMOffline/L1Trigger/interface/L1TEfficiencyEG_Offline.h index a52d430d2369d..6a2356ce162bd 100644 --- a/DQMOffline/L1Trigger/interface/L1TEfficiencyEG_Offline.h +++ b/DQMOffline/L1Trigger/interface/L1TEfficiencyEG_Offline.h @@ -1,7 +1,7 @@ #ifndef DQMOFFLINE_L1TRIGGER_L1TEFFICIENCYEG_OFFLINE_H #define DQMOFFLINE_L1TRIGGER_L1TEFFICIENCYEG_OFFLINE_H -/* +/** * \file L1TEfficiencyEG.h * * \author J. Pela diff --git a/DQMOffline/L1Trigger/interface/L1TEfficiencyJets_Offline.h b/DQMOffline/L1Trigger/interface/L1TEfficiencyJets_Offline.h index 10a655beef1ba..c0dd4276d7a26 100644 --- a/DQMOffline/L1Trigger/interface/L1TEfficiencyJets_Offline.h +++ b/DQMOffline/L1Trigger/interface/L1TEfficiencyJets_Offline.h @@ -1,7 +1,7 @@ #ifndef DQMOFFLINE_L1TRIGGER_L1TEFFICIENCYJETS_OFFLINE_H #define DQMOFFLINE_L1TRIGGER_L1TEFFICIENCYJETS_OFFLINE_H -/* +/** * \file L1TEfficiencyJets.h * * \author J. Pela diff --git a/DQMOffline/L1Trigger/interface/L1TEfficiencyMuons_Offline.h b/DQMOffline/L1Trigger/interface/L1TEfficiencyMuons_Offline.h index de3def5ea697e..0cb6ba5b046cf 100644 --- a/DQMOffline/L1Trigger/interface/L1TEfficiencyMuons_Offline.h +++ b/DQMOffline/L1Trigger/interface/L1TEfficiencyMuons_Offline.h @@ -1,7 +1,7 @@ #ifndef DQMOFFLINE_L1TRIGGER_L1TEFFICIENCYMUON_OFFLINE_H #define DQMOFFLINE_L1TRIGGER_L1TEFFICIENCYMUON_OFFLINE_H -/* +/** * \file L1TEfficiencyMuons.h * * \author J. Pela, C. Battilana diff --git a/DQMOffline/L1Trigger/interface/L1TEfficiency_Harvesting.h b/DQMOffline/L1Trigger/interface/L1TEfficiency_Harvesting.h index cf9c8d3f30dd2..274f8ed05beec 100644 --- a/DQMOffline/L1Trigger/interface/L1TEfficiency_Harvesting.h +++ b/DQMOffline/L1Trigger/interface/L1TEfficiency_Harvesting.h @@ -1,7 +1,7 @@ #ifndef DQMOFFLINE_L1TRIGGER_L1TEFFICIENCYHARVESTING_H #define DQMOFFLINE_L1TRIGGER_L1TEFFICIENCYHARVESTING_H -/* +/** * \file L1TEfficiencyHarvesting.h * * \author J. Pela, C. Battilana diff --git a/DQMOffline/L1Trigger/interface/L1TLSBlock.h b/DQMOffline/L1Trigger/interface/L1TLSBlock.h index 1f5e53e4d973f..33ded971e2303 100644 --- a/DQMOffline/L1Trigger/interface/L1TLSBlock.h +++ b/DQMOffline/L1Trigger/interface/L1TLSBlock.h @@ -1,7 +1,7 @@ #ifndef DQMOffline_L1Trigger_L1TLSBlock_h #define DQMOffline_L1Trigger_L1TLSBlock_h -/* +/** * \class L1TLSBlock * * diff --git a/DQMOffline/L1Trigger/interface/L1TMenuHelper.h b/DQMOffline/L1Trigger/interface/L1TMenuHelper.h index 8455fbe0e5805..4ca6db2a94bb5 100644 --- a/DQMOffline/L1Trigger/interface/L1TMenuHelper.h +++ b/DQMOffline/L1Trigger/interface/L1TMenuHelper.h @@ -1,7 +1,7 @@ #ifndef DQMOFFLINE_L1TRIGGER_L1TMENUHELPER_H #define DQMOFFLINE_L1TRIGGER_L1TMENUHELPER_H -/* +/** * \file L1TMenuHelper.h * * \author J. Pela diff --git a/DQMOffline/L1Trigger/interface/L1TRate_Harvest.h b/DQMOffline/L1Trigger/interface/L1TRate_Harvest.h index 22fd1c94e3cc1..7de60a6db750b 100644 --- a/DQMOffline/L1Trigger/interface/L1TRate_Harvest.h +++ b/DQMOffline/L1Trigger/interface/L1TRate_Harvest.h @@ -1,13 +1,6 @@ #ifndef DQMOFFLINE_L1TRIGGER_L1TRATE_HARVEST_H #define DQMOFFLINE_L1TRIGGER_L1TRATE_HARVEST_H -/* - * \file L1TRate_Harvest.h - * - * \author J. Pela - * -*/ - // system include files #include #include @@ -53,7 +46,8 @@ class L1TRate_Harvest : public edm::EDAnalyzer { protected: - void analyze (const edm::Event& e, const edm::EventSetup& c); // Analyze + void analyze (const edm::Event& e, const edm::EventSetup& c) { + }; // Analyze void beginJob(); // BeginJob void endJob (); // EndJob void beginRun(const edm::Run& run, const edm::EventSetup& iSetup); @@ -65,7 +59,7 @@ class L1TRate_Harvest : public edm::EDAnalyzer { // Private methods private: - bool getXSexFitsOMDS (const edm::ParameterSet& ps); + // bool getXSexFitsOMDS (const edm::ParameterSet& ps); bool getXSexFitsPython(const edm::ParameterSet& ps); // Private variables @@ -90,12 +84,20 @@ class L1TRate_Harvest : public edm::EDAnalyzer { std::map m_lsLuminosity; // Map of luminosity recorded for each LS std::map > m_lsRates; // Map of rates (by bit) recorded for each LS std::map m_algoBit; // Map of bit associated with a L1 Algo alias + std::map m_algoFit; // Map of bit associated with a L1 Algo alias std::map m_inputCategories; // Map of categories to monitor std::map m_selectedTriggers; // Map of what trigger to monitor for each category std::map m_xSecObservedToExpected; // Monitor Elements for Observed to Expected Algo XSec std::map m_xSecVsInstLumi; // Monitor Elements for Algo XSec vs Instant Luminosity + + std::map m_CountsVsLS; // Monitor Elements for + std::map m_InstLumiVsLS; // Monitor Elements for + std::map m_PrescIndexVsLS; // Monitor Elements for + std::map m_templateFunctions; // For each trigger template f(InstLumi)=XSec - + + std::map > m_lsCounts; // Map of counts (by bit) recorded for each LS + // Input tags edm::InputTag m_scalersSource; // Where to get L1 Scalers edm::InputTag m_l1GtDataDaqInputTag; // Where to get L1 GT Data DAQ diff --git a/DQMOffline/L1Trigger/interface/L1TRate_Offline.h b/DQMOffline/L1Trigger/interface/L1TRate_Offline.h index 4162222fffbf8..3e6c5ed3d8163 100644 --- a/DQMOffline/L1Trigger/interface/L1TRate_Offline.h +++ b/DQMOffline/L1Trigger/interface/L1TRate_Offline.h @@ -1,13 +1,6 @@ #ifndef DQMOFFLINE_L1TRIGGER_L1TRATE_OFFLINE_H #define DQMOFFLINE_L1TRIGGER_L1TRATE_OFFLINE_H -/* - * \file L1TRate_Offline.h - * - * \author J. Pela - * -*/ - // system include files #include #include @@ -73,7 +66,7 @@ class L1TRate_Offline : public edm::EDAnalyzer { virtual void endLuminosityBlock (edm::LuminosityBlock const& lumiBlock, edm::EventSetup const& c); // Private methods -private: +//private: // bool getXSexFitsOMDS (const edm::ParameterSet& ps); bool getXSexFitsPython(const edm::ParameterSet& ps); @@ -96,6 +89,7 @@ class L1TRate_Offline : public edm::EDAnalyzer { const std::vector< std::vector >* m_listsPrescaleFactors; // Collection os all sets of prescales // Maps + std::map m_lsDeadTime; // Map of dead time for each LS std::map m_lsPrescaleIndex; // Map of precale index for each LS std::map m_lsLuminosity; // Map of luminosity recorded for each LS std::map > m_lsRates; // Map of rates (by bit) recorded for each LS @@ -105,19 +99,28 @@ class L1TRate_Offline : public edm::EDAnalyzer { std::map m_selectedTriggers; // Map of what trigger to monitor for each category std::map m_xSecObservedToExpected; // Monitor Elements for Observed to Expected Algo XSec std::map m_xSecVsInstLumi; // Monitor Elements for Algo XSec vs Instant Luminosity + + std::map m_xSecObservedVsDelivLumi; + std::map m_xSecObservedVsRecorLumi; + + + std::map m_CountsVsLS; // Monitor Elements for counts + std::map m_InstLumiVsLS; // Monitor Elements for Instant Lumi + std::map m_PrescIndexVsLS; // Monitor Elements for Prescale Index + // std::map m_DeadTimeVsLS; // Monitor Elements (Check Purpose) - std::map m_CountsVsLS; // Monitor Elements for - std::map m_InstLumiVsLS; // Monitor Elements for - std::map m_PrescIndexVsLS; // Monitor Elements for + std::map m_xSecObservedVsLS; + std::map m_DelivLumiVsLS; + std::map m_RecorLumiVsLS; std::map m_templateFunctions; // For each trigger template f(InstLumi)=XSec std::map > m_lsCounts; // Map of counts (by bit) recorded for each LS // Input tags - edm::EDGetTokenT m_scalersSource_LSCollection; // Where to get L1 Scalers + edm::EDGetTokenT m_scalersSource_LSCollection; // Where to get L1 Scalers edm::EDGetTokenT m_scalersSource_L1TSCollection; // Where to get L1 Scalers - edm::EDGetTokenT m_l1GtDataDaqInputTag; // Where to get L1 GT Data DAQ + edm::EDGetTokenT m_l1GtDataDaqInputTag; // Where to get L1 GT Data DAQ // ParameterSet edm::ParameterSet m_parameters; diff --git a/DQMOffline/L1Trigger/interface/L1TSync_Harvest.h b/DQMOffline/L1Trigger/interface/L1TSync_Harvest.h index ee2f8928f1cd0..70867a5bc9a45 100644 --- a/DQMOffline/L1Trigger/interface/L1TSync_Harvest.h +++ b/DQMOffline/L1Trigger/interface/L1TSync_Harvest.h @@ -1,7 +1,7 @@ #ifndef DQMOffline_L1Trigger_L1TSync_Harvest_h #define DQMOffline_L1Trigger_L1TSync_Harvest_h -/* +/** * \class L1TSync_Harvest * * diff --git a/DQMOffline/L1Trigger/python/L1TRateOfflineParams_cff.py b/DQMOffline/L1Trigger/python/L1TRateOfflineParams_cff.py index 2162c78e26115..660056595f2d0 100644 --- a/DQMOffline/L1Trigger/python/L1TRateOfflineParams_cff.py +++ b/DQMOffline/L1Trigger/python/L1TRateOfflineParams_cff.py @@ -1,5 +1,53 @@ import FWCore.ParameterSet.Config as cms +RateParams_2012 = cms.VPSet( +cms.PSet( + AlgoName = cms.string ('L1_SingleEG22'), + TemplateFunction = cms.string ('[0]/x+[1]+[2]*x+[3]*x*x'), + Parameters = cms.vdouble(-250.646,1.78975,-5.5801e-05,5.90724e-09), + ParErrors = cms.vdouble(4.6133,0.00124988,2.17871e-07,2.56616e-11), + ), +cms.PSet( + AlgoName = cms.string ('L1_ETM50'), + TemplateFunction = cms.string ('[0]/x+[1]+[2]*x+[3]*x*x'), + Parameters = cms.vdouble(-781.253,0.589212,-8.09682e-05,6.11958e-09), + ParErrors = cms.vdouble(1.57155,0.000427218,7.48549e-08,8.83838e-12), + ), +cms.PSet( + AlgoName = cms.string ('L1_ETT80'), + TemplateFunction = cms.string ('[0]/x+[1]+[2]*x+[3]*x*x'), + Parameters = cms.vdouble(6.41489e+06,-3748.94,0.656481,-2.14204e-05), + ParErrors = cms.vdouble(34685.1,9.68504,0.00177067,2.12745e-07), + ), +cms.PSet( + AlgoName = cms.string ('L1_HTT100'), + TemplateFunction = cms.string ('[0]/x+[1]+[2]*x+[3]*x*x'), + Parameters = cms.vdouble(-461.806,0.635347,-1.80574e-05,1.61805e-08), + ParErrors = cms.vdouble(2026.82,0.549814,9.61286e-05,1.1393e-08), + ), +cms.PSet( + AlgoName = cms.string ('L1_SingleIsoEG20er'), + TemplateFunction = cms.string ('[0]/x+[1]+[2]*x+[3]*x*x'), + Parameters = cms.vdouble(152.06,1.02088,5.33485e-06,9.91573e-10), + ParErrors = cms.vdouble(3.81866,0.00103454,1.80314e-07,2.12361e-11), + ), +cms.PSet( + AlgoName = cms.string ('L1_SingleJet128'), + TemplateFunction = cms.string ('[0]/x+[1]+[2]*x+[3]*x*x'), + Parameters = cms.vdouble(-217.021,0.326,-1.41957e-05,1.4588e-09), + ParErrors = cms.vdouble(1.82347,0.000494797,8.64361e-08,1.01899e-11), + ), +cms.PSet( + AlgoName = cms.string ('L1_SingleMu16'), + TemplateFunction = cms.string ('[0]/x+[1]+[2]*x+[3]*x*x'), + Parameters = cms.vdouble(-5435.68,6.38796,-0.000563198,3.4096e-08), + ParErrors = cms.vdouble(7.08545,0.00194953,3.5046e-07,4.37085e-11), + ), + +) + + + RateParams_2011 = cms.VPSet( cms.PSet( AlgoName = cms.string ('L1_BeamHalo'), @@ -332,11 +380,11 @@ ParErrors = cms.vdouble(0.283,0.00273,1.62e-05,5.72e-08), ), cms.PSet( -AlgoName = cms.string ('L1_SingleJet32_NotBptxOR_NotMuBeamHalo'), -TemplateFunction = cms.string ('[0]/x+[1]+[2]*x+[3]*x*x'), - Parameters = cms.vdouble(-37.43,2.527,-0.005776,1.052e-05), - ParErrors = cms.vdouble(1.01,0.00972,5.75e-05,2.04e-07), - ), + AlgoName = cms.string ('L1_SingleJet32_NotBptxOR_NotMuBeamHalo'), + TemplateFunction = cms.string ('[0]/x+[1]+[2]*x+[3]*x*x'), + Parameters = cms.vdouble(-37.43,2.527,-0.005776,1.052e-05), + ParErrors = cms.vdouble(1.01,0.00972,5.75e-05,2.04e-07), + ), cms.PSet( AlgoName = cms.string ('L1_DoubleJet44_Central'), TemplateFunction = cms.string ('[0]/x+[1]+[2]*x+[3]*x*x'), @@ -724,6 +772,8 @@ ) + + RateParams_2010 = cms.VPSet( cms.PSet( AlgoName = cms.string ('L1_SingleTauJet50U'), @@ -1262,4 +1312,4 @@ ) -RateParams = RateParams_2011 +RateParams = RateParams_2012 diff --git a/DQMOffline/L1Trigger/python/L1TRate_Harvest_cfi.py b/DQMOffline/L1Trigger/python/L1TRate_Harvest_cfi.py index 5345f5a0dba2d..4a486578f124a 100644 --- a/DQMOffline/L1Trigger/python/L1TRate_Harvest_cfi.py +++ b/DQMOffline/L1Trigger/python/L1TRate_Harvest_cfi.py @@ -1,6 +1,6 @@ import FWCore.ParameterSet.Config as cms -from DQMOffline.L1Trigger.L1TRateParams_cff import RateParams +from DQMOffline.L1Trigger.L1TRateOfflineParams_cff import RateParams l1tRate_Harvest = cms.EDAnalyzer("L1TRate_Harvest", @@ -53,7 +53,7 @@ # Algo XSec Fits # srcAlgoXSecFit = 0 -> From WbM via OMDS # srcAlgoXSecFit = 1 -> From python - srcAlgoXSecFit = cms.int32(0), + srcAlgoXSecFit = cms.int32(1), # if srcAlgoXSecFit = 0 we need to define ## Online diff --git a/DQMOffline/L1Trigger/python/L1TRate_Offline_cfi.py b/DQMOffline/L1Trigger/python/L1TRate_Offline_cfi.py index e2acd62559e2e..2e14945bee03d 100644 --- a/DQMOffline/L1Trigger/python/L1TRate_Offline_cfi.py +++ b/DQMOffline/L1Trigger/python/L1TRate_Offline_cfi.py @@ -16,7 +16,7 @@ # set to 0 again. lsShiftGTRates = cms.untracked.int32(-1), - verbose = cms.untracked.bool(False), + verbose = cms.untracked.bool(False), # This must be off when running on official release dqmStore = cms.untracked.bool(True), disableROOToutput = cms.untracked.bool(True), inputTagScalersResults = cms.InputTag("scalersRawToDigi"), diff --git a/DQMOffline/L1Trigger/src/L1TBeamConfiguration.cc b/DQMOffline/L1Trigger/src/L1TBeamConfiguration.cc index 86fda6eeb4c7d..8b8a0acf7499d 100644 --- a/DQMOffline/L1Trigger/src/L1TBeamConfiguration.cc +++ b/DQMOffline/L1Trigger/src/L1TBeamConfiguration.cc @@ -1,4 +1,4 @@ - /* +/** * \class L1TBeamConfiguration * * diff --git a/DQMOffline/L1Trigger/src/L1TEfficiencyEG_Offline.cc b/DQMOffline/L1Trigger/src/L1TEfficiencyEG_Offline.cc index 0a885a3fa30e8..e837456b099fa 100644 --- a/DQMOffline/L1Trigger/src/L1TEfficiencyEG_Offline.cc +++ b/DQMOffline/L1Trigger/src/L1TEfficiencyEG_Offline.cc @@ -1,7 +1,7 @@ -/* +/** * \file L1TEfficiencyEG_Offline.cc * - * \author J. Pela, P. Musella + * \author J. Pela * */ diff --git a/DQMOffline/L1Trigger/src/L1TEfficiencyJets_Offline.cc b/DQMOffline/L1Trigger/src/L1TEfficiencyJets_Offline.cc index d4ed54167ddfa..c232482437371 100644 --- a/DQMOffline/L1Trigger/src/L1TEfficiencyJets_Offline.cc +++ b/DQMOffline/L1Trigger/src/L1TEfficiencyJets_Offline.cc @@ -1,7 +1,7 @@ -/* +/** * \file L1TEfficiencyJets_Offline.cc * - * \author J. Pela, P. Musella + * \author J. Pela * */ diff --git a/DQMOffline/L1Trigger/src/L1TEfficiencyMuons_Offline.cc b/DQMOffline/L1Trigger/src/L1TEfficiencyMuons_Offline.cc index 2e6cca260c5bf..9f4d166697c22 100644 --- a/DQMOffline/L1Trigger/src/L1TEfficiencyMuons_Offline.cc +++ b/DQMOffline/L1Trigger/src/L1TEfficiencyMuons_Offline.cc @@ -1,28 +1,28 @@ - /* - * \file L1TEfficiencyMuons_Offline.cc - * - * \author J. Pela, C. Battilana - * - */ +/** + * \file L1TEfficiencyMuons_Offline.cc + * + * \author J. Pela, C. Battilana + * + */ + +#include "DQMOffline/L1Trigger/interface/L1TEfficiencyMuons_Offline.h" - #include "DQMOffline/L1Trigger/interface/L1TEfficiencyMuons_Offline.h" - - #include "DQMServices/Core/interface/DQMStore.h" - - #include "DataFormats/Histograms/interface/MEtoEDMFormat.h" +#include "DQMServices/Core/interface/DQMStore.h" - #include "DataFormats/MuonReco/interface/MuonSelectors.h" - - #include "DataFormats/GeometrySurface/interface/Cylinder.h" - #include "DataFormats/GeometrySurface/interface/Plane.h" +#include "DataFormats/Histograms/interface/MEtoEDMFormat.h" + +#include "DataFormats/MuonReco/interface/MuonSelectors.h" + +#include "DataFormats/GeometrySurface/interface/Cylinder.h" +#include "DataFormats/GeometrySurface/interface/Plane.h" + +#include "TMath.h" + +using namespace reco; +using namespace trigger; +using namespace edm; +using namespace std; - #include "TMath.h" - - using namespace reco; - using namespace trigger; - using namespace edm; - using namespace std; - //__________RECO-GMT Muon Pair Helper Class____________________________ diff --git a/DQMOffline/L1Trigger/src/L1TEfficiency_Harvesting.cc b/DQMOffline/L1Trigger/src/L1TEfficiency_Harvesting.cc index c04cdc2215920..6249edc1bff0e 100644 --- a/DQMOffline/L1Trigger/src/L1TEfficiency_Harvesting.cc +++ b/DQMOffline/L1Trigger/src/L1TEfficiency_Harvesting.cc @@ -1,4 +1,4 @@ -/* +/** * \file L1TEfficiency_Harvesting.cc * * \author J. Pela, C. Battilana diff --git a/DQMOffline/L1Trigger/src/L1TLSBlock.cc b/DQMOffline/L1Trigger/src/L1TLSBlock.cc index 9ec201430925e..672f87fc72520 100644 --- a/DQMOffline/L1Trigger/src/L1TLSBlock.cc +++ b/DQMOffline/L1Trigger/src/L1TLSBlock.cc @@ -1,4 +1,4 @@ -/* +/** * \class L1TLSBlock * * diff --git a/DQMOffline/L1Trigger/src/L1TMenuHelper.cc b/DQMOffline/L1Trigger/src/L1TMenuHelper.cc index e9112a38d57ce..048a78d4edd63 100644 --- a/DQMOffline/L1Trigger/src/L1TMenuHelper.cc +++ b/DQMOffline/L1Trigger/src/L1TMenuHelper.cc @@ -1,5 +1,4 @@ - -/* +/** * \file L1TMenuHelper.cc * * \author J. Pela, P. Musella diff --git a/DQMOffline/L1Trigger/src/L1TRate_Harvest.cc b/DQMOffline/L1Trigger/src/L1TRate_Harvest.cc index efee1a1a9b912..c556cdbddc747 100644 --- a/DQMOffline/L1Trigger/src/L1TRate_Harvest.cc +++ b/DQMOffline/L1Trigger/src/L1TRate_Harvest.cc @@ -1,10 +1,3 @@ -/* - * \file L1TRate_Harvest.cc - * - * \author J. Pela, P. Musella - * - */ - // L1TMonitor includes #include "DQMOffline/L1Trigger/interface/L1TRate_Harvest.h" @@ -80,7 +73,7 @@ L1TRate_Harvest::L1TRate_Harvest(const ParameterSet & ps){ bool disable = ps.getUntrackedParameter < bool > ("disableROOToutput", false); if (disable) {m_outputFile = "";} - if (dbe != NULL) {dbe->setCurrentFolder("L1T/L1TRate_Harvest");} + if (dbe != NULL) {dbe->setCurrentFolder("L1T/L1TRate");} } @@ -97,8 +90,8 @@ void L1TRate_Harvest::beginJob(void){ dbe = Service < DQMStore > ().operator->(); if (dbe) { - dbe->setCurrentFolder("L1T/L1TRate_Harvest"); - dbe->rmdir("L1T/L1TRate_Harvest"); + dbe->setCurrentFolder("L1T/L1TRate"); + dbe->rmdir("L1T/L1TRate"); } } @@ -120,7 +113,7 @@ void L1TRate_Harvest::endJob(void){ //_____________________________________________________________________ void L1TRate_Harvest::beginRun(const edm::Run& run, const edm::EventSetup& iSetup){ -// if (m_verbose) {cout << "[L1TRate_Harvest:] Called beginRun." << endl;} + if (m_verbose) {cout << "[L1TRate_Harvest:] Called beginRun." << endl;} // ESHandle menuRcd; // ESHandle l1GtPfAlgo; @@ -132,34 +125,37 @@ void L1TRate_Harvest::beginRun(const edm::Run& run, const edm::EventSetup& iSetu // const L1GtPrescaleFactors* m_l1GtPfAlgo = l1GtPfAlgo.product(); // // Initializing DQM Monitor Elements -// dbe->setCurrentFolder("L1T/L1TRate_Harvest"); +// dbe->setCurrentFolder("L1T/L1TRate"); +// m_ErrorMonitor = dbe->book1D("ErrorMonitor", "ErrorMonitor",2,0,2); +// m_ErrorMonitor->setBinLabel(UNKNOWN ,"UNKNOWN"); +// m_ErrorMonitor->setBinLabel(WARNING_PY_MISSING_FIT,"WARNING_PY_MISSING_FIT"); + +// cout << "[L1TRate_Harvest:] m_ErrorMonitor: " << m_ErrorMonitor << endl; // // Retriving the list of prescale sets // m_listsPrescaleFactors = &(m_l1GtPfAlgo->gtPrescaleFactors()); - + // // Getting Lowest Prescale Single Object Triggers from the menu // L1TMenuHelper myMenuHelper = L1TMenuHelper(iSetup); // m_selectedTriggers = myMenuHelper.getLUSOTrigger(m_inputCategories,m_refPrescaleSet); // //-> Getting template fits for the algLo cross sections -// int srcAlgoXSecFit = m_parameters.getParameter("srcAlgoXSecFit"); -// if (srcAlgoXSecFit == 0){getXSexFitsOMDS (m_parameters);} -// else if(srcAlgoXSecFit == 1){getXSexFitsPython(m_parameters);} +// getXSexFitsPython(m_parameters); // for (CItAlgo algo = menu->gtAlgorithmMap().begin(); algo!=menu->gtAlgorithmMap().end(); ++algo){ -// m_algoBit[(algo->second).algoAlias()] = (algo->second).algoBitNumber(); +// m_algoBit[(algo->second).algoAlias()] = (algo->second).algoBitNumber(); // } -// // double minRate = m_parameters.getParameter("minRate"); -// // double maxRate = m_parameters.getParameter("maxRate"); +// double minInstantLuminosity = m_parameters.getParameter("minInstantLuminosity"); +// double maxInstantLuminosity = m_parameters.getParameter("maxInstantLuminosity"); // // Initializing DQM Monitor Elements // for(map::const_iterator i=m_selectedTriggers.begin() ; i!=m_selectedTriggers.end() ; i++){ -// TString tCategory = (*i).first; -// TString tTrigger = (*i).second; +// TString tCategory = (*i).first; +// TString tTrigger = (*i).second; -// TString tErrorMessage = ""; +// TString tErrorMessage = ""; // TF1* tTestFunction; // if(tTrigger != "Undefined" && m_templateFunctions.find(tTrigger) != m_templateFunctions.end()){ @@ -201,41 +197,55 @@ void L1TRate_Harvest::beginRun(const edm::Run& run, const edm::EventSetup& iSetu // if(tCategory == "Mu" && myMenuHelper.getQualityAlias(tCategory,tTrigger) != 240){ // tErrorMessage += " WARNING: Quality = "; -// tErrorMessage += myMenuHelper.getQualityAlias(tCategory,tTrigger); +// tErrorMessage += myMenuHelper.getQualityAlias(tCategory,tTrigger); // } // } +// dbe->setCurrentFolder("L1T/L1TRate/TriggerCounts"); // trigger counts... +// m_CountsVsLS[tTrigger] = dbe->bookProfile(tCategory, +// "Cross Sec. vs Inst. Lumi Algo: "+tTrigger+tErrorMessage, +// m_maxNbins, +// minInstantLuminosity, +// maxInstantLuminosity,0,500); +// m_CountsVsLS[tTrigger] ->setAxisTitle("Instantaneous Luminosity [10^{30}cm^{-2}s^{-1}]" ,1); +// m_CountsVsLS[tTrigger] ->setAxisTitle("Algorithm #sigma [#mu b]" ,2); +// m_CountsVsLS[tTrigger] ->getTProfile()->GetListOfFunctions()->Add(tTestFunction); +// m_CountsVsLS[tTrigger] ->getTProfile()->SetMarkerStyle(23); + +// m_algoFit[tTrigger] = (TF1*) tTestFunction->Clone("Fit_"+tTrigger); // NOTE: Workaround -// dbe->setCurrentFolder("L1T/L1TRate_Harvest/TriggerRates"); // rate of the trigger... -// m_xSecVsInstLumi[tTrigger] = dbe->book1D(tCategory, -// "Rate "+tTrigger+tErrorMessage, -// m_maxNbins,0.5,m_maxNbins+0.5); -// m_xSecVsInstLumi[tTrigger] ->setAxisTitle("Luminosity Section" ,1); -// m_xSecVsInstLumi[tTrigger] ->setAxisTitle("Rate [Hz]" ,2); -// // m_xSecVsInstLumi[tTrigger] ->getTProfile()->GetListOfFunctions()->Add(tTestFunction); -// m_xSecVsInstLumi[tTrigger] ->getTH1()->SetMarkerStyle(23); +// dbe->setCurrentFolder("L1T/L1TRate/Ratio"); +// m_xSecObservedToExpected[tTrigger] = dbe->book1D(tCategory, "Algo: "+tTrigger+tErrorMessage,m_maxNbins,-0.5,double(m_maxNbins)-0.5); +// m_xSecObservedToExpected[tTrigger] ->setAxisTitle("Lumi Section" ,1); +// m_xSecObservedToExpected[tTrigger] ->setAxisTitle("#sigma_{obs} / #sigma_{exp}" ,2); -// } + +// } } + //_____________________________________________________________________ void L1TRate_Harvest::endRun(const edm::Run& run, const edm::EventSetup& iSetup){ -// if (m_verbose) {cout << "[L1TRate_Harvest:] Called endRun." << endl;} + + if (m_verbose) {cout << "[L1TRate_Harvest:] Called endRun." << endl;} } + + + //_____________________________________________________________________ void L1TRate_Harvest::beginLuminosityBlock(LuminosityBlock const& lumiBlock, EventSetup const& c) { - // if (m_verbose) {cout << "[L1TRate_Harvest:] Called beginLuminosityBlock at LS=" << lumiBlock.id().luminosityBlock() << endl;} +// if (m_verbose) {cout << "[L1TRate_Harvest:] Called beginLuminosityBlock at LS=" << lumiBlock.id().luminosityBlock() << endl;} } //_____________________________________________________________________ void L1TRate_Harvest::endLuminosityBlock(LuminosityBlock const& lumiBlock, EventSetup const& c) { -// int eventLS = lumiBlock.id().luminosityBlock(); +// int eventLS = lumiBlock.id().luminosityBlock(); // if (m_verbose) {cout << "[L1TRate_Harvest:] Called endLuminosityBlock at LS=" << eventLS << endl;} // // We can certify LS -1 since we should have available: @@ -243,212 +253,135 @@ void L1TRate_Harvest::endLuminosityBlock(LuminosityBlock const& lumiBlock, Event // // prescale: current LS // // lumi : current LS // //eventLS--; - + // // Checking if all necessary quantities are defined for our calculations -// bool isDefRate,isDefLumi,isDefPrescaleIndex; -// map* rates=0; +// //bool isDefRate,isDefLumi,isDefPrescaleIndex; +// bool isDefLumi,isDefPrescaleIndex; +// //map* rates=0; // double lumi=0; // int prescalesIndex=0; -// // Reseting MonitorElements so we can refill them +// bool isDefCount; +// map* counts=0; + +// // Resetting MonitorElements so we can refill them // for(map::const_iterator i=m_selectedTriggers.begin() ; i!=m_selectedTriggers.end() ; i++){ // string tTrigger = (*i).second; -// // m_xSecObservedToExpected[tTrigger]->getTH1()->Reset("ICE"); -// m_xSecVsInstLumi [tTrigger]->getTH1()->Reset("ICE"); +// m_CountsVsLS [tTrigger]->getTH1()->Reset("ICE"); +// m_xSecObservedToExpected[tTrigger]->getTH1()->Reset("ICE"); + // } - -// for(map >::iterator i=m_lsRates.begin() ; i!=m_lsRates.end() ; i++){ -// unsigned int ls = (*i).first; -// rates = &(*i).second; -// isDefRate=true; +// //Trying to do the same with Counts.... +// for(map >::iterator j=m_lsRates.begin() ; j!=m_lsRates.end() ; j++){ -// if(m_lsLuminosity.find(ls)==m_lsLuminosity.end()){isDefLumi=false;} +// unsigned int lsOffline = (*j).first; +// counts = &(*j).second; +// isDefCount=true; + +// unsigned int lsPreInd; + +// if(m_lsLuminosity.find(lsOffline)==m_lsLuminosity.end()){isDefLumi=false;} // else{ // isDefLumi=true; -// lumi=m_lsLuminosity[ls]; +// lumi=m_lsLuminosity[lsOffline]; // } - -// if(m_lsPrescaleIndex.find(ls)==m_lsPrescaleIndex.end()){isDefPrescaleIndex=false;} + +// lsPreInd = lsOffline + 1; // NOTE: Workaround + +// if(m_lsPrescaleIndex.find(lsPreInd)==m_lsPrescaleIndex.end()){isDefPrescaleIndex=false;} // else{ // isDefPrescaleIndex=true; -// prescalesIndex=m_lsPrescaleIndex[ls]; +// prescalesIndex=m_lsPrescaleIndex[lsPreInd]; // } - -// if(isDefRate && isDefLumi && isDefPrescaleIndex){ - -// const vector& currentPrescaleFactors = (*m_listsPrescaleFactors).at(prescalesIndex); - -// for(map::const_iterator i=m_selectedTriggers.begin() ; i!=m_selectedTriggers.end() ; i++){ -// string tTrigger = (*i).second; -// // TF1* tTestFunction = (TF1*) m_xSecVsInstLumi[tTrigger]->getTProfile()->GetListOfFunctions()->First(); +// if(isDefCount && isDefLumi && isDefPrescaleIndex){ -// // If trigger name is defined we get the rate fit parameters -// if(tTrigger != "Undefined"){ +// //const vector& currentPrescaleFactors = (*m_listsPrescaleFactors).at(prescalesIndex); -// unsigned int trigBit = m_algoBit[tTrigger]; -// double trigPrescale = currentPrescaleFactors[trigBit]; -// double trigRate = (*rates)[tTrigger]; +// for(map::const_iterator j=m_selectedTriggers.begin() ; j!=m_selectedTriggers.end() ; j++){ -// if(lumi!=0 && trigPrescale!=0 && trigRate!=0){ +// string tTrigger = (*j).second; +// double trigCount = (*counts)[tTrigger]; -// // double AlgoXSec = (trigPrescale*trigRate)/lumi; -// // double TemplateFunctionValue = tTestFunction->Eval(lumi); +// // TF1* tTestFunction = (TF1*) m_CountsVsLS[tTrigger]->getTProfile()->GetListOfFunctions()->First(); +// TF1* tTestFunction = m_algoFit[tTrigger]; // NOTE: Workaround.... -// // Checking against Template function -// int ibin = m_xSecVsInstLumi[tTrigger]->getTH1()->FindBin(ls); -// // m_xSecObservedToExpected[tTrigger]->setBinContent(ibin,AlgoXSec/TemplateFunctionValue); -// m_xSecVsInstLumi[tTrigger]->setBinContent(trigPrescale*trigRate,ibin); - -// // if(m_verbose){cout<<"[L1TRate_Harvest:] ls="< gtReadoutRecordData; -// edm::Handle triggerScalers; -// edm::Handle colLScal; - -// iEvent.getByLabel(m_l1GtDataDaqInputTag, gtReadoutRecordData); -// iEvent.getByLabel(m_scalersSource , colLScal); -// iEvent.getByLabel(m_scalersSource , triggerScalers); +// if(lumi!=0 && trigCount!=0 && prescalesIndex!=0){ -// // Integers -// int EventRun = iEvent.id().run(); -// unsigned int eventLS = iEvent.id().luminosityBlock(); +// double AlgoXSec = (prescalesIndex*trigCount)/lumi; +// double TemplateFunctionValue = tTestFunction->Eval(lumi); -// // Getting the trigger trigger rates from GT and buffering it -// if(triggerScalers.isValid()){ - -// Level1TriggerScalersCollection::const_iterator itL1TScalers = triggerScalers->begin(); -// Level1TriggerRates trigRates(*itL1TScalers,EventRun); - -// int gtLS = (*itL1TScalers).lumiSegmentNr()+m_lsShiftGTRates; - -// // If we haven't got the data from this LS yet get it -// if(m_lsRates.find(gtLS)==m_lsRates.end()){ - -// if (m_verbose) {cout << "[L1TRate_Harvest:] Buffering GT Rates for LS=" << gtLS << endl;} -// map bufferRate; - -// // Buffer the rate informations for all selected bits -// for(map::const_iterator i=m_selectedTriggers.begin() ; i!=m_selectedTriggers.end() ; i++){ +// // Checking against Template function +// m_CountsVsLS [tTrigger]->Fill(lumi,AlgoXSec); -// string tTrigger = (*i).second; +// int ibin = m_xSecObservedToExpected[tTrigger]->getTH1()->FindBin(lsOffline); +// m_xSecObservedToExpected[tTrigger]->setBinContent(ibin,AlgoXSec/TemplateFunctionValue); -// // If trigger name is defined we store the rate -// if(tTrigger != "Undefined"){ +// } +// else { +// m_CountsVsLS [tTrigger]->Fill(0.000001,0.000001); -// unsigned int trigBit = m_algoBit[tTrigger]; -// double trigRate = trigRates.gtAlgoCountsRate()[trigBit]; - -// bufferRate[tTrigger] = trigRate; +// int ibin = m_xSecObservedToExpected[tTrigger]->getTH1()->FindBin(lsOffline); +// m_xSecObservedToExpected[tTrigger]->setBinContent(ibin,0.000001); +// } // } // } -// m_lsRates[gtLS] = bufferRate; // } // } - -// // Getting from the SCAL the luminosity information and buffering it -// if(colLScal.isValid() && colLScal->size()){ - -// LumiScalersCollection::const_iterator itLScal = colLScal->begin(); -// unsigned int scalLS = itLScal->sectionNumber(); - -// // If we haven't got the data from this SCAL LS yet get it -// if(m_lsLuminosity.find(scalLS)==m_lsLuminosity.end()){ - -// if (m_verbose) {cout << "[L1TRate_Harvest:] Buffering SCAL-HF Lumi for LS=" << scalLS << endl;} -// double instLumi = itLScal->instantLumi(); // Getting Instant Lumi from HF (via SCAL) -// double deadTimeNormHF = itLScal->deadTimeNormalization(); // Getting Dead Time Normalization from HF (via SCAL) - -// // If HF Dead Time Corrections is requested we apply it -// // NOTE: By default this is assumed false since for now WbM fits do NOT assume this correction -// if(m_parameters.getUntrackedParameter("useHFDeadTimeNormalization",false)){ - -// // Protecting for deadtime = 0 -// if(deadTimeNormHF==0){instLumi = 0;} -// else {instLumi = instLumi/deadTimeNormHF;} -// } -// // Buffering the luminosity information -// m_lsLuminosity[scalLS]=instLumi; -// } -// } - -// // Getting the prescale index used when this event was triggered -// if(gtReadoutRecordData.isValid()){ - -// // If we haven't got the data from this LS yet get it -// if(m_lsPrescaleIndex.find(eventLS)==m_lsPrescaleIndex.end()){ - -// if (m_verbose) {cout << "[L1TRate_Harvest:] Buffering Prescale Index for LS=" << eventLS << endl;} - -// // Getting Final Decision Logic (FDL) Data from GT -// const vector& gtFdlVectorData = gtReadoutRecordData->gtFdlVector(); - -// // Getting the index for the fdl data for this event -// int indexFDL=0; -// for(unsigned int i=0; i m_fitParameters = ps.getParameter< vector >("fitParameters"); - cout<<"WP02"<("minInstantLuminosity"); double maxInstantLuminosity = m_parameters.getParameter("maxInstantLuminosity"); - cout<<"WP03"<::const_iterator a=m_selectedTriggers.begin() ; a!=m_selectedTriggers.end() ; a++){ - cout<<"WP04-1"<("AlgoName")){ - cout<<"WP05-2"< ("AlgoName"); TString tTemplateFunction = m_fitParameters[b].getParameter< string > ("TemplateFunction"); vector tParameters = m_fitParameters[b].getParameter< vector >("Parameters"); - + // Retriving and populating the m_templateFunctions array m_templateFunctions[tTrigger] = new TF1("FitParametrization_"+tAlgoName,tTemplateFunction, minInstantLuminosity,maxInstantLuminosity); @@ -461,14 +394,13 @@ bool L1TRate_Harvest::getXSexFitsPython(const edm::ParameterSet& ps){ } if(!foundFit){ - cout<<"WP05-3"<getTH1()->GetBinContent(WARNING_PY_MISSING_FIT); eCount++; m_ErrorMonitor->getTH1()->SetBinContent(WARNING_PY_MISSING_FIT,eCount); - cout<<"WP05-4"<(m_parameters.getParameter ("inputTagScalersResults") ); - m_scalersSource_L1TSCollection = consumes(m_parameters.getParameter ("inputTagScalersResults") ); - m_l1GtDataDaqInputTag = consumes(m_parameters.getParameter ("inputTagL1GtDataDaq") ); - m_verbose = m_parameters.getUntrackedParameter ("verbose",false); - m_refPrescaleSet = m_parameters.getParameter ("refPrescaleSet"); - m_lsShiftGTRates = m_parameters.getUntrackedParameter ("lsShiftGTRates",0); + m_scalersSource_LSCollection = consumes (m_parameters.getParameter("inputTagScalersResults")); + m_scalersSource_L1TSCollection = consumes(m_parameters.getParameter("inputTagScalersResults")); + m_l1GtDataDaqInputTag = consumes (m_parameters.getParameter("inputTagL1GtDataDaq")); + m_verbose = m_parameters.getUntrackedParameter("verbose",false); + m_refPrescaleSet = m_parameters.getParameter ("refPrescaleSet"); + m_lsShiftGTRates = m_parameters.getUntrackedParameter ("lsShiftGTRates",0); // Getting which categories to monitor ParameterSet Categories = ps.getParameter("categories"); @@ -53,15 +46,15 @@ L1TRate_Offline::L1TRate_Offline(const ParameterSet & ps){ m_inputCategories["HTT"] = Categories.getUntrackedParameter("HTT"); m_inputCategories["HTM"] = Categories.getUntrackedParameter("HTM"); - // Inicializing Variables + // Initializing Variables if (m_verbose) { - cout << "[L1TRate_Offline:] ____________ Storage inicialization ____________ " << endl; - cout << "[L1TRate_Offline:] Setting up dbe folder: L1T/L1TRate_Offline" << endl; + cout << "[L1TRate_Offline:] ____________ Storage initialization ____________ " << endl; + cout << "[L1TRate_Offline:] Setting up dbe folder: L1T/L1TRate" << endl; } dbe = Service < DQMStore > ().operator->(); dbe->setVerbose(0); - dbe->setCurrentFolder("L1T/L1TRate_Offline"); + dbe->setCurrentFolder("L1T/L1TRate"); // Inicializing Variables if (m_verbose) {cout << "[L1TRate_Offline:] Pointer for DQM Store: " << dbe << endl;} @@ -80,8 +73,8 @@ void L1TRate_Offline::beginJob(void){ dbe = Service < DQMStore > ().operator->(); if (dbe) { - dbe->setCurrentFolder("L1T/L1TRate_Offline"); - dbe->rmdir("L1T/L1TRate_Offline"); + dbe->setCurrentFolder("L1T/L1TRate"); + dbe->rmdir("L1T/L1TRate"); } } @@ -115,7 +108,7 @@ void L1TRate_Offline::beginRun(const edm::Run& run, const edm::EventSetup& iSetu const L1GtPrescaleFactors* m_l1GtPfAlgo = l1GtPfAlgo.product(); // Initializing DQM Monitor Elements - dbe->setCurrentFolder("L1T/L1TRate_Offline"); + dbe->setCurrentFolder("L1T/L1TRate"); m_ErrorMonitor = dbe->book1D("ErrorMonitor", "ErrorMonitor",2,0,2); m_ErrorMonitor->setBinLabel(UNKNOWN ,"UNKNOWN"); m_ErrorMonitor->setBinLabel(WARNING_PY_MISSING_FIT,"WARNING_PY_MISSING_FIT"); @@ -192,7 +185,25 @@ void L1TRate_Offline::beginRun(const edm::Run& run, const edm::EventSetup& iSetu } - dbe->setCurrentFolder("L1T/L1TRate_Offline/TriggerCounts"); // trigger counts... + dbe->setCurrentFolder("L1T/L1TRate/xSecDelivLumi"); // trigger counts... + m_xSecObservedVsDelivLumi[tTrigger] = dbe->bookProfile(tCategory, + "Cross Sec. vs Deliv. Lumi: "+tTrigger+tErrorMessage, + m_maxNbins, + minInstantLuminosity, + maxInstantLuminosity,0,500); + m_xSecObservedVsDelivLumi[tTrigger] ->setAxisTitle("Delivered Luminosity [10^{30}cm^{-2}s^{-1}]" ,1); + m_xSecObservedVsDelivLumi[tTrigger] ->setAxisTitle("Algorithm #sigma [#mu b]" ,2); + + dbe->setCurrentFolder("L1T/L1TRate/xSecRecorLumi"); // trigger counts... + m_xSecObservedVsRecorLumi[tTrigger] = dbe->bookProfile(tCategory, + "Cross Sec. vs Recor. Lumi: "+tTrigger+tErrorMessage, + m_maxNbins, + minInstantLuminosity, + maxInstantLuminosity,0,500); + m_xSecObservedVsRecorLumi[tTrigger] ->setAxisTitle("Recorded Luminosity [10^{30}cm^{-2}s^{-1}]" ,1); + m_xSecObservedVsRecorLumi[tTrigger] ->setAxisTitle("Algorithm #sigma [#mu b]" ,2); + + dbe->setCurrentFolder("L1T/L1TRate/TriggerCounts"); // trigger counts... m_CountsVsLS[tTrigger] = dbe->bookProfile(tCategory, "Cross Sec. vs Inst. Lumi Algo: "+tTrigger+tErrorMessage, m_maxNbins, @@ -205,11 +216,30 @@ void L1TRate_Offline::beginRun(const edm::Run& run, const edm::EventSetup& iSetu m_algoFit[tTrigger] = (TF1*) tTestFunction->Clone("Fit_"+tTrigger); // NOTE: Workaround - dbe->setCurrentFolder("L1T/L1TRate_Offline/Ratio"); + dbe->setCurrentFolder("L1T/L1TRate/xSecObs"); + m_xSecObservedVsLS[tTrigger] = dbe->book1D(tCategory, "Algo: "+tTrigger+tErrorMessage,m_maxNbins,-0.5,double(m_maxNbins)-0.5); + m_xSecObservedVsLS[tTrigger] ->setAxisTitle("Lumi Section" ,1); + m_xSecObservedVsLS[tTrigger] ->setAxisTitle("#sigma_{obs}" ,2); + + dbe->setCurrentFolder("L1T/L1TRate/Delivered"); + m_DelivLumiVsLS[tTrigger] = dbe->book1D(tCategory, "Algo: "+tTrigger+tErrorMessage,m_maxNbins,-0.5,double(m_maxNbins)-0.5); + m_DelivLumiVsLS[tTrigger] ->setAxisTitle("Lumi Section" ,1); + m_DelivLumiVsLS[tTrigger] ->setAxisTitle("Deliv. Lumi" ,2); + + dbe->setCurrentFolder("L1T/L1TRate/Recorded"); + m_RecorLumiVsLS[tTrigger] = dbe->book1D(tCategory, "Algo: "+tTrigger+tErrorMessage,m_maxNbins,-0.5,double(m_maxNbins)-0.5); + m_RecorLumiVsLS[tTrigger] ->setAxisTitle("Lumi Section" ,1); + m_RecorLumiVsLS[tTrigger] ->setAxisTitle("Recor. Lumi" ,2); + + dbe->setCurrentFolder("L1T/L1TRate/Ratio"); m_xSecObservedToExpected[tTrigger] = dbe->book1D(tCategory, "Algo: "+tTrigger+tErrorMessage,m_maxNbins,-0.5,double(m_maxNbins)-0.5); m_xSecObservedToExpected[tTrigger] ->setAxisTitle("Lumi Section" ,1); m_xSecObservedToExpected[tTrigger] ->setAxisTitle("#sigma_{obs} / #sigma_{exp}" ,2); +// dbe->setCurrentFolder("L1T/L1TRate/DeadTime"); +// m_DeadTimeVsLS[tTrigger] = dbe->book1D(tCategory, "Dead Time: "+tTrigger+tErrorMessage,m_maxNbins,-0.5,double(m_maxNbins)-0.5); +// m_DeadTimeVsLS[tTrigger] ->setAxisTitle("Lumi Section" ,1); +// m_DeadTimeVsLS[tTrigger] ->setAxisTitle("Dead Time" ,2); } @@ -219,8 +249,8 @@ void L1TRate_Offline::beginRun(const edm::Run& run, const edm::EventSetup& iSetu void L1TRate_Offline::endRun(const edm::Run& run, const edm::EventSetup& iSetup){ if (m_verbose) {cout << "[L1TRate_Offline:] Called endRun." << endl;} -} +} //_____________________________________________________________________ void L1TRate_Offline::beginLuminosityBlock(LuminosityBlock const& lumiBlock, EventSetup const& c) { @@ -245,6 +275,7 @@ void L1TRate_Offline::endLuminosityBlock(LuminosityBlock const& lumiBlock, Event bool isDefLumi,isDefPrescaleIndex; //map* rates=0; double lumi=0; + double deadtime=0; int prescalesIndex=0; bool isDefCount; @@ -253,9 +284,17 @@ void L1TRate_Offline::endLuminosityBlock(LuminosityBlock const& lumiBlock, Event // Resetting MonitorElements so we can refill them for(map::const_iterator i=m_selectedTriggers.begin() ; i!=m_selectedTriggers.end() ; i++){ string tTrigger = (*i).second; + // m_DeadTimeVsLS [tTrigger]->getTH1()->Reset("ICE"); m_CountsVsLS [tTrigger]->getTH1()->Reset("ICE"); m_xSecObservedToExpected[tTrigger]->getTH1()->Reset("ICE"); + m_xSecObservedVsLS [tTrigger]->getTH1()->Reset("ICE"); + m_DelivLumiVsLS [tTrigger]->getTH1()->Reset("ICE"); + m_RecorLumiVsLS [tTrigger]->getTH1()->Reset("ICE"); + + m_xSecObservedVsDelivLumi[tTrigger]->getTH1()->Reset("ICE"); + m_xSecObservedVsRecorLumi[tTrigger]->getTH1()->Reset("ICE"); + } //Trying to do the same with Counts.... @@ -271,6 +310,7 @@ void L1TRate_Offline::endLuminosityBlock(LuminosityBlock const& lumiBlock, Event else{ isDefLumi=true; lumi=m_lsLuminosity[lsOffline]; + deadtime=m_lsDeadTime[lsOffline]; } lsPreInd = lsOffline + 1; // NOTE: Workaround @@ -283,7 +323,7 @@ void L1TRate_Offline::endLuminosityBlock(LuminosityBlock const& lumiBlock, Event if(isDefCount && isDefLumi && isDefPrescaleIndex){ - //const vector& currentPrescaleFactors = (*m_listsPrescaleFactors).at(prescalesIndex); + const vector& currentPrescaleFactors = (*m_listsPrescaleFactors).at(prescalesIndex); for(map::const_iterator j=m_selectedTriggers.begin() ; j!=m_selectedTriggers.end() ; j++){ @@ -297,26 +337,49 @@ void L1TRate_Offline::endLuminosityBlock(LuminosityBlock const& lumiBlock, Event // If trigger name is defined we get the rate fit parameters if(tTrigger != "Undefined"){ + unsigned int trigBit = m_algoBit[tTrigger]; + double trigPrescale = currentPrescaleFactors[trigBit]; + + if(lumi!=0 && trigCount!=0 && trigPrescale!=0){ - if(lumi!=0 && trigCount!=0 && prescalesIndex!=0){ + double RecLumi = lumi*(1. - deadtime/100.); - double AlgoXSec = (prescalesIndex*trigCount)/lumi; + double AlgoXSec = (trigPrescale*trigCount)/RecLumi; double TemplateFunctionValue = tTestFunction->Eval(lumi); + // Checking against Template function + // m_DeadTimeVsLS [tTrigger]->Fill(lumi,deadtime); + + + m_xSecObservedVsRecorLumi[tTrigger]->Fill(RecLumi,AlgoXSec); + m_CountsVsLS [tTrigger]->Fill(lumi,AlgoXSec); int ibin = m_xSecObservedToExpected[tTrigger]->getTH1()->FindBin(lsOffline); m_xSecObservedToExpected[tTrigger]->setBinContent(ibin,AlgoXSec/TemplateFunctionValue); + m_DelivLumiVsLS[tTrigger]->setBinContent(ibin,lumi); + m_RecorLumiVsLS[tTrigger]->setBinContent(ibin,RecLumi); + + m_xSecObservedVsLS[tTrigger]->setBinContent(ibin,AlgoXSec); } else { + // m_DeadTimeVsLS [tTrigger]->Fill(0.000001,0.000001); + + m_xSecObservedVsRecorLumi[tTrigger]->Fill(0.000001,0.000001); + m_CountsVsLS [tTrigger]->Fill(0.000001,0.000001); int ibin = m_xSecObservedToExpected[tTrigger]->getTH1()->FindBin(lsOffline); m_xSecObservedToExpected[tTrigger]->setBinContent(ibin,0.000001); - } + + m_DelivLumiVsLS[tTrigger]->setBinContent(ibin,0.000001); + m_RecorLumiVsLS[tTrigger]->setBinContent(ibin,0.000001); + + m_xSecObservedVsLS[tTrigger]->setBinContent(ibin,0.000001); + } } } } @@ -336,18 +399,28 @@ void L1TRate_Offline::analyze(const Event & iEvent, const EventSetup & eventSetu iEvent.getByToken(m_scalersSource_L1TSCollection , triggerScalers); // Integers - //int EventRun = iEvent.id().run(); + int EventRun = iEvent.id().run(); unsigned int eventLS = iEvent.id().luminosityBlock(); // Getting the trigger trigger rates from GT and buffering it if(triggerScalers.isValid() && triggerScalers->size()){ Level1TriggerScalersCollection::const_iterator itL1TScalers = triggerScalers->begin(); - //Level1TriggerRates trigRates(*itL1TScalers,EventRun); + Level1TriggerRates trigRates(*itL1TScalers,EventRun); + + //Trying to retrieve GT DeadTime + //unsigned long long deadtime = itL1TScalers->deadtime(); + //double deadtime = itL1TScalers->deadtime(); + double deadtime = trigRates.deadtimePercent(); //correct DeadTime % to retrieve // Trying to get the trigger counts const std::vector gtAlgoCounts = itL1TScalers->gtAlgoCounts(); + // int lumisegment = (*itL1TScalers).lumiSegmentNr(); + +// cout << "deadtime =" << deadtime << " -- +// cout << "lumisegment = " << lumisegment << endl; + int gtLS = (*itL1TScalers).lumiSegmentNr()+m_lsShiftGTRates; // If we haven't got the data from this LS yet get it @@ -371,6 +444,7 @@ void L1TRate_Offline::analyze(const Event & iEvent, const EventSetup & eventSetu } } m_lsRates[gtLS] = bufferCount; + m_lsDeadTime[gtLS] = deadtime; } } @@ -388,6 +462,22 @@ void L1TRate_Offline::analyze(const Event & iEvent, const EventSetup & eventSetu double instLumi = itLScal->instantLumi(); // Getting Instant Lumi from HF (via SCAL) // <###### WE NEED TO STORE THIS double deadTimeNormHF = itLScal->deadTimeNormalization(); // Getting Dead Time Normalization from HF (via SCAL) +// double mylumiFill = itLScal->lumiFill(); // Integrated lumi since beginning of fill, delivered +// double mylumiRun = itLScal->lumiRun(); // Integrated lumi since beginning of run, delivered +// double myliveLumiFill = itLScal->liveLumiFill(); // Integrated lumi since beginning of fill, live +// double myliveLumiRun = itLScal->liveLumiRun(); // Integrated lumi since beginning of run, live +// double mysectionNumber = itLScal->sectionNumber(); // Lumi section number for this info +// double mynumOrbits = itLScal->numOrbits(); // Number of orbits that have passed this run + +// cout << "instantLumi = " << instLumi << endl; +// cout << "lumiFill = " << mylumiFill << endl; +// cout << "lumiRun = " << mylumiRun << endl; +// cout << "livelumiFill = " << myliveLumiFill << endl; +// cout << "livelumiRun = " << myliveLumiRun << endl; +// cout << "sectionNumber = " << mysectionNumber << endl; +// cout << "numOrbits = " << mynumOrbits << endl; + + // If HF Dead Time Corrections is requested we apply it // NOTE: By default this is assumed false since for now WbM fits do NOT assume this correction if(m_parameters.getUntrackedParameter("useHFDeadTimeNormalization",false)){ @@ -495,6 +585,5 @@ bool L1TRate_Offline::getXSexFitsPython(const edm::ParameterSet& ps){ } - //define this as a plug-in DEFINE_FWK_MODULE(L1TRate_Offline); diff --git a/DQMOffline/L1Trigger/src/L1TSync_Harvest.cc b/DQMOffline/L1Trigger/src/L1TSync_Harvest.cc index 2e03692ca15f6..35cd36d1cba6d 100644 --- a/DQMOffline/L1Trigger/src/L1TSync_Harvest.cc +++ b/DQMOffline/L1Trigger/src/L1TSync_Harvest.cc @@ -437,7 +437,6 @@ void L1TSync_Harvest::analyze(const Event & iEvent, const EventSetup & eventSetu /// /// // Retriving information from GT /// edm::Handle gtEvmReadoutRecord; -/// iEvent.getByLabel(m_l1GtEvmSource, gtEvmReadoutRecord); /// /// // Determining beam mode and fill number /// if(gtEvmReadoutRecord.isValid()){ @@ -468,7 +467,6 @@ void L1TSync_Harvest::analyze(const Event & iEvent, const EventSetup & eventSetu /// /// // Getting Final Decision Logic (FDL) Data from GT /// edm::Handle gtReadoutRecordData; -/// iEvent.getByLabel(m_l1GtDataDaqInputTag, gtReadoutRecordData); /// /// if(gtReadoutRecordData.isValid()){ /// diff --git a/DQMOffline/L1Trigger/src/L1TSync_Offline.cc b/DQMOffline/L1Trigger/src/L1TSync_Offline.cc index 1a9364fb7ae46..a0f8db3fbcd27 100644 --- a/DQMOffline/L1Trigger/src/L1TSync_Offline.cc +++ b/DQMOffline/L1Trigger/src/L1TSync_Offline.cc @@ -1,5 +1,4 @@ - -/* +/** * \class L1TSync_Offline * * diff --git a/DQMOffline/L1Trigger/test/crab_runDQMOffline_step1_L1TriggerOnly.cfg b/DQMOffline/L1Trigger/test/crab_runDQMOffline_step1_L1TriggerOnly.cfg new file mode 100644 index 0000000000000..b7e3d305f1226 --- /dev/null +++ b/DQMOffline/L1Trigger/test/crab_runDQMOffline_step1_L1TriggerOnly.cfg @@ -0,0 +1,28 @@ +[CRAB] + +jobtype = cmssw +scheduler = glite + +[CMSSW] +dbs_url = http://cmsdbsprod.cern.ch/cms_dbs_prod_global/servlet/DBSServlet +pset = runDQMOffline_step1_L1TriggerOnly_job1_cfg.py +number_of_jobs = 100 +total_number_of_lumis = 500 +runselection = 202272 +datasetpath = /SingleMu/Run2012C-v1/RAW + +output_file = L1TOffline_L1TriggerOnly_job1_RAW2DIGI_RECO_DQM.root + +[USER] + +storage_element = T2_ES_CIEMAT +return_data = 0 +copy_data = 1 + +user_remote_dir = /L1Trigger/DQM/202272/v7 +check_user_remote_dir = 0 + +ui_working_dir = runDQMOffline_step1_L1TriggerOnly_v1 + +[GRID] +ce_white_list = T2_ES_CIEMAT diff --git a/DQMOffline/L1Trigger/test/runDQMOffline_step1NoRECO_L1TriggerOnly_job1_cfg.py b/DQMOffline/L1Trigger/test/runDQMOffline_step1NoRECO_L1TriggerOnly_job1_cfg.py new file mode 100644 index 0000000000000..f0717f858ca97 --- /dev/null +++ b/DQMOffline/L1Trigger/test/runDQMOffline_step1NoRECO_L1TriggerOnly_job1_cfg.py @@ -0,0 +1,108 @@ +# Auto generated configuration file +# using: +# Revision: 1.1 +# Source: /local/reps/CMSSW/CMSSW/Configuration/Applications/python/ConfigBuilder.py,v +# with command line options: test_11_a_1 -s RAW2DIGI,RECO,DQM -n 500 --eventcontent DQM --conditions auto:com10 --filein file:/afs/cern.ch/cms/CAF/CMSCOMM/COMM_DQM/DQMTest/MinimumBias__RAW__v1__165633__1CC420EE-B686-E011-A788-0030487CD6E8.root --data --customise DQMTools/Tests/customDQM.py --no_exec --python_filename=test_11_a_1.py +import FWCore.ParameterSet.Config as cms + +process = cms.Process('RECO') + +# import of standard configurations +process.load('Configuration.StandardSequences.Services_cff') +process.load('SimGeneral.HepPDTESSource.pythiapdt_cfi') +process.load('FWCore.MessageService.MessageLogger_cfi') +process.load('Configuration.EventContent.EventContent_cff') +process.load('Configuration.StandardSequences.GeometryRecoDB_cff') +process.load('Configuration.StandardSequences.MagneticField_AutoFromDBCurrent_cff') +process.load('Configuration.StandardSequences.RawToDigi_Data_cff') +process.load('Configuration.StandardSequences.Reconstruction_Data_cff') +process.load('DQMOffline.Configuration.DQMOffline_cff') +process.load('Configuration.StandardSequences.EndOfProcess_cff') +process.load('Configuration.StandardSequences.FrontierConditions_GlobalTag_cff') + +# Removing other DQM modules form the DQMOfflinePreDPG +process.DQMOfflinePreDPG.remove(process.dqmDcsInfo) +process.DQMOfflinePreDPG.remove(process.ecal_dqm_source_offline) +process.DQMOfflinePreDPG.remove(process.hcalOfflineDQMSource) +process.DQMOfflinePreDPG.remove(process.SiStripDQMTier0) +process.DQMOfflinePreDPG.remove(process.siPixelOfflineDQM_source) +process.DQMOfflinePreDPG.remove(process.dtSources) +process.DQMOfflinePreDPG.remove(process.rpcTier0Source) +process.DQMOfflinePreDPG.remove(process.cscSources) +process.DQMOfflinePreDPG.remove(process.es_dqm_source_offline) +process.DQMOfflinePreDPG.remove(process.castorSources) +process.DQMOfflinePreDPG.remove(process.HcalDQMOfflineSequence) + +# Removing other DQM modules form the DQMOfflinePrePOG +process.DQMOfflinePrePOG.remove(process.muonMonitors) +process.DQMOfflinePrePOG.remove(process.jetMETDQMOfflineSource) +process.DQMOfflinePrePOG.remove(process.egammaDQMOffline) +#process.DQMOfflinePrePOG.Remove(process.l1TriggerDqmOffline) +process.DQMOfflinePrePOG.remove(process.triggerOfflineDQMSource) +process.DQMOfflinePrePOG.remove(process.pvMonitor) +process.DQMOfflinePrePOG.remove(process.prebTagSequence) +process.DQMOfflinePrePOG.remove(process.bTagPlotsDATA) +process.DQMOfflinePrePOG.remove(process.alcaBeamMonitor) +process.DQMOfflinePrePOG.remove(process.dqmPhysics) +process.DQMOfflinePrePOG.remove(process.produceDenoms) +process.DQMOfflinePrePOG.remove(process.pfTauRunDQMValidation) + +process.maxEvents = cms.untracked.PSet( + input = cms.untracked.int32(1000) +) + +# Input source +process.source = cms.Source("PoolSource", + secondaryFileNames = cms.untracked.vstring(), + fileNames = cms.untracked.vstring('file:/afs/cern.ch/cms/CAF/CMSCOMM/COMM_DQM/DQMTest/MinimumBias__RAW__v1__165633__1CC420EE-B686-E011-A788-0030487CD6E8.root') +) + +process.options = cms.untracked.PSet( + +) + +# Production Info +process.configurationMetadata = cms.untracked.PSet( + version = cms.untracked.string('$Revision: 1.2 $'), + annotation = cms.untracked.string('test_11_a_1 nevts:10'), + name = cms.untracked.string('Applications') +) + +# Output definition + +process.DQMoutput = cms.OutputModule("PoolOutputModule", + splitLevel = cms.untracked.int32(0), + outputCommands = process.DQMEventContent.outputCommands, + fileName = cms.untracked.string('L1TOffline_L1TriggerOnly_job1_RAW2DIGI_RECO_DQM.root'), + dataset = cms.untracked.PSet( + filterName = cms.untracked.string(''), + dataTier = cms.untracked.string('') + ) +) + +# Additional output definition + +# Other statements +from Configuration.AlCa.GlobalTag import GlobalTag +process.GlobalTag = GlobalTag(process.GlobalTag, 'auto:com10', '') + +# Path and EndPath definitions +process.raw2digi_step = cms.Path(process.RawToDigi) +#process.reconstruction_step = cms.Path(process.reconstruction) +process.dqmoffline_step = cms.Path(process.DQMOffline) +process.endjob_step = cms.EndPath(process.endOfProcess) +process.DQMoutput_step = cms.EndPath(process.DQMoutput) + +# Schedule definition +#process.schedule = cms.Schedule(process.raw2digi_step,process.reconstruction_step,process.dqmoffline_step,process.endjob_step,process.DQMoutput_step) +process.schedule = cms.Schedule(process.raw2digi_step,process.dqmoffline_step,process.endjob_step,process.DQMoutput_step) + +# customisation of the process. + +# Automatic addition of the customisation function from DQMTools.Tests.customDQM +from DQMTools.Tests.customDQM import customise + +#call to customisation function customise imported from DQMTools.Tests.customDQM +process = customise(process) + +# End of customisation functions \ No newline at end of file diff --git a/DQMOffline/L1Trigger/test/runDQMOffline_step1NoRECO_justRate_L1TriggerOnly_job1_cfg.py b/DQMOffline/L1Trigger/test/runDQMOffline_step1NoRECO_justRate_L1TriggerOnly_job1_cfg.py new file mode 100644 index 0000000000000..8834d627a0c9f --- /dev/null +++ b/DQMOffline/L1Trigger/test/runDQMOffline_step1NoRECO_justRate_L1TriggerOnly_job1_cfg.py @@ -0,0 +1,136 @@ +# Auto generated configuration file +# using: +# Revision: 1.1 +# Source: /local/reps/CMSSW/CMSSW/Configuration/Applications/python/ConfigBuilder.py,v +# with command line options: test_11_a_1 -s RAW2DIGI,RECO,DQM -n 500 --eventcontent DQM --conditions auto:com10 --filein file:/afs/cern.ch/cms/CAF/CMSCOMM/COMM_DQM/DQMTest/MinimumBias__RAW__v1__165633__1CC420EE-B686-E011-A788-0030487CD6E8.root --data --customise DQMTools/Tests/customDQM.py --no_exec --python_filename=test_11_a_1.py +import FWCore.ParameterSet.Config as cms + +process = cms.Process('RECO') + +process.load("FWCore.MessageLogger.MessageLogger_cfi") +process.options = cms.untracked.PSet( wantSummary = cms.untracked.bool(True) ) +process.MessageLogger.cerr.FwkReport.reportEvery = 100 + +# import of standard configurations +process.load('Configuration.StandardSequences.Services_cff') +process.load('SimGeneral.HepPDTESSource.pythiapdt_cfi') +process.load('FWCore.MessageService.MessageLogger_cfi') +process.load('Configuration.EventContent.EventContent_cff') +process.load('Configuration.StandardSequences.GeometryRecoDB_cff') +process.load('Configuration.StandardSequences.MagneticField_AutoFromDBCurrent_cff') +process.load('Configuration.StandardSequences.RawToDigi_Data_cff') +process.load('Configuration.StandardSequences.Reconstruction_Data_cff') +process.load('DQMOffline.Configuration.DQMOffline_cff') +process.load('Configuration.StandardSequences.EndOfProcess_cff') +process.load('Configuration.StandardSequences.FrontierConditions_GlobalTag_cff') + + +process.RawToDigi.remove(process.csctfDigis) +process.RawToDigi.remove(process.dttfDigis) +process.RawToDigi.remove(process.gctDigis) +#process.RawToDigi.remove(process.gtDigis) +process.RawToDigi.remove(process.gtEvmDigis) +process.RawToDigi.remove(process.siPixelDigis) +process.RawToDigi.remove(process.siStripDigis) +process.RawToDigi.remove(process.ecalDigis) +process.RawToDigi.remove(process.ecalPreshowerDigis) +process.RawToDigi.remove(process.hcalDigis) +process.RawToDigi.remove(process.muonCSCDigis) +process.RawToDigi.remove(process.muonDTDigis) +process.RawToDigi.remove(process.muonRPCDigis) +process.RawToDigi.remove(process.castorDigis) +#process.RawToDigi.remove(process.scalersRawToDigi) + +process.DQMOffline.remove(process.DQMOfflinePreDPG) + +# Removing other DQM modules form the DQMOfflinePrePOG +process.DQMOfflinePrePOG.remove(process.muonMonitors) +process.DQMOfflinePrePOG.remove(process.jetMETDQMOfflineSource) +process.DQMOfflinePrePOG.remove(process.egammaDQMOffline) +#process.DQMOfflinePrePOG.Remove(process.l1TriggerDqmOffline) +process.DQMOfflinePrePOG.remove(process.triggerOfflineDQMSource) +process.DQMOfflinePrePOG.remove(process.pvMonitor) +process.DQMOfflinePrePOG.remove(process.prebTagSequence) +process.DQMOfflinePrePOG.remove(process.bTagPlotsDATA) +process.DQMOfflinePrePOG.remove(process.alcaBeamMonitor) +process.DQMOfflinePrePOG.remove(process.dqmPhysics) +process.DQMOfflinePrePOG.remove(process.produceDenoms) +process.DQMOfflinePrePOG.remove(process.pfTauRunDQMValidation) + +process.l1TriggerDqmOffline.remove(process.l1TriggerOffline) +process.l1TriggerDqmOffline.remove(process.l1tSync_Offline) +process.l1TriggerDqmOffline.remove(process.l1tEfficiencyMuons_offline) +process.l1TriggerDqmOffline.remove(process.l1TriggerEmulatorOffline) + +# Removing other L1T DQM modules +#process.l1tMonitorOnline.remove(process.bxTiming) +#process.l1tMonitorOnline.remove(process.l1tDttf) +#process.l1tMonitorOnline.remove(process.l1tCsctf) +#process.l1tMonitorOnline.remove(process.l1tRpctf) +#process.l1tMonitorOnline.remove(process.l1tGmt) +#process.l1tMonitorOnline.remove(process.l1tGt) +#process.l1tMonitorOnline.remove(process.l1ExtraDqmSeq) +#process.l1tMonitorOnline.remove(process.l1tBPTX) +#process.l1tMonitorOnline.remove(process.l1tRate) +#process.l1tMonitorOnline.remove(process.l1tRctSeq) +#process.l1tMonitorOnline.remove(process.l1tGctSeq) + +process.maxEvents = cms.untracked.PSet( + input = cms.untracked.int32(-1) +) + +# Input source +process.source = cms.Source("PoolSource", + secondaryFileNames = cms.untracked.vstring(), + fileNames = cms.untracked.vstring('file:/afs/cern.ch/cms/CAF/CMSCOMM/COMM_DQM/DQMTest/MinimumBias__RAW__v1__165633__1CC420EE-B686-E011-A788-0030487CD6E8.root') +) + +process.options = cms.untracked.PSet( + +) + +# Production Info +process.configurationMetadata = cms.untracked.PSet( + version = cms.untracked.string('$Revision: 1.2 $'), + annotation = cms.untracked.string('test_11_a_1 nevts:10'), + name = cms.untracked.string('Applications') +) + +# Output definition + +process.DQMoutput = cms.OutputModule("PoolOutputModule", + splitLevel = cms.untracked.int32(0), + outputCommands = process.DQMEventContent.outputCommands, + fileName = cms.untracked.string('L1TOffline_L1TriggerOnly_job1_RAW2DIGI_RECO_DQM.root'), + dataset = cms.untracked.PSet( + filterName = cms.untracked.string(''), + dataTier = cms.untracked.string('') + ) +) + +# Additional output definition + +# Other statements +from Configuration.AlCa.GlobalTag import GlobalTag +process.GlobalTag = GlobalTag(process.GlobalTag, 'auto:com10', '') + +# Path and EndPath definitions +process.raw2digi_step = cms.Path(process.RawToDigi) +#process.reconstruction_step = cms.Path(process.reconstruction) +process.dqmoffline_step = cms.Path(process.DQMOffline) +process.endjob_step = cms.EndPath(process.endOfProcess) +process.DQMoutput_step = cms.EndPath(process.DQMoutput) + +# Schedule definition +#process.schedule = cms.Schedule(process.raw2digi_step,process.reconstruction_step,process.dqmoffline_step,process.endjob_step,process.DQMoutput_step) +process.schedule = cms.Schedule(process.raw2digi_step,process.dqmoffline_step,process.endjob_step,process.DQMoutput_step) + +# customisation of the process. + +# Automatic addition of the customisation function from DQMTools.Tests.customDQM +from DQMTools.Tests.customDQM import customise + +#call to customisation function customise imported from DQMTools.Tests.customDQM +process = customise(process) + +# End of customisation functions diff --git a/Validation/Configuration/python/globalValidation_cff.py b/Validation/Configuration/python/globalValidation_cff.py index cb463d6c4d4e8..810437c3bc52e 100644 --- a/Validation/Configuration/python/globalValidation_cff.py +++ b/Validation/Configuration/python/globalValidation_cff.py @@ -36,6 +36,7 @@ from Validation.RPCRecHits.rpcRecHitValidation_cfi import * from Validation.DTRecHits.DTRecHitQuality_cfi import * from Validation.RecoTau.DQMMCValidation_cfi import * +from Validation.L1T.L1Validator_cfi import * from DQMOffline.RecoB.dqmAnalyzer_cff import * # filter/producer "pre-" sequence for globalValidation @@ -87,4 +88,5 @@ + dtLocalRecoValidation_no2D + pfTauRunDQMValidation + bTagPlotsMCbcl + + L1Validator ) diff --git a/Validation/L1T/BuildFile.xml b/Validation/L1T/BuildFile.xml new file mode 100644 index 0000000000000..3f4201d0a0648 --- /dev/null +++ b/Validation/L1T/BuildFile.xml @@ -0,0 +1,8 @@ + + + + + + + + diff --git a/Validation/L1T/interface/L1Validator.h b/Validation/L1T/interface/L1Validator.h new file mode 100644 index 0000000000000..79b0f85eab227 --- /dev/null +++ b/Validation/L1T/interface/L1Validator.h @@ -0,0 +1,113 @@ +#ifndef L1Validator_h +#define L1Validator_h + +// -*- C++ -*- +// +// Package: L1T +// Class: L1Validator +// +/**\class L1T L1Validator.cc Validation/L1T/plugins/L1Validator.cc + + Description: [one line class summary] + + Implementation: + [Notes on implementation] +*/ +// +// Original Author: Scott Wilbur +// Created: Wed, 28 Aug 2013 09:42:55 GMT +// $Id$ +// +// + + +// system include files +#include +#include +#include +#include + +// user include files +#include "FWCore/Framework/interface/Frameworkfwd.h" +#include "FWCore/Framework/interface/EDAnalyzer.h" + +#include "FWCore/Framework/interface/Event.h" +#include "FWCore/Framework/interface/ESHandle.h" +#include "FWCore/Framework/interface/MakerMacros.h" +#include "FWCore/ServiceRegistry/interface/Service.h" +#include "FWCore/ParameterSet/interface/ParameterSet.h" + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include + +#include + +// +// class declaration +// + +class L1Validator : public edm::EDAnalyzer { + public: + explicit L1Validator(const edm::ParameterSet&); + ~L1Validator(); + + static void fillDescriptions(edm::ConfigurationDescriptions& descriptions); + + + private: + //virtual void beginJob() override; + //virtual void analyze(const edm::Event&, const edm::EventSetup&) override; + virtual void endJob() override; + + virtual void beginRun(edm::Run const&, edm::EventSetup const&) override; + virtual void endRun(edm::Run const&, edm::EventSetup const&) override; + //virtual void beginLuminosityBlock(edm::LuminosityBlock const&, edm::EventSetup const&) override; + //virtual void endLuminosityBlock(edm::LuminosityBlock const&, edm::EventSetup const&) override; + void analyze(const edm::Event&, const edm::EventSetup&); + + // ----------member data --------------------------- + DQMStore* _dbe; + std::string _dirName; + std::string _fileName; + + edm::EDGetTokenT _GenSource; + edm::EDGetTokenT _L1ExtraIsoEGSource; + edm::EDGetTokenT _L1ExtraNonIsoEGSource; + edm::EDGetTokenT _L1ExtraCenJetSource; + edm::EDGetTokenT _L1ExtraForJetSource; + edm::EDGetTokenT _L1ExtraTauJetSource; + edm::EDGetTokenT _L1ExtraMuonSource; + //edm::EDGetTokenT _L1ExtraMETSource; + + L1ValidatorHists *_Hists; + + //---------------helper functions------------------ + private: + const reco::LeafCandidate *FindBest(const reco::GenParticle *, const std::vector *, const std::vector *); + const reco::LeafCandidate *FindBest(const reco::GenParticle *, const std::vector *, const std::vector *); + const reco::LeafCandidate *FindBest(const reco::GenParticle *, const std::vector *); +}; + +// +// constants, enums and typedefs +// + +// +// static data member definitions +// + +// +// constructors and destructor +// + +#endif diff --git a/Validation/L1T/interface/L1ValidatorHists.h b/Validation/L1T/interface/L1ValidatorHists.h new file mode 100644 index 0000000000000..94bdfbd91e6b1 --- /dev/null +++ b/Validation/L1T/interface/L1ValidatorHists.h @@ -0,0 +1,74 @@ +#ifndef L1ValidatorHists_h +#define L1ValidatorHists_h + +#include "TH1F.h" +//#include + +//#include +#include + +#include + +#include "DQMServices/Core/interface/DQMStore.h" +#include "DQMServices/Core/interface/MonitorElement.h" + +/*#define DECLARE_HISTS(TYPE) \ +TH2F * ## TYPE ## _N_Pt; \ +TH2F * ## TYPE ## _N_Eta; \ +TH2F * ## TYPE ## _Eff_Pt; \ +TH2F * ## TYPE ## _Eff_Eta; \ +TH2F * ## TYPE ## _dR; \ +TH2F * ## TYPE ## _dPt; +*/ + +class L1ValidatorHists{ + public: + L1ValidatorHists(DQMStore *dbe); + ~L1ValidatorHists(); + void Book(); + void Normalize(); + void Write(); + + int NEvents; + + enum Type{ IsoEG, NonIsoEG, CenJet, ForJet, TauJet, Muon, Number }; + std::string Name[6]; + + // Each object has gen (pt, eta, phi, pdg), reco (pt, eta, phi, pdg) + // split by pdg (CenJet, ETM, ETT, ForJet, HTM, HTT, IsoEG, Mu, NoIsoEG, TauJet): 10 + // needs efficiency (by pt, eta), fake rate (by pt, eta), dR (by pt, (eta?)) + /**TH2F *IsoEG_N_Pt_Eta, *IsoEG_Eff_Pt, *IsoEG_Eff_Eta, *IsoEG_dR_Pt, *IsoEG_dPt_Pt; + TH2F *NonIsoEG_N_Pt_Eta, *NonIsoEG_Eff_Pt, *NonIsoEG_Eff_Eta, *NonIsoEG_dR_Pt, *NonIsoEG_dPt_Pt; + TH2F *CenJet_N_Pt_Eta, *CenJet_Eff_Pt, *CenJet_Eff_Eta, *CenJet_dR_Pt, *CenJet_dPt_Pt; + TH2F *Muon_N_Pt_Eta, *Muon_Eff_Pt, *Muon_Eff_Eta, *Muon_dR_Pt, *Muon_dPt_Pt;*/ + + /*DECLARE_HISTS(IsoEG) + DECLARE_HISTS(NonIsoEG) + DECLARE_HISTS(CenJet) + DECLARE_HISTS(ForJet) + DECLARE_HISTS(TauJet) + DECLARE_HISTS(Muon)*/ + + MonitorElement *N[Type::Number]; + TH1F *N_Pt[Type::Number]; + TH1F *N_Eta[Type::Number]; + MonitorElement *Eff_Pt[Type::Number]; + MonitorElement *Eff_Eta[Type::Number]; + MonitorElement *TurnOn_15[Type::Number]; + MonitorElement *TurnOn_30[Type::Number]; + MonitorElement *dR[Type::Number]; + MonitorElement *dPt[Type::Number]; + + // add the rest... + //TH2F *ETM_Delta, *ETT_Delta, *HTM_Delta, *HTT_Delta; + + DQMStore *_dbe; + + void Fill(int, const reco::LeafCandidate *, const reco::LeafCandidate *); + void FillNumber(int, int); +// private: +// void NormalizeSlices(TH2F *Hist); +}; + + +#endif diff --git a/Validation/L1T/plugins/BuildFile.xml b/Validation/L1T/plugins/BuildFile.xml new file mode 100644 index 0000000000000..dfb4cc42d2a79 --- /dev/null +++ b/Validation/L1T/plugins/BuildFile.xml @@ -0,0 +1,8 @@ + + + + + + + + diff --git a/Validation/L1T/plugins/L1Validator.cc b/Validation/L1T/plugins/L1Validator.cc new file mode 100644 index 0000000000000..bdc8a5222a680 --- /dev/null +++ b/Validation/L1T/plugins/L1Validator.cc @@ -0,0 +1,283 @@ +// -*- C++ -*- +// +// Package: L1T +// Class: L1Validator +// +/** + * \class L1T L1Validator.cc Validation/L1T/plugins/L1Validator.cc + * + * Description: [one line class summary] + * + * Implementation: + * [Notes on implementation] + */ +// +// Original Author: Scott Wilbur +// Created: Wed, 28 Aug 2013 09:42:55 GMT +// $Id$ +// +// + +#include + +#include + +#include "FWCore/ServiceRegistry/interface/Service.h" + +#include "DataFormats/Math/interface/deltaR.h" + +#include "TFile.h" + +//defining as a macro instead of a function because inheritance doesn't work: +#define FINDRECOPART(TYPE, COLLECTION1, COLLECTION2) \ +const TYPE *RecoPart=NULL; \ +double BestDist=999.; \ +for(uint i=0; i < COLLECTION1->size(); i++){ \ + const TYPE *ThisPart = &COLLECTION1->at(i); \ + double ThisDist = reco::deltaR(GenPart->eta(), GenPart->phi(), ThisPart->eta(), ThisPart->phi()); \ + if(ThisDist < 1.0 && ThisDist < BestDist){ \ + BestDist = ThisDist; \ + RecoPart = ThisPart; \ + } \ +} \ +if(COLLECTION1.product() != COLLECTION2.product()){ \ + for(uint i=0; i < COLLECTION2->size(); i++){ \ + const TYPE *ThisPart = &COLLECTION2->at(i); \ + double ThisDist = reco::deltaR(GenPart->eta(), GenPart->phi(), ThisPart->eta(), ThisPart->phi()); \ + if(ThisDist < 1.0 && ThisDist < BestDist){ \ + BestDist = ThisDist; \ + RecoPart = ThisPart; \ + } \ + } \ +} + +L1Validator::L1Validator(const edm::ParameterSet& iConfig){ + _dbe = edm::Service().operator->(); + _dirName = iConfig.getParameter("dirName"); + _GenSource = consumes (iConfig.getParameter("GenSource")); + + _L1ExtraIsoEGSource = consumes (iConfig.getParameter("L1ExtraIsoEGSource")); + _L1ExtraNonIsoEGSource = consumes (iConfig.getParameter("L1ExtraNonIsoEGSource")); + _L1ExtraCenJetSource = consumes (iConfig.getParameter("L1ExtraCenJetSource")); + _L1ExtraForJetSource = consumes (iConfig.getParameter("L1ExtraForJetSource")); + _L1ExtraTauJetSource = consumes (iConfig.getParameter("L1ExtraTauJetSource")); + _L1ExtraMuonSource = consumes (iConfig.getParameter("L1ExtraMuonSource")); + //_L1ExtraMETSource = consumes (iConfig.getParameter("L1ExtraMETSource")); + + //_fileName = iConfig.getParameter("fileName"); + + _dbe->setCurrentFolder(_dirName.c_str()); + _Hists = new L1ValidatorHists(_dbe); +} + + +L1Validator::~L1Validator(){ +} + +void L1Validator::analyze(const edm::Event& iEvent, const edm::EventSetup& iSetup){ + using namespace edm; + using namespace std; + using namespace l1extra; + using namespace reco; + + Handle GenParticles; + Handle IsoEGs; + Handle NonIsoEGs; + Handle CenJets; + Handle ForJets; + Handle Taus; + Handle Muons; + //Handle METs; + + bool GotEverything=true; + + if(!iEvent.getByToken(_GenSource, GenParticles)) GotEverything=false; + if(!iEvent.getByToken(_L1ExtraIsoEGSource, IsoEGs)) GotEverything=false; + if(!iEvent.getByToken(_L1ExtraNonIsoEGSource, NonIsoEGs)) GotEverything=false; + if(!iEvent.getByToken(_L1ExtraCenJetSource, CenJets)) GotEverything=false; + if(!iEvent.getByToken(_L1ExtraForJetSource, ForJets)) GotEverything=false; + if(!iEvent.getByToken(_L1ExtraTauJetSource, Taus)) GotEverything=false; + if(!iEvent.getByToken(_L1ExtraMuonSource, Muons)) GotEverything=false; + + if(!GotEverything) return; + + + _Hists->NEvents++; + + _Hists->FillNumber(L1ValidatorHists::Type::IsoEG, IsoEGs->size()); + _Hists->FillNumber(L1ValidatorHists::Type::NonIsoEG, NonIsoEGs->size()); + _Hists->FillNumber(L1ValidatorHists::Type::CenJet, CenJets->size()); + _Hists->FillNumber(L1ValidatorHists::Type::ForJet, ForJets->size()); + _Hists->FillNumber(L1ValidatorHists::Type::TauJet, Taus->size()); + _Hists->FillNumber(L1ValidatorHists::Type::Muon, Muons->size()); + + for(uint i=0; i < GenParticles->size(); i++){ + const GenParticle *GenPart = &GenParticles->at(i); + + int pdg = GenPart->pdgId(), status = GenPart->status(); + + if(status==1 && (abs(pdg)==11 || pdg==22)){ + FINDRECOPART(L1EmParticle, IsoEGs, NonIsoEGs) + + if(RecoPart==NULL){ + _Hists->Fill(L1ValidatorHists::Type::IsoEG, GenPart, NULL); + _Hists->Fill(L1ValidatorHists::Type::NonIsoEG, GenPart, NULL); + }else if(RecoPart->type() == L1EmParticle::EmType::kIsolated){ + _Hists->Fill(L1ValidatorHists::Type::IsoEG, GenPart, RecoPart); + _Hists->Fill(L1ValidatorHists::Type::NonIsoEG, GenPart, NULL); + }else if(RecoPart->type() == L1EmParticle::EmType::kNonIsolated){ + _Hists->Fill(L1ValidatorHists::Type::IsoEG, GenPart, NULL); + _Hists->Fill(L1ValidatorHists::Type::NonIsoEG, GenPart, RecoPart); + } + }else if(status==1 && abs(pdg)==13){ + FINDRECOPART(L1MuonParticle, Muons, Muons) + + _Hists->Fill(L1ValidatorHists::Type::Muon, GenPart, RecoPart); + }else if(status==3 && abs(pdg)==15){ + FINDRECOPART(L1JetParticle, Taus, Taus) + + _Hists->Fill(L1ValidatorHists::Type::TauJet, GenPart, RecoPart); + }else if(status==3 && (abs(pdg)<=5 || pdg==21)){ + FINDRECOPART(L1JetParticle, CenJets, ForJets) + + if(RecoPart==NULL){ + _Hists->Fill(L1ValidatorHists::Type::CenJet, GenPart, NULL); + _Hists->Fill(L1ValidatorHists::Type::ForJet, GenPart, NULL); + }else if(RecoPart->type() == L1JetParticle::JetType::kCentral){ + _Hists->Fill(L1ValidatorHists::Type::CenJet, GenPart, RecoPart); + _Hists->Fill(L1ValidatorHists::Type::ForJet, GenPart, NULL); + }else if(RecoPart->type() == L1JetParticle::JetType::kForward){ + _Hists->Fill(L1ValidatorHists::Type::CenJet, GenPart, NULL); + _Hists->Fill(L1ValidatorHists::Type::ForJet, GenPart, RecoPart); + } + }else continue; + + //cout << GenPart->pt() << '\t' << GenPart->eta() << '\t' << GenPart->phi() << '\t' << GenPart->pdgId() << endl; + } +} + + +// ------------ method called once each job just before starting event loop ------------ +/* +void L1Validator::beginJob(){ +} +*/ + +// ------------ method called once each job just after ending the event loop ------------ +void L1Validator::endJob(){ + + //TFile OutFile(_fileName.c_str(), "recreate"); + //_Hists->Write(); + //OutFile.Close(); +} + +// ------------ method called when starting to processes a run ------------ +void L1Validator::beginRun(edm::Run const&, edm::EventSetup const&){ + _Hists->Book(); +} + +// ------------ method called when ending the processing of a run ------------ + +void L1Validator::endRun(edm::Run const&, edm::EventSetup const&){ + _Hists->Normalize(); +} + + +// ------------ method called when starting to processes a luminosity block ------------ +/* +void L1Validator::beginLuminosityBlock(edm::LuminosityBlock const&, edm::EventSetup const&) +{ +} +*/ + +// ------------ method called when ending the processing of a luminosity block ------------ +/* +void L1Validator::endLuminosityBlock(edm::LuminosityBlock const&, edm::EventSetup const&) +{ +} +*/ + + +//The next three are exactly the same, but apparently inheritance doesn't work like I thought it did. +const reco::LeafCandidate *L1Validator::FindBest(const reco::GenParticle *GenPart, const std::vector *Collection1, const std::vector *Collection2=NULL){ + const reco::LeafCandidate *BestPart=NULL; + double BestDR=999.; + + for(uint i=0; i < Collection1->size(); i++){ + const reco::LeafCandidate *ThisPart = &Collection1->at(i); + double ThisDR = reco::deltaR(GenPart->eta(), GenPart->phi(), ThisPart->eta(), ThisPart->phi()); + if(ThisDR < BestDR){ + BestDR = ThisDR; + BestPart = ThisPart; + } + } + + if(Collection2==NULL) return BestPart; + + for(uint i=0; i < Collection2->size(); i++){ + const reco::LeafCandidate *ThisPart = &Collection2->at(i); + double ThisDR = reco::deltaR(GenPart->eta(), GenPart->phi(), ThisPart->eta(), ThisPart->phi()); + if(ThisDR < BestDR){ + BestDR = ThisDR; + BestPart = ThisPart; + } + } + + return BestPart; +} + +const reco::LeafCandidate *L1Validator::FindBest(const reco::GenParticle *GenPart, const std::vector *Collection1, const std::vector *Collection2=NULL){ + const reco::LeafCandidate *BestPart=NULL; + double BestDR=999.; + + for(uint i=0; i < Collection1->size(); i++){ + const reco::LeafCandidate *ThisPart = &Collection1->at(i); + double ThisDR = reco::deltaR(GenPart->eta(), GenPart->phi(), ThisPart->eta(), ThisPart->phi()); + if(ThisDR < BestDR){ + BestDR = ThisDR; + BestPart = ThisPart; + } + } + + if(Collection2==NULL) return BestPart; + + for(uint i=0; i < Collection2->size(); i++){ + const reco::LeafCandidate *ThisPart = &Collection2->at(i); + double ThisDR = reco::deltaR(GenPart->eta(), GenPart->phi(), ThisPart->eta(), ThisPart->phi()); + if(ThisDR < BestDR){ + BestDR = ThisDR; + BestPart = ThisPart; + } + } + + return BestPart; +} + +const reco::LeafCandidate *L1Validator::FindBest(const reco::GenParticle *GenPart, const std::vector *Collection1){ + const reco::LeafCandidate *BestPart=NULL; + double BestDR=999.; + + for(uint i=0; i < Collection1->size(); i++){ + const reco::LeafCandidate *ThisPart = &Collection1->at(i); + double ThisDR = reco::deltaR(GenPart->eta(), GenPart->phi(), ThisPart->eta(), ThisPart->phi()); + if(ThisDR < BestDR){ + BestDR = ThisDR; + BestPart = ThisPart; + } + } + + return BestPart; +} + + +// ------------ method fills 'descriptions' with the allowed parameters for the module ------------ +void L1Validator::fillDescriptions(edm::ConfigurationDescriptions& descriptions) { + //The following says we do not know what parameters are allowed so do no validation + // Please change this to state exactly what you do use, even if it is no parameters + edm::ParameterSetDescription desc; + desc.setUnknown(); + descriptions.addDefault(desc); +} + +//define this as a plug-in +DEFINE_FWK_MODULE(L1Validator); diff --git a/Validation/L1T/python/JustL1Validation_cff.py b/Validation/L1T/python/JustL1Validation_cff.py new file mode 100644 index 0000000000000..bcacfea5d48b9 --- /dev/null +++ b/Validation/L1T/python/JustL1Validation_cff.py @@ -0,0 +1,80 @@ +# Auto generated configuration file +# using: +# Revision: 1.20 +# Source: /local/reps/CMSSW/CMSSW/Configuration/Applications/python/ConfigBuilder.py,v +# with command line options: step2 -s RAW2DIGI,RECO,VALIDATION,DQM -n 10 --filein /store/relval/CMSSW_6_2_0_pre8/RelValZMM/GEN-SIM-DIGI-RAW-HLTDEBUG/PRE_ST62_V8-v1/00000/3AFDBE70-E2E0-E211-B9A5-003048F179C2.root --eventcontent FEVTDEBUGHLT --conditions auto:mc --mc --no_exec +import FWCore.ParameterSet.Config as cms + +process = cms.Process('RECO') + +# import of standard configurations +process.load('Configuration.StandardSequences.Services_cff') +process.load('SimGeneral.HepPDTESSource.pythiapdt_cfi') +process.load('FWCore.MessageService.MessageLogger_cfi') +process.load('Configuration.EventContent.EventContent_cff') +process.load('SimGeneral.MixingModule.mixNoPU_cfi') +process.load('Configuration.StandardSequences.GeometryRecoDB_cff') +process.load('Configuration.StandardSequences.MagneticField_38T_cff') +process.load('Configuration.StandardSequences.RawToDigi_cff') +process.load('Configuration.StandardSequences.Reconstruction_cff') +process.load('Configuration.StandardSequences.Validation_cff') +process.load('DQMOffline.Configuration.DQMOfflineMC_cff') +process.load('Configuration.StandardSequences.EndOfProcess_cff') +process.load('Configuration.StandardSequences.FrontierConditions_GlobalTag_cff') + +process.maxEvents = cms.untracked.PSet( + input = cms.untracked.int32(100) +) + +# Input source +process.source = cms.Source("PoolSource", + secondaryFileNames = cms.untracked.vstring(), + fileNames = cms.untracked.vstring('/store/relval/CMSSW_6_2_0_pre8/RelValZMM/GEN-SIM-DIGI-RAW-HLTDEBUG/PRE_ST62_V8-v1/00000/3AFDBE70-E2E0-E211-B9A5-003048F179C2.root') +) + +process.options = cms.untracked.PSet( + +) + +# Production Info +process.configurationMetadata = cms.untracked.PSet( + version = cms.untracked.string('$Revision: 1.20 $'), + annotation = cms.untracked.string('step2 nevts:10'), + name = cms.untracked.string('Applications') +) + +# Output definition + +process.FEVTDEBUGHLToutput = cms.OutputModule("PoolOutputModule", + splitLevel = cms.untracked.int32(0), + eventAutoFlushCompressedSize = cms.untracked.int32(5242880), + outputCommands = process.FEVTDEBUGHLTEventContent.outputCommands, + fileName = cms.untracked.string('step2_RAW2DIGI_RECO_VALIDATION_DQM.root'), + dataset = cms.untracked.PSet( + filterName = cms.untracked.string(''), + dataTier = cms.untracked.string('') + ) +) + +# Additional output definition + +# Other statements +process.mix.playback = True +process.mix.digitizers = cms.PSet() +for a in process.aliases: delattr(process, a) +process.RandomNumberGeneratorService.restoreStateLabel=cms.untracked.string("randomEngineStateProducer") +from Configuration.AlCa.GlobalTag import GlobalTag +process.GlobalTag = GlobalTag(process.GlobalTag, 'auto:mc', '') + +# Path and EndPath definitions +process.raw2digi_step = cms.Path(process.RawToDigi) +process.reconstruction_step = cms.Path(process.reconstruction) +process.prevalidation_step = cms.Path(process.prevalidation) +process.dqmoffline_step = cms.Path(process.DQMOffline) +process.validation_step = cms.EndPath(process.validation) +process.endjob_step = cms.EndPath(process.endOfProcess) +process.FEVTDEBUGHLToutput_step = cms.EndPath(process.FEVTDEBUGHLToutput) + +# Schedule definition +process.schedule = cms.Schedule(process.raw2digi_step,process.reconstruction_step,process.prevalidation_step,process.validation_step,process.dqmoffline_step,process.endjob_step,process.FEVTDEBUGHLToutput_step) + diff --git a/Validation/L1T/python/L1Validator_cfi.py b/Validation/L1T/python/L1Validator_cfi.py new file mode 100644 index 0000000000000..c4a87347bfc53 --- /dev/null +++ b/Validation/L1T/python/L1Validator_cfi.py @@ -0,0 +1,13 @@ +import FWCore.ParameterSet.Config as cms + +L1Validator = cms.EDAnalyzer('L1Validator', + dirName=cms.string("L1T/L1TriggerVsGen/"), +# fileName=cms.string("L1Validation.root") #output file name + GenSource=cms.InputTag("genParticles"), + L1ExtraIsoEGSource=cms.InputTag("l1extraParticles", "Isolated"), + L1ExtraNonIsoEGSource=cms.InputTag("l1extraParticles", "NonIsolated"), + L1ExtraCenJetSource=cms.InputTag("l1extraParticles", "Central"), + L1ExtraForJetSource=cms.InputTag("l1extraParticles", "Forward"), + L1ExtraTauJetSource=cms.InputTag("l1extraParticles", "Tau"), + L1ExtraMuonSource=cms.InputTag("l1extraParticles") +) diff --git a/Validation/L1T/python/test_2.py b/Validation/L1T/python/test_2.py new file mode 100644 index 0000000000000..07734c433066b --- /dev/null +++ b/Validation/L1T/python/test_2.py @@ -0,0 +1,40 @@ +import FWCore.ParameterSet.Config as cms + +process = cms.Process("L1Val") + +process.load('Configuration.StandardSequences.Services_cff') +process.load("Validation.L1T.L1Validator_cfi") +process.load("FWCore.MessageService.MessageLogger_cfi") +#process.load('Configuration.StandardSequences.EndOfProcess_cff') +process.load('Configuration.StandardSequences.EDMtoMEAtRunEnd_cff') +#process.load('Configuration.EventContent.EventContent_cff') +import FWCore.ParameterSet.VarParsing as VarParsing + +options = VarParsing.VarParsing("analysis") +options.parseArguments() + +process.maxEvents = cms.untracked.PSet( input = cms.untracked.int32(-1) ) + +process.source = cms.Source("PoolSource", + # replace 'myfile.root' with the source file you want to use + fileNames = cms.untracked.vstring (options.inputFiles), +) + +#process.FEVTDEBUGHLToutput = cms.OutputModule("PoolOutputModule", +# splitLevel = cms.untracked.int32(0), +# eventAutoFlushCompressedSize = cms.untracked.int32(5242880), +# outputCommands = process.FEVTDEBUGHLTEventContent.outputCommands, +# fileName = cms.untracked.string('L1Validation.root'), +# dataset = cms.untracked.PSet( +# filterName = cms.untracked.string(''), +# dataTier = cms.untracked.string('') +# ) +#) + + +process.val_step = cms.Path(process.L1Validator) +#process.endjob_step = cms.EndPath(process.endOfProcess) +#process.FEVTDEBUGHLToutput_step = cms.EndPath(process.FEVTDEBUGHLToutput) +process.dqmsave_step = cms.Path(process.DQMSaver) + +process.schedule = cms.Schedule(process.val_step, process.dqmsave_step) diff --git a/Validation/L1T/python/test_cfg.py b/Validation/L1T/python/test_cfg.py new file mode 100644 index 0000000000000..002620c955e8a --- /dev/null +++ b/Validation/L1T/python/test_cfg.py @@ -0,0 +1,19 @@ +import FWCore.ParameterSet.Config as cms + +process = cms.Process("L1Val") + +process.load("Validation.L1T.L1Validator_cfi") +process.load("FWCore.MessageService.MessageLogger_cfi") + +process.maxEvents = cms.untracked.PSet( input = cms.untracked.int32(10000) ) + +process.source = cms.Source("PoolSource", + # replace 'myfile.root' with the source file you want to use + fileNames = cms.untracked.vstring( +# 'file:step2_RAW2DIGI_RECO_VALIDATION_DQM.root' + '/store/relval/CMSSW_6_2_0_pre8/RelValZMM/GEN-SIM-DIGI-RAW-HLTDEBUG/PRE_ST62_V8-v1/00000/3AFDBE70-E2E0-E211-B9A5-003048F179C2.root' +# '/store/relval/CMSSW_7_0_0_pre1/RelValZMM/GEN-SIM-DIGI-RAW-HLTDEBUG/PRE_ST62_V8-v1/00000/A8B55F84-2E0F-E311-8F27-003048D15E24.root' + ) +) + +process.p = cms.Path(process.L1Validator) diff --git a/Validation/L1T/src/L1ValidatorHists.cc b/Validation/L1T/src/L1ValidatorHists.cc new file mode 100644 index 0000000000000..8990d4e6716b7 --- /dev/null +++ b/Validation/L1T/src/L1ValidatorHists.cc @@ -0,0 +1,107 @@ +#include "Validation/L1T/interface/L1ValidatorHists.h" + +//#include + +#include "DataFormats/Math/interface/deltaR.h" + +/*#define BOOKHISTS(TYPE) \ +TYPE ## _N_Pt = new TH2F(#TYPE "_N_Pt", #TYPE " Number", 20, 0, 200); \ +TYPE ## _N_Eta = new TH2F(#TYPE "_N_Eta", #TYPE " Number", 20, -4, 4); \ +TYPE ## _Eff_Pt = new TH2F(#TYPE "_Eff_Pt", #TYPE " Number", 20, 0, 200); \ +TYPE ## _Eff_Eta = new TH2F(#TYPE "_Eff_Eta", #TYPE " Number", 20, -4, 4); \ +TYPE ## _dR = new TH2F(#TYPE "_dR", #TYPE " Number", 20, 0, 1); \ +TYPE ## _dPt = new TH2F(#TYPE "_dPt", #TYPE " Number", 20, -1, 1); +*/ +L1ValidatorHists::L1ValidatorHists(DQMStore *dbe){ + _dbe=dbe; + //_dbe->setCurrentFolder("L1T/L1Extra"); + + Name[0]="IsoEG"; + Name[1]="NonIsoEG"; + Name[2]="CenJet"; + Name[3]="ForJet"; + Name[4]="TauJet"; + Name[5]="Muon"; +} + +void L1ValidatorHists::Book(){ + NEvents=0; + + for(int i=0; ibook1D( (Name[i]+"_N").c_str(), (Name[i]+" Number").c_str(), 5, -0.5, 4.5); + N_Pt[i] = new TH1F( (Name[i]+"_N_Pt").c_str(), (Name[i]+" Number").c_str(), 20, 0, 100); + N_Eta[i] = new TH1F( (Name[i]+"_N_Eta").c_str(), (Name[i]+" Number").c_str(), 20, -4, 4); + Eff_Pt[i] = _dbe->book1D( (Name[i]+"_Eff_Pt").c_str(), (Name[i]+" Efficiency").c_str(), 20, 0, 100); + Eff_Eta[i] = _dbe->book1D( (Name[i]+"_Eff_Eta").c_str(), (Name[i]+" Efficiency").c_str(), 20, -4, 4); + TurnOn_15[i] = _dbe->book1D( (Name[i]+"_TurnOn_15").c_str(), (Name[i]+" Turn On (15 GeV)").c_str(), 20, 0, 100); + TurnOn_30[i] = _dbe->book1D( (Name[i]+"_TurnOn_30").c_str(), (Name[i]+" Turn On (30 GeV)").c_str(), 20, 0, 100); + dR[i] = _dbe->book1D( (Name[i]+"_dR").c_str(), (Name[i]+" dR").c_str(), 20, 0, 1); + dPt[i] = _dbe->book1D( (Name[i]+"_dPt").c_str(), (Name[i]+" dPt").c_str(), 20, -1, 1); + + N[i]->getTH1()->Sumw2(); + N_Pt[i]->Sumw2(); + N_Eta[i]->Sumw2(); + Eff_Pt[i]->getTH1()->Sumw2(); + Eff_Eta[i]->getTH1()->Sumw2(); + TurnOn_15[i]->getTH1()->Sumw2(); + TurnOn_30[i]->getTH1()->Sumw2(); + dR[i]->getTH1()->Sumw2(); + dPt[i]->getTH1()->Sumw2(); + } + +} + +void L1ValidatorHists::Fill(int i, const reco::LeafCandidate *GenPart, const reco::LeafCandidate *RecoPart){ + N_Pt[i]->Fill(GenPart->pt()); + N_Eta[i]->Fill(GenPart->eta()); + + if(RecoPart==NULL) return; + + Eff_Pt[i]->Fill(GenPart->pt()); + if(RecoPart->pt()>15) TurnOn_15[i]->Fill(GenPart->pt()); + if(RecoPart->pt()>30) TurnOn_30[i]->Fill(GenPart->pt()); + Eff_Eta[i]->Fill(GenPart->eta()); + dR[i]->Fill(reco::deltaR(GenPart->eta(), GenPart->phi(), RecoPart->eta(), RecoPart->phi())); + dPt[i]->Fill( (RecoPart->pt()-GenPart->pt()) / GenPart->pt() ); +} + +void L1ValidatorHists::FillNumber(int i, int Number){ + N[i]->Fill(Number); +} + +void L1ValidatorHists::Normalize(){ + for(int i=0; igetTH1F()->Divide(N_Pt[i]); + TurnOn_15[i]->getTH1F()->Divide(N_Pt[i]); + TurnOn_30[i]->getTH1F()->Divide(N_Pt[i]); + Eff_Eta[i]->getTH1F()->Divide(N_Eta[i]); + N[i]->getTH1()->Scale(1./N[i]->getEntries()); + dR[i]->getTH1()->Scale(1./dR[i]->getEntries()); + dPt[i]->getTH1()->Scale(1./dPt[i]->getEntries()); + } +} + +void L1ValidatorHists::Write(){ + for(int i=0; igetTH1()->Write(); + Eff_Pt[i]->getTH1()->Write(); + Eff_Eta[i]->getTH1()->Write(); + TurnOn_15[i]->getTH1()->Write(); + TurnOn_30[i]->getTH1()->Write(); + dR[i]->getTH1()->Write(); + dPt[i]->getTH1()->Write(); + } +} + +/*void L1ValidatorHists::NormalizeSlices(TH2F *Hist){ + int NBinsX = Hist->GetNbinsX(); + int NBinsY = Hist->GetNbinsY(); + for(int i=0; iIntegral(i, i, 0, -1); + if(Total == 0) continue; + for(int j=0; jSetBinContent(i,j, Hist->GetBinContent(i,j)/Total); + } + } +} +*/