Skip to content

Commit

Permalink
add PU vs LS
Browse files Browse the repository at this point in the history
fix
  • Loading branch information
mtosi committed Sep 28, 2017
1 parent 030352c commit 271311b
Show file tree
Hide file tree
Showing 6 changed files with 90 additions and 32 deletions.
18 changes: 18 additions & 0 deletions DQM/HLTEvF/plugins/LumiMonitor.cc
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ LumiMonitor::LumiMonitor( const edm::ParameterSet& iConfig ) :
folderName_ ( iConfig.getParameter<std::string>("FolderName") )
, lumiScalersToken_ ( consumes<LumiScalersCollection>(iConfig.getParameter<edm::InputTag>("scalers") ) )
, lumi_binning_ ( getHistoPSet (iConfig.getParameter<edm::ParameterSet>("histoPSet").getParameter<edm::ParameterSet>("lumiPSet")) )
, pu_binning_ ( getHistoPSet (iConfig.getParameter<edm::ParameterSet>("histoPSet").getParameter<edm::ParameterSet>("puPSet")) )
, ls_binning_ ( getHistoLSPSet(iConfig.getParameter<edm::ParameterSet>("histoPSet").getParameter<edm::ParameterSet>("lsPSet")) )
, doPixelLumi_ ( iConfig.getParameter<bool>("doPixelLumi") )
, pixelClustersToken_ ( doPixelLumi_ ? consumes<edmNew::DetSetVector<SiPixelCluster> >(iConfig.getParameter<edm::InputTag>("pixelClusters") ) : edm::EDGetTokenT<edmNew::DetSetVector<SiPixelCluster>> () )
Expand All @@ -26,6 +27,7 @@ LumiMonitor::LumiMonitor( const edm::ParameterSet& iConfig ) :
numberOfPixelClustersVsLS_ = nullptr;
numberOfPixelClustersVsLumi_ = nullptr;
lumiVsLS_ = nullptr;
puVsLS_ = nullptr;
pixelLumiVsLS_ = nullptr;
pixelLumiVsLumi_ = nullptr;

Expand Down Expand Up @@ -103,6 +105,14 @@ void LumiMonitor::bookHistograms(DQMStore::IBooker & ibooker,
lumiVsLS_->setAxisTitle("LS",1);
lumiVsLS_->setAxisTitle("scal inst lumi E30 [Hz cm^{-2}]",2);

histname = "puVsLS"; histtitle = "scal PU vs LS";
puVsLS_ = ibooker.bookProfile(histname, histtitle,
ls_binning_.nbins, ls_binning_.xmin, ls_binning_.xmax,
pu_binning_.xmin, pu_binning_.xmax);
// puVsLS_->getTH1()->SetCanExtend(TH1::kAllAxes);
puVsLS_->setAxisTitle("LS",1);
puVsLS_->setAxisTitle("scal PU",2);

}

