CMS 3D CMS Logo

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

#include <CandidateBoostedDoubleSecondaryVertexComputer.h>

Inheritance diagram for CandidateBoostedDoubleSecondaryVertexComputer:
JetTagComputer

Classes

struct  Tokens
 

Public Member Functions

 CandidateBoostedDoubleSecondaryVertexComputer (const edm::ParameterSet &parameters, Tokens tokens)
 
float discriminator (const TagInfoHelper &tagInfos) const override
 
void initialize (const JetTagComputerRecord &) override
 
- Public Member Functions inherited from JetTagComputer
const std::vector< std::string > & getInputLabels () const
 
 JetTagComputer ()
 
 JetTagComputer (const edm::ParameterSet &configuration)
 
float operator() (const reco::BaseTagInfo &info) const
 
float operator() (const TagInfoHelper &helper) const
 
void setupDone ()
 
virtual ~JetTagComputer ()
 

Private Attributes

std::unique_ptr< TMVAEvaluatormvaID
 
const Tokens tokens_
 
const bool useAdaBoost_
 
const bool useGBRForest_
 
const edm::FileInPath weightFile_
 

Additional Inherited Members

- Protected Member Functions inherited from JetTagComputer
virtual float discriminator (const reco::BaseTagInfo &) const
 
void uses (const std::string &label)
 
void uses (unsigned int id, const std::string &label)
 

Detailed Description

Definition at line 10 of file CandidateBoostedDoubleSecondaryVertexComputer.h.

Constructor & Destructor Documentation

◆ CandidateBoostedDoubleSecondaryVertexComputer()

CandidateBoostedDoubleSecondaryVertexComputer::CandidateBoostedDoubleSecondaryVertexComputer ( const edm::ParameterSet parameters,
Tokens  tokens 
)

Definition at line 20 of file CandidateBoostedDoubleSecondaryVertexComputer.cc.

22  : weightFile_(parameters.existsAs<edm::FileInPath>("weightFile")
23  ? parameters.getParameter<edm::FileInPath>("weightFile")
24  : edm::FileInPath()),
25  useGBRForest_(parameters.existsAs<bool>("useGBRForest") ? parameters.getParameter<bool>("useGBRForest") : false),
26  useAdaBoost_(parameters.existsAs<bool>("useAdaBoost") ? parameters.getParameter<bool>("useAdaBoost") : false),
27  tokens_{std::move(tokens)} {
28  uses(0, "svTagInfos");
29 
30  mvaID.reset(new TMVAEvaluator());
31 }

References eostools::move().

Member Function Documentation

◆ discriminator()

float CandidateBoostedDoubleSecondaryVertexComputer::discriminator ( const TagInfoHelper tagInfos) const
overridevirtual

Reimplemented from JetTagComputer.

Definition at line 72 of file CandidateBoostedDoubleSecondaryVertexComputer.cc.

