How to get weights for the LifetimeTag and SecVtxTags

Basics: you are running 10.0.x (x>=1) and have checked out the 3 packages described here:

which enables you to rerun b-tagging on AOD level.

Due to persistency problems the procedure to obtain weights has to be (almost) entirely shifted to your analysis algorithm. The only files which had to be updated are:

  • LikelihoodTool.cxx
  • LikelihoodTool.h

Since I do not want to branch the packages and the HEAD versions are incompatible with 10.0.x already I did not commit any of these changes into the repository. Please copy by hand the following two files:

to the apropriet locations inside JetTagTools (src and JetTagTools dir).

Now recompile the packages.

Changes in your analysis algorithm

For every tag tool you need a separate likelihood tool in your algorithm. Here is an example for the LifetimeTag2D tool. Assume the analysis algorithms are called myAnalysis.h and myAnalysis.cxx. In myAnalysis.h add the following:
  • add a forward declaration
class LikelihoodTool;
  • and a datamember for the tool (one per tag, remember ... this on is for the 2D tag)
LikelihoodTool* m_likelihoodTool;
In the source files add:
  • the following inludes
      #include "JetTagTools/ILikelihoodTool.h"
      #include "JetTagTools/LikelihoodTool.h"
  • in the initialize() method get the tool:
      /// retrieve the Likelihood tool
      ILikelihoodTool* likelihoodTool(0);
      StatusCode sc = toolSvc->retrieveTool("Analysis::LikelihoodTool", "AnalysisLikelihoodTool2D" , likelihoodTool);
      if (StatusCode::SUCCESS != sc && likelihoodTool == 0)
          mLog << MSG::ERROR << "Can't get handle on AnalysisLikelihoodTool2D" << endreq;
          return StatusCode::FAILURE;
      m_likelihoodTool = dynamic_cast< LikelihoodTool* >(likelihoodTool);
      if (m_likelihoodTool==0)
          mLog << MSG::ERROR << "dynamic cast from ILikelihood to Likelihood did not work!" << endreq;
          return StatusCode::FAILURE;
  • in your execute() method add the following lines and you have the weight:
      std::vector<double> signif = bLifeInfo2D->significance();
      m_likelihoodTool->setLhVariableValue("significance2D", signif);
      double weight2D(m_likelihoodTool->calculateWeight());
Important: the variable bLifeInfo2D is a pointer to the LifetimeInfo object in the JetTag object. If you do not have it already in the analysis let me know smile

  • last step: modify your jobOptions and add these lines:
     AnalysisLikelihoodTool2D = Service ("ToolSvc.AnalysisLikelihoodTool2D")
     AnalysisLikelihoodTool2D.allLhVariables      = [ "significance2D" ]
     AnalysisLikelihoodTool2D.useTheseLhVariables = [ "significance2D" ]
For the 1D and 3D weight repeat everything but change 2D correspondingly. For the SecVtxTags it is a bit more work (more variables) which I will post in a bit. Please try this one first.

Attached you find very preliminar plots to show that it works ...

-- DerSchrecklicheSven - 23 May 2005

Topic attachments
I AttachmentSorted ascending History Action Size Date Who Comment
Postscriptps Weight1D.ps r1 manage 10.7 K 2005-05-23 - 09:26 AndreasWildauer 1D weight
Postscriptps Weight2D.ps r1 manage 10.9 K 2005-05-23 - 09:25 AndreasWildauer 2D weight
Postscriptps Weight3D.ps r1 manage 10.9 K 2005-05-23 - 09:27 AndreasWildauer 3D weight

This topic: Main > DerSchrecklicheSven > AthenaStuff > BTaggIng
Topic revision: r2 - 2005-05-30 - AndreasWildauer
This site is powered by the TWiki collaboration platform Powered by PerlCopyright & 2008-2023 by the contributing authors. All material on this collaboration platform is the property of the contributing authors.
or Ideas, requests, problems regarding TWiki? use Discourse or Send feedback