CMS 3D CMS Logo

List of all members | Public Member Functions | Static Public Member Functions | Private Member Functions | Private Attributes
LeptonSkimming Class Reference

#include <Configuration/Skimming/src/LeptonSkimming.cc>

Inheritance diagram for LeptonSkimming:
edm::stream::EDFilter<> edm::stream::EDFilterBase edm::ProducerBase edm::EDConsumerBase edm::ProductRegistryHelper

Public Member Functions

 LeptonSkimming (const edm::ParameterSet &)
 
 ~LeptonSkimming () override
 
- Public Member Functions inherited from edm::stream::EDFilter<>
 EDFilter ()=default
 
 EDFilter (const EDFilter &)=delete
 
bool hasAbilityToProduceInBeginLumis () const final
 
bool hasAbilityToProduceInBeginProcessBlocks () const final
 
bool hasAbilityToProduceInBeginRuns () const final
 
bool hasAbilityToProduceInEndLumis () const final
 
bool hasAbilityToProduceInEndProcessBlocks () const final
 
bool hasAbilityToProduceInEndRuns () const final
 
const EDFilteroperator= (const EDFilter &)=delete
 
- Public Member Functions inherited from edm::stream::EDFilterBase
 EDFilterBase ()
 
 EDFilterBase (const EDFilterBase &)=delete
 
ModuleDescription const & moduleDescription () const
 
const EDFilterBaseoperator= (const EDFilterBase &)=delete
 
 ~EDFilterBase () override
 
- Public Member Functions inherited from edm::ProducerBase
void callWhenNewProductsRegistered (std::function< void(BranchDescription const &)> const &func)
 
std::vector< edm::ProductResolverIndex > const & indiciesForPutProducts (BranchType iBranchType) const
 
 ProducerBase ()
 
std::vector< edm::ProductResolverIndex > const & putTokenIndexToProductResolverIndex () const
 
std::vector< bool > const & recordProvenanceList () const
 
void registerProducts (ProducerBase *, ProductRegistry *, ModuleDescription const &)
 
std::function< void(BranchDescription const &)> registrationCallback () const
 used by the fwk to register list of products More...
 
void resolvePutIndicies (BranchType iBranchType, ModuleToResolverIndicies const &iIndicies, std::string const &moduleLabel)
 
TypeLabelList const & typeLabelList () const
 used by the fwk to register the list of products of this module More...
 
 ~ProducerBase () noexcept(false) override
 
- Public Member Functions inherited from edm::EDConsumerBase
std::vector< ConsumesInfoconsumesInfo () const
 
void convertCurrentProcessAlias (std::string const &processName)
 Convert "@currentProcess" in InputTag process names to the actual current process name. More...
 
 EDConsumerBase ()
 
 EDConsumerBase (EDConsumerBase const &)=delete
 
 EDConsumerBase (EDConsumerBase &&)=default
 
ESResolverIndex const * esGetTokenIndices (edm::Transition iTrans) const
 
std::vector< ESResolverIndex > const & esGetTokenIndicesVector (edm::Transition iTrans) const
 
std::vector< ESRecordIndex > const & esGetTokenRecordIndicesVector (edm::Transition iTrans) const
 
ProductResolverIndexAndSkipBit indexFrom (EDGetToken, BranchType, TypeID const &) const
 
void itemsMayGet (BranchType, std::vector< ProductResolverIndexAndSkipBit > &) const
 
void itemsToGet (BranchType, std::vector< ProductResolverIndexAndSkipBit > &) const
 
std::vector< ProductResolverIndexAndSkipBit > const & itemsToGetFrom (BranchType iType) const
 
void labelsForToken (EDGetToken iToken, Labels &oLabels) const
 
void modulesWhoseProductsAreConsumed (std::array< std::vector< ModuleDescription const *> *, NumBranchTypes > &modulesAll, std::vector< ModuleProcessName > &modulesInPreviousProcesses, ProductRegistry const &preg, std::map< std::string, ModuleDescription const *> const &labelsToDesc, std::string const &processName) const
 
EDConsumerBase const & operator= (EDConsumerBase const &)=delete
 
EDConsumerBaseoperator= (EDConsumerBase &&)=default
 
bool registeredToConsume (ProductResolverIndex, bool, BranchType) const
 
void selectInputProcessBlocks (ProductRegistry const &productRegistry, ProcessBlockHelperBase const &processBlockHelperBase)
 
ProductResolverIndexAndSkipBit uncheckedIndexFrom (EDGetToken) const
 
void updateLookup (BranchType iBranchType, ProductResolverIndexHelper const &, bool iPrefetchMayGet)
 
void updateLookup (eventsetup::ESRecordsToProductResolverIndices const &)
 
virtual ~EDConsumerBase () noexcept(false)
 

Static Public Member Functions

static void fillDescriptions (edm::ConfigurationDescriptions &descriptions)
 
- Static Public Member Functions inherited from edm::stream::EDFilterBase
static const std::string & baseType ()
 
static void fillDescriptions (ConfigurationDescriptions &descriptions)
 
static void prevalidate (ConfigurationDescriptions &descriptions)
 

Private Member Functions

void beginStream (edm::StreamID) override
 
void endStream () override
 
bool filter (edm::Event &, const edm::EventSetup &) override
 
bool hltFired (const edm::Event &iEvent, const edm::EventSetup &iSetup, std::vector< string > HLTPath)
 
std::array< float, 5 > hltObject (const edm::Event &iEvent, const edm::EventSetup &iSetup, std::vector< string > Seed)
 

Private Attributes

float beam_x
 
float beam_y
 
float beam_z
 
edm::EDGetTokenT< reco::BeamSpotbeamSpotToken_
 
edm::ESGetToken< MagneticField, IdealMagneticFieldRecordbFieldToken_
 
double BiasedWP = -100
 
std::vector< std::shared_ptr< reco::Track > > cleanedObjTracks
 
std::vector< std::shared_ptr< reco::Track > > cleanedPairTracks
 
std::vector< std::shared_ptr< reco::Track > > cleanedTracks
 
edm::EDGetTokenT< reco::ConversionCollectionconversionsToken_
 
double Cosee_Cut = -1
 
double CoseeK_Cut = 0
 
bool EarlyStop = false
 
std::vector< float > el_eta
 
std::vector< float > el_phi
 
std::vector< float > el_pt
 
edm::EDGetTokenT< edm::ValueMap< float > > eleBWPToken_
 
edm::EDGetToken electronsToken_
 
edm::EDGetTokenT< edm::ValueMap< float > > eleUnBWPToken_
 
std::vector< std::shared_ptr< reco::Track > > ElTracks
 
double ElTrgExclusionCone = 0
 
double ElTrgMuDz_Cut = 1000
 
std::vector< unsigned int > Epair_ObjectId
 
std::vector< unsigned int > Epair_ObjectIndex
 
std::vector< unsigned int > Epair_TrkIndex
 
double EpairZvtx_Cut = 10000000
 
double EtaTrack_Cut = 10
 
std::vector< string > HLTFilter_
 
std::vector< string > HLTPath_
 
double Ksdxy_Cut = 1000
 
double MaxChi2Track_Cut = 1000
 
double MaxMB_Cut = 1000
 
double MaxMee_Cut = 1000
 
double MinChi2Track_Cut = -1000
 
double MinMB_Cut = 0
 
double MinMee_Cut = 0
 
std::vector< float > muon_eta
 
std::vector< float > muon_medium
 
std::vector< float > muon_phi
 
std::vector< float > muon_pt
 
std::vector< float > muon_soft
 
std::vector< float > muon_tight
 
edm::EDGetToken muonsToken_
 
std::vector< std::shared_ptr< reco::Track > > MuTracks
 
double MuTrgExclusionCone = 0
 
double MuTrgMatchCone = 1000
 
double MuTrgMuDz_Cut = 1000
 
double MuTrkMinDR_Cut = 0
 
unsigned int nel = 0
 
unsigned int nmuons = 0
 
unsigned int ntracks = 0
 
std::vector< unsigned int > object_container
 
std::vector< unsigned int > object_id
 
bool ObjPtLargerThanTrack = false
 
double Probee_Cut = 0
 
double ProbeeK_Cut = 0
 
double PtB_Cut = 0
 
double PtEl_Cut = 0
 
double PtKTrack_Cut = 0
 
double PtMu_Cut = 0
 
double PtTrack_Cut = 0
 
double QualMu_Cut = 0
 
bool Result = false
 
bool SaveOnlyEPairTracks = false
 
bool SaveOnlyTracks = false
 
bool SaveOutputRoot = true
 
float SelectedMu_DR = -1
 
int SelectedMu_index
 
std::vector< float > SelectedTrgObj_PtEtaPhiCharge
 
