CMS 3D CMS Logo

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

#include <CombinedSVSoftLeptonComputer.h>

Inheritance diagram for CombinedSVSoftLeptonComputer:
CombinedSVComputer

Public Member Functions

 CombinedSVSoftLeptonComputer (const edm::ParameterSet &params)
 
double flipSoftLeptonValue (double value) const
 
template<class IPTI , class SVTI >
reco::TaggingVariableList operator() (const IPTI &ipInfo, const SVTI &svInfo, const reco::CandSoftLeptonTagInfo &muonInfo, const reco::CandSoftLeptonTagInfo &elecInfo) const
 
 ~CombinedSVSoftLeptonComputer () override=default
 
- Public Member Functions inherited from CombinedSVComputer
 CombinedSVComputer (const edm::ParameterSet &params)
 
edm::ParameterSet dropDeltaR (const edm::ParameterSet &pset) const
 
template<class SVTI , class IPTI >
void fillCommonVariables (reco::TaggingVariableList &vars, reco::TrackKinematics &vertexKinematics, const IPTI &ipInfo, const SVTI &svInfo, double &vtx_track_ptSum, double &vtx_track_ESum) const
 
IterationRange flipIterate (int size, bool vertex) const
 
double flipValue (double value, bool vertex) const
 
virtual reco::TaggingVariableList operator() (const reco::TrackIPTagInfo &ipInfo, const reco::SecondaryVertexTagInfo &svInfo) const
 
virtual reco::TaggingVariableList operator() (const reco::CandIPTagInfo &ipInfo, const reco::CandSecondaryVertexTagInfo &svInfo) const
 
const reco::btag::TrackIPDatathreshTrack (const reco::CandIPTagInfo &trackIPTagInfo, const reco::btag::SortCriteria sort, const reco::Jet &jet, const GlobalPoint &pv) const
 
const reco::btag::TrackIPDatathreshTrack (const reco::TrackIPTagInfo &trackIPTagInfo, const reco::btag::SortCriteria sort, const reco::Jet &jet, const GlobalPoint &pv) const
 
virtual ~CombinedSVComputer ()=default
 

Private Attributes

bool SoftLeptonFlip
 

Detailed Description

Definition at line 13 of file CombinedSVSoftLeptonComputer.h.

Constructor & Destructor Documentation

CombinedSVSoftLeptonComputer::CombinedSVSoftLeptonComputer ( const edm::ParameterSet params)
explicit

Definition at line 6 of file CombinedSVSoftLeptonComputer.cc.

7  : CombinedSVComputer(params), SoftLeptonFlip(params.getParameter<bool>("SoftLeptonFlip")) {}
T getParameter(std::string const &) const
CombinedSVComputer(const edm::ParameterSet &params)
CombinedSVSoftLeptonComputer::~CombinedSVSoftLeptonComputer ( )
overridedefault

Member Function Documentation

double CombinedSVSoftLeptonComputer::flipSoftLeptonValue ( double  value) const
template<class IPTI , class SVTI >
reco::TaggingVariableList CombinedSVSoftLeptonComputer::operator() ( const IPTI &  ipInfo,
const SVTI &  svInfo,
const reco::CandSoftLeptonTagInfo muonInfo,
const reco::CandSoftLeptonTagInfo elecInfo 
) const

Definition at line 32 of file CombinedSVSoftLeptonComputer.h.

References reco::TaggingVariableList::checkTag(), reco::SoftLeptonProperties::deltaR, reco::SoftLeptonProperties::etaRel, reco::TaggingVariableList::finalize(), flipSoftLeptonValue(), reco::TaggingVariableList::get(), mps_fire::i, reco::TaggingVariableList::insert(), createfilelist::int, reco::btau::leptonDeltaR, reco::btau::leptonEtaRel, reco::btau::leptonPtRel, reco::btau::leptonRatio, reco::btau::leptonRatioRel, reco::TemplatedSoftLeptonTagInfo< REF >::leptons(), reco::btau::leptonSip3d, CombinedSVComputer::operator()(), reco::TemplatedSoftLeptonTagInfo< REF >::properties(), reco::btag::Vertices::PseudoVertex, reco::SoftLeptonProperties::ptRel, reco::SoftLeptonProperties::ratio, reco::SoftLeptonProperties::ratioRel, reco::btag::Vertices::RecoVertex, reco::SoftLeptonProperties::sip3d, reco::btau::vertexCategory, and reco::btau::vertexLeptonCategory.

