Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add PV monitoring @HLT #18191

Merged
merged 10 commits into from
Apr 12, 2017
12 changes: 6 additions & 6 deletions Configuration/PyReleaseValidation/python/relval_steps.py
Original file line number Diff line number Diff line change
Expand Up @@ -1173,13 +1173,13 @@ def lhegensim(fragment,howMuch):

# step3
step3Defaults = {
'-s' : 'RAW2DIGI,L1Reco,RECO,EI,VALIDATION,DQM',
'-s' : 'RAW2DIGI,L1Reco,RECO,EI,VALIDATION:@standardValidationNoHLT,DQM:@standardDQMFakeHLT',
'--conditions' : 'auto:run1_mc',
'--no_exec' : '',
'--datatier' : 'GEN-SIM-RECO,DQMIO',
'--eventcontent': 'RECOSIM,DQM',
}
step3DefaultsAlCaCalo=merge([{'-s':'RAW2DIGI,L1Reco,RECO,EI,ALCA:EcalCalZElectron+EcalCalWElectron+EcalUncalZElectron+EcalUncalWElectron+HcalCalIsoTrk,VALIDATION,DQM'}, step3Defaults])
step3DefaultsAlCaCalo=merge([{'-s':'RAW2DIGI,L1Reco,RECO,EI,ALCA:EcalCalZElectron+EcalCalWElectron+EcalUncalZElectron+EcalUncalWElectron+HcalCalIsoTrk,VALIDATION:@standardValidationNoHLT,DQM:@standardDQMFakeHLT'}, step3Defaults])

steps['DIGIPU']=merge([{'--process':'REDIGI'},steps['DIGIPU1']])

Expand All @@ -1195,9 +1195,9 @@ def lhegensim(fragment,howMuch):
'--era' : 'Run2_2016'
}

step3Up2015Defaults50ns = merge([{'-s':'RAW2DIGI,L1Reco,RECO,EI,PAT,VALIDATION:@standardValidation+@miniAODValidation,DQM:@standardDQMFakeHLT+@miniAODDQM','--conditions':'auto:run2_mc_50ns','--era':'Run2_50ns'},step3Up2015Defaults])
step3Up2015Defaults50ns = merge([{'-s':'RAW2DIGI,L1Reco,RECO,EI,PAT,VALIDATION:@standardValidationNoHLT+@miniAODValidation,DQM:@standardDQMFakeHLT+@miniAODDQM','--conditions':'auto:run2_mc_50ns','--era':'Run2_50ns'},step3Up2015Defaults])

step3Up2015DefaultsAlCaCalo = merge([{'-s':'RAW2DIGI,L1Reco,RECO,EI,ALCA:EcalCalZElectron+EcalCalWElectron+EcalUncalZElectron+EcalUncalWElectron+EcalTrg+HcalCalIsoTrk,VALIDATION,DQM'},step3Up2015Defaults])
step3Up2015DefaultsAlCaCalo = merge([{'-s':'RAW2DIGI,L1Reco,RECO,EI,ALCA:EcalCalZElectron+EcalCalWElectron+EcalUncalZElectron+EcalUncalWElectron+EcalTrg+HcalCalIsoTrk,VALIDATION:@standardValidationNoHLT,DQM:@standardDQMFakeHLT'},step3Up2015Defaults])
step3Up2015DefaultsAlCaCalo50ns = merge([{'--conditions':'auto:run2_mc_50ns','--era':'Run2_50ns'},step3Up2015DefaultsAlCaCalo])

