File indexing completed on 2023-03-17 10:49:06
0001
0002
0003
0004
0005
0006
0007
0008
0009
0010
0011
0012
0013
0014
0015
0016 #include <memory>
0017 #include <fstream>
0018
0019
0020 #include "DataFormats/Common/interface/Handle.h"
0021 #include "FWCore/Framework/interface/Event.h"
0022 #include "FWCore/Framework/interface/Frameworkfwd.h"
0023 #include "FWCore/Framework/interface/MakerMacros.h"
0024 #include "FWCore/Framework/interface/one/EDFilter.h"
0025 #include "FWCore/ParameterSet/interface/ParameterSet.h"
0026 #include "FWCore/Utilities/interface/EDGetToken.h"
0027
0028
0029 #include "DataFormats/EgammaCandidates/interface/GsfElectron.h"
0030 #include "DataFormats/EgammaCandidates/interface/GsfElectronFwd.h"
0031 #include "RecoEcal/EgammaCoreTools/interface/EcalClusterTools.h"
0032 #include "Geometry/CaloTopology/interface/CaloTopology.h"
0033 #include "Geometry/Records/interface/CaloTopologyRecord.h"
0034 #include "DataFormats/EcalDetId/interface/EcalSubdetector.h"
0035 #include "Geometry/CaloTopology/interface/EcalBarrelTopology.h"
0036 #include "Geometry/CaloTopology/interface/EcalEndcapTopology.h"
0037 #include "DataFormats/MuonReco/interface/Muon.h"
0038 #include "DataFormats/MuonReco/interface/MuonFwd.h"
0039 #include "DataFormats/JetReco/interface/Jet.h"
0040 #include "DataFormats/BTauReco/interface/JetTag.h"
0041 #include "DataFormats/JetReco/interface/PFJet.h"
0042 #include "DataFormats/JetReco/interface/PFJetCollection.h"
0043 #include "DataFormats/JetReco/interface/CaloJetCollection.h"
0044 #include "DataFormats/JetReco/interface/CaloJet.h"
0045 #include "DataFormats/TrackReco/interface/Track.h"
0046 #include "DataFormats/TrackReco/interface/TrackFwd.h"
0047
0048
0049 #include "DataFormats/ParticleFlowCandidate/interface/PFCandidate.h"
0050
0051
0052 #include "DataFormats/Common/interface/TriggerResults.h"
0053 #include "FWCore/Common/interface/TriggerNames.h"
0054
0055 class LeptonRecoSkim : public edm::one::EDFilter<> {
0056 public:
0057 explicit LeptonRecoSkim(const edm::ParameterSet&);
0058 ~LeptonRecoSkim() override;
0059
0060 private:
0061 void beginJob() override;
0062 bool filter(edm::Event&, const edm::EventSetup&) override;
0063 void endJob() override;
0064
0065 void handleObjects(const edm::Event&, const edm::EventSetup& iSetup);
0066
0067
0068 const edm::ESGetToken<CaloGeometry, CaloGeometryRecord> m_CaloGeoToken;
0069 const edm::ESGetToken<CaloTopology, CaloTopologyRecord> m_CaloTopoToken;
0070
0071 edm::InputTag hltLabel;
0072 std::string filterName;
0073
0074 edm::EDGetTokenT<reco::GsfElectronCollection> gsfElectronCollectionToken_;
0075 edm::EDGetTokenT<reco::PFCandidateCollection> pfCandidateCollectionToken_;
0076 edm::EDGetTokenT<reco::MuonCollection> muonCollectionToken_;
0077 edm::EDGetTokenT<reco::CaloJetCollection> caloJetCollectionToken_;
0078 edm::EDGetTokenT<reco::PFJetCollection> pfJetCollectionToken_;
0079 edm::EDGetTokenT<EcalRecHitCollection> ebRecHitCollectionToken_;
0080 edm::EDGetTokenT<EcalRecHitCollection> eeRecHitCollectionToken_;
0081
0082 const reco::GsfElectronCollection* theElectronCollection;
0083 const reco::PFCandidateCollection* thePfCandidateCollection;
0084 const reco::MuonCollection* theMuonCollection;
0085 const reco::CaloJetCollection* theCaloJetCollection;
0086 const reco::PFJetCollection* thePFJetCollection;
0087 const EcalRecHitCollection* theEcalBarrelCollection;
0088 const EcalRecHitCollection* theEcalEndcapCollection;
0089 const CaloTopology* theCaloTopology;
0090 const CaloGeometry* theCaloGeometry;
0091
0092 bool firstEvent;
0093
0094 bool useElectronSelection;
0095 bool usePfElectronSelection;
0096 bool useMuonSelection;
0097 bool useHtSelection;
0098 bool usePFHtSelection;
0099
0100 bool ElectronCutPassed;
0101 bool PfElectronCutPassed;
0102 bool MuonCutPassed;
0103 bool HtCutPassed;
0104 bool PFHtCutPassed;
0105
0106 double ptElecMin;
0107 double ptPfElecMin;
0108 int nSelectedElectrons;
0109 int nSelectedPfElectrons;
0110 double ptGlobalMuonMin;
0111 double ptTrackerMuonMin;
0112 int nSelectedMuons;
0113 double htMin;
0114 double pfHtMin;
0115 double htJetThreshold;
0116 double pfHtJetThreshold;
0117
0118 int NeventsTotal;
0119 int NeventsFiltered;
0120 int NHltMu9;
0121 int NHltDiMu3;
0122
0123 int NtotalElectrons;
0124 int NmvaElectrons;
0125 };