bool SkimOnlyElectrons = false
 
bool SkimOnlyMuons = false
 
bool SkipIfNoMuMatch = false
 
double SLxy_Cut = 0
 
std::vector< float > tempPtEtaPhiM
 
std::vector< float > tempXYZ
 
int test_ev = 0
 
std::vector< float > track_vx
 
std::vector< float > track_vy
 
std::vector< float > track_vz
 
double TrackMuDz_Cut = 100000000
 
std::vector< unsigned int > trackObj_container
 
std::vector< unsigned int > trackPair_container
 
edm::EDGetToken Tracks_
 
double TrackSdxy_Cut = 0
 
double TrgExclusionCone = -1
 
edm::EDGetTokenT< edm::TriggerResultstrgresultsToken_
 
edm::EDGetTokenT< trigger::TriggerEventtrigobjectsToken_
 
std::vector< unsigned int > Trk_container
 
unsigned int trk_index = 0
 
double TrkObjExclusionCone = 0
 
double UnbiasedWP = -100
 
bool UseOnlyBKeeMCForTriplets = false
 
reco::TrackBase::Point vertex_point
 
edm::EDGetTokenT< reco::VertexCollectionvtxToken_
 
float ZvertexTrg = -1 * std::numeric_limits<float>::max()
 

Additional Inherited Members

- Public Types inherited from edm::stream::EDFilter<>
using CacheTypes = CacheContexts< T... >
 
using GlobalCache = typename CacheTypes::GlobalCache
 
using HasAbility = AbilityChecker< T... >
 
using InputProcessBlockCache = typename CacheTypes::InputProcessBlockCache
 
using LuminosityBlockCache = typename CacheTypes::LuminosityBlockCache
 
using LuminosityBlockContext = LuminosityBlockContextT< LuminosityBlockCache, RunCache, GlobalCache >
 
using LuminosityBlockSummaryCache = typename CacheTypes::LuminosityBlockSummaryCache
 
using RunCache = typename CacheTypes::RunCache
 
using RunContext = RunContextT< RunCache, GlobalCache >
 
using RunSummaryCache = typename CacheTypes::RunSummaryCache
 
- Public Types inherited from edm::stream::EDFilterBase
typedef EDFilterAdaptorBase ModuleType
 
- Public Types inherited from edm::ProducerBase
template<typename T >
using BranchAliasSetterT = ProductRegistryHelper::BranchAliasSetterT< T >
 
using ModuleToResolverIndicies = std::unordered_multimap< std::string, std::tuple< edm::TypeID const *, const char *, edm::ProductResolverIndex > >
 
typedef ProductRegistryHelper::TypeLabelList TypeLabelList
 
- Public Types inherited from edm::EDConsumerBase
typedef ProductLabels Labels
 
- Protected Member Functions inherited from edm::ProducerBase
template<Transition Tr = Transition::Event>
auto produces (std::string instanceName) noexcept
 declare what type of product will make and with which optional label More...
 
template<Transition B>
BranchAliasSetter produces (const TypeID &id, std::string instanceName=std::string(), bool recordProvenance=true)
 
template<BranchType B>
BranchAliasSetter produces (const TypeID &id, std::string instanceName=std::string(), bool recordProvenance=true)
 
BranchAliasSetter produces (const TypeID &id, std::string instanceName=std::string(), bool recordProvenance=true)
 
template<typename ProductType , Transition B>
BranchAliasSetterT< ProductType > produces (std::string instanceName)
 
template<class ProductType >
BranchAliasSetterT< ProductType > produces ()
 
template<typename ProductType , BranchType B>
BranchAliasSetterT< ProductType > produces (std::string instanceName)
 
template<typename ProductType , BranchType B>
BranchAliasSetterT< ProductType > produces ()
 
template<class ProductType >
BranchAliasSetterT< ProductType > produces (std::string instanceName)
 
template<typename ProductType , Transition B>
BranchAliasSetterT< ProductType > produces ()
 
template<Transition Tr = Transition::Event>
auto produces () noexcept
 
ProducesCollector producesCollector ()
 
- Protected Member Functions inherited from edm::EDConsumerBase
template<typename ProductType , BranchType B = InEvent>
EDGetTokenT< ProductType > consumes (edm::InputTag const &tag)
 
template<BranchType B = InEvent>
EDConsumerBaseAdaptor< Bconsumes (edm::InputTag tag) noexcept
 
EDGetToken consumes (const TypeToGet &id, edm::InputTag const &tag)
 
template<BranchType B>
EDGetToken consumes (TypeToGet const &id, edm::InputTag const &tag)
 
ConsumesCollector consumesCollector ()
 Use a ConsumesCollector to gather consumes information from helper functions. More...
 
template<typename ESProduct , typename ESRecord , Transition Tr = Transition::Event>
auto esConsumes ()
 
template<typename ESProduct , typename ESRecord , Transition Tr = Transition::Event>
auto esConsumes (ESInputTag const &tag)
 
template<Transition Tr = Transition::Event>
constexpr auto esConsumes ()
 
template<Transition Tr = Transition::Event>
auto esConsumes (ESInputTag tag)
 
template<Transition Tr = Transition::Event>
ESGetTokenGeneric esConsumes (eventsetup::EventSetupRecordKey const &iRecord, eventsetup::DataKey const &iKey)
 Used with EventSetupRecord::doGet. More...
 
template<typename ProductType , BranchType B = InEvent>
EDGetTokenT< ProductType > mayConsume (edm::InputTag const &tag)
 
EDGetToken mayConsume (const TypeToGet &id, edm::InputTag const &tag)
 
template<BranchType B>
EDGetToken mayConsume (const TypeToGet &id, edm::InputTag const &tag)
 
void resetItemsToGetFrom (BranchType iType)
 

Detailed Description

Description: [one line class summary]

Implementation: [Notes on implementation]

Definition at line 84 of file LeptonSkimming.h.

Constructor & Destructor Documentation

◆ LeptonSkimming()

LeptonSkimming::LeptonSkimming ( const edm::ParameterSet iConfig)
explicit

Definition at line 26 of file LeptonSkimming.cc.

References BiasedWP, Cosee_Cut, CoseeK_Cut, ElTrgExclusionCone, ElTrgMuDz_Cut, EpairZvtx_Cut, EtaTrack_Cut, edm::ParameterSet::getParameter(), Ksdxy_Cut, MaxChi2Track_Cut, MaxMB_Cut, MaxMee_Cut, MinChi2Track_Cut, MinMB_Cut, MinMee_Cut, MuTrgExclusionCone, MuTrgMatchCone, MuTrgMuDz_Cut, MuTrkMinDR_Cut, ObjPtLargerThanTrack, Probee_Cut, ProbeeK_Cut, PtB_Cut, PtEl_Cut, PtKTrack_Cut, PtMu_Cut, PtTrack_Cut, QualMu_Cut, environment_file_cff::runParameters, SkimOnlyElectrons, SkimOnlyMuons, SkipIfNoMuMatch, SLxy_Cut, TrackMuDz_Cut, TrackSdxy_Cut, TrgExclusionCone, TrkObjExclusionCone, and UnbiasedWP.

