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::CandIPTagInfo &ipInfo, const reco::CandSecondaryVertexTagInfo &svInfo) const
 
virtual reco::TaggingVariableList operator() (const reco::TrackIPTagInfo &ipInfo, const reco::SecondaryVertexTagInfo &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 14 of file CombinedSVSoftLeptonComputer.h.

Constructor & Destructor Documentation

◆ CombinedSVSoftLeptonComputer()

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

Definition at line 6 of file CombinedSVSoftLeptonComputer.cc.

7  : CombinedSVComputer(params), SoftLeptonFlip(params.getParameter<bool>("SoftLeptonFlip")) {}

◆ ~CombinedSVSoftLeptonComputer()

CombinedSVSoftLeptonComputer::~CombinedSVSoftLeptonComputer ( )
overridedefault

Member Function Documentation

◆ flipSoftLeptonValue()

double CombinedSVSoftLeptonComputer::flipSoftLeptonValue ( double  value) const

Definition at line 30 of file CombinedSVSoftLeptonComputer.h.

30 { return SoftLeptonFlip ? -value : value; }

References SoftLeptonFlip, and relativeConstraints::value.

Referenced by operator()().

◆ operator()()

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 33 of file CombinedSVSoftLeptonComputer.h.

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

References reco::SoftLeptonProperties::deltaR, reco::SoftLeptonProperties::etaRel, flipSoftLeptonValue(), mps_fire::i, 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.

Member Data Documentation

◆ SoftLeptonFlip

bool CombinedSVSoftLeptonComputer::SoftLeptonFlip
private

Definition at line 27 of file CombinedSVSoftLeptonComputer.h.

Referenced by flipSoftLeptonValue().

CombinedSVSoftLeptonComputer::flipSoftLeptonValue
double flipSoftLeptonValue(double value) const
Definition: CombinedSVSoftLeptonComputer.h:30
mps_fire.i
i
Definition: mps_fire.py:428
reco::SoftLeptonProperties
Definition: TemplatedSoftLeptonTagInfo.h:15
reco::SoftLeptonProperties::sip3d
float sip3d
Definition: TemplatedSoftLeptonTagInfo.h:34
reco::TemplatedSoftLeptonTagInfo::leptons
unsigned int leptons(void) const
Definition: TemplatedSoftLeptonTagInfo.h:118
reco::btau::vertexCategory
Definition: TaggingVariable.h:69
CalibrationSummaryClient_cfi.params
params
Definition: CalibrationSummaryClient_cfi.py:14
reco::btau::leptonEtaRel
Definition: TaggingVariable.h:124
reco::TaggingVariableList
Definition: TaggingVariable.h:194
reco::btag::Vertices::PseudoVertex
Definition: VertexTypes.h:18
reco
fixed size matrix
Definition: AlignmentAlgorithmBase.h:45
reco::btau::leptonDeltaR
Definition: TaggingVariable.h:125
reco::btau::vertexLeptonCategory
Definition: TaggingVariable.h:70
reco::SoftLeptonProperties::etaRel
float etaRel
Definition: TemplatedSoftLeptonTagInfo.h:38
vars
vars
Definition: DeepTauId.cc:164
reco::btag::Vertices::RecoVertex
Definition: VertexTypes.h:18
reco::SoftLeptonProperties::ratio
float ratio
Definition: TemplatedSoftLeptonTagInfo.h:40
reco::SoftLeptonProperties::ptRel
float ptRel
Definition: TemplatedSoftLeptonTagInfo.h:35
CombinedSVSoftLeptonComputer::SoftLeptonFlip
bool SoftLeptonFlip
Definition: CombinedSVSoftLeptonComputer.h:27
createfilelist.int
int
Definition: createfilelist.py:10
reco::SoftLeptonProperties::deltaR
float deltaR
Definition: TemplatedSoftLeptonTagInfo.h:39
relativeConstraints.value
value
Definition: relativeConstraints.py:53
CombinedSVComputer::CombinedSVComputer
CombinedSVComputer(const edm::ParameterSet &params)
Definition: CombinedSVComputer.cc:11
reco::TemplatedSoftLeptonTagInfo::properties
const SoftLeptonProperties & properties(size_t i) const
Definition: TemplatedSoftLeptonTagInfo.h:122
reco::btau::leptonSip3d
Definition: TaggingVariable.h:121
reco::btau::leptonRatio
Definition: TaggingVariable.h:126
reco::SoftLeptonProperties::ratioRel
float ratioRel
Definition: TemplatedSoftLeptonTagInfo.h:41
reco::btau::leptonPtRel
Definition: TaggingVariable.h:122
CombinedSVComputer::operator()
virtual reco::TaggingVariableList operator()(const reco::TrackIPTagInfo &ipInfo, const reco::SecondaryVertexTagInfo &svInfo) const
Definition: CombinedSVComputer.cc:133
reco::btau::leptonRatioRel
Definition: TaggingVariable.h:127