ATLAS Offline Software
Functions
BTaggingEigenVectorRecompositionToolTester.cxx File Reference
#include <AsgTools/StandaloneToolHandle.h>
#include <AsgTools/ToolHandle.h>
#include "FTagAnalysisInterfaces/IBTaggingEfficiencyTool.h"
#include "FTagAnalysisInterfaces/IBTaggingEigenVectorRecompositionTool.h"
Include dependency graph for BTaggingEigenVectorRecompositionToolTester.cxx:

Go to the source code of this file.

Functions

int main ()
 

Function Documentation

◆ main()

int main ( )

getCoefficientMap(label, EigenIdxList)

input value:

  1. label: falvor label in std::string format, could be one of B, C, T, Light
  2. EigenIdxList is user defined vector containing all eigenvector index that user interested in. output: Map of format map<string, map<string, float>> containing decomposition coefficient of the list of eigenvectors defined by EigenIdxList.

getCoefficients(label, evIdx)

input value:

  1. label: falvor label in std::string format, could be one of B, C, T, Light
  2. evIdx: The index of eigenvector user interested in. output value: vector of coefficient values. The order is the same as output given by getListOfOriginalNuisanceParameters()

getListOfOriginalNuisanceParameters(label)

input value:

  1. label: falvor label in std::string format, could be one of B, C, T, Light output value: List of original nuisance parameter names.

getNumEigenVectors(label)

input value:

  1. label: falvor label in std::string format, could be one of B, C, T, Light return value: number of eigen vectors used for chosen label. Return 0 if error occured.

Definition at line 12 of file BTaggingEigenVectorRecompositionToolTester.cxx.

12  {
13  bool retval = true;
14 
15  std::string taggerName = "MV2c10";
16  std::string workingPointName = "Continuous";
17 
18  asg::StandaloneToolHandle<IBTaggingEfficiencyTool> btag_eff_tool("BTaggingEfficiencyTool/BTagEffTest");
19  StatusCode code1 = btag_eff_tool.setProperty("ScaleFactorFileName","xAODBTaggingEfficiency/13TeV/2017-21-13TeV-MC16-CDI-2019-07-30_v1.root" );
20  StatusCode code2 = btag_eff_tool.setProperty("TaggerName", taggerName );
21  StatusCode code3 = btag_eff_tool.setProperty("OperatingPoint", workingPointName);
22  StatusCode code4 = btag_eff_tool.setProperty("JetAuthor", "AntiKt4EMTopoJets" );
23  StatusCode code5 = btag_eff_tool.setProperty("MinPt", 20. );
24  // Exclude certain original uncertainties from Eigenvector scheme so that
25  // it these uncertainties will be exclude from eigen vector recomposition.
26  // The original uncertainty names are separated by semicolon.
27  // Here exclude two uncertainties as an example.
28  // StatusCode code0 = btag_eff_tool.setProperty("ExcludeFromEigenVectorBTreatment","FT_EFF_PDF4LHC_np_19;JET_EffectiveNP_Mixed3");
29  StatusCode code6 = btag_eff_tool.initialize();
30  if (code1 != StatusCode::SUCCESS
31  || code2 != StatusCode::SUCCESS
32  || code3 != StatusCode::SUCCESS
33  || code4 != StatusCode::SUCCESS
34  || code5 != StatusCode::SUCCESS
35  || code6 != StatusCode::SUCCESS ){
36  std::cout << "Initialization of tool " << btag_eff_tool->name() << " failed! " << std::endl;
37  return -1;
38  }
39  else {
40  std::cout << "Initialization of tool " << btag_eff_tool->name() << " finished." << std::endl;
41  }
42 
43  asg::StandaloneToolHandle<IBTaggingEigenVectorRecompositionTool> evr_tool("BTaggingEigenVectorRecompositionTool/BTagEVRTest");
44  StatusCode code7 = evr_tool.setProperty("BTaggingEfficiencyTool", btag_eff_tool);
45  StatusCode code8 = evr_tool.initialize();
46  if (code7 != StatusCode::SUCCESS
47  ||code8 != StatusCode::SUCCESS ) {
48  std::cout << "Initialization of tool" << evr_tool->name() << " failed!" << std::endl;
49  } else {
50  std::cout << "Initialization of tool " << evr_tool->name() << " finished." << std::endl;
51  }
52 
53  const std::string label = "B";
54  const unsigned int evIdx = 0;
55 
67  std::vector<unsigned int> eigenIdxList = {1,2,3,4,5};
68  std::map<std::string, std::map<std::string, float>> coefficientMap = evr_tool->getCoefficientMap(label, eigenIdxList);
69 
80  std::vector<float> coeffs = evr_tool->getCoefficients(label, evIdx);
81 
90  std::vector<std::string> orig_nps = evr_tool->getListOfOriginalNuisanceParameters(label);
91 
100  int nEigen = evr_tool->getNumEigenVectors("B");
101  if (nEigen >= 0){
102  std::cout<<"There are "<<nEigen
103  <<" eigen vectors for flavour B."<<std::endl;
104  }
105 
106  return retval;
107 
108 }
PlotCalibFromCool.label
label
Definition: PlotCalibFromCool.py:78
LArCellBinning_test.retval
def retval
Definition: LArCellBinning_test.py:112
perfmonmt-refit.coeffs
coeffs
Definition: perfmonmt-refit.py:105
asg::StandaloneToolHandle
an "initializing" ToolHandle for stand-alone applications
Definition: StandaloneToolHandle.h:44
EL::StatusCode
::StatusCode StatusCode
StatusCode definition for legacy code.
Definition: PhysicsAnalysis/D3PDTools/EventLoop/EventLoop/StatusCode.h:22