27  : electronsToken_(consumes<std::vector<reco::GsfElectron>>(iConfig.getParameter<edm::InputTag>("electrons"))),
30  muonsToken_(consumes<std::vector<reco::Muon>>(iConfig.getParameter<edm::InputTag>("muons"))),
31  Tracks_(consumes<std::vector<reco::Track>>(iConfig.getParameter<edm::InputTag>("tracks"))),
32  vtxToken_(consumes<std::vector<reco::Vertex>>(iConfig.getParameter<edm::InputTag>("vertices"))),
33  beamSpotToken_(consumes<reco::BeamSpot>(iConfig.getParameter<edm::InputTag>("beamSpot"))),
34  conversionsToken_(consumes<reco::ConversionCollection>(iConfig.getParameter<edm::InputTag>("conversions"))),
35 
36  trgresultsToken_(consumes<edm::TriggerResults>(iConfig.getParameter<edm::InputTag>("triggerresults"))),
37  trigobjectsToken_(consumes<trigger::TriggerEvent>(iConfig.getParameter<edm::InputTag>("triggerobjects"))),
39  HLTFilter_(iConfig.getParameter<vector<string>>("HLTFilter")),
40  HLTPath_(iConfig.getParameter<vector<string>>("HLTPath")) {
42  //mu matching with trigger
43  MuTrgMatchCone = runParameters.getParameter<double>("MuTrgMatchCone");
44  SkipIfNoMuMatch = runParameters.getParameter<bool>("SkipIfNoMuMatch");
45  //track cuts
46  PtTrack_Cut = runParameters.getParameter<double>("PtTrack_Cut");
47  EtaTrack_Cut = runParameters.getParameter<double>("EtaTrack_Cut");
48  MinChi2Track_Cut = runParameters.getParameter<double>("MinChi2Track_Cut");
49  MaxChi2Track_Cut = runParameters.getParameter<double>("MaxChi2Track_Cut");
50  MuTrkMinDR_Cut = runParameters.getParameter<double>("MuTrkMinDR_Cut");
51  TrackMuDz_Cut = runParameters.getParameter<double>("TrackMuDz_Cut");
52  TrgExclusionCone = runParameters.getParameter<double>("TrgExclusionCone");
53  //lepton cuts
54  PtMu_Cut = runParameters.getParameter<double>("PtMu_Cut");
55  PtEl_Cut = runParameters.getParameter<double>("PtEl_Cut");
56  QualMu_Cut = runParameters.getParameter<double>("QualMu_Cut");
57  MuTrgExclusionCone = runParameters.getParameter<double>("MuTrgExclusionCone");
58  ElTrgExclusionCone = runParameters.getParameter<double>("ElTrgExclusionCone");
59  TrkObjExclusionCone = runParameters.getParameter<double>("TrkObjExclusionCone");
60  MuTrgMuDz_Cut = runParameters.getParameter<double>("MuTrgMuDz_Cut");
61  ElTrgMuDz_Cut = runParameters.getParameter<double>("ElTrgMuDz_Cut");
62  BiasedWP = runParameters.getParameter<double>("BiasedWP");
63  UnbiasedWP = runParameters.getParameter<double>("UnbiasedWP");
64  SkimOnlyMuons = runParameters.getParameter<bool>("SkimOnlyMuons");
65  SkimOnlyElectrons = runParameters.getParameter<bool>("SkimOnlyElectrons");
66  //pair cuts
67  MaxMee_Cut = runParameters.getParameter<double>("MaxMee_Cut");
68  MinMee_Cut = runParameters.getParameter<double>("MinMee_Cut");
69  Probee_Cut = runParameters.getParameter<double>("Probee_Cut");
70  Cosee_Cut = runParameters.getParameter<double>("Cosee_Cut");
71  EpairZvtx_Cut = runParameters.getParameter<double>("EpairZvtx_Cut");
72  //kaon
73  PtKTrack_Cut = runParameters.getParameter<double>("PtKTrack_Cut");
74  TrackSdxy_Cut = runParameters.getParameter<double>("TrackSdxy_Cut");
75  Ksdxy_Cut = runParameters.getParameter<double>("Ksdxy_Cut");
76  //triplet
77  MaxMB_Cut = runParameters.getParameter<double>("MaxMB_Cut");
78  MinMB_Cut = runParameters.getParameter<double>("MinMB_Cut");
79  ProbeeK_Cut = runParameters.getParameter<double>("ProbeeK_Cut");
80  CoseeK_Cut = runParameters.getParameter<double>("CoseeK_Cut");
81  SLxy_Cut = runParameters.getParameter<double>("SLxy_Cut");
82  PtB_Cut = runParameters.getParameter<double>("PtB_Cut");
83 
84  ObjPtLargerThanTrack = runParameters.getParameter<bool>("ObjPtLargerThanTrack");
85 }
T getParameter(std::string const &) const
Definition: ParameterSet.h:303
double TrgExclusionCone
double MaxChi2Track_Cut
double MinChi2Track_Cut
edm::EDGetTokenT< reco::VertexCollection > vtxToken_
double TrkObjExclusionCone
edm::EDGetTokenT< edm::TriggerResults > trgresultsToken_
std::vector< string > HLTFilter_
EDGetTokenT< ProductType > consumes(edm::InputTag const &tag)
edm::EDGetToken electronsToken_
edm::EDGetTokenT< edm::ValueMap< float > > eleBWPToken_
edm::ESGetToken< MagneticField, IdealMagneticFieldRecord > bFieldToken_
edm::EDGetToken Tracks_
double ElTrgExclusionCone
edm::EDGetTokenT< trigger::TriggerEvent > trigobjectsToken_
edm::EDGetTokenT< reco::BeamSpot > beamSpotToken_
double MuTrgExclusionCone
edm::EDGetTokenT< reco::ConversionCollection > conversionsToken_
edm::EDGetToken muonsToken_
edm::EDGetTokenT< edm::ValueMap< float > > eleUnBWPToken_
std::vector< string > HLTPath_

◆ ~LeptonSkimming()

LeptonSkimming::~LeptonSkimming ( )
override

Definition at line 87 of file LeptonSkimming.cc.

87  {
88  // do anything here that needs to be done at destruction time
89  // (e.g. close files, deallocate resources etc.)
90 }

Member Function Documentation

◆ beginStream()

void LeptonSkimming::beginStream ( edm::StreamID  )
overrideprivatevirtual

Reimplemented from edm::stream::EDFilterBase.

Definition at line 527 of file LeptonSkimming.cc.

527 {}

◆ endStream()

void LeptonSkimming::endStream ( )
overrideprivatevirtual

Reimplemented from edm::stream::EDFilterBase.

Definition at line 530 of file LeptonSkimming.cc.

530 {}

◆ fillDescriptions()

void LeptonSkimming::fillDescriptions ( edm::ConfigurationDescriptions descriptions)
static

Definition at line 565 of file LeptonSkimming.cc.

References edm::ConfigurationDescriptions::addDefault(), and submitPVResolutionJobs::desc.

565  {
566  //The following says we do not know what parameters are allowed so do no validation
567  // Please change this to state exactly what you do use, even if it is no parameters
569  desc.setUnknown();
570  descriptions.addDefault(desc);
571 }
void addDefault(ParameterSetDescription const &psetDescription)

◆ filter()

bool LeptonSkimming::filter ( edm::Event iEvent,
const edm::EventSetup iSetup 
)
overrideprivatevirtual

Implements edm::stream::EDFilterBase.

Definition at line 168 of file LeptonSkimming.cc.

References beam_x, beam_y, beam_z, beamSpotToken_, Calorimetry_cff::bField, bFieldToken_, BiasedWP, ChiSquaredProbability(), cleanedObjTracks, cleanedPairTracks, cleanedTracks, pwdgSkimBPark_cfi::conversions, conversionsToken_, Cosee_Cut, CoseeK_Cut, TransientVertex::degreesOfFreedom(), PbPb_ZMuSkimMuonDPG_cff::deltaR, reco::BeamSpot::dxdz(), reco::BeamSpot::dydz(), el_eta, el_phi, el_pt, eleBWPToken_, pwdgSkimBPark_cfi::electrons, electronsToken_, eleUnBWPToken_, ElTracks, ElTrgExclusionCone, ElTrgMuDz_Cut, Epair_ObjectId, Epair_ObjectIndex, Epair_TrkIndex, EpairZvtx_Cut, submitPVResolutionJobs::err, reco::TrackBase::eta(), EtaTrack_Cut, edm::EventSetup::getData(), ConversionTools::hasMatchedConversion(), muons_cff::highPurity, HLTFilter_, hltFired(), hltObject(), HLTPath_, iEvent, isMediumMuonCustom(), muon::isSoftMuon(), isTightMuonCustom(), TransientVertex::isValid(), Ksdxy_Cut, SiStripPI::max, MaxChi2Track_Cut, MaxMB_Cut, MaxMee_Cut, MinChi2Track_Cut, MinMB_Cut, MinMee_Cut, amptDefaultParameters_cff::mu, muon_eta, muon_medium, muon_phi, muon_pt, muon_soft, muon_tight, PDWG_BPHSkim_cff::muons, muonsToken_, MuTracks, MuTrgExclusionCone, MuTrgMuDz_Cut, nel, nmuons, ntracks, getGTfromDQMFile::obj, object_container, object_id, ObjPtLargerThanTrack, PV3DBase< T, PVType, FrameType >::perp(), reco::BeamSpot::position(), TransientVertex::position(), TransientVertex::positionError(), Probee_Cut, ProbeeK_Cut, reco::TrackBase::pt(), PtB_Cut, PtEl_Cut, PtKTrack_Cut, PtMu_Cut, PtTrack_Cut, QualMu_Cut, Result, fileCollector::seed, SelectedMu_DR, SelectedMu_index, SelectedTrgObj_PtEtaPhiCharge, SkimOnlyElectrons, SkimOnlyMuons, SkipIfNoMuMatch, SLxy_Cut, mathSSE::sqrt(), test_ev, TransientVertex::totalChiSquared(), TrackMuDz_Cut, pwdgSkimBPark_cfi::tracks, Tracks_, TrackSdxy_Cut, TrgExclusionCone, trgresultsToken_, Trk_container, trk_index, TrkObjExclusionCone, UnbiasedWP, KalmanVertexFitter::vertex(), vertex_point, AlignmentTracksFromVertexSelector_cfi::vertices, L1BJetProducer_cff::vtx, vtxToken_, PV3DBase< T, PVType, FrameType >::x(), reco::BeamSpot::x0(), PV3DBase< T, PVType, FrameType >::y(), reco::BeamSpot::y0(), PV3DBase< T, PVType, FrameType >::z(), reco::BeamSpot::z0(), and ZvertexTrg.