step3Up2015Hal = {'-s' :'RAW2DIGI,L1Reco,RECO,EI,VALIDATION,DQM',
Expand Down Expand Up @@ -1510,7 +1510,7 @@ def lhegensim(fragment,howMuch):


#MC
steps['HARVEST']={'-s':'HARVESTING:validationHarvesting+dqmHarvesting',
steps['HARVEST']={'-s':'HARVESTING:validationHarvestingNoHLT+dqmHarvestingFakeHLT',
'--conditions':'auto:run1_mc',
'--mc':'',
'--filetype':'DQM',
Expand Down Expand Up @@ -1580,7 +1580,7 @@ def lhegensim(fragment,howMuch):

steps['HARVESTUP15_PU25']=steps['HARVESTUP15']

steps['HARVESTUP15_PU50']=merge([{'-s':'HARVESTING:@standardValidation+@standardDQMFakeHLT+@miniAODValidation+@miniAODDQM','--era' : 'Run2_50ns'},steps['HARVESTUP15']])
steps['HARVESTUP15_PU50']=merge([{'-s':'HARVESTING:@standardValidationNoHLT+@standardDQMFakeHLT+@miniAODValidation+@miniAODDQM','--era' : 'Run2_50ns'},steps['HARVESTUP15']])

steps['HARVESTUP15_trackingOnly']=merge([{'-s': 'HARVESTING:@trackingOnlyValidation+@trackingOnlyDQM'}, steps['HARVESTUP15']])

Expand Down
3 changes: 1 addition & 2 deletions Configuration/StandardSequences/python/Validation_cff.py
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@
*globalhitsanalyze
*globalrechitsanalyze
*globalValidation)

validationNoHLT.remove(condDataValidation) # foca d'ovatta !
validation = cms.Sequence(validationNoHLT
*hltvalidation)

Expand Down Expand Up @@ -88,7 +88,6 @@
from Configuration.Eras.Modifier_fastSim_cff import fastSim
fastSim.toReplaceWith(validation_preprod,_validation_preprod_fastsim)

validation.remove(condDataValidation)
validation_prodNoHLT = cms.Sequence(
genvalid_all
)
Expand Down
2 changes: 2 additions & 0 deletions DQM/HLTEvF/python/HLTObjectMonitor_cff.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,13 +13,15 @@
# DQM.HLTEvF.HLTSiStripMonitoring_cff has to be updated as soon as the 25ns menu will be in production
from DQM.HLTEvF.HLTSiStripMonitoring_cff import *
from DQM.HLTEvF.HLTTrackingMonitoring_cff import *
from DQM.HLTEvF.HLTPrimaryVertexMonitoring_cff import *


hlt4vector = cms.Path(
hltObjectMonitor
# * sistripOnlineMonitorHLTsequence # strip cluster monitoring
* trackingMonitoringHLTsequence # tracking monitoring
* egmTrackingMonitorHLTsequence # EGM tracking monitoring
* vertexingMonitorHLTsequence # vertexing
)


Expand Down
10 changes: 10 additions & 0 deletions DQM/HLTEvF/python/HLTPrimaryVertexMonitoring_cff.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
import FWCore.ParameterSet.Config as cms

# tracking monitor
from DQMOffline.Trigger.PrimaryVertexMonitoring_cff import *

vertexingMonitorHLTsequence = cms.Sequence(
hltPixelVerticesMonitoring
+ hltVerticesPFFilterMonitoring
# + hltVerticesL3PFBjets
)
7 changes: 7 additions & 0 deletions DQMOffline/Configuration/python/DQMOfflineHeavyIons_cff.py
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,13 @@

triggerOfflineDQMSource.remove(jetMETHLTOfflineAnalyzer)
triggerOfflineDQMSource.remove(exoticaMonitorHLT)
triggerOfflineDQMSource.remove(susyMonitorHLT)
triggerOfflineDQMSource.remove(b2gMonitorHLT)
triggerOfflineDQMSource.remove(bphysicsMonitorHLT)
triggerOfflineDQMSource.remove(higgsMonitorHLT)
triggerOfflineDQMSource.remove(smpMonitorHLT)
triggerOfflineDQMSource.remove(topMonitorHLT)
triggerOfflineDQMSource.remove(btagMonitorHLT)

#egammaDQMOffline.remove(electronAnalyzerSequence)
egammaDQMOffline.remove(zmumugammaAnalysis)
Expand Down
55 changes: 40 additions & 15 deletions DQMOffline/RecoB/plugins/PrimaryVertexMonitor.cc
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,10 @@ using namespace edm;

PrimaryVertexMonitor::PrimaryVertexMonitor(const edm::ParameterSet& pSet)
: conf_ ( pSet )
, TopFolderName_ ( pSet.getParameter<std::string>("TopFolderName") )
, AlignmentLabel_( pSet.getParameter<std::string>("AlignmentLabel"))
, TopFolderName_ ( pSet.getParameter<std::string>("TopFolderName") )
, AlignmentLabel_( pSet.getParameter<std::string>("AlignmentLabel") )
, ndof_ ( pSet.getParameter<int> ("ndof") )
, errorPrinted_ ( false )
, nbvtx(NULL)
, bsX(NULL)
, bsY(NULL)
Expand Down Expand Up @@ -52,7 +54,7 @@ PrimaryVertexMonitor::PrimaryVertexMonitor(const edm::ParameterSet& pSet)
vertexInputTag_ = pSet.getParameter<InputTag>("vertexLabel");
beamSpotInputTag_ = pSet.getParameter<InputTag>("beamSpotLabel");
vertexToken_ = consumes<reco::VertexCollection>(vertexInputTag_);
scoreToken_ = consumes<VertexScore>(vertexInputTag_);
scoreToken_ = consumes<VertexScore> (vertexInputTag_);
beamspotToken_ = consumes<reco::BeamSpot> (beamSpotInputTag_);

}
Expand Down Expand Up @@ -242,6 +244,7 @@ PrimaryVertexMonitor::~PrimaryVertexMonitor()

void PrimaryVertexMonitor::analyze(const edm::Event& iEvent, const edm::EventSetup& iSetup)
{

Handle<reco::VertexCollection> recVtxs;
iEvent.getByToken(vertexToken_, recVtxs);

Expand All @@ -265,28 +268,50 @@ void PrimaryVertexMonitor::analyze(const edm::Event& iEvent, const edm::EventSet
return;
}

// check upfront that refs to track are (likely) to be valid
{
bool ok = true;
for(const auto& v: *recVtxs) {
if(v.tracksSize() > 0) {
const auto& ref = v.trackRefAt(0);
if(ref.isNull() || !ref.isAvailable()) {
if (!errorPrinted_)
edm::LogWarning("PrimaryVertexMonitor")
<< "Skipping vertex collection: " << vertexInputTag_ << " since likely the track collection the vertex has refs pointing to is missing (at least the first TrackBaseRef is null or not available)";
else
errorPrinted_ = true;
ok = false;
}
}
}
if(!ok)
return;
}

BeamSpot beamSpot = *beamSpotHandle;

nbvtx->Fill(recVtxs->size()*1.);
int ng=0;
for (auto const & vx : (*recVtxs) )
if (vx.isValid() && !vx.isFake() && vx.ndof()>=4.) ++ng;
if (vx.isValid() && !vx.isFake() && vx.ndof()>=ndof_) ++ng;
nbgvtx->Fill(ng*1.);

vertexPlots(recVtxs->front(), beamSpot, 1);

if (scores.isValid() && (*scores).size()>0) {
auto pvScore = (*scores).get(0);
score[1]->Fill(std::sqrt(pvScore));
for (unsigned int i=1; i<(*scores).size(); ++i) score[0]->Fill(std::sqrt((*scores).get(i)));
for (unsigned int i=1; i<(*scores).size(); ++i)
score[0]->Fill(std::sqrt((*scores).get(i)));
}

// fill PV tracks MEs (as now, for alignment)
pvTracksPlots(recVtxs->front());
if (recVtxs->size() > 0) {

for(reco::VertexCollection::const_iterator v=recVtxs->begin()+1;
v!=recVtxs->end(); ++v){
vertexPlots(*v, beamSpot, 0);
vertexPlots (recVtxs->front(), beamSpot, 1);
pvTracksPlots(recVtxs->front());

for(reco::VertexCollection::const_iterator v=recVtxs->begin()+1;
v!=recVtxs->end(); ++v)
vertexPlots(*v, beamSpot, 0);
}

// Beamline plots:
Expand All @@ -306,8 +331,6 @@ void
PrimaryVertexMonitor::pvTracksPlots(const Vertex & v)
{

const math::XYZPoint myVertex(v.position().x(),v.position().y(),v.position().z());

if ( !v.isValid() ) return;
if ( v.isFake() ) return;

Expand All @@ -316,6 +339,8 @@ PrimaryVertexMonitor::pvTracksPlots(const Vertex & v)
return;
}

const math::XYZPoint myVertex(v.position().x(),v.position().y(),v.position().z());

size_t nTracks = 0;
float sumPT = 0.;
const int cmToUm = 10000;
Expand All @@ -336,8 +361,8 @@ PrimaryVertexMonitor::pvTracksPlots(const Vertex & v)
float w = v.trackWeight(*t);
float chi2NDF = (**t).normalizedChi2();
float chi2Prob = TMath::Prob((**t).chi2(),(int)(**t).ndof());
float Dxy = (**t).dxy(myVertex)*cmToUm;
float Dz = (**t).dz(myVertex)*cmToUm;
float Dxy = (**t).dxy(myVertex)*cmToUm; // is it needed ?
float Dz = (**t).dz(myVertex)*cmToUm; // is it needed ?
float DxyErr = (**t).dxyError()*cmToUm;
float DzErr = (**t).dzError()*cmToUm;

Expand Down
2 changes: 2 additions & 0 deletions DQMOffline/RecoB/plugins/PrimaryVertexMonitor.h
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,8 @@ class PrimaryVertexMonitor : public DQMEDAnalyzer {

std::string TopFolderName_;
std::string AlignmentLabel_;
int ndof_;
bool errorPrinted_;

// the histos
MonitorElement *nbvtx, *nbgvtx, *nbtksinvtx[2], *trksWeight[2], *score[2];
Expand Down
1 change: 1 addition & 0 deletions DQMOffline/RecoB/python/PrimaryVertexMonitor_cff.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
AlignmentLabel = cms.string("Alignment"),
vertexLabel = cms.InputTag("offlinePrimaryVertices"),
beamSpotLabel = cms.InputTag("offlineBeamSpot"),
ndof = cms.int32( 4 ),
TkSizeBin = cms.int32( 100 ),
TkSizeMax = cms.double(499.5),
TkSizeMin = cms.double( -0.5),
Expand Down
4 changes: 4 additions & 0 deletions DQMOffline/Trigger/python/B2GMonitoring_Client_cff.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
import FWCore.ParameterSet.Config as cms

b2gClient = cms.Sequence(
)
4 changes: 4 additions & 0 deletions DQMOffline/Trigger/python/B2GMonitoring_cff.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
import FWCore.ParameterSet.Config as cms

b2gMonitorHLT = cms.Sequence(
)
4 changes: 4 additions & 0 deletions DQMOffline/Trigger/python/BPhysicsMonitoring_Client_cff.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
import FWCore.ParameterSet.Config as cms

bphysicsClient = cms.Sequence(
)
4 changes: 4 additions & 0 deletions DQMOffline/Trigger/python/BPhysicsMonitoring_cff.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
import FWCore.ParameterSet.Config as cms

bphysicsMonitorHLT = cms.Sequence(
)
4 changes: 4 additions & 0 deletions DQMOffline/Trigger/python/BTaggingMonitoring_Client_cff.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
import FWCore.ParameterSet.Config as cms

btaggingClient = cms.Sequence(
)
4 changes: 4 additions & 0 deletions DQMOffline/Trigger/python/BTaggingMonitoring_cff.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
import FWCore.ParameterSet.Config as cms

btagMonitorHLT = cms.Sequence(
)
16 changes: 15 additions & 1 deletion DQMOffline/Trigger/python/DQMOffline_HLT_Client_cff.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,14 @@
from DQMOffline.Trigger.TrackingMonitoringPA_Client_cff import *

from DQMOffline.Trigger.ExoticaMonitoring_Client_cff import *
from DQMOffline.Trigger.SusyMonitoring_Client_cff import *
from DQMOffline.Trigger.B2GMonitoring_Client_cff import *
from DQMOffline.Trigger.BPhysicsMonitoring_Client_cff import *
from DQMOffline.Trigger.HiggsMonitoring_Client_cff import *
from DQMOffline.Trigger.StandardModelMonitoring_Client_cff import *
from DQMOffline.Trigger.TopMonitoring_Client_cff import *

from DQMOffline.Trigger.BTaggingMonitoring_Client_cff import *

hltOfflineDQMClient = cms.Sequence(
# hltGeneralSeqClient *
Expand All @@ -30,6 +38,12 @@
HLTTauPostSeq *
dqmOfflineHLTCert *
hltInclusiveVBFClient *
exoticaClient
exoticaClient *
susyClient *
b2gClient *
higgsClient *
smpClient *
topClient *
btaggingClient
)

30 changes: 28 additions & 2 deletions DQMOffline/Trigger/python/DQMOffline_Trigger_cff.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,9 @@
# Inclusive VBF
from DQMOffline.Trigger.HLTInclusiveVBFSource_cfi import *

# vertexing
from DQMOffline.Trigger.PrimaryVertexMonitoring_cff import *

# tracking
from DQMOffline.Trigger.TrackingMonitoring_cff import *
from DQMOffline.Trigger.TrackingMonitoringPA_cff import*
Expand All @@ -49,6 +52,21 @@

# EXO
from DQMOffline.Trigger.ExoticaMonitoring_cff import *
# SUS
from DQMOffline.Trigger.SusyMonitoring_cff import *
# B2G
from DQMOffline.Trigger.B2GMonitoring_cff import *
# BPH
from DQMOffline.Trigger.BPhysicsMonitoring_cff import *
# HIG
from DQMOffline.Trigger.HiggsMonitoring_cff import *
# SMP
from DQMOffline.Trigger.StandardModelMonitoring_cff import *
# TOP
from DQMOffline.Trigger.TopMonitoring_cff import *

# BTV
from DQMOffline.Trigger.BTaggingMonitoring_cff import *

# remove quadJetAna
from DQMOffline.Trigger.topHLTOfflineDQM_cff import *
Expand All @@ -67,7 +85,14 @@
eventshapeDQMSequence *
HeavyIonUCCDQMSequence *
hotlineDQMSequence *
exoticaMonitorHLT
exoticaMonitorHLT *
susyMonitorHLT *
b2gMonitorHLT *
bphysicsMonitorHLT *
higgsMonitorHLT *
smpMonitorHLT *
topMonitorHLT *
btagMonitorHLT
)

# offline DQM for the HLTMonitoring stream
Expand All @@ -80,7 +105,8 @@
sistripMonitorHLTsequence * # strip
BTVHLTOfflineSource *
trackingMonitorHLT * # tracking
egmTrackingMonitorHLT # egm tracking
egmTrackingMonitorHLT * # egm tracking
vertexingMonitorHLT # vertexing
)
OfflineHLTMonitoringPA = cms.Sequence(
dqmInfoHLTMon *
Expand Down
4 changes: 4 additions & 0 deletions DQMOffline/Trigger/python/HiggsMonitoring_Client_cff.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
import FWCore.ParameterSet.Config as cms

higgsClient = cms.Sequence(
)
4 changes: 4 additions & 0 deletions DQMOffline/Trigger/python/HiggsMonitoring_cff.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
import FWCore.ParameterSet.Config as cms

higgsMonitorHLT = cms.Sequence(
)
4 changes: 2 additions & 2 deletions DQMOffline/Trigger/python/METMonitor_cfi.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,11 +15,11 @@
hltMETmonitoring.muons = cms.InputTag("muons") # while pfIsolatedMuonsEI are reco::PFCandidate !

hltMETmonitoring.numGenericTriggerEventPSet.andOr = cms.bool( False )
hltMETmonitoring.numGenericTriggerEventPSet.dbLabel = cms.string("ExoDQMTrigger") # it does not exist yet, we should consider the possibility of using the DB, but as it is now it will need a label per path !
#hltMETmonitoring.numGenericTriggerEventPSet.dbLabel = cms.string("ExoDQMTrigger") # it does not exist yet, we should consider the possibility of using the DB, but as it is now it will need a label per path !
hltMETmonitoring.numGenericTriggerEventPSet.andOrHlt = cms.bool(True)# True:=OR; False:=AND
hltMETmonitoring.numGenericTriggerEventPSet.hltInputTag = cms.InputTag( "TriggerResults::HLT" )
hltMETmonitoring.numGenericTriggerEventPSet.hltPaths = cms.vstring("HLT_PFMETNoMu120_PFMHTNoMu120_IDTight_v*") # HLT_ZeroBias_v*
hltMETmonitoring.numGenericTriggerEventPSet.hltDBKey = cms.string("EXO_HLT_MET")
#hltMETmonitoring.numGenericTriggerEventPSet.hltDBKey = cms.string("EXO_HLT_MET")
hltMETmonitoring.numGenericTriggerEventPSet.errorReplyHlt = cms.bool( False )
hltMETmonitoring.numGenericTriggerEventPSet.verbosityLevel = cms.uint32(1)

Expand Down