72  {
73  // get the TagInfo
75 
76  // get the TaggingVariables
77  const reco::TaggingVariableList vars = bdsvTagInfo.taggingVariables();
78 
79  // default discriminator value
80  float value = -10.;
81 
82  std::map<std::string, float> inputs;
83  inputs["z_ratio"] = vars.get(reco::btau::z_ratio);
84  inputs["trackSipdSig_3"] = vars.get(reco::btau::trackSip3dSig_3);
85  inputs["trackSipdSig_2"] = vars.get(reco::btau::trackSip3dSig_2);
86  inputs["trackSipdSig_1"] = vars.get(reco::btau::trackSip3dSig_1);
87  inputs["trackSipdSig_0"] = vars.get(reco::btau::trackSip3dSig_0);
88  inputs["trackSipdSig_1_0"] = vars.get(reco::btau::tau2_trackSip3dSig_0);
89  inputs["trackSipdSig_0_0"] = vars.get(reco::btau::tau1_trackSip3dSig_0);
90  inputs["trackSipdSig_1_1"] = vars.get(reco::btau::tau2_trackSip3dSig_1);
91  inputs["trackSipdSig_0_1"] = vars.get(reco::btau::tau1_trackSip3dSig_1);
92  inputs["trackSip2dSigAboveCharm_0"] = vars.get(reco::btau::trackSip2dSigAboveCharm);
93  inputs["trackSip2dSigAboveBottom_0"] = vars.get(reco::btau::trackSip2dSigAboveBottom_0);
94  inputs["trackSip2dSigAboveBottom_1"] = vars.get(reco::btau::trackSip2dSigAboveBottom_1);
95  inputs["tau1_trackEtaRel_0"] = vars.get(reco::btau::tau2_trackEtaRel_0);
96  inputs["tau1_trackEtaRel_1"] = vars.get(reco::btau::tau2_trackEtaRel_1);
97  inputs["tau1_trackEtaRel_2"] = vars.get(reco::btau::tau2_trackEtaRel_2);
98  inputs["tau0_trackEtaRel_0"] = vars.get(reco::btau::tau1_trackEtaRel_0);
99  inputs["tau0_trackEtaRel_1"] = vars.get(reco::btau::tau1_trackEtaRel_1);
100  inputs["tau0_trackEtaRel_2"] = vars.get(reco::btau::tau1_trackEtaRel_2);
101  inputs["tau_vertexMass_0"] = vars.get(reco::btau::tau1_vertexMass);
102  inputs["tau_vertexEnergyRatio_0"] = vars.get(reco::btau::tau1_vertexEnergyRatio);
103  inputs["tau_vertexDeltaR_0"] = vars.get(reco::btau::tau1_vertexDeltaR);
104  inputs["tau_flightDistance2dSig_0"] = vars.get(reco::btau::tau1_flightDistance2dSig);
105  inputs["tau_vertexMass_1"] = vars.get(reco::btau::tau2_vertexMass);
106  inputs["tau_vertexEnergyRatio_1"] = vars.get(reco::btau::tau2_vertexEnergyRatio);
107  inputs["tau_flightDistance2dSig_1"] = vars.get(reco::btau::tau2_flightDistance2dSig);
108  inputs["jetNTracks"] = vars.get(reco::btau::jetNTracks);
110 
111  // evaluate the MVA
112  value = mvaID->evaluate(inputs);
113 
114  // return the final discriminator value
115  return value;
116 }

References PixelMapPlotter::inputs, reco::btau::jetNSecondaryVertices, reco::btau::jetNTracks, mvaID, reco::BoostedDoubleSVTagInfo::taggingVariables(), dumpRecoGeometry_cfg::tagInfo, reco::btau::tau1_flightDistance2dSig, reco::btau::tau1_trackEtaRel_0, reco::btau::tau1_trackEtaRel_1, reco::btau::tau1_trackEtaRel_2, reco::btau::tau1_trackSip3dSig_0, reco::btau::tau1_trackSip3dSig_1, reco::btau::tau1_vertexDeltaR, reco::btau::tau1_vertexEnergyRatio, reco::btau::tau1_vertexMass, reco::btau::tau2_flightDistance2dSig, reco::btau::tau2_trackEtaRel_0, reco::btau::tau2_trackEtaRel_1, reco::btau::tau2_trackEtaRel_2, reco::btau::tau2_trackSip3dSig_0, reco::btau::tau2_trackSip3dSig_1, reco::btau::tau2_vertexEnergyRatio, reco::btau::tau2_vertexMass, reco::btau::trackSip2dSigAboveBottom_0, reco::btau::trackSip2dSigAboveBottom_1, reco::btau::trackSip2dSigAboveCharm, reco::btau::trackSip3dSig_0, reco::btau::trackSip3dSig_1, reco::btau::trackSip3dSig_2, reco::btau::trackSip3dSig_3, relativeConstraints::value, and reco::btau::z_ratio.

◆ initialize()

void CandidateBoostedDoubleSecondaryVertexComputer::initialize ( const JetTagComputerRecord record)
overridevirtual

Reimplemented from JetTagComputer.

Definition at line 33 of file CandidateBoostedDoubleSecondaryVertexComputer.cc.