#include "FWCore/Framework/interface/ESHandle.h"
Expand All @@ -115,15 +125,19 @@ void LumiMonitor::analyze(edm::Event const& iEvent, edm::EventSetup const& iSetu
int ls = iEvent.id().luminosityBlock();

float scal_lumi = -1.;
float scal_pu = -1.;
edm::Handle<LumiScalersCollection> lumiScalers;
iEvent.getByToken(lumiScalersToken_, lumiScalers);
if ( lumiScalers.isValid() && lumiScalers->size() ) {
LumiScalersCollection::const_iterator scalit = lumiScalers->begin();
scal_lumi = scalit->instantLumi();
scal_pu = scalit->pileup();
} else {
scal_lumi = -1.;
scal_pu = -1.;
}
lumiVsLS_ -> Fill(ls, scal_lumi);
puVsLS_ -> Fill(ls, scal_pu );

if ( doPixelLumi_ ) {
size_t pixel_clusters = 0;
Expand Down Expand Up @@ -201,6 +215,10 @@ void LumiMonitor::fillDescriptions(edm::ConfigurationDescriptions & descriptions
fillHistoPSetDescription(lumiPSet);
histoPSet.add<edm::ParameterSetDescription>("lumiPSet", lumiPSet);

edm::ParameterSetDescription puPSet;
fillHistoPSetDescription(puPSet);
histoPSet.add<edm::ParameterSetDescription>("puPSet", puPSet);

edm::ParameterSetDescription pixellumiPSet;
fillHistoPSetDescription(pixellumiPSet);
histoPSet.add<edm::ParameterSetDescription>("pixellumiPSet", pixellumiPSet);
Expand Down
2 changes: 2 additions & 0 deletions DQM/HLTEvF/plugins/LumiMonitor.h
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,7 @@ class LumiMonitor : public DQMEDAnalyzer

edm::EDGetTokenT<LumiScalersCollection> lumiScalersToken_;
MEbinning lumi_binning_;
MEbinning pu_binning_;
MEbinning ls_binning_;

bool doPixelLumi_;
Expand All @@ -76,6 +77,7 @@ class LumiMonitor : public DQMEDAnalyzer
MonitorElement* numberOfPixelClustersVsLS_;
MonitorElement* numberOfPixelClustersVsLumi_;
MonitorElement* lumiVsLS_;
MonitorElement* puVsLS_;
MonitorElement* pixelLumiVsLS_;
MonitorElement* pixelLumiVsLumi_;

Expand Down
5 changes: 5 additions & 0 deletions DQM/HLTEvF/python/LumiMonitor_cff.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,11 @@
xmin = cms.double( 3000.),
xmax = cms.double(12000.),
),
puPSet = cms.PSet(
nbins = cms.int32 (260 ),
xmin = cms.double( 0.),
xmax = cms.double(130.),
),
pixellumiPSet = cms.PSet(
nbins = cms.int32 (300 ),
xmin = cms.double( 0.),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,4 +44,4 @@
MonitorTrackMuonsInnerTrack.doEffFromHitPatternVsBX = False

#MonitorTrackINNMuons = cms.Sequence(muonInnerTrack+MonitorTrackMuonsInnerTrack)
MonitorTrackINNMuons = cms.Sequence(muonsPt10+muonInnerTrack+MonitorTrackMuonsInnerTrack)
MonitorTrackINNMuons = cms.Sequence(cms.ignore(muonsPt10)+muonInnerTrack+MonitorTrackMuonsInnerTrack)
59 changes: 34 additions & 25 deletions DQMOffline/Trigger/python/DQMOffline_LumiMontiroring_cff.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,33 +4,42 @@
#hltScalersRawToDigi4DQM = cms.EDProducer( "ScalersRawToDigi",
# scalersInputTag = cms.InputTag( "rawDataCollector" )
#)
hltLumiMonitor = cms.EDAnalyzer( "LumiMonitor",
useBPixLayer1 = cms.bool( False ),
minPixelClusterCharge = cms.double( 15000.0 ),
histoPSet = cms.PSet(
lsPSet = cms.PSet( nbins = cms.int32( 2500 ) ),
pixelClusterPSet = cms.PSet(
nbins = cms.int32( 200 ),
xmin = cms.double( -0.5 ),
xmax = cms.double( 19999.5 )
),
lumiPSet = cms.PSet(
nbins = cms.int32( 5000 ),
xmin = cms.double( 0.0 ),
xmax = cms.double( 20000.0 )
),
pixellumiPSet = cms.PSet(
nbins = cms.int32( 300 ),
xmin = cms.double( 0.0 ),
xmax = cms.double( 3.0 )
)

from DQM.HLTEvF.lumiMonitor_cfi import lumiMonitor

hltLumiMonitor = lumiMonitor.clone()
hltLumiMonitor.useBPixLayer1 = cms.bool( False )
hltLumiMonitor.minPixelClusterCharge = cms.double( 15000.0 )
hltLumiMonitor.histoPSet = cms.PSet(
lsPSet = cms.PSet(
nbins = cms.int32( 2500 )
),
pixelClusterPSet = cms.PSet(
nbins = cms.int32( 200 ),
xmin = cms.double( -0.5 ),
xmax = cms.double( 19999.5 )
),
puPSet = cms.PSet(
nbins = cms.int32( 130 ),
xmin = cms.double( 0. ),
xmax = cms.double( 130. )
),
lumiPSet = cms.PSet(
nbins = cms.int32( 440 ),
xmin = cms.double( 0.0 ),
xmax = cms.double( 22000.0 )
),
minNumberOfPixelsPerCluster = cms.int32( 2 ),
FolderName = cms.string( "HLT/LumiMonitoring" ),
scalers = cms.InputTag( "scalersRawToDigi" ),
pixelClusters = cms.InputTag( "hltSiPixelClusters" ),
doPixelLumi = cms.bool( False )
pixellumiPSet = cms.PSet(
nbins = cms.int32( 300 ),
xmin = cms.double( 0.0 ),
xmax = cms.double( 3.0 )
)
)
hltLumiMonitor.minNumberOfPixelsPerCluster = cms.int32( 2 )
hltLumiMonitor.FolderName = cms.string( "HLT/LumiMonitoring" )
hltLumiMonitor.scalers = cms.InputTag( "scalersRawToDigi" )
hltLumiMonitor.pixelClusters = cms.InputTag( "hltSiPixelClusters" )
hltLumiMonitor.doPixelLumi = cms.bool( False )

lumiMonitorHLTsequence = cms.Sequence(
# hltScalersRawToDigi4DQM +
Expand Down
36 changes: 30 additions & 6 deletions HLTrigger/Timer/plugins/FastTimerServiceClient.cc
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ class FastTimerServiceClient : public DQMEDHarvester {

static void fillDescriptions(edm::ConfigurationDescriptions & descriptions);
static void fillLumiMePSetDescription(edm::ParameterSetDescription & pset);
static void fillPUMePSetDescription(edm::ParameterSetDescription & pset);

private:
std::string m_dqm_path;
Expand All @@ -54,9 +55,11 @@ class FastTimerServiceClient : public DQMEDHarvester {

bool doPlotsVsScalLumi_;
bool doPlotsVsPixelLumi_;
bool doPlotsVsPU_;

MEPSet scalLumiMEPSet_;
MEPSet pixelLumiMEPSet_;
MEPSet puMEPSet_;

};

Expand All @@ -65,8 +68,10 @@ FastTimerServiceClient::FastTimerServiceClient(edm::ParameterSet const & config)
m_dqm_path( config.getUntrackedParameter<std::string>( "dqmPath" ) )
, doPlotsVsScalLumi_ ( config.getParameter<bool>( "doPlotsVsScalLumi" ) )
, doPlotsVsPixelLumi_( config.getParameter<bool>( "doPlotsVsPixelLumi" ) )
, scalLumiMEPSet_ ( doPlotsVsScalLumi_ ? getHistoPSet(config.getParameter<edm::ParameterSet>("scalLumiME")) : MEPSet{} )
, doPlotsVsPU_ ( config.getParameter<bool>( "doPlotsVsPU" ) )
, scalLumiMEPSet_ ( doPlotsVsScalLumi_ ? getHistoPSet(config.getParameter<edm::ParameterSet>("scalLumiME") ) : MEPSet{} )
, pixelLumiMEPSet_( doPlotsVsPixelLumi_ ? getHistoPSet(config.getParameter<edm::ParameterSet>("pixelLumiME")) : MEPSet{} )
, puMEPSet_ ( doPlotsVsPU_ ? getHistoPSet(config.getParameter<edm::ParameterSet>("puME") ) : MEPSet{} )
{
}

Expand Down Expand Up @@ -131,6 +136,8 @@ FastTimerServiceClient::fillProcessSummaryPlots(DQMStore::IBooker & booker, DQMS
fillPlotsVsLumi( booker,getter, current_path, "VsScalLumi", scalLumiMEPSet_ );
if ( doPlotsVsPixelLumi_ )
fillPlotsVsLumi( booker,getter, current_path, "VsPixelLumi", pixelLumiMEPSet_ );
if ( doPlotsVsPU_ )
fillPlotsVsLumi( booker,getter, current_path, "VsPU", puMEPSet_ );

// getter.setCurrentFolder(current_path);

Expand Down Expand Up @@ -347,6 +354,8 @@ FastTimerServiceClient::fillPathSummaryPlots(DQMStore::IBooker & booker, DQMStor
fillPlotsVsLumi( booker,getter, subsubdir, "VsScalLumi", scalLumiMEPSet_ );
if ( doPlotsVsPixelLumi_ )
fillPlotsVsLumi( booker,getter, subsubdir, "VsPixelLumi", pixelLumiMEPSet_ );
if ( doPlotsVsPU_ )
fillPlotsVsLumi( booker,getter, subsubdir, "VsPU", puMEPSet_ );

}

Expand Down Expand Up @@ -379,7 +388,7 @@ FastTimerServiceClient::fillPlotsVsLumi(DQMStore::IBooker & booker, DQMStore::IG
double xmin = pset.xmin;
double xmax = pset.xmax;

// get lumi VS LS ME
// get lumi/PU VS LS ME
getter.setCurrentFolder(folder);
MonitorElement* lumiVsLS = getter.get(folder+"/"+name);
// if no ME available, return
Expand All @@ -395,8 +404,8 @@ FastTimerServiceClient::fillPlotsVsLumi(DQMStore::IBooker & booker, DQMStore::IG
std::vector<double> lumi;
std::vector<int> LS;
for ( size_t ibin=1; ibin <= size; ++ibin ) {
// avoid to store points w/ no info
if ( lumiVsLS->getTProfile()->GetBinContent(ibin) == 0. ) continue;
// // avoid to store points w/ no info
// if ( lumiVsLS->getTProfile()->GetBinContent(ibin) == 0. ) continue;

lumi.push_back( lumiVsLS->getTProfile()->GetBinContent(ibin) );
LS.push_back ( lumiVsLS->getTProfile()->GetXaxis()->GetBinCenter(ibin) );
Expand Down Expand Up @@ -439,9 +448,19 @@ void
FastTimerServiceClient::fillLumiMePSetDescription(edm::ParameterSetDescription & pset) {
pset.add<std::string>("folder", "HLT/LumiMonitoring");
pset.add<std::string>("name" , "lumiVsLS");
pset.add<int> ("nbins", 6500 );
pset.add<int> ("nbins", 440 );
pset.add<double>("xmin", 0.);
pset.add<double>("xmax", 13000.);
pset.add<double>("xmax", 22000.);
}


void
FastTimerServiceClient::fillPUMePSetDescription(edm::ParameterSetDescription & pset) {
pset.add<std::string>("folder", "HLT/LumiMonitoring");
pset.add<std::string>("name" , "puVsLS");
pset.add<int> ("nbins", 260 );
pset.add<double>("xmin", 0.);
pset.add<double>("xmax", 130.);
}


Expand All @@ -464,6 +483,7 @@ FastTimerServiceClient::fillDescriptions(edm::ConfigurationDescriptions & descri
desc.addUntracked<std::string>( "dqmPath", "HLT/TimerService");
desc.add<bool>( "doPlotsVsScalLumi", true );
desc.add<bool>( "doPlotsVsPixelLumi", false );
desc.add<bool>( "doPlotsVsPU", true );

edm::ParameterSetDescription scalLumiMEPSet;
fillLumiMePSetDescription(scalLumiMEPSet);
Expand All @@ -473,6 +493,10 @@ FastTimerServiceClient::fillDescriptions(edm::ConfigurationDescriptions & descri
fillLumiMePSetDescription(pixelLumiMEPSet);
desc.add<edm::ParameterSetDescription>("pixelLumiME", pixelLumiMEPSet);

edm::ParameterSetDescription puMEPSet;
fillPUMePSetDescription(puMEPSet);
desc.add<edm::ParameterSetDescription>("puME", puMEPSet);

descriptions.add("fastTimerServiceClient", desc);
}

Expand Down

0 comments on commit 271311b

Please sign in to comment.