Skip to content

Commit

Permalink
Merge pull request #40937 from revering/disapperingMuonsSkim_13_0_0
Browse files Browse the repository at this point in the history
Added skimming filter for disappearing muons [13_0_X Backport]
  • Loading branch information
cmsbuild authored Mar 20, 2023
2 parents 3045400 + 8ee8512 commit cb88613
Show file tree
Hide file tree
Showing 4 changed files with 581 additions and 0 deletions.
102 changes: 102 additions & 0 deletions Configuration/Skimming/interface/DisappearingMuonsSkimming.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,102 @@
// -*- C++ -*-
//
// Package: Skimming/DisappearingMuonsSkimming
// Class: DisappearingMuonsSkimming
//
/**\class DisappearingMuonsSkimming DisappearingMuonsSkimming.cc Skimming/DisappearingMuonsSkimming/plugins/DisappearingMuonsSkimming.cc
Description: [one line class summary]
Implementation:
[Notes on implementation]
*/
//
// Original Author: Michael Revering
// Created: Tie, 31 Jan 2023 21:22:23 GMT
//
//
#ifndef Configuration_Skimming_DisappearingMuonsSkimming_h
#define Configuration_Skimming_DisappearingMuonsSkimming_h

// system include files
#include <memory>

// user include filter
#include "FWCore/Utilities/interface/EDGetToken.h"
#include "FWCore/Framework/interface/one/EDFilter.h"
#include "FWCore/ParameterSet/interface/ParameterSet.h"
#include "FWCore/ParameterSet/interface/ConfigurationDescriptions.h"
#include "DataFormats/TrackReco/interface/Track.h"
#include "TrackingTools/TransientTrack/interface/TransientTrack.h"
#include "DataFormats/VertexReco/interface/Vertex.h"
#include "DataFormats/Common/interface/TriggerResults.h"
#include "DataFormats/EcalRecHit/interface/EcalRecHitCollections.h"
#include "TrackingTools/Records/interface/TransientTrackRecord.h"
#include "TrackingTools/TransientTrack/interface/TransientTrackBuilder.h"
#include "Geometry/CaloGeometry/interface/CaloGeometry.h"
#include "Geometry/Records/interface/CaloGeometryRecord.h"

//
// class declaration
//

class DisappearingMuonsSkimming : public edm::one::EDFilter<> {
public:
explicit DisappearingMuonsSkimming(const edm::ParameterSet&);
~DisappearingMuonsSkimming() override = default;
static void fillDescriptions(edm::ConfigurationDescriptions& descriptions);

private:
void beginJob() override;
bool filter(edm::Event&, const edm::EventSetup&) override;
void endJob() override;
bool passTriggers(const edm::Event& iEvent,
edm::EDGetToken m_trigResultsToken,
std::vector<std::string> m_muonPathsToPass);
double getTrackIsolation(const edm::Event&,
edm::Handle<reco::VertexCollection> vtxHandle,
std::vector<reco::Track>::const_iterator& iTrack);
double getECALIsolation(const edm::Event&, const edm::EventSetup&, const reco::TransientTrack track);

// ----------member data ---------------------------

const edm::EDGetToken recoMuonToken_;
const edm::EDGetToken standaloneMuonToken_;
const edm::EDGetTokenT<std::vector<reco::Track>> trackCollectionToken_;
const edm::EDGetTokenT<std::vector<reco::Vertex>> primaryVerticesToken_;
const edm::EDGetTokenT<EcalRecHitCollection> reducedEndcapRecHitCollectionToken_;
const edm::EDGetTokenT<EcalRecHitCollection> reducedBarrelRecHitCollectionToken_;
const edm::EDGetTokenT<edm::TriggerResults> trigResultsToken_;
const edm::EDGetToken genParticleToken_;
const edm::EDGetToken genInfoToken_;
const edm::ESGetToken<TransientTrackBuilder, TransientTrackRecord> transientTrackToken_;
const edm::ESGetToken<CaloGeometry, CaloGeometryRecord> geometryToken_;
const std::vector<std::string> muonPathsToPass_;

//options
const double minMuPt_;
const double maxMuEta_;
const double minTrackEta_;
const double maxTrackEta_;
const double minTrackPt_;
const double maxTransDCA_;
const double maxLongDCA_;
const double maxVtxChi_;
const double minInvMass_;
const double maxInvMass_;
const double trackIsoConesize_;
const double trackIsoInnerCone_;
const double ecalIsoConesize_;
const double minEcalHitE_;
const double maxTrackIso_;
const double maxEcalIso_;
const double minSigInvMass_;
const double maxSigInvMass_;
const double minStandaloneDr_;
const double maxStandaloneDE_;
const bool keepOffPeak_;
const bool keepSameSign_;
const bool keepTotalRegion_;
const bool keepPartialRegion_;
};
#endif
24 changes: 24 additions & 0 deletions Configuration/Skimming/python/PDWG_EXODisappMuon_cff.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
import FWCore.ParameterSet.Config as cms

import HLTrigger.HLTfilters.hltHighLevel_cfi as hlt

from Configuration.EventContent.EventContent_cff import AODSIMEventContent
EXODisappMuonSkimContent = AODSIMEventContent.clone()
EXODisappMuonSkimContent.outputCommands.append('keep *_hbhereco_*_*')
EXODisappMuonSkimContent.outputCommands.append('keep *_horeco_*_*')
EXODisappMuonSkimContent.outputCommands.append('keep *_csc2DRecHits_*_*')

exoDisappMuonsHLT = hlt.hltHighLevel.clone(
throw = False,
andOr = True,
HLTPaths = [
"HLT_IsoMu*_v*"
]
)

from Configuration.Skimming.disappearingMuonsSkimming_cfi import *
disappMuonsSelection = disappearingMuonsSkimming.clone()

EXODisappMuonSkimSequence = cms.Sequence(
exoDisappMuonsHLT+disappMuonsSelection
)
11 changes: 11 additions & 0 deletions Configuration/Skimming/python/Skims_PDWG_cff.py
Original file line number Diff line number Diff line change
Expand Up @@ -327,6 +327,17 @@
dataTier = cms.untracked.string('AOD')
)

from Configuration.Skimming.PDWG_EXODisappMuon_cff import *
EXODisappMuonPath = cms.Path(EXODisappMuonSkimSequence)
SKIMStreamEXODisappMuon = cms.FilteredStream(
responsible = 'PDWG',
name = 'EXODisappMuon',
paths = (EXODisappMuonPath),
content = EXODisappMuonSkimContent.outputCommands,
selectEvents = cms.untracked.PSet(),
dataTier = cms.untracked.string('USER')
)

#####################
# For the Data on Data Mixing in TSG
from HLTrigger.Configuration.HLT_Fake1_cff import fragment as _fragment
Expand Down
Loading

0 comments on commit cb88613

Please sign in to comment.