168  {
169  using namespace std;
170  using namespace edm;
171  using namespace reco;
172  using namespace trigger;
173  // using namespace PhysicsTools;
174 
175  test_ev++;
176  //Get a few collections to apply basic electron ID
177  //Get electrons
179  iEvent.getByToken(electronsToken_, electrons);
180  //get bdt values
181  edm::Handle<edm::ValueMap<float>> ele_mva_wp_biased;
182  iEvent.getByToken(eleBWPToken_, ele_mva_wp_biased);
183  edm::Handle<edm::ValueMap<float>> ele_mva_wp_unbiased;
184  iEvent.getByToken(eleUnBWPToken_, ele_mva_wp_unbiased);
185  //get muons
187  iEvent.getByToken(muonsToken_, muons);
188  //Get conversions
190  iEvent.getByToken(conversionsToken_, conversions);
191  // Get the beam spot
192  edm::Handle<reco::BeamSpot> theBeamSpot;
193  iEvent.getByToken(beamSpotToken_, theBeamSpot);
194  //Get vertices
196  iEvent.getByToken(vtxToken_, vertices);
197  //continue if there are no vertices
198  if (vertices->empty())
199  return false;
201  iEvent.getByToken(Tracks_, tracks);
203  iEvent.getByToken(trgresultsToken_, trigResults);
204  auto const& bField = iSetup.getData(bFieldToken_);
205  KalmanVertexFitter theKalmanFitter(false);
206  TransientVertex LLvertex;
207 
208  // trigger1=0; trigger2=0; trigger3=0; trigger4=0; trigger5=0; trigger6=0;
209  nmuons = 0;
210  nel = 0;
211  ntracks = 0;
212 
213  SelectedMu_index = -1;
215  muon_pt.clear();
216  muon_eta.clear();
217  muon_phi.clear();
218  Result = false;
219  el_pt.clear();
220  el_eta.clear();
221  el_phi.clear();
222  Trk_container.clear();
223  MuTracks.clear();
224  ElTracks.clear();
225  object_container.clear();
226  object_id.clear();
227  cleanedTracks.clear();
228  Epair_ObjectId.clear();
229  muon_soft.clear();
230  muon_medium.clear();
231  muon_tight.clear();
232  Epair_ObjectIndex.clear();
233  cleanedObjTracks.clear();
234  cleanedPairTracks.clear();
235  Epair_ObjectIndex.clear();
236  Epair_ObjectId.clear();
237  Epair_TrkIndex.clear();
238  //internal stuff
240  std::array<float, 5> SelectedTrgObj_PtEtaPhiCharge{{-999, -999, -999, -999, -999}};
241  vertex_point.SetCoordinates(-1 * std::numeric_limits<float>::max(),
244  for (const reco::Vertex& vtx : *vertices) {
245  bool isFake = vtx.isFake();
246  if (isFake)
247  continue;
248  vertex_point.SetCoordinates(vtx.x(), vtx.y(), vtx.z());
250  break;
251  }
253  return false;
254 
255  beam_x = theBeamSpot->x0();
256  beam_y = theBeamSpot->y0();
257  beam_z = theBeamSpot->z0();
258  if (!hltFired(iEvent, iSetup, HLTPath_))
259  return false;
260 
263  MuTracks.clear();
264  object_container.clear();
265  object_id.clear();
266  nmuons = 0;
267  for (const reco::Muon& mu : *muons) {
268  if (fabs(mu.eta()) > EtaTrack_Cut)
269  continue;
270  //find triggering muon
271  float deltaRmu = deltaR(mu.eta(), mu.phi(), SelectedTrgObj_PtEtaPhiCharge[1], SelectedTrgObj_PtEtaPhiCharge[2]);
272  if (deltaRmu < MuTrgMatchCone && SelectedMu_DR > deltaRmu) {
274  ZvertexTrg = mu.vz();
275  }
276  //save muons that we want to skim
277  if (!SkimOnlyElectrons) {
278  bool tight = false, soft = false;
279  if (vertices.isValid()) {
280  tight = isTightMuonCustom(*(&mu), (*vertices)[0]);
281  soft = muon::isSoftMuon(*(&mu), (*vertices)[0]);
282  }
283  const Track* mutrack = mu.bestTrack();
284  muon_medium.push_back(isMediumMuonCustom(*(&mu)));
285  muon_tight.push_back(tight);
286  muon_soft.push_back(soft);
287  muon_pt.push_back(mu.pt());
288  muon_eta.push_back(mu.eta());
289  muon_phi.push_back(mu.phi());
290  auto muTrack = std::make_shared<reco::Track>(*mutrack);
291  MuTracks.push_back(muTrack);
292  object_container.push_back(nmuons);
293  object_id.push_back(13);
294  nmuons++;
295  }
296  }
297 
299  return false;
300  }
301 
302  //Save electrons we want to skim
303  ElTracks.clear();
304  if (!SkimOnlyMuons) {
305  for (const reco::GsfElectron& el : *electrons) {
306  bool passConvVeto = !ConversionTools::hasMatchedConversion(*(&el), *conversions, theBeamSpot->position());
307  if (!passConvVeto)
308  continue;
309  reco::GsfTrackRef seed = el.gsfTrack();
310  if (seed.isNull())
311  continue;
312  if ((*ele_mva_wp_biased)[seed] < BiasedWP)
313  continue;
314  if ((*ele_mva_wp_unbiased)[seed] < UnbiasedWP)
315  continue;
316  const Track* eltrack = el.bestTrack();
317  if (fabs(eltrack->eta()) > EtaTrack_Cut)
318  continue;
319  if (eltrack->pt() < PtEl_Cut)
320  continue;
321  auto ElTrack = std::make_shared<reco::Track>(*eltrack);
322  ElTracks.push_back(ElTrack);
323  object_container.push_back(nel);
324  el_pt.push_back(eltrack->pt());
325  el_eta.push_back(eltrack->eta());
326  el_phi.push_back(eltrack->phi());
327  nel++;
328  object_id.push_back(11);
329  }
330  }
331 
332  //Save tracks we want to skim: used both as mu or e candidate
333  cleanedTracks.clear();
334  trk_index = 0;
335  for (const reco::Track& trk : *tracks) {
336  if (!trk.quality(Track::highPurity))
337  continue;
338  if (trk.pt() < PtTrack_Cut)
339  continue;
340  if (fabs(trk.eta()) > EtaTrack_Cut)
341  continue;
342  if (trk.charge() == 0)
343  continue;
344  if (trk.normalizedChi2() > MaxChi2Track_Cut || trk.normalizedChi2() < MinChi2Track_Cut)
345  continue;
346  if (fabs(trk.dxy()) / trk.dxyError() < TrackSdxy_Cut)
347  continue;
349  if (fabs(ZvertexTrg - trk.vz()) > TrackMuDz_Cut)
350  continue;
351  if (deltaR(trk.eta(), trk.phi(), SelectedTrgObj_PtEtaPhiCharge[1], SelectedTrgObj_PtEtaPhiCharge[2]) <
353  continue;
354  }
355  //assignments
356  auto cleanTrack = std::make_shared<reco::Track>(trk);
357  cleanedTracks.push_back(cleanTrack);
358  Trk_container.push_back(trk_index);
359  trk_index++;
360  }
361 
362  //create ll combination
363 
364  // fit track pairs
365  cleanedObjTracks.clear();
366  cleanedPairTracks.clear();
367  TLorentzVector vel1, vel2;
368  std::vector<std::shared_ptr<reco::Track>> cleanedObjects;
369  //add tracks of objects
370  if (!SkimOnlyElectrons) {
371  for (auto& vec : MuTracks)
372  cleanedObjects.push_back(vec);
373  }
374 
375  if (!SkimOnlyMuons) {
376  for (auto& vec : ElTracks)
377  cleanedObjects.push_back(vec);
378  }
379 
380  if (cleanedObjects.empty())
381  return false;
382 
383  for (auto& obj : cleanedObjects) {
384  auto tranobj = std::make_shared<reco::TransientTrack>(reco::TransientTrack(*obj, &bField));
385  unsigned int iobj = &obj - &cleanedObjects[0];
386  unsigned int index = object_container.at(iobj);
387  float massLep = 0.0005;
388  if (object_id.at(iobj) == 13)
389  massLep = 0.105;
390  //posible cut in mu quality
391  if (object_id.at(iobj) == 13 && QualMu_Cut == 1 && !muon_soft.at(index))
392  continue;
393  if (object_id.at(iobj) == 13 && QualMu_Cut == 2 && !muon_medium.at(index))
394  continue;
395  if (object_id.at(iobj) == 13 && QualMu_Cut == 3 && !muon_tight.at(index))
396  continue;
397  // take the corresponding lepton track for lorentz vector
398  vel1.SetPtEtaPhiM(obj->pt(), obj->eta(), obj->phi(), massLep);
399  if (object_id.at(iobj) == 13 && vel1.Pt() < PtMu_Cut)
400  continue;
401  for (auto& trk2 : cleanedTracks) {
402  unsigned int itrk2 = &trk2 - &cleanedTracks[0];
403  //opposite sign
404  if (obj->charge() * trk2->charge() == 1)
405  continue;
406  if (ObjPtLargerThanTrack && vel1.Pt() < trk2->pt())
407  continue;
408  vel2.SetPtEtaPhiM(trk2->pt(), trk2->eta(), trk2->phi(), massLep);
409  //probe side cuts
410  if (object_id.at(iobj) == 13 &&
413  continue;
414  if (object_id.at(iobj) == 11 &&
417  continue;
419  if (object_id.at(iobj) == 13 && fabs(ZvertexTrg - obj->vz()) > MuTrgMuDz_Cut)
420  continue;
421  if (object_id.at(iobj) == 11 && fabs(ZvertexTrg - obj->vz()) > ElTrgMuDz_Cut)
422  continue;
423  }
424  //additional cuts
425  float InvMassLepLep = (vel1 + vel2).M();
426  if (InvMassLepLep > MaxMee_Cut || InvMassLepLep < MinMee_Cut)
427  continue;
428  auto trantrk2 = std::make_shared<reco::TransientTrack>(reco::TransientTrack(*trk2, &bField));
429  std::vector<reco::TransientTrack> tempTracks;
430  tempTracks.reserve(2);
431  tempTracks.push_back(*tranobj);
432  tempTracks.push_back(*trantrk2);
433  LLvertex = theKalmanFitter.vertex(tempTracks);
434  if (!LLvertex.isValid())
435  continue;
437  continue;
439  fabs(ZvertexTrg - LLvertex.position().z()) > EpairZvtx_Cut)
440  continue;
441  GlobalError err = LLvertex.positionError();
442  GlobalPoint Dispbeamspot(-1 * ((theBeamSpot->x0() - LLvertex.position().x()) +
443  (LLvertex.position().z() - theBeamSpot->z0()) * theBeamSpot->dxdz()),
444  -1 * ((theBeamSpot->y0() - LLvertex.position().y()) +
445  (LLvertex.position().z() - theBeamSpot->z0()) * theBeamSpot->dydz()),
446  0);
447  math::XYZVector pperp((vel1 + vel2).Px(), (vel1 + vel2).Py(), 0);
448  math::XYZVector vperp(Dispbeamspot.x(), Dispbeamspot.y(), 0.);
449  float tempCos = vperp.Dot(pperp) / (vperp.R() * pperp.R());
450  if (tempCos < Cosee_Cut)
451  continue;
452  cleanedObjTracks.push_back(obj);
453  cleanedPairTracks.push_back(trk2);
454  Epair_ObjectIndex.push_back(object_container.at(iobj));
455  Epair_ObjectId.push_back(object_id.at(iobj));
456  Epair_TrkIndex.push_back(Trk_container.at(itrk2));
457  }
458  }
459 
460  // B recontrsuction
461  TLorentzVector vK;
462  for (unsigned int iobj = 0; iobj < cleanedObjTracks.size(); iobj++) {
463  auto objtrk = cleanedObjTracks.at(iobj);
464  auto pairtrk = cleanedPairTracks.at(iobj);
465  auto tranobj = std::make_shared<reco::TransientTrack>(reco::TransientTrack(*objtrk, &bField));
466  auto tranpair = std::make_shared<reco::TransientTrack>(reco::TransientTrack(*pairtrk, &bField));
467  //unsigned int index=Epair_ObjectIndex.at(iobj);
468  float massLep = 0.0005;
469  if (Epair_ObjectId.at(iobj) == 13)
470  massLep = 0.105;
471  vel1.SetPtEtaPhiM(objtrk->pt(), objtrk->eta(), objtrk->phi(), massLep);
472  vel2.SetPtEtaPhiM(pairtrk->pt(), pairtrk->eta(), pairtrk->phi(), massLep);
473  for (auto& trk : cleanedTracks) {
474  //reject track corresponding to mu or e
475  if (trk->charge() == objtrk->charge() &&
476  deltaR(objtrk->eta(), objtrk->phi(), trk->eta(), trk->phi()) < TrkObjExclusionCone)
477  continue;
478  if (trk->pt() < PtKTrack_Cut)
479  continue;
480  if (fabs(trk->dxy(vertex_point)) / trk->dxyError() < Ksdxy_Cut)
481  continue;
482  // skip the track that was used as mu or e
483  if (Epair_TrkIndex.at(iobj) == &trk - &cleanedTracks[0])
484  continue;
485  vK.SetPtEtaPhiM(trk->pt(), trk->eta(), trk->phi(), 0.493);
486  //final cuts
487  float InvMass = (vel1 + vel2 + vK).M();
488  if (InvMass > MaxMB_Cut || InvMass < MinMB_Cut)
489  continue;
490  if ((vel1 + vel2 + vK).Pt() < PtB_Cut)
491  continue;
492  auto trantrk = std::make_shared<reco::TransientTrack>(reco::TransientTrack(*trk, &bField));
493  std::vector<reco::TransientTrack> tempTracks;
494  tempTracks.reserve(3);
495  tempTracks.push_back(*tranobj);
496  tempTracks.push_back(*tranpair);
497  tempTracks.push_back(*trantrk);
498  LLvertex = theKalmanFitter.vertex(tempTracks);
499  if (!LLvertex.isValid())
500  continue;
502  continue;
503  GlobalError err = LLvertex.positionError();
504  GlobalPoint Dispbeamspot(-1 * ((theBeamSpot->x0() - LLvertex.position().x()) +
505  (LLvertex.position().z() - theBeamSpot->z0()) * theBeamSpot->dxdz()),
506  -1 * ((theBeamSpot->y0() - LLvertex.position().y()) +
507  (LLvertex.position().z() - theBeamSpot->z0()) * theBeamSpot->dydz()),
508  0);
509  math::XYZVector pperp((vel1 + vel2 + vK).Px(), (vel1 + vel2 + vK).Py(), 0);
510  math::XYZVector vperp(Dispbeamspot.x(), Dispbeamspot.y(), 0.);
511  float tempCos = vperp.Dot(pperp) / (vperp.R() * pperp.R());
512  if (tempCos < CoseeK_Cut)
513  continue;
514  if (SLxy_Cut > Dispbeamspot.perp() / sqrt(err.rerr(Dispbeamspot)))
515  continue;
516  Result = true;
517  break;
518  }
519  if (Result)
520  break;
521  }
522  //decission
523  return Result;
524 }
unsigned int trk_index
std::vector< float > muon_eta
float totalChiSquared() const
std::vector< std::shared_ptr< reco::Track > > cleanedTracks
std::vector< unsigned int > object_id
T const & getData(const ESGetToken< T, R > &iToken) const noexcept(false)
Definition: EventSetup.h:119
double TrgExclusionCone
GlobalPoint position() const
const Point & position() const
position
Definition: BeamSpot.h:59
double MaxChi2Track_Cut
T z() const
Definition: PV3DBase.h:61
GlobalError positionError() const
double MinChi2Track_Cut
edm::EDGetTokenT< reco::VertexCollection > vtxToken_
unsigned int nmuons
double TrkObjExclusionCone
double dydz() const
dydz slope
Definition: BeamSpot.h:80
edm::EDGetTokenT< edm::TriggerResults > trgresultsToken_
std::vector< std::shared_ptr< reco::Track > > cleanedPairTracks
float degreesOfFreedom() const
std::vector< unsigned int > Epair_ObjectId
std::vector< string > HLTFilter_
std::vector< unsigned int > Epair_ObjectIndex
std::vector< std::shared_ptr< reco::Track > > MuTracks
std::vector< unsigned int > Epair_TrkIndex
reco::TrackBase::Point vertex_point
double x0() const
x coordinate
Definition: BeamSpot.h:61
double pt() const
track transverse momentum
Definition: TrackBase.h:637
T x() const
Definition: PV3DBase.h:59
T y() const
Definition: PV3DBase.h:60
int iEvent
Definition: GenABIO.cc:224
std::vector< float > SelectedTrgObj_PtEtaPhiCharge
edm::EDGetToken electronsToken_
std::vector< float > el_pt
edm::EDGetTokenT< edm::ValueMap< float > > eleBWPToken_
std::vector< unsigned int > object_container
edm::ESGetToken< MagneticField, IdealMagneticFieldRecord > bFieldToken_
bool isValid() const
T sqrt(T t)
Definition: SSEVec.h:19
static bool hasMatchedConversion(const reco::GsfElectron &ele, const reco::ConversionCollection &convCol, const math::XYZPoint &beamspot, bool allowCkfMatch=true, float lxyMin=2.0, float probMin=1e-6, unsigned int nHitsBeforeVtxMax=0)
float ChiSquaredProbability(double chiSquared, double nrDOF)
std::vector< float > el_eta
bool isTightMuonCustom(const reco::Muon &recoMu, const reco::Vertex recoVtx)
Definition: MuonID.h:36
std::vector< unsigned int > Trk_container
bool isMediumMuonCustom(const reco::Muon &recoMu)
Definition: MuonID.h:27
std::vector< float > muon_medium
double y0() const
y coordinate
Definition: BeamSpot.h:63
edm::EDGetToken Tracks_
unsigned int ntracks
bool isSoftMuon(const reco::Muon &, const reco::Vertex &, bool run2016_hip_mitigation=false)
double ElTrgExclusionCone
unsigned int nel
std::vector< std::shared_ptr< reco::Track > > cleanedObjTracks
std::vector< std::shared_ptr< reco::Track > > ElTracks
std::vector< float > muon_pt
double eta() const
pseudorapidity of momentum vector
Definition: TrackBase.h:652
edm::EDGetTokenT< reco::BeamSpot > beamSpotToken_
double MuTrgExclusionCone
XYZVectorD XYZVector
spatial vector with cartesian internal representation
Definition: Vector3D.h:31
edm::EDGetTokenT< reco::ConversionCollection > conversionsToken_
std::vector< float > el_phi
double dxdz() const
dxdz slope
Definition: BeamSpot.h:78
edm::EDGetToken muonsToken_
std::vector< float > muon_tight
bool hltFired(const edm::Event &iEvent, const edm::EventSetup &iSetup, std::vector< string > HLTPath)
double z0() const
z coordinate
Definition: BeamSpot.h:65
std::vector< float > muon_soft
edm::EDGetTokenT< edm::ValueMap< float > > eleUnBWPToken_
fixed size matrix
std::vector< string > HLTPath_
HLT enums.
std::vector< float > muon_phi
std::array< float, 5 > hltObject(const edm::Event &iEvent, const edm::EventSetup &iSetup, std::vector< string > Seed)

