CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
SimpleSecondaryVertexComputer.h
Go to the documentation of this file.
1 #ifndef RecoBTag_SecondaryVertex_SimpleSecondaryVertexComputer_h
2 #define RecoBTag_SecondaryVertex_SimpleSecondaryVertexComputer_h
3 
4 #include <cmath>
5 
6 #include "Math/GenVector/VectorUtil.h"
7 
11 
13 
15 
17  public:
19  use2d(!parameters.getParameter<bool>("use3d")),
20  useSig(parameters.getParameter<bool>("useSignificance")),
21  unBoost(parameters.getParameter<bool>("unBoost")),
22  minTracks(parameters.getParameter<unsigned int>("minTracks"))
23  { uses("svTagInfos"); }
24 
25  float discriminator(const TagInfoHelper &tagInfos) const
26  {
29  unsigned int idx = 0;
30  while(idx < info.nVertices()) {
31  if (info.nVertexTracks(idx) >= minTracks)
32  break;
33  idx++;
34  }
35  if (idx >= info.nVertices())
36  return -1.0;
37 
38  double gamma;
39  if (unBoost) {
40  reco::TrackKinematics kinematics(
41  info.secondaryVertex(idx));
42  gamma = kinematics.vectorSum().Gamma();
43  } else
44  gamma = 1.0;
45 
46  double value;
47  if (useSig)
48  value = info.flightDistance(idx, use2d).significance();
49  else
50  value = info.flightDistance(idx, use2d).value();
51 
52  value /= gamma;
53 
54  if (useSig)
55  value = (value > 0) ? +std::log(1 + value)
56  : -std::log(1 - value);
57 
58  return value;
59  }
60 
61  private:
62  bool use2d;
63  bool useSig;
64  bool unBoost;
65  unsigned int minTracks;
66 };
67 
68 #endif // RecoBTag_SecondaryVertex_SimpleSecondaryVertexComputer_h
dictionary parameters
Definition: Parameters.py:2
const T & get(unsigned int index=0) const
Measurement1D flightDistance(unsigned int index, bool in2d=false) const
const Vertex & secondaryVertex(unsigned int index) const
void uses(unsigned int id, const std::string &label)
double significance() const
Definition: Measurement1D.h:32
Log< T >::type log(const T &t)
Definition: Log.h:22
double value() const
Definition: Measurement1D.h:28
const math::XYZTLorentzVector & vectorSum() const
float discriminator(const TagInfoHelper &tagInfos) const
SimpleSecondaryVertexComputer(const edm::ParameterSet &parameters)