Skip to content

Commit

Permalink
Merge pull request #7 from anigamova/new_branch
Browse files Browse the repository at this point in the history
New branch
  • Loading branch information
anigamova authored Jun 7, 2017
2 parents 19f5f95 + 53ecc3c commit 0feedf0
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 5 deletions.
12 changes: 8 additions & 4 deletions DQMOffline/Trigger/plugins/BPHMonitor.cc
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ BPHMonitor::BPHMonitor( const edm::ParameterSet& iConfig ) :
, muoSelection_probe ( iConfig.getParameter<std::string>("muoSelection_probe") )
, nmuons_ ( iConfig.getParameter<int>("nmuons" ) )
, tnp_ ( iConfig.getParameter<int>("tnp" ) )
, L3_ ( iConfig.getParameter<int>("L3" ) )
, trOrMu_ ( iConfig.getParameter<int>("trOrMu" ) )
, Jpsi_ ( iConfig.getParameter<int>("Jpsi" ) )
, Upsilon_ ( iConfig.getParameter<int>("Upsilon" ) )//if ==1 path with Upsilon constraint
Expand Down Expand Up @@ -354,19 +355,21 @@ void BPHMonitor::analyze(edm::Event const& iEvent, edm::EventSetup const& iSetup
// edm::Handle<reco::BeamSpot> const& beamSpot;
// Filter out events if Trigger Filtering is requested
if (tnp_>0) {//TnP method
if (num_genTriggerEventFlag_->on() && ! num_genTriggerEventFlag_->accept( iEvent, iSetup) ) return;
if (den_genTriggerEventFlag_->on() && ! den_genTriggerEventFlag_->accept( iEvent, iSetup) ) return;
iEvent.getByLabel( hltInputTag_, handleTriggerEvent);
if (handleTriggerEvent->sizeFilters()== 0)return;
std::string hltpath = hltpaths_num[0];
std::vector<reco::Muon> tagMuons;
std::vector<reco::Muon> probeMuons;
for ( auto const & m : *muoHandle ) {//applying tag selection
if(!matchToTrigger(hltpath,m, handleTriggerEvent)) continue;
if(!L3_){//matching does not work for L3 tnp monitoring yet
if(!matchToTrigger(hltpath,m, handleTriggerEvent)) continue;}
if ( muoSelection_ref( m ) ) tagMuons.push_back(m);
}
for (int i = 0; i<int(tagMuons.size());i++){
for ( auto const & m : *muoHandle ) {
if(!matchToTrigger(hltpath,m, handleTriggerEvent)) continue;
if(!L3_){
if(!matchToTrigger(hltpath,m, handleTriggerEvent)) continue;}
if ((tagMuons[i].pt() == m.pt()))continue;//not the same
if ((tagMuons[i].p4()+m.p4()).M() >minmass_&& (tagMuons[i].p4()+m.p4()).M() <maxmass_){//near to J/psi mass
muPhi_.denominator->Fill(m.phi());
Expand Down Expand Up @@ -1027,6 +1030,7 @@ void BPHMonitor::fillDescriptions(edm::ConfigurationDescriptions & descriptions)

desc.add<int>("nmuons", 1);
desc.add<int>( "tnp", 0 );
desc.add<int>( "L3", 0 );
desc.add<int>( "trOrMu", 0 );//if =0, track param monitoring
desc.add<int>( "Jpsi", 0 );
desc.add<int>( "Upsilon", 0 );
Expand Down Expand Up @@ -1107,8 +1111,8 @@ void BPHMonitor::fillDescriptions(edm::ConfigurationDescriptions & descriptions)
bool BPHMonitor::matchToTrigger(std::string theTriggerName,T t, edm::Handle<trigger::TriggerEvent> handleTriggerEvent){

bool matchedToTrigger = false;
const trigger::TriggerObjectCollection & toc(handleTriggerEvent->getObjects());//Handle< trigger::TriggerEvent > handleTriggerEvent;
if (handleTriggerEvent->sizeFilters() >0){
const trigger::TriggerObjectCollection & toc(handleTriggerEvent->getObjects());//Handle< trigger::TriggerEvent > handleTriggerEvent;
for ( size_t ia = 0; ia < handleTriggerEvent->sizeFilters(); ++ ia) {
std::string fullname = handleTriggerEvent->filterTag(ia).encode();
std::string name;
Expand Down
1 change: 1 addition & 0 deletions DQMOffline/Trigger/plugins/BPHMonitor.h
Original file line number Diff line number Diff line change
Expand Up @@ -158,6 +158,7 @@ METME DiMudR_ ;
StringCutObjectSelector<reco::Muon,true> muoSelection_probe;
int nmuons_;
int tnp_;
int L3_;
int trOrMu_;
int Jpsi_;
int Upsilon_;
Expand Down
5 changes: 4 additions & 1 deletion DQMOffline/Trigger/python/BPHMonitor_cff.py
Original file line number Diff line number Diff line change
Expand Up @@ -470,7 +470,9 @@
Dimuon0_L3TnP_Jpsi = hltBPHmonitoring.clone()
Dimuon0_L3TnP_Jpsi.FolderName = cms.string('HLT/BPH/DiMu0_L1_L3TnP_Jpsi/')
Dimuon0_L3TnP_Jpsi.tnp = cms.int32(1)
Dimuon0_L3TnP_Jpsi.L3 = cms.int32(1)
Dimuon0_L3TnP_Jpsi.nofset = cms.int32(1)
##Dimuon0_L3TnP_Jpsi.Jpsi = cms.int32(1)
Dimuon0_L3TnP_Jpsi.numGenericTriggerEventPSet.hltPaths = cms.vstring("HLT_Mu7p5_L2Mu2_Jpsi_v*")
Dimuon0_L3TnP_Jpsi.numGenericTriggerEventPSet.l1Algorithms = cms.vstring("L1_DoubleMu0_SQ")
Dimuon0_L3TnP_Jpsi.denGenericTriggerEventPSet.hltPaths = cms.vstring("HLT_Mu7p5_L2Mu2_Jpsi_v*")
Expand All @@ -481,7 +483,8 @@
Dimuon0_L3TnP_Upsilon = hltBPHmonitoring.clone()
Dimuon0_L3TnP_Upsilon.FolderName = cms.string('HLT/BPH/DiMu0_L1_L3TnP_Upsilon/')
Dimuon0_L3TnP_Upsilon.tnp = cms.int32(1)
Dimuon0_L3TnP_Upsilon.Upsilon = cms.int32(1)
Dimuon0_L3TnP_Upsilon.L3 = cms.int32(1)
##Dimuon0_L3TnP_Upsilon.Upsilon = cms.int32(1)
Dimuon0_L3TnP_Upsilon.nofset = cms.int32(1)
Dimuon0_L3TnP_Upsilon.numGenericTriggerEventPSet.hltPaths = cms.vstring("HLT_Mu7p5_L2Mu2_Upsilon_v*")
Dimuon0_L3TnP_Upsilon.numGenericTriggerEventPSet.l1Algorithms = cms.vstring("L1_DoubleMu0_SQ")
Expand Down
5 changes: 5 additions & 0 deletions DQMOffline/Trigger/python/BPHMonitor_cfi.py
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,11 @@
hltBPHmonitoring.muons = cms.InputTag("muons") #
hltBPHmonitoring.photons = cms.InputTag("photons") #

#hltBPHmonitoring.DMSelection_ref = cms.string("")
#hltBPHmonitoring.muoSelection_ref = cms.string("")
#hltBPHmonitoring.muoSelection_ = cms.string("")


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.andOrHlt = cms.bool(True)# True:=OR; False:=AND
Expand Down

0 comments on commit 0feedf0

Please sign in to comment.