diff --git a/DQMOffline/Trigger/plugins/BPHMonitor.cc b/DQMOffline/Trigger/plugins/BPHMonitor.cc index 78e8525bb1bff..01fdf2a961a66 100644 --- a/DQMOffline/Trigger/plugins/BPHMonitor.cc +++ b/DQMOffline/Trigger/plugins/BPHMonitor.cc @@ -51,7 +51,8 @@ BPHMonitor::BPHMonitor( const edm::ParameterSet& iConfig ) : , minprob ( iConfig.getParameter("minprob" ) ) , mincos ( iConfig.getParameter("mincos" ) ) , minDS ( iConfig.getParameter("minDS" ) ) - , hltInputTag_ ( iConfig.getParameter("numGenericTriggerEventPSet").getParameter("hltInputTag")) + //, hltInputTag_ ( iConfig.getParameter("numGenericTriggerEventPSet").getParameter("hltInputTag")) + , hltInputTag_ (mayConsume( iConfig.getParameter("numGenericTriggerEventPSet").getParameter("hltInputTag"))) , hltpaths_num ( iConfig.getParameter("numGenericTriggerEventPSet").getParameter>("hltPaths")) , hltpaths_den ( iConfig.getParameter("denGenericTriggerEventPSet").getParameter>("hltPaths")) , trSelection_ ( iConfig.getParameter("muoSelection") ) @@ -214,6 +215,33 @@ void BPHMonitor::bookHistograms(DQMStore::IBooker & ibooker, histname =trMuPh+"Eta"; histtitle = trMuPh+"_Eta"; bookME(ibooker,muEta_,histname,histtitle, eta_binning_.nbins,eta_binning_.xmin, eta_binning_.xmax); setMETitle(muEta_,trMuPh+"_#eta","events/ "); + } + if (nofset_==11){ + trMuPh = "tr"; + histname = trMuPh+"1Pt"; histtitle = trMuPh+"1_P_{t}"; + bookME(ibooker,muPt_,histname,histtitle, pt_binning_.nbins, pt_binning_.xmin, pt_binning_.xmax); + setMETitle(mu1Pt_,trMuPh+"_Pt[GeV]","events/1GeV"); + + histname =trMuPh+"1Phi"; histtitle =trMuPh+"1Phi"; + bookME(ibooker,muPhi_,histname,histtitle, phi_binning_.nbins, phi_binning_.xmin, phi_binning_.xmax); + setMETitle(mu1Phi_,trMuPh+"_#phi","events / 0.1 rad"); + + histname =trMuPh+"1Eta"; histtitle = trMuPh+"1_Eta"; + bookME(ibooker,muEta_,histname,histtitle, eta_binning_.nbins,eta_binning_.xmin, eta_binning_.xmax); + setMETitle(mu1Eta_,trMuPh+"_#eta","events/ "); + + histname = trMuPh+"2Pt"; histtitle = trMuPh+"2_P_{t}"; + bookME(ibooker,muPt_,histname,histtitle, pt_binning_.nbins, pt_binning_.xmin, pt_binning_.xmax); + setMETitle(mu2Pt_,trMuPh+"_Pt[GeV]","events/1GeV"); + + histname =trMuPh+"2Phi"; histtitle =trMuPh+"2Phi"; + bookME(ibooker,muPhi_,histname,histtitle, phi_binning_.nbins, phi_binning_.xmin, phi_binning_.xmax); + setMETitle(mu2Phi_,trMuPh+"_#phi","events / 0.1 rad"); + + histname =trMuPh+"2Eta"; histtitle = trMuPh+"2_Eta"; + bookME(ibooker,muEta_,histname,histtitle, eta_binning_.nbins,eta_binning_.xmin, eta_binning_.xmax); + setMETitle(mu2Eta_,trMuPh+"_#eta","events/ "); + } ///// @@ -349,14 +377,15 @@ void BPHMonitor::analyze(edm::Event const& iEvent, edm::EventSetup const& iSetup iEvent.getByToken( phToken_, phHandle ); edm::Handle handleTriggerEvent; -// iEvent.getByLabel( hltInputTag_, handleTriggerEvent); +// edm::Handle handleTriggerEvent; +// iEvent.getByToken( hltInputTag_, handleTriggerEvent); // if (handleTriggerEvent->sizeFilters()== 0)return; // if(! handleTriggerEvent->isValid() ) return; // edm::Handle const& beamSpot; // Filter out events if Trigger Filtering is requested if (tnp_>0) {//TnP method if (den_genTriggerEventFlag_->on() && ! den_genTriggerEventFlag_->accept( iEvent, iSetup) ) return; - iEvent.getByLabel( hltInputTag_, handleTriggerEvent); + iEvent.getByToken( hltInputTag_, handleTriggerEvent); if (handleTriggerEvent->sizeFilters()== 0)return; std::string hltpath = hltpaths_num[0]; std::vector tagMuons; @@ -422,7 +451,7 @@ void BPHMonitor::analyze(edm::Event const& iEvent, edm::EventSetup const& iSetup // else{ if (den_genTriggerEventFlag_->on() && ! den_genTriggerEventFlag_->accept( iEvent, iSetup) ) return; - iEvent.getByLabel( hltInputTag_, handleTriggerEvent); + iEvent.getByToken( hltInputTag_, handleTriggerEvent); if (handleTriggerEvent->sizeFilters()== 0)return; std::string hltpath = hltpaths_den[0]; for (auto const & m : *muoHandle ) { @@ -752,6 +781,89 @@ void BPHMonitor::analyze(edm::Event const& iEvent, edm::EventSetup const& iSetup } } break; + case 11: + + if (dimuonCL t_tks; + t_tks.push_back(mu1TT); + t_tks.push_back(mu2TT); + t_tks.push_back(trTT); + t_tks.push_back(tr1TT); + if (t_tks.size()!=4) continue; + + KalmanVertexFitter kvf; + TransientVertex tv = kvf.vertex(t_tks); + reco::Vertex vertex = tv; + if (!tv.isValid()) continue; + if( pB.mass()> maxmassJpsiTk || pB.mass()< minmassJpsiTk)continue; + float JpsiTkCL = 0; + if ((vertex.chi2()>=0.0) && (vertex.ndof()>0) ) + JpsiTkCL = TMath::Prob(vertex.chi2(), vertex.ndof() ); + math::XYZVector pperp(m.px() + m1.px() + itrk1.px() + itrk2.px(), + m.py() + m1.py() + itrk1.py() + itrk2.py(), + 0.); + GlobalPoint secondaryVertex = tv.position(); + GlobalError err = tv.positionError(); + GlobalPoint displacementFromBeamspot( -1*((vertexBeamSpot.x0() - secondaryVertex.x()) + + (secondaryVertex.z() - vertexBeamSpot.z0()) * vertexBeamSpot.dxdz()), + -1*((vertexBeamSpot.y0() - secondaryVertex.y()) + + (secondaryVertex.z() - vertexBeamSpot.z0()) * vertexBeamSpot.dydz()), + 0); + reco::Vertex::Point vperp(displacementFromBeamspot.x(),displacementFromBeamspot.y(),0.); + float jpsiKcos = vperp.Dot(pperp)/(vperp.R()*pperp.R()); + if (JpsiTkCLFill(t.phi()); + mu1Eta_.denominator->Fill(t.eta()); + mu1Pt_.denominator ->Fill(t.pt()); + mu2Phi_.denominator->Fill(t1.phi()); + mu2Eta_.denominator->Fill(t1.eta()); + mu2Pt_.denominator ->Fill(t1.pt()); + } + ///////////////////////// + } + } + break; // // } @@ -772,7 +884,7 @@ void BPHMonitor::analyze(edm::Event const& iEvent, edm::EventSetup const& iSetup ///////// //filling numerator hists if (num_genTriggerEventFlag_->on() && ! num_genTriggerEventFlag_->accept( iEvent, iSetup) ) return; - iEvent.getByLabel( hltInputTag_, handleTriggerEvent); + iEvent.getByToken( hltInputTag_, handleTriggerEvent); if (handleTriggerEvent->sizeFilters()== 0)return; hltpath = hltpaths_num[0]; for (auto const & m : *muoHandle ) { @@ -1092,7 +1204,88 @@ void BPHMonitor::analyze(edm::Event const& iEvent, edm::EventSetup const& iSetup } } break; + case 11: + if (dimuonCL t_tks; + t_tks.push_back(mu1TT); + t_tks.push_back(mu2TT); + t_tks.push_back(trTT); + t_tks.push_back(tr1TT); + if (t_tks.size()!=4) continue; + + KalmanVertexFitter kvf; + TransientVertex tv = kvf.vertex(t_tks); + reco::Vertex vertex = tv; + if (!tv.isValid()) continue; + if( pB.mass()> maxmassJpsiTk || pB.mass()< minmassJpsiTk)continue; + float JpsiTkCL = 0; + if ((vertex.chi2()>=0.0) && (vertex.ndof()>0) ) + JpsiTkCL = TMath::Prob(vertex.chi2(), vertex.ndof() ); + math::XYZVector pperp(m.px() + m1.px() + itrk1.px() + itrk2.px(), + m.py() + m1.py() + itrk1.py() + itrk2.py(), + 0.); + GlobalPoint secondaryVertex = tv.position(); + GlobalError err = tv.positionError(); + GlobalPoint displacementFromBeamspot( -1*((vertexBeamSpot.x0() - secondaryVertex.x()) + + (secondaryVertex.z() - vertexBeamSpot.z0()) * vertexBeamSpot.dxdz()), + -1*((vertexBeamSpot.y0() - secondaryVertex.y()) + + (secondaryVertex.z() - vertexBeamSpot.z0()) * vertexBeamSpot.dydz()), + 0); + reco::Vertex::Point vperp(displacementFromBeamspot.x(),displacementFromBeamspot.y(),0.); + float jpsiKcos = vperp.Dot(pperp)/(vperp.R()*pperp.R()); + if (JpsiTkCLFill(t.phi()); + mu1Eta_.numerator->Fill(t.eta()); + mu1Pt_.numerator ->Fill(t.pt()); + mu2Phi_.numerator->Fill(t1.phi()); + mu2Eta_.numerator->Fill(t1.eta()); + mu2Pt_.numerator ->Fill(t1.pt()); + } + ///////////////////////// + } + } + break; } } } @@ -1163,7 +1356,7 @@ void BPHMonitor::fillDescriptions(edm::ConfigurationDescriptions & descriptions) edm::ParameterSetDescription genericTriggerEventPSet; genericTriggerEventPSet.add("andOr"); genericTriggerEventPSet.add("dcsInputTag", edm::InputTag("scalersRawToDigi") ); - genericTriggerEventPSet.add("hltInputTag", edm::InputTag("TriggerResults::HLT") ); + genericTriggerEventPSet.add("hltInputTag", edm::InputTag("hltTriggerSummaryAOD","","HLT") ); genericTriggerEventPSet.add >("dcsPartitions",{}); genericTriggerEventPSet.add("andOrDcs", false); genericTriggerEventPSet.add("errorReplyDcs", true); @@ -1221,6 +1414,7 @@ void BPHMonitor::fillDescriptions(edm::ConfigurationDescriptions & descriptions) } template bool BPHMonitor::matchToTrigger(std::string theTriggerName,T t, edm::Handle handleTriggerEvent){ + //bool BPHMonitor::matchToTrigger(std::string theTriggerName,T t, edm::Handle handleTriggerEvent){ bool matchedToTrigger = false; if (handleTriggerEvent->sizeFilters() >0){ diff --git a/DQMOffline/Trigger/plugins/BPHMonitor.h b/DQMOffline/Trigger/plugins/BPHMonitor.h index 076a7a5d37b7b..bf5b0bebc42ce 100644 --- a/DQMOffline/Trigger/plugins/BPHMonitor.h +++ b/DQMOffline/Trigger/plugins/BPHMonitor.h @@ -84,6 +84,7 @@ class BPHMonitor : public DQMEDAnalyzer void analyze(edm::Event const& iEvent, edm::EventSetup const& iSetup) override; template bool matchToTrigger(std::string theTriggerName,T t, edm::Handle handleTriggerEvent); + //bool matchToTrigger(std::string theTriggerName,T t, edm::Handle handleTriggerEvent); private: @@ -175,9 +176,9 @@ METME DiMudR_ ; double minprob; double mincos; double minDS; - //edm::EDGetTokenT hltInputTag_; + edm::EDGetTokenT hltInputTag_; //edm::EDGetTokenT hltInputTag_; - edm::InputTag hltInputTag_; + //edm::InputTag hltInputTag_; std::vector hltpaths_num; std::vector hltpaths_den; StringCutObjectSelector trSelection_; diff --git a/DQMOffline/Trigger/python/BPHMonitor_cff.py b/DQMOffline/Trigger/python/BPHMonitor_cff.py index 094e7e8a85088..13a556c1c0870 100644 --- a/DQMOffline/Trigger/python/BPHMonitor_cff.py +++ b/DQMOffline/Trigger/python/BPHMonitor_cff.py @@ -388,6 +388,20 @@ +Trimuon2_masscut6 = hltBPHmonitoring.clone() +Trimuon2_masscut6.FolderName = cms.string('HLT/BPH/DoubleMu3_Trk_L1_masscut6') +Trimuon2_masscut6.tnp = cms.int32(0) +Trimuon2_masscut6.nofset = cms.int32(5) +Trimuon2_masscut6.numGenericTriggerEventPSet.hltPaths = cms.vstring("HLT_Dimuon0_Jpsi3p5_Muon2_v*") +Trimuon2_masscut6.numGenericTriggerEventPSet.l1Algorithms = cms.vstring("L1_TripleMu_5SQ_3SQ_0OQ_DoubleMu5_3_SQ_Mass_Max9") +Trimuon2_masscut6.denGenericTriggerEventPSet.hltPaths = cms.vstring("HLT_Dimuon0_Jpsi_v*") +Trimuon2_masscut6.denGenericTriggerEventPSet.l1Algorithms = cms.vstring("L1_DoubleMu0_SQ_OS") +Trimuon2_masscut6.muoSelection_ref = cms.string("pt>3 && abs(eta)<2.4 & isGlobalMuon & innerTrack.hitPattern.trackerLayersWithMeasurement>5 & innerTrack.hitPattern.numberOfValidPixelHits>0 ") +Trimuon2_masscut6.DMSelection_ref = cms.string("M<9 & abs(Eta)<2.4") + + + + Dimuon0_masscut3 = hltBPHmonitoring.clone() Dimuon0_masscut3.FolderName = cms.string('HLT/BPH/DiMu0_Lowmass_L1_masscut3/') Dimuon0_masscut3.tnp = cms.int32(0) @@ -501,12 +515,24 @@ Dimuon0_HLT_OS.nofset = cms.int32(2) Dimuon0_HLT_OS.Jpsi = cms.int32(1) Dimuon0_HLT_OS.numGenericTriggerEventPSet.hltPaths = cms.vstring("HLT_Dimuon0_Jpsi_NoVertexing_v*") -Dimuon0_HLT_OS.numGenericTriggerEventPSet.l1Algorithms = cms.vstring("L1_DoubleMu4_SQ_OS_dR_Max1p2 OR L1_DoubleMu0er1p5_SQ_OS_dR_Max1p4") +Dimuon0_HLT_OS.numGenericTriggerEventPSet.l1Algorithms = cms.vstring("L1_DoubleMu0_SQ_OS") Dimuon0_HLT_OS.denGenericTriggerEventPSet.hltPaths = cms.vstring("HLT_Dimuon0_Jpsi_NoVertexing_NoOS_v*") -Dimuon0_HLT_OS.denGenericTriggerEventPSet.l1Algorithms = cms.vstring("L1_DoubleMu4_SQ_OS_dR_Max1p2 OR L1_DoubleMu0er1p5_SQ_OS_dR_Max1p4") -Dimuon0_HLT_OS.muoSelection_ref = cms.string("pt>5 && abs(eta)<2.4 & isGlobalMuon & innerTrack.hitPattern.trackerLayersWithMeasurement>5 & innerTrack.hitPattern.numberOfValidPixelHits>0 ") +Dimuon0_HLT_OS.denGenericTriggerEventPSet.l1Algorithms = cms.vstring("L1_DoubleMu0_SQ") +Dimuon0_HLT_OS.muoSelection_ref = cms.string("abs(eta)<2.4 & isGlobalMuon & innerTrack.hitPattern.trackerLayersWithMeasurement>5 & innerTrack.hitPattern.numberOfValidPixelHits>0 ") Dimuon0_HLT_OS.DMSelection_ref = cms.string("abs(Eta)<2.4") +Dimuon0_HLT_OS1 = hltBPHmonitoring.clone() +Dimuon0_HLT_OS1.FolderName = cms.string('HLT/BPH/DiMu0_Jpsi_L1_HLT_OS1/') +Dimuon0_HLT_OS1.tnp = cms.int32(0) +Dimuon0_HLT_OS1.nofset = cms.int32(2) +Dimuon0_HLT_OS1.Jpsi = cms.int32(1) +Dimuon0_HLT_OS1.numGenericTriggerEventPSet.hltPaths = cms.vstring("HLT_Dimuon0_Jpsi_L1_NoOS_v*") +Dimuon0_HLT_OS1.numGenericTriggerEventPSet.l1Algorithms = cms.vstring("L1_DoubleMu0_SQ") +Dimuon0_HLT_OS1.denGenericTriggerEventPSet.hltPaths = cms.vstring("HLT_Dimuon0_Jpsi_NoVertexing_NoOS_v*") +Dimuon0_HLT_OS1.denGenericTriggerEventPSet.l1Algorithms = cms.vstring("L1_DoubleMu0_SQ") +Dimuon0_HLT_OS1.muoSelection_ref = cms.string("abs(eta)<2.4 & isGlobalMuon & innerTrack.hitPattern.trackerLayersWithMeasurement>5 & innerTrack.hitPattern.numberOfValidPixelHits>0 ") +Dimuon0_HLT_OS1.DMSelection_ref = cms.string("abs(Eta)<2.4") + ### ###Loose vertex Jpsi @@ -562,6 +588,18 @@ Dimuon0_addTrack_Jpsi.muoSelection_ref = cms.string("pt>5 && abs(eta)<2.4 & isGlobalMuon & innerTrack.hitPattern.trackerLayersWithMeasurement>5 & innerTrack.hitPattern.numberOfValidPixelHits>0 ") Dimuon0_addTrack_Jpsi.DMSelection_ref = cms.string("abs(Eta)<2.4") +Dimuon0_addTrackTrack_Jpsi = hltBPHmonitoring.clone() +Dimuon0_addTrackTrack_Jpsi.FolderName = cms.string('HLT/BPH/DiMu0_L1_addTrackTrack_Jpsi/') +Dimuon0_addTrackTrack_Jpsi.tnp = cms.int32(0) +Dimuon0_addTrackTrack_Jpsi.nofset = cms.int32(11) +Dimuon0_addTrackTrack_Jpsi.numGenericTriggerEventPSet.hltPaths = cms.vstring("HLT_DoubleMu4_JpsiTrkTrk_Displaced_Mcut_v*") +Dimuon0_addTrackTrack_Jpsi.numGenericTriggerEventPSet.l1Algorithms = cms.vstring("L1_DoubleMu4_SQ_OS_dR_Max1p2 OR L1_DoubleMu0er1p5_SQ_OS_dR_Max1p4") +Dimuon0_addTrackTrack_Jpsi.denGenericTriggerEventPSet.hltPaths = cms.vstring("HLT_DoubleMu4_Jpsi_displaced_v*") +Dimuon0_addTrackTrack_Jpsi.denGenericTriggerEventPSet.l1Algorithms = cms.vstring("L1_DoubleMu4_SQ_OS_dR_Max1p2 OR L1_DoubleMu0er1p5_SQ_OS_dR_Max1p4") +Dimuon0_addTrackTrack_Jpsi.muoSelection_ref = cms.string("pt>5 && abs(eta)<2.4 & isGlobalMuon & innerTrack.hitPattern.trackerLayersWithMeasurement>5 & innerTrack.hitPattern.numberOfValidPixelHits>0 ") +Dimuon0_addTrackTrack_Jpsi.DMSelection_ref = cms.string("abs(Eta)<2.4") + + Dimuon0_addTrackMu_Phi = hltBPHmonitoring.clone() Dimuon0_addTrackMu_Phi.FolderName = cms.string('HLT/BPH/DiMu0_L1_addTrackMu_Phi/') Dimuon0_addTrackMu_Phi.tnp = cms.int32(0) @@ -624,6 +662,7 @@ + Dimuon12_masscut2 + Trimuon2_masscut4 + Trimuon2_masscut5 + #+ Trimuon2_masscut6 + Dimuon0_masscut3 + Dimuon0_tripleMu1 + Dimuon0_tripleMu2 @@ -633,10 +672,12 @@ + Dimuon0_L3TnP_Jpsi + Dimuon0_L3TnP_Upsilon + Dimuon0_HLT_OS +# + Dimuon0_HLT_OS1 + Dimuon0_looseVtx_Jpsi + Dimuon0_looseVtx_Upsilon + Dimuon0_tightVtx_Jpsi + Dimuon0_addTrack_Jpsi + #+ Dimuon0_addTrackTrack_Jpsi + Dimuon0_addTrackMu_Onia + Dimuon0_addTrackMu_Phi ) diff --git a/DQMOffline/Trigger/python/BPHMonitor_cfi.py b/DQMOffline/Trigger/python/BPHMonitor_cfi.py index 4b26e4e3e994f..4e33d463bdba9 100644 --- a/DQMOffline/Trigger/python/BPHMonitor_cfi.py +++ b/DQMOffline/Trigger/python/BPHMonitor_cfi.py @@ -85,10 +85,11 @@ hltBPHmonitoring.numGenericTriggerEventPSet.andOr = cms.bool( False ) -hltBPHmonitoring.numGenericTriggerEventPSet.dbLabel = cms.string("BPHDQMTrigger") # 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 ! +#hltBPHmonitoring.numGenericTriggerEventPSet.dbLabel = cms.string("BPHDQMTrigger") # 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 ! hltBPHmonitoring.numGenericTriggerEventPSet.andOrHlt = cms.bool(True)# True:=OR; False:=AND hltBPHmonitoring.numGenericTriggerEventPSet.andOrL1 = cms.bool(True)# True:=OR; False:=AND -hltBPHmonitoring.numGenericTriggerEventPSet.hltInputTag = cms.InputTag( "hltTriggerSummaryAOD","","HLT" ) +hltBPHmonitoring.numGenericTriggerEventPSet.hltInputTag = cms.InputTag( "hltTriggerSummaryAOD","","HLT") +#hltBPHmonitoring.numGenericTriggerEventPSet.hltInputTag = cms.InputTag( "hltTriggerSummaryRAW") hltBPHmonitoring.numGenericTriggerEventPSet.hltPaths = cms.vstring("HLT_Dimuon0_Jpsi_L1_NoOS_v*") # HLT_ZeroBias_v* hltBPHmonitoring.numGenericTriggerEventPSet.l1Algorithms = cms.vstring("L1_DoubleMu0_SQ") # HLT_ZeroBias_v* hltBPHmonitoring.numGenericTriggerEventPSet.hltDBKey = cms.string("diMu10")