35  {
36  using namespace reco;
37 
38  // call the inherited operator()
40 
41  //Jets with vtxCategory 99 cause problems
42  unsigned int vtxType =
43  (vars.checkTag(reco::btau::vertexCategory) ? (unsigned int)(vars.get(reco::btau::vertexCategory)) : 99);
44  if (vtxType == 99)
45  return vars;
46 
47  // the following is specific to soft leptons
48  int leptonCategory = 0; // 0 = no lepton, 1 = muon, 2 = electron
49 
50  for (unsigned int i = 0; i < muonInfo.leptons();
51  ++i) // loop over all muons, not optimal -> find the best or use ranking from best to worst
52  {
53  leptonCategory = 1; // muon category
54  const SoftLeptonProperties &propertiesMuon = muonInfo.properties(i);
55  vars.insert(btau::leptonPtRel, propertiesMuon.ptRel, true);
56  vars.insert(btau::leptonSip3d, flipSoftLeptonValue(propertiesMuon.sip3d), true);
57  vars.insert(btau::leptonDeltaR, propertiesMuon.deltaR, true);
58  vars.insert(btau::leptonRatioRel, propertiesMuon.ratioRel, true);
59  vars.insert(btau::leptonEtaRel, propertiesMuon.etaRel, true);
60  vars.insert(btau::leptonRatio, propertiesMuon.ratio, true);
61  }
62 
63  if (leptonCategory != 1) // no soft muon found, try soft electron
64  {
65  for (unsigned int i = 0; i < elecInfo.leptons();
66  ++i) // loop over all electrons, not optimal -> find the best or use ranking from best to worst
67  {
68  leptonCategory = 2; // electron category
69  const SoftLeptonProperties &propertiesElec = elecInfo.properties(i);
70  vars.insert(btau::leptonPtRel, propertiesElec.ptRel, true);
71  vars.insert(btau::leptonSip3d, flipSoftLeptonValue(propertiesElec.sip3d), true);
72  vars.insert(btau::leptonDeltaR, propertiesElec.deltaR, true);
73  vars.insert(btau::leptonRatioRel, propertiesElec.ratioRel, true);
74  vars.insert(btau::leptonEtaRel, propertiesElec.etaRel, true);
75  vars.insert(btau::leptonRatio, propertiesElec.ratio, true);
76  }
77  }
78 
79  // set the default value for vertexLeptonCategory to 2 (= NoVertexNoSoftLepton)
80  int vertexLepCat = 2;
81 
82  if (leptonCategory == 0) // no soft lepton
83  {
84  if (vtxType == (unsigned int)(btag::Vertices::RecoVertex))
85  vertexLepCat = 0;
86  else if (vtxType == (unsigned int)(btag::Vertices::PseudoVertex))
87  vertexLepCat = 1;
88  else
89  vertexLepCat = 2;
90  } else if (leptonCategory == 1) // soft muon
91  {
92  if (vtxType == (unsigned int)(btag::Vertices::RecoVertex))
93  vertexLepCat = 3;
94  else if (vtxType == (unsigned int)(btag::Vertices::PseudoVertex))
95  vertexLepCat = 4;
96  else
97  vertexLepCat = 5;
98  } else if (leptonCategory == 2) // soft electron
99  {
100  if (vtxType == (unsigned int)(btag::Vertices::RecoVertex))
101  vertexLepCat = 6;
102  else if (vtxType == (unsigned int)(btag::Vertices::PseudoVertex))
103  vertexLepCat = 7;
104  else
105  vertexLepCat = 8;
106  }
107  vars.insert(btau::vertexLeptonCategory, vertexLepCat, true);
108 
109  vars.finalize();
110  return vars;
111 }
bool checkTag(TaggingVariableName tag) const
virtual reco::TaggingVariableList operator()(const reco::TrackIPTagInfo &ipInfo, const reco::SecondaryVertexTagInfo &svInfo) const
double flipSoftLeptonValue(double value) const
const SoftLeptonProperties & properties(size_t i) const
TaggingValue get(TaggingVariableName tag) const
fixed size matrix
vars
Definition: DeepTauId.cc:158
void insert(const TaggingVariable &variable, bool delayed=false)

Member Data Documentation

bool CombinedSVSoftLeptonComputer::SoftLeptonFlip
private

Definition at line 26 of file CombinedSVSoftLeptonComputer.h.

Referenced by flipSoftLeptonValue().