◆ hltFired()

bool LeptonSkimming::hltFired ( const edm::Event iEvent,
const edm::EventSetup iSetup,
std::vector< string >  HLTPath 
)
private

Definition at line 92 of file LeptonSkimming.cc.

References edm::HLTGlobalStatus::accept(), edm::HandleBase::failedToGet(), pwdgSkimBPark_cfi::HLTPath, iEvent, edm::HLTGlobalStatus::size(), AlCaHLTBitMon_QueryRunRegistry::string, trgresultsToken_, and cscTnPEfficiencyTask_cfi::trigName.

Referenced by filter().

92  {
93  using namespace std;
94  using namespace edm;
95  using namespace reco;
96  using namespace trigger;
97 
99  iEvent.getByToken(trgresultsToken_, trigResults);
100  bool fire = false;
101  if (trigResults.failedToGet())
102  return false;
103  for (unsigned int ip = 0; ip < HLTPath.size(); ip++) {
104  int N_Triggers = trigResults->size();
105  const edm::TriggerNames& trigName = iEvent.triggerNames(*trigResults);
106  for (int i_Trig = 0; i_Trig < N_Triggers; ++i_Trig) {
107  if (!trigResults->accept(i_Trig))
108  continue;
109  const std::string& TrigPath = trigName.triggerName(i_Trig);
110  if (TrigPath.find(HLTPath[ip]) != std::string::npos)
111  fire = true;
112  }
113  }
114  return fire;
115 }
bool accept() const
Has at least one path accepted the event?
edm::EDGetTokenT< edm::TriggerResults > trgresultsToken_
bool failedToGet() const
Definition: HandleBase.h:72
unsigned int size() const
Get number of paths stored.
int iEvent
Definition: GenABIO.cc:224
fixed size matrix
HLT enums.

