|
|
#include <RecoBTag/SoftLepton/plugin/SoftLepton.h>
Description: CMSSW EDProducer for soft lepton b tagging.
Implementation:
Description: CMSSW EDProducer wrapper for sot lepton b tagging.
Implementation: The actual tagging is performed by SoftLeptonAlgorithm.
Definition at line 50 of file SoftLepton.h.
◆ LeptonIds
◆ Leptons
◆ SoftLepton()
Definition at line 70 of file SoftLepton.cc.
93 produces<reco::SoftLeptonTagInfoCollection>();
◆ ~SoftLepton()
SoftLepton::~SoftLepton |
( |
void |
| ) |
|
|
override |
◆ boostedPPar()
Definition at line 421 of file SoftLepton.cc.
422 static const double lepton_mass = 0.00;
423 static const double jet_mass = 5.279;
424 ROOT::Math::LorentzVector<ROOT::Math::PxPyPzM4D<double> > lepton(
425 vector.Dot(axis) / axis.r(), Perp(
vector, axis), 0., lepton_mass);
426 ROOT::Math::LorentzVector<ROOT::Math::PxPyPzM4D<double> >
jet(axis.r(), 0., 0., jet_mass);
427 ROOT::Math::BoostX
boost(-
jet.Beta());
428 return boost(lepton).x();
References metsig::jet, and trackerHitRTTI::vector.
Referenced by tag().
◆ fillDescriptions()
◆ produce()
Definition at line 100 of file SoftLepton.cc.
110 std::vector<edm::RefToBase<reco::Jet> >
jets;
111 std::vector<reco::TrackRefVector>
tracks;
121 for (
unsigned int i = 0;
i <
size; ++
i) {
122 jets[
i] = (*h_jtas)[
i].first;
133 unsigned int size = h_jets->size();
136 for (
unsigned int i = 0;
i < h_jets->size();
i++)
137 jets[
i] = h_jets->refAt(
i);
144 <<
" of type among (\"reco::JetTracksAssociationCollection\", \"edm::View<reco::Jet>\") not found";
152 if (h_primaryVertex.
isValid() and not h_primaryVertex->empty())
153 vertex = h_primaryVertex->front();
176 leptonId = SoftLeptonProperties::Quality::egammaElectronId;
180 id[SoftLeptonProperties::Quality::pfElectronId] =
electron->mva_e_pi();
182 id[SoftLeptonProperties::Quality::btagElectronCands] =
194 leptonId = SoftLeptonProperties::Quality::egammaElectronId;
198 id[SoftLeptonProperties::Quality::btagElectronCands] =
210 leptonId = SoftLeptonProperties::Quality::egammaElectronId;
211 for (reco::PFCandidateCollection::const_iterator
electron = h_electrons->begin();
215 if (
electron->gsfTrackRef().isNonnull())
217 else if (
electron->trackRef().isNonnull())
221 (*id)[SoftLeptonProperties::Quality::pfElectronId] =
electron->mva_e_pi();
223 (*id)[SoftLeptonProperties::Quality::btagElectronCands] =
238 if (
muon->globalTrack().isNonnull())
240 else if (
muon->innerTrack().isNonnull())
242 else if (
muon->outerTrack().isNonnull())
248 (*id)[SoftLeptonProperties::Quality::btagMuonCands] =
260 for (
unsigned int i = 0;
i < h_tracks->size();
i++) {
263 id[SoftLeptonProperties::Quality::btagLeptonCands] = (*h_leptonCands)[h_tracks->refAt(
i)];
270 <<
" of type among (\"edm::View<reco::GsfElectron>\", "
271 "\"edm::View<reco::Muon>\", \"edm::View<reco::Track>\") !found";
279 for (Leptons::iterator lepton =
leptons.begin(); lepton !=
leptons.end(); ++lepton)
280 lepton->second[
leptonId] = (*h_leptonId)[lepton->first];
284 auto outputCollection = std::make_unique<reco::SoftLeptonTagInfoCollection>();
285 for (
unsigned int i = 0;
i <
jets.size(); ++
i) {
287 outputCollection->push_back(
result);
References edm::View< T >::begin(), metsig::electron, edm::View< T >::end(), Exception, get, mps_fire::i, triggerObjects_cff::id, HLT_FULL_cff::InputTag, muon::isGoodMuon(), edm::HandleBase::isValid(), singleTopDQM_cfi::jets, HLT_FULL_cff::leptonId, HLT_FULL_cff::leptons, m_jets, m_leptonCands, m_leptonId, m_leptons, m_muonSelection, m_transientTrackBuilder, eostools::move(), HLT_FULL_cff::muon, edm::errors::NotFound, edm::ESHandle< T >::product(), edm::View< T >::refAt(), mps_fire::result, s_nominalBeamSpot, singleTopDQM_cfi::setup, edm::AssociationVector< KeyRefProd, CVal, KeyRef, SizeType, KeyReferenceHelper >::size(), findQualityFiles::size, tag(), token_electrons, token_gsfElectrons, token_jets, token_jtas, token_leptonCands, token_leptonId, token_muons, token_pfElectrons, token_primaryVertex, token_tracks, PDWG_EXOHSCP_cff::tracks, and bphysicsOniaDQM_cfi::vertex.
◆ refineJetAxis()
Definition at line 337 of file SoftLepton.cc.
345 double sum_eta_by_pT = 0.;
346 double sum_phi_by_pT = 0.;
357 eta_rel = (double)
track.eta() - axis.eta();
358 phi_rel = (double)
track.phi() - axis.phi();
359 while (phi_rel < -
M_PI)
361 while (phi_rel >
M_PI)
365 sum_phi_by_pT +=
perp * phi_rel;
366 sum_eta_by_pT +=
perp * eta_rel;
374 eta_rel = (double)
track.eta() - axis.eta();
375 phi_rel = (double)
track.phi() - axis.phi();
376 while (phi_rel < -
M_PI)
378 while (phi_rel >
M_PI)
382 sum_phi_by_pT -=
perp * phi_rel;
383 sum_eta_by_pT -=
perp * eta_rel;
388 math::RhoEtaPhiVector(axis.rho(), axis.eta() + sum_eta_by_pT / sum_pT, axis.phi() + sum_phi_by_pT / sum_pT);
396 sum +=
track.momentum();
402 sum -=
track.momentum();
References AXIS_CALORIMETRIC_NOLEPTON, AXIS_CHARGED_AVERAGE, AXIS_CHARGED_AVERAGE_NOLEPTON, AXIS_CHARGED_SUM, AXIS_CHARGED_SUM_NOLEPTON, edm::RefToBase< T >::isNonnull(), metsig::jet, M_PI, m_refineJetAxis, reco::TrackBase::momentum(), or, perp(), HLT_FULL_cff::track, and PDWG_EXOHSCP_cff::tracks.
Referenced by tag().
◆ relativeEta()
◆ tag()
Definition at line 293 of file SoftLepton.cc.
300 for (Leptons::const_iterator lepton =
leptons.begin(); lepton !=
leptons.end(); ++lepton) {
321 properties.
ptRel = Perp(lepton_momentum, axis);
324 properties.
ratio = lepton_momentum.R() / axis.R();
325 properties.
ratioRel = lepton_momentum.Dot(axis) / axis.Mag2();
327 for (LeptonIds::const_iterator iter = lepton->second.begin(); iter != lepton->second.end(); ++iter)
328 properties.
setQuality(static_cast<SoftLeptonProperties::Quality::Generic>(iter->first), iter->second);
330 info.insert(lepton->first, properties);
References boostedPPar(), TransientTrackBuilder::build(), reco::SoftLeptonProperties::deltaR, PbPb_ZMuSkimMuonDPG_cff::deltaR, reco::SoftLeptonProperties::etaRel, info(), electrons_cff::ip3d, metsig::jet, HLT_FULL_cff::leptons, m_chi2Cut, m_deltaRCut, m_transientTrackBuilder, reco::SoftLeptonProperties::p0Par, BeamMonitor_cff::primaryVertex, reco::SoftLeptonProperties::ptRel, reco::SoftLeptonProperties::ratio, reco::SoftLeptonProperties::ratioRel, refineJetAxis(), relativeEta(), reco::SoftLeptonProperties::setQuality(), IPTools::signedImpactParameter3D(), IPTools::signedTransverseImpactParameter(), Measurement1D::significance(), reco::SoftLeptonProperties::sip2d, reco::SoftLeptonProperties::sip2dsig, reco::SoftLeptonProperties::sip3d, reco::SoftLeptonProperties::sip3dsig, PDWG_EXOHSCP_cff::tracks, Measurement1D::value(), PV3DBase< T, PVType, FrameType >::x(), PV3DBase< T, PVType, FrameType >::y(), and PV3DBase< T, PVType, FrameType >::z().
Referenced by produce().
◆ m_chi2Cut
double SoftLepton::m_chi2Cut |
|
private |
◆ m_deltaRCut
double SoftLepton::m_deltaRCut |
|
private |
◆ m_jets
◆ m_leptonCands
◆ m_leptonId
◆ m_leptons
◆ m_muonSelection
◆ m_refineJetAxis
unsigned int SoftLepton::m_refineJetAxis |
|
private |
◆ m_transientTrackBuilder
◆ s_nominalBeamSpot
◆ token_electrons
◆ token_gsfElectrons
◆ token_jets
◆ token_jtas
◆ token_leptonCands
◆ token_leptonId
◆ token_muons
◆ token_pfElectrons
◆ token_primaryVertex
◆ token_tracks
T dot(const Basic3DVector &v) const
Scalar product, or "dot" product, with a vector of same type.
const edm::EDGetTokenT< reco::JetTracksAssociationCollection > token_jtas
T const * product() const
const_iterator begin() const
const edm::EDGetTokenT< reco::PFCandidateCollection > token_pfElectrons
std::map< edm::RefToBase< reco::Track >, LeptonIds, TrackCompare > Leptons
RefToBase< value_type > refAt(size_type i) const
const edm::EDGetTokenT< reco::VertexCollection > token_primaryVertex
const edm::InputTag m_jets
edm::RefToBase< reco::Track > TrackBaseRef
persistent reference to a Track, using views
Global3DVector GlobalVector
T perp() const
Magnitude of transverse component.
RhoEtaPhiVectorD RhoEtaPhiVector
spatial vector with cylindrical internal representation using pseudorapidity
primaryVertex
hltOfflineBeamSpot for HLTMON
bool isGoodMuon(const reco::Muon &muon, SelectionType type, reco::Muon::ArbitrationType arbitrationType=reco::Muon::SegmentAndTrackArbitration)
main GoodMuon wrapper call
std::map< unsigned int, float > LeptonIds
const edm::EDGetTokenT< edm::ValueMap< float > > token_leptonId
SelectionType
Selector type.
reco::SoftLeptonTagInfo tag(const edm::RefToBase< reco::Jet > &jet, const reco::TrackRefVector &tracks, const Leptons &leptons, const reco::Vertex &primaryVertex) const
static const reco::Vertex s_nominalBeamSpot
const edm::EDGetTokenT< edm::View< reco::Track > > token_tracks
bool exists(std::string const ¶meterName) const
checks if a parameter exists
double significance() const
const edm::EDGetTokenT< edm::ValueMap< float > > token_leptonCands
const edm::EDGetTokenT< edm::View< reco::Electron > > token_electrons
const edm::InputTag m_leptonId
XYZVectorD XYZVector
spatial vector with cartesian internal representation
edm::Ref< PFCandidateCollection > PFCandidateRef
persistent reference to a PFCandidate
const edm::EDGetTokenT< edm::View< reco::Muon > > token_muons
const edm::EDGetTokenT< edm::View< reco::Jet > > token_jets
const edm::InputTag m_leptons
static double relativeEta(const math::XYZVector &vector, const math::XYZVector &axis)
static double boostedPPar(const math::XYZVector &vector, const math::XYZVector &axis)
T mag() const
The vector magnitude. Equivalent to sqrt(vec.mag2())
muon::SelectionType m_muonSelection
const TransientTrackBuilder * m_transientTrackBuilder
bool isNonnull() const
Checks for non-null.
The Signals That Services Can Subscribe To This is based on ActivityRegistry and is current per Services can connect to the signals distributed by the ActivityRegistry in order to monitor the activity of the application Each possible callback has some defined which we here list in angle e< void, edm::EventID const &, edm::Timestamp const & > We also list in braces which AR_WATCH_USING_METHOD_ is used for those or
T getParameter(std::string const &) const
const edm::InputTag m_leptonCands
boost::indirect_iterator< typename seq_t::const_iterator > const_iterator
reco::TransientTrack build(const reco::Track *p) const
const_iterator end() const
GlobalVector refineJetAxis(const edm::RefToBase< reco::Jet > &jet, const reco::TrackRefVector &tracks, const edm::RefToBase< reco::Track > &exclude=edm::RefToBase< reco::Track >()) const
void setQuality(Quality::Generic qual, float value)
const Vector & momentum() const
track momentum vector
void addDefault(ParameterSetDescription const &psetDescription)
const edm::EDGetTokenT< edm::View< reco::GsfElectron > > token_gsfElectrons
unsigned int m_refineJetAxis