Skip to content

Commit

Permalink
Merge pull request #41311 from mmusich/modernize_DisappearingMuonsSki…
Browse files Browse the repository at this point in the history
…mming_13_0_X

[13.0.X] Modernize / optimize `DisappearingMuonsSkimming`
  • Loading branch information
cmsbuild authored Apr 13, 2023
2 parents ef63447 + 559f2c2 commit f3e32da
Show file tree
Hide file tree
Showing 3 changed files with 194 additions and 144 deletions.
50 changes: 26 additions & 24 deletions Configuration/Skimming/interface/DisappearingMuonsSkimming.h
Original file line number Diff line number Diff line change
Expand Up @@ -22,19 +22,21 @@
#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 "DataFormats/MuonReco/interface/Muon.h"
#include "DataFormats/MuonReco/interface/MuonFwd.h"
#include "DataFormats/TrackReco/interface/Track.h"
#include "DataFormats/VertexReco/interface/Vertex.h"
#include "FWCore/Framework/interface/one/EDFilter.h"
#include "FWCore/ParameterSet/interface/ConfigurationDescriptions.h"
#include "FWCore/ParameterSet/interface/ParameterSet.h"
#include "FWCore/Utilities/interface/EDGetToken.h"
#include "Geometry/CaloGeometry/interface/CaloGeometry.h"
#include "Geometry/Records/interface/CaloGeometryRecord.h"
#include "TrackingTools/Records/interface/TransientTrackRecord.h"
#include "TrackingTools/TransientTrack/interface/TransientTrack.h"
#include "TrackingTools/TransientTrack/interface/TransientTrackBuilder.h"

//
// class declaration
Expand All @@ -47,28 +49,28 @@ class DisappearingMuonsSkimming : public edm::one::EDFilter<> {
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);
const edm::TriggerResults& results,
const std::vector<std::string>& m_muonPathsToPass);

// ----------member data ---------------------------
bool findTrackInVertices(const reco::TrackRef& tkToMatch,
const reco::VertexCollection& vertices,
unsigned int& vtxIndex,
unsigned int& trackIndex);

const edm::EDGetToken recoMuonToken_;
const edm::EDGetToken standaloneMuonToken_;
const edm::EDGetTokenT<std::vector<reco::Track>> trackCollectionToken_;
const edm::EDGetTokenT<std::vector<reco::Vertex>> primaryVerticesToken_;
double getTrackIsolation(const reco::TrackRef& tkToMatch, const reco::VertexCollection& vertices);
double getECALIsolation(const edm::Event&, const edm::EventSetup&, const reco::TransientTrack& track);

// ----------member data ---------------------------
const edm::EDGetTokenT<reco::MuonCollection> recoMuonToken_;
const edm::EDGetTokenT<reco::TrackCollection> standaloneMuonToken_;
const edm::EDGetTokenT<reco::TrackCollection> trackCollectionToken_;
const edm::EDGetTokenT<reco::VertexCollection> 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_;
Expand Down
Loading

0 comments on commit f3e32da

Please sign in to comment.