◆ hltObject()

std::array< float, 5 > LeptonSkimming::hltObject ( const edm::Event iEvent,
const edm::EventSetup iSetup,
std::vector< string >  Seed 
)
private

Definition at line 117 of file LeptonSkimming.cc.

References a, b, trigger::TriggerObject::eta(), trigger::TriggerEvent::getObjects(), trigger::TriggerObject::id(), iEvent, ProducerED_cfi::InputTag, edm::HandleBase::isValid(), dqmiolumiharvest::j, relativeConstraints::keys, trigger::TriggerObject::phi(), trigger::TriggerObject::pt(), jetUpdater_cfi::sort, and trigobjectsToken_.

Referenced by filter().

119  {
120  using namespace std;
121  using namespace edm;
122  using namespace reco;
123  using namespace trigger;
124 
125  edm::Handle<trigger::TriggerEvent> triggerObjectsSummary;
126  iEvent.getByToken(trigobjectsToken_, triggerObjectsSummary);
127  trigger::TriggerObjectCollection selectedObjects;
128 
129  std::vector<std::array<float, 5>> max_per_trigger;
130 
131  for (unsigned int ipath = 0; ipath < Seed.size(); ipath++) {
132  std::vector<std::array<float, 5>> tot_tr_obj_pt_eta_phi;
133  if (!triggerObjectsSummary.isValid())
134  continue;
135  size_t filterIndex = (*triggerObjectsSummary).filterIndex(InputTag(Seed[ipath], "", "HLT"));
136  trigger::TriggerObjectCollection allTriggerObjects = triggerObjectsSummary->getObjects();
137  if (filterIndex < (*triggerObjectsSummary).sizeFilters()) {
138  const trigger::Keys& keys = (*triggerObjectsSummary).filterKeys(filterIndex);
139  for (size_t j = 0; j < keys.size(); j++) {
140  const trigger::TriggerObject& foundObject = (allTriggerObjects)[keys[j]];
141  std::array<float, 5> tr_obj_pt_eta_phi;
142  if (fabs(foundObject.id()) != 13)
143  continue;
144  tr_obj_pt_eta_phi[0] = foundObject.pt();
145  tr_obj_pt_eta_phi[1] = foundObject.eta();
146  tr_obj_pt_eta_phi[2] = foundObject.phi();
147  tr_obj_pt_eta_phi[3] = foundObject.id() / fabs(foundObject.id());
148  tot_tr_obj_pt_eta_phi.push_back(tr_obj_pt_eta_phi);
149  }
150  }
151  //take the max per hlt
152  if (!tot_tr_obj_pt_eta_phi.empty()) {
153  std::sort(tot_tr_obj_pt_eta_phi.begin(),
154  tot_tr_obj_pt_eta_phi.end(),
155  [](const std::array<float, 5>& a, const std::array<float, 5>& b) { return a[0] > b[0]; });
156  max_per_trigger.push_back(tot_tr_obj_pt_eta_phi.at(0));
157  }
158  }
159  //we know that at least a trigger fired
160  //find the total max
161  std::sort(max_per_trigger.begin(),
162  max_per_trigger.end(),
163  [](const std::array<float, 5>& a, const std::array<float, 5>& b) { return a[0] > b[0]; });
164  return max_per_trigger.at(0);
165 }
Single trigger physics object (e.g., an isolated muon)
Definition: TriggerObject.h:21
int iEvent
Definition: GenABIO.cc:224
const TriggerObjectCollection & getObjects() const
Definition: TriggerEvent.h:101
int id() const
getters
Definition: TriggerObject.h:51
edm::EDGetTokenT< trigger::TriggerEvent > trigobjectsToken_
std::vector< TriggerObject > TriggerObjectCollection
collection of trigger physics objects (e.g., all isolated muons)
Definition: TriggerObject.h:75
std::vector< size_type > Keys
double b
Definition: hdecay.h:120
bool isValid() const
Definition: HandleBase.h:70
fixed size matrix
HLT enums.
double a
Definition: hdecay.h:121

Member Data Documentation

◆ beam_x

float LeptonSkimming::beam_x
private