33  {
34  // variable names and order need to be the same as in the training
35  std::vector<std::string> variables({"z_ratio",
36  "trackSipdSig_3",
37  "trackSipdSig_2",
38  "trackSipdSig_1",
39  "trackSipdSig_0",
40  "trackSipdSig_1_0",
41  "trackSipdSig_0_0",
42  "trackSipdSig_1_1",
43  "trackSipdSig_0_1",
44  "trackSip2dSigAboveCharm_0",
45  "trackSip2dSigAboveBottom_0",
46  "trackSip2dSigAboveBottom_1",
47  "tau0_trackEtaRel_0",
48  "tau0_trackEtaRel_1",
49  "tau0_trackEtaRel_2",
50  "tau1_trackEtaRel_0",
51  "tau1_trackEtaRel_1",
52  "tau1_trackEtaRel_2",
53  "tau_vertexMass_0",
54  "tau_vertexEnergyRatio_0",
55  "tau_vertexDeltaR_0",
56  "tau_flightDistance2dSig_0",
57  "tau_vertexMass_1",
58  "tau_vertexEnergyRatio_1",
59  "tau_flightDistance2dSig_1",
60  "jetNTracks",
61  "nSV"});
62  // book TMVA readers
63  std::vector<std::string> spectators({"massPruned", "flavour", "nbHadrons", "ptPruned", "etaPruned"});
64 
66  mvaID->initializeGBRForest(&record.get(tokens_.gbrForest_), variables, spectators, useAdaBoost_);
67  } else
68  mvaID->initialize(
69  "Color:Silent:Error", "BDT", weightFile_.fullPath(), variables, spectators, useGBRForest_, useAdaBoost_);
70 }

References edm::FileInPath::fullPath(), CandidateBoostedDoubleSecondaryVertexComputer::Tokens::gbrForest_, edm::ESGetToken< ESProduct, ESRecord >::isInitialized(), mvaID, GlobalPosition_Frontier_DevDB_cff::record, candidateCombinedMVAV2Computer_cfi::spectators, tokens_, useAdaBoost_, useGBRForest_, L1TEGammaDiff_cfi::variables, and weightFile_.

Member Data Documentation

◆ mvaID

std::unique_ptr<TMVAEvaluator> CandidateBoostedDoubleSecondaryVertexComputer::mvaID
private

Definition at line 28 of file CandidateBoostedDoubleSecondaryVertexComputer.h.

Referenced by discriminator(), and initialize().

◆ tokens_

const Tokens CandidateBoostedDoubleSecondaryVertexComputer::tokens_
private

Definition at line 26 of file CandidateBoostedDoubleSecondaryVertexComputer.h.

Referenced by initialize().

◆ useAdaBoost_

const bool CandidateBoostedDoubleSecondaryVertexComputer::useAdaBoost_
private

Definition at line 25 of file CandidateBoostedDoubleSecondaryVertexComputer.h.

Referenced by initialize().

◆ useGBRForest_

const bool CandidateBoostedDoubleSecondaryVertexComputer::useGBRForest_
private

Definition at line 24 of file CandidateBoostedDoubleSecondaryVertexComputer.h.

Referenced by initialize().

◆ weightFile_

const edm::FileInPath CandidateBoostedDoubleSecondaryVertexComputer::weightFile_
private

Definition at line 23 of file CandidateBoostedDoubleSecondaryVertexComputer.h.

Referenced by initialize().

