PandaRoot
PndHypAdvancedPidAlgo.h
Go to the documentation of this file.
1 //****************************************************************************
2 //* This file is part of PandaRoot. *
3 //* *
4 //* PandaRoot is distributed under the terms of the *
5 //* GNU General Public License (GPL) version 3, *
6 //* copied verbatim in the file "LICENSE". *
7 //* *
8 //* Copyright (C) 2006 - 2024 FAIR GmbH and copyright holders of PandaRoot *
9 //* The copyright holders are listed in the file "COPYRIGHTHOLDERS". *
10 //* The authors are listed in the file "AUTHORS". *
11 //****************************************************************************
12 
13 #ifndef PndHypAdvancedPidAlgo_h
14 #define PndHypAdvancedPidAlgo_h
15 
16 #include <math.h>
17 #include <map>
18 #include "Rtypes.h"
19 
20 class PndHypPidCand;
21 
23  public:
24  // Local pid type (BABAR)
25  enum { kNPidType = 5 };
27 
28  // Write likelihoods to PndHypPidCand
29  static void CalcLikelihood(PndHypPidCand *cand);
30 
31  // Same as CalcLikelihood but create random energyloss first
32  static void CalcLikelihood(PidType particle, double momentum, PndHypPidCand *cand);
33 
34  // Same as CalcLikelihood but write lhs to array instead
35  static void CalcLikelihood(PidType part, double momentum, double *lh);
36 
37  // Same with a pdtid switch
38  static void CalcLikelihood(int lundId, double momentum, double *lh);
39 
40  // Read last used energy loss and momentum
41  static double GetMomentum() { return fmomentum; };
42  static double GetEnergyLoss() { return fenergyloss; };
43 
44  private:
46  virtual ~PndHypAdvancedPidAlgo(){};
47  static void CalcLikelihood(double *lh);
48 
49  // Expected energy loss, as given by Bethe-Bloch formula
50  static double MeanEnergyLoss(PidType particle);
51 
52  // Integral algorithm that computes convolution of landau and gaus
53  // distribution; s_mpv is the difference between energy loss and
54  // most probable value of the landau distribution, width1 is its
55  // scaling, widht2 is the gaussian width.
56  static double LandauGaus(double s_mpv, double width1, double width2);
57 
58  // Obtained by TrkFitter
59  static double fmomentum;
60  static double fenergyloss;
61 
62  // Distribution parameters depending on track momentum and particle
63  static double mpv(PidType particle);
64  static double width1(PidType particle);
65  static double width2(PidType particle);
66 
67  // public:
68  ClassDef(PndHypAdvancedPidAlgo, 1);
69 };
70 
71 #endif
static void CalcLikelihood(PndHypPidCand *cand)