Definition at line 113 of file LeptonSkimming.h.

Referenced by filter().

◆ beam_y

float LeptonSkimming::beam_y
private

Definition at line 113 of file LeptonSkimming.h.

Referenced by filter().

◆ beam_z

float LeptonSkimming::beam_z
private

Definition at line 113 of file LeptonSkimming.h.

Referenced by filter().

◆ beamSpotToken_

edm::EDGetTokenT<reco::BeamSpot> LeptonSkimming::beamSpotToken_
private

Definition at line 105 of file LeptonSkimming.h.

Referenced by filter().

◆ bFieldToken_

edm::ESGetToken<MagneticField, IdealMagneticFieldRecord> LeptonSkimming::bFieldToken_
private

Definition at line 109 of file LeptonSkimming.h.

Referenced by filter().

◆ BiasedWP

double LeptonSkimming::BiasedWP = -100
private

Definition at line 174 of file LeptonSkimming.h.

Referenced by filter(), and LeptonSkimming().

◆ cleanedObjTracks

std::vector<std::shared_ptr<reco::Track> > LeptonSkimming::cleanedObjTracks
private

Definition at line 127 of file LeptonSkimming.h.

Referenced by filter().

◆ cleanedPairTracks

std::vector<std::shared_ptr<reco::Track> > LeptonSkimming::cleanedPairTracks
private

Definition at line 128 of file LeptonSkimming.h.

Referenced by filter().

◆ cleanedTracks

std::vector<std::shared_ptr<reco::Track> > LeptonSkimming::cleanedTracks
private

Definition at line 131 of file LeptonSkimming.h.

Referenced by filter().

◆ conversionsToken_

edm::EDGetTokenT<reco::ConversionCollection> LeptonSkimming::conversionsToken_
private

Definition at line 106 of file LeptonSkimming.h.

Referenced by filter().

◆ Cosee_Cut

double LeptonSkimming::Cosee_Cut = -1
private

Definition at line 152 of file LeptonSkimming.h.

Referenced by filter(), and LeptonSkimming().

◆ CoseeK_Cut

double LeptonSkimming::CoseeK_Cut = 0
private

Definition at line 159 of file LeptonSkimming.h.

Referenced by filter(), and LeptonSkimming().

◆ EarlyStop

bool LeptonSkimming::EarlyStop = false
private

Definition at line 153 of file LeptonSkimming.h.

◆ el_eta

std::vector<float> LeptonSkimming::el_eta
private

Definition at line 116 of file LeptonSkimming.h.

Referenced by filter().

◆ el_phi

std::vector<float> LeptonSkimming::el_phi
private

Definition at line 116 of file LeptonSkimming.h.

Referenced by filter().

◆ el_pt

std::vector<float> LeptonSkimming::el_pt
private

Definition at line 116 of file LeptonSkimming.h.

Referenced by filter().

◆ eleBWPToken_

edm::EDGetTokenT<edm::ValueMap<float> > LeptonSkimming::eleBWPToken_
private

Definition at line 100 of file LeptonSkimming.h.

Referenced by filter().

◆ electronsToken_

edm::EDGetToken LeptonSkimming::electronsToken_
private

Definition at line 99 of file LeptonSkimming.h.

Referenced by filter().

◆ eleUnBWPToken_

edm::EDGetTokenT<edm::ValueMap<float> > LeptonSkimming::eleUnBWPToken_
private

Definition at line 101 of file LeptonSkimming.h.

Referenced by filter().

◆ ElTracks

std::vector<std::shared_ptr<reco::Track> > LeptonSkimming::ElTracks
private

Definition at line 130 of file LeptonSkimming.h.

Referenced by filter().

◆ ElTrgExclusionCone

double LeptonSkimming::ElTrgExclusionCone = 0
private

Definition at line 168 of file LeptonSkimming.h.

Referenced by filter(), and LeptonSkimming().

◆ ElTrgMuDz_Cut

double LeptonSkimming::ElTrgMuDz_Cut = 1000
private

Definition at line 171 of file LeptonSkimming.h.

Referenced by filter(), and LeptonSkimming().

◆ Epair_ObjectId

std::vector<unsigned int> LeptonSkimming::Epair_ObjectId
private

Definition at line 117 of file LeptonSkimming.h.

Referenced by filter().

◆ Epair_ObjectIndex

std::vector<unsigned int> LeptonSkimming::Epair_ObjectIndex
private

Definition at line 117 of file LeptonSkimming.h.

Referenced by filter().

◆ Epair_TrkIndex

std::vector<unsigned int> LeptonSkimming::Epair_TrkIndex
private

Definition at line 117 of file LeptonSkimming.h.

Referenced by filter().

◆ EpairZvtx_Cut

double LeptonSkimming::EpairZvtx_Cut = 10000000
private

Definition at line 156 of file LeptonSkimming.h.

Referenced by filter(), and LeptonSkimming().

◆ EtaTrack_Cut

double LeptonSkimming::EtaTrack_Cut = 10
private

Definition at line 138 of file LeptonSkimming.h.

Referenced by filter(), and LeptonSkimming().

◆ HLTFilter_

std::vector<string> LeptonSkimming::HLTFilter_
private

Definition at line 110 of file LeptonSkimming.h.

Referenced by filter().

◆ HLTPath_

std::vector<string> LeptonSkimming::HLTPath_
private

Definition at line 110 of file LeptonSkimming.h.

Referenced by filter().

◆ Ksdxy_Cut

double LeptonSkimming::Ksdxy_Cut = 1000
private

Definition at line 157 of file LeptonSkimming.h.

Referenced by filter(), and LeptonSkimming().

◆ MaxChi2Track_Cut

double LeptonSkimming::MaxChi2Track_Cut = 1000
private

Definition at line 140 of file LeptonSkimming.h.

Referenced by filter(), and LeptonSkimming().

◆ MaxMB_Cut

double LeptonSkimming::MaxMB_Cut = 1000
private

Definition at line 144 of file LeptonSkimming.h.

Referenced by filter(), and LeptonSkimming().

◆ MaxMee_Cut

double LeptonSkimming::MaxMee_Cut = 1000
private

Definition at line 142 of file LeptonSkimming.h.

Referenced by filter(), and LeptonSkimming().

◆ MinChi2Track_Cut

double LeptonSkimming::MinChi2Track_Cut = -1000
private

Definition at line 139 of file LeptonSkimming.h.

Referenced by filter(), and LeptonSkimming().

◆ MinMB_Cut

double LeptonSkimming::MinMB_Cut = 0
private

Definition at line 145 of file LeptonSkimming.h.

Referenced by filter(), and LeptonSkimming().

◆ MinMee_Cut

double LeptonSkimming::MinMee_Cut = 0
private

Definition at line 150 of file LeptonSkimming.h.

Referenced by filter(), and LeptonSkimming().

◆ muon_eta

std::vector<float> LeptonSkimming::muon_eta
private

Definition at line 116 of file LeptonSkimming.h.

Referenced by filter().

◆ muon_medium

std::vector<float> LeptonSkimming::muon_medium
private

Definition at line 116 of file LeptonSkimming.h.

Referenced by filter().

◆ muon_phi

std::vector<float> LeptonSkimming::muon_phi
private

Definition at line 116 of file LeptonSkimming.h.

Referenced by filter().

◆ muon_pt

std::vector<float> LeptonSkimming::muon_pt
private

Definition at line 116 of file LeptonSkimming.h.

Referenced by filter().

◆ muon_soft

std::vector<float> LeptonSkimming::muon_soft
private

Definition at line 116 of file LeptonSkimming.h.

Referenced by filter().

◆ muon_tight

std::vector<float> LeptonSkimming::muon_tight
private

Definition at line 116 of file LeptonSkimming.h.

Referenced by filter().

◆ muonsToken_

edm::EDGetToken LeptonSkimming::muonsToken_
private

Definition at line 102 of file LeptonSkimming.h.

Referenced by filter().

◆ MuTracks

std::vector<std::shared_ptr<reco::Track> > LeptonSkimming::MuTracks
private

Definition at line 129 of file LeptonSkimming.h.

Referenced by filter().

◆ MuTrgExclusionCone

double LeptonSkimming::MuTrgExclusionCone = 0
private

Definition at line 167 of file LeptonSkimming.h.

Referenced by filter(), and LeptonSkimming().

◆ MuTrgMatchCone

double LeptonSkimming::MuTrgMatchCone = 1000
private

Definition at line 154 of file LeptonSkimming.h.

Referenced by LeptonSkimming().

◆ MuTrgMuDz_Cut

double LeptonSkimming::MuTrgMuDz_Cut = 1000
private

Definition at line 170 of file LeptonSkimming.h.