reco::btau::tau2_trackEtaRel_1
Definition: TaggingVariable.h:145
reco::btau::tau1_vertexEnergyRatio
Definition: TaggingVariable.h:148
reco::btau::trackSip2dSigAboveBottom_0
Definition: TaggingVariable.h:139
reco::btau::tau2_trackEtaRel_2
Definition: TaggingVariable.h:146
L1TEGammaDiff_cfi.variables
variables
Definition: L1TEGammaDiff_cfi.py:5
candidateCombinedMVAV2Computer_cfi.spectators
spectators
Definition: candidateCombinedMVAV2Computer_cfi.py:15
reco::btau::trackSip2dSigAboveCharm
Definition: TaggingVariable.h:90
reco::TaggingVariableList
Definition: TaggingVariable.h:194
GlobalPosition_Frontier_DevDB_cff.record
record
Definition: GlobalPosition_Frontier_DevDB_cff.py:10
reco::btau::trackSip2dSigAboveBottom_1
Definition: TaggingVariable.h:140
CandidateBoostedDoubleSecondaryVertexComputer::useGBRForest_
const bool useGBRForest_
Definition: CandidateBoostedDoubleSecondaryVertexComputer.h:24
reco::btau::tau2_trackEtaRel_0
Definition: TaggingVariable.h:144
CandidateBoostedDoubleSecondaryVertexComputer::Tokens::gbrForest_
edm::ESGetToken< GBRForest, GBRWrapperRcd > gbrForest_
Definition: CandidateBoostedDoubleSecondaryVertexComputer.h:14
reco::btau::tau2_flightDistance2dSig
Definition: TaggingVariable.h:153
edm::ESGetToken::isInitialized
constexpr bool isInitialized() const noexcept
Definition: ESGetToken.h:52
parameters
parameters
Definition: BeamSpot_PayloadInspector.cc:14
TMVAEvaluator
Definition: TMVAEvaluator.h:16
edm::FileInPath
Definition: FileInPath.h:64
vars
vars
Definition: DeepTauId.cc:163
CandidateBoostedDoubleSecondaryVertexComputer::weightFile_
const edm::FileInPath weightFile_
Definition: CandidateBoostedDoubleSecondaryVertexComputer.h:23
reco::btau::trackSip3dSig_2
Definition: TaggingVariable.h:133
reco::btau::trackSip3dSig_3
Definition: TaggingVariable.h:134
reco::btau::trackSip3dSig_0
Definition: TaggingVariable.h:131
CandidateBoostedDoubleSecondaryVertexComputer::useAdaBoost_
const bool useAdaBoost_
Definition: CandidateBoostedDoubleSecondaryVertexComputer.h:25
CandidateBoostedDoubleSecondaryVertexComputer::tokens_
const Tokens tokens_
Definition: CandidateBoostedDoubleSecondaryVertexComputer.h:26
reco::btau::z_ratio
Definition: TaggingVariable.h:155
reco::btau::trackSip3dSig_1
Definition: TaggingVariable.h:132
reco::btau::tau1_trackEtaRel_0
Definition: TaggingVariable.h:141
reco::btau::jetNSecondaryVertices
Definition: TaggingVariable.h:72
reco::BoostedDoubleSVTagInfo
Definition: BoostedDoubleSVTagInfo.h:12
reco::btau::tau2_trackSip3dSig_0
Definition: TaggingVariable.h:137
value
Definition: value.py:1
PixelMapPlotter.inputs
inputs
Definition: PixelMapPlotter.py:490
reco::btau::tau1_trackEtaRel_1
Definition: TaggingVariable.h:142
reco::btau::tau1_vertexDeltaR
Definition: TaggingVariable.h:150
JetTagComputer::uses
void uses(unsigned int id, const std::string &label)
Definition: JetTagComputer.cc:17
reco::btau::tau1_trackSip3dSig_0
Definition: TaggingVariable.h:135
reco::btau::tau2_vertexEnergyRatio
Definition: TaggingVariable.h:152
reco::btau::tau1_trackEtaRel_2
Definition: TaggingVariable.h:143
eostools.move
def move(src, dest)
Definition: eostools.py:511
reco::btau::tau2_vertexMass
Definition: TaggingVariable.h:151
reco::btau::tau2_trackSip3dSig_1
Definition: TaggingVariable.h:138
relativeConstraints.value
value
Definition: relativeConstraints.py:53
reco::BoostedDoubleSVTagInfo::taggingVariables
TaggingVariableList taggingVariables(void) const override
returns a description of the extended informations in a TaggingVariableList
Definition: BoostedDoubleSVTagInfo.h:26
reco::btau::jetNTracks
Definition: TaggingVariable.h:37
dumpRecoGeometry_cfg.tagInfo
tagInfo
Definition: dumpRecoGeometry_cfg.py:194
CandidateBoostedDoubleSecondaryVertexComputer::mvaID
std::unique_ptr< TMVAEvaluator > mvaID
Definition: CandidateBoostedDoubleSecondaryVertexComputer.h:28
reco::btau::tau1_vertexMass
Definition: TaggingVariable.h:147
reco::btau::tau1_trackSip3dSig_1
Definition: TaggingVariable.h:136
reco::btau::tau1_flightDistance2dSig
Definition: TaggingVariable.h:149
edm::FileInPath::fullPath
std::string fullPath() const
Definition: FileInPath.cc:163