Referenced by filter(), and LeptonSkimming().

◆ MuTrkMinDR_Cut

double LeptonSkimming::MuTrkMinDR_Cut = 0
private

Definition at line 141 of file LeptonSkimming.h.

Referenced by LeptonSkimming().

◆ nel

unsigned int LeptonSkimming::nel = 0
private

Definition at line 135 of file LeptonSkimming.h.

Referenced by filter().

◆ nmuons

unsigned int LeptonSkimming::nmuons = 0
private

Definition at line 135 of file LeptonSkimming.h.

Referenced by filter().

◆ ntracks

unsigned int LeptonSkimming::ntracks = 0
private

Definition at line 135 of file LeptonSkimming.h.

Referenced by filter().

◆ object_container

std::vector<unsigned int> LeptonSkimming::object_container
private

Definition at line 133 of file LeptonSkimming.h.

Referenced by filter().

◆ object_id

std::vector<unsigned int> LeptonSkimming::object_id
private

Definition at line 133 of file LeptonSkimming.h.

Referenced by filter().

◆ ObjPtLargerThanTrack

bool LeptonSkimming::ObjPtLargerThanTrack = false
private

Definition at line 173 of file LeptonSkimming.h.

Referenced by filter(), and LeptonSkimming().

◆ Probee_Cut

double LeptonSkimming::Probee_Cut = 0
private

Definition at line 151 of file LeptonSkimming.h.

Referenced by filter(), and LeptonSkimming().

◆ ProbeeK_Cut

double LeptonSkimming::ProbeeK_Cut = 0
private

Definition at line 158 of file LeptonSkimming.h.

Referenced by filter(), and LeptonSkimming().

◆ PtB_Cut

double LeptonSkimming::PtB_Cut = 0
private

Definition at line 163 of file LeptonSkimming.h.

Referenced by filter(), and LeptonSkimming().

◆ PtEl_Cut

double LeptonSkimming::PtEl_Cut = 0
private

Definition at line 166 of file LeptonSkimming.h.

Referenced by filter(), and LeptonSkimming().

◆ PtKTrack_Cut

double LeptonSkimming::PtKTrack_Cut = 0
private

Definition at line 143 of file LeptonSkimming.h.

Referenced by filter(), and LeptonSkimming().

◆ PtMu_Cut

double LeptonSkimming::PtMu_Cut = 0
private

Definition at line 164 of file LeptonSkimming.h.

Referenced by filter(), and LeptonSkimming().

◆ PtTrack_Cut

double LeptonSkimming::PtTrack_Cut = 0
private

Definition at line 137 of file LeptonSkimming.h.

Referenced by filter(), and LeptonSkimming().

◆ QualMu_Cut

double LeptonSkimming::QualMu_Cut = 0
private

Definition at line 165 of file LeptonSkimming.h.

Referenced by filter(), and LeptonSkimming().

◆ Result

bool LeptonSkimming::Result = false
private

Definition at line 112 of file LeptonSkimming.h.

Referenced by filter().

◆ SaveOnlyEPairTracks

bool LeptonSkimming::SaveOnlyEPairTracks = false
private

Definition at line 147 of file LeptonSkimming.h.

◆ SaveOnlyTracks

bool LeptonSkimming::SaveOnlyTracks = false
private

Definition at line 146 of file LeptonSkimming.h.

◆ SaveOutputRoot

bool LeptonSkimming::SaveOutputRoot = true
private

Definition at line 172 of file LeptonSkimming.h.

◆ SelectedMu_DR

float LeptonSkimming::SelectedMu_DR = -1
private

Definition at line 122 of file LeptonSkimming.h.

Referenced by filter().

◆ SelectedMu_index

int LeptonSkimming::SelectedMu_index
private

Definition at line 120 of file LeptonSkimming.h.

Referenced by filter().

◆ SelectedTrgObj_PtEtaPhiCharge

std::vector<float> LeptonSkimming::SelectedTrgObj_PtEtaPhiCharge
private

Definition at line 119 of file LeptonSkimming.h.

Referenced by filter().

◆ SkimOnlyElectrons

bool LeptonSkimming::SkimOnlyElectrons = false
private

Definition at line 177 of file LeptonSkimming.h.

Referenced by filter(), and LeptonSkimming().

◆ SkimOnlyMuons

bool LeptonSkimming::SkimOnlyMuons = false
private

Definition at line 176 of file LeptonSkimming.h.

Referenced by filter(), and LeptonSkimming().

◆ SkipIfNoMuMatch

bool LeptonSkimming::SkipIfNoMuMatch = false
private

Definition at line 155 of file LeptonSkimming.h.

Referenced by filter(), and LeptonSkimming().

◆ SLxy_Cut

double LeptonSkimming::SLxy_Cut = 0
private

Definition at line 162 of file LeptonSkimming.h.

Referenced by filter(), and LeptonSkimming().

◆ tempPtEtaPhiM

std::vector<float> LeptonSkimming::tempPtEtaPhiM
private

Definition at line 126 of file LeptonSkimming.h.

◆ tempXYZ

std::vector<float> LeptonSkimming::tempXYZ
private

Definition at line 126 of file LeptonSkimming.h.

◆ test_ev

int LeptonSkimming::test_ev = 0
private

Definition at line 178 of file LeptonSkimming.h.

Referenced by filter().

◆ track_vx

std::vector<float> LeptonSkimming::track_vx
private

Definition at line 115 of file LeptonSkimming.h.

◆ track_vy

std::vector<float> LeptonSkimming::track_vy
private

Definition at line 115 of file LeptonSkimming.h.

◆ track_vz

std::vector<float> LeptonSkimming::track_vz
private

Definition at line 115 of file LeptonSkimming.h.

◆ TrackMuDz_Cut

double LeptonSkimming::TrackMuDz_Cut = 100000000
private

Definition at line 160 of file LeptonSkimming.h.

Referenced by filter(), and LeptonSkimming().

◆ trackObj_container

std::vector<unsigned int> LeptonSkimming::trackObj_container
private

Definition at line 132 of file LeptonSkimming.h.

◆ trackPair_container

std::vector<unsigned int> LeptonSkimming::trackPair_container
private

Definition at line 132 of file LeptonSkimming.h.

◆ Tracks_

edm::EDGetToken LeptonSkimming::Tracks_
private

Definition at line 103 of file LeptonSkimming.h.

Referenced by filter().

◆ TrackSdxy_Cut

double LeptonSkimming::TrackSdxy_Cut = 0
private

Definition at line 148 of file LeptonSkimming.h.

Referenced by filter(), and LeptonSkimming().

◆ TrgExclusionCone

double LeptonSkimming::TrgExclusionCone = -1
private

Definition at line 161 of file LeptonSkimming.h.

Referenced by filter(), and LeptonSkimming().

◆ trgresultsToken_

edm::EDGetTokenT<edm::TriggerResults> LeptonSkimming::trgresultsToken_
private

Definition at line 107 of file LeptonSkimming.h.

Referenced by filter(), and hltFired().

◆ trigobjectsToken_

edm::EDGetTokenT<trigger::TriggerEvent> LeptonSkimming::trigobjectsToken_
private

Definition at line 108 of file LeptonSkimming.h.

Referenced by hltObject().

◆ Trk_container

std::vector<unsigned int> LeptonSkimming::Trk_container
private

Definition at line 133 of file LeptonSkimming.h.

Referenced by filter().

◆ trk_index

unsigned int LeptonSkimming::trk_index = 0
private

Definition at line 124 of file LeptonSkimming.h.

Referenced by filter().

◆ TrkObjExclusionCone

double LeptonSkimming::TrkObjExclusionCone = 0
private

Definition at line 169 of file LeptonSkimming.h.

Referenced by filter(), and LeptonSkimming().

◆ UnbiasedWP

double LeptonSkimming::UnbiasedWP = -100
private

Definition at line 175 of file LeptonSkimming.h.

Referenced by filter(), and LeptonSkimming().

◆ UseOnlyBKeeMCForTriplets

bool LeptonSkimming::UseOnlyBKeeMCForTriplets = false
private

Definition at line 149 of file LeptonSkimming.h.

◆ vertex_point

reco::TrackBase::Point LeptonSkimming::vertex_point
private

Definition at line 125 of file LeptonSkimming.h.

Referenced by filter().

◆ vtxToken_

edm::EDGetTokenT<reco::VertexCollection> LeptonSkimming::vtxToken_
private

Definition at line 104 of file LeptonSkimming.h.

Referenced by filter().

◆ ZvertexTrg

float LeptonSkimming::ZvertexTrg = -1 * std::numeric_limits<float>::max()
private

Definition at line 123 of file LeptonSkimming.h.

Referenced by filter().