FairRoot/PandaRoot
Static Public Member Functions | Static Private Member Functions | Static Private Attributes | List of all members
PndMvdIdealPidAlgo Class Reference

#include <PndMvdIdealPidAlgo.h>

Static Public Member Functions

static void CalcLikelihood (PndMvdPidCand *cand)
 

Static Private Member Functions

static double LowerBoundary (double p, double m)
 
static double LowerProtonBoundary (double momentum)
 
static double LowerKaonBoundary (double momentum)
 
static double LowerPionBoundary (double momentum)
 
static double LandauIntegral (double x)
 

Static Private Attributes

static float fpiMass =0.1396
 
static float fkMass =0.4937
 
static float fpMass =0.9383
 
static float feMass =0.511e-3
 
static float fc =2.99792458e8
 
static float feb =0.14e-6
 
static double fkShift =3.38598e-4
 
static double fkScale =1.36362e-4
 
static double fpiShift =3.09159e-4
 
static double fpiScale =1.58696e-4
 
static double fPRemainder =0.015
 
static double fKRemainder =0.01
 
static double fPiRemainder =0.001
 

Detailed Description

Definition at line 10 of file PndMvdIdealPidAlgo.h.

Member Function Documentation

void PndMvdIdealPidAlgo::CalcLikelihood ( PndMvdPidCand cand)
static

Definition at line 5 of file PndMvdIdealPidAlgo.cxx.

References dE, dx, fkMass, fKRemainder, fkScale, fkShift, fpiMass, fPiRemainder, fpiScale, fpiShift, fPRemainder, PndMvdPidCand::GetMvdHitdE(), PndMvdPidCand::GetMvdHitdx(), PndMvdPidCand::GetMvdHitMomentum(), PndMvdPidCand::GetMvdHits(), LandauIntegral(), LowerBoundary(), LowerKaonBoundary(), LowerPionBoundary(), LowerProtonBoundary(), and PndMvdPidCand::SetLikelihood().

Referenced by PndMvdPidIdealTask::Exec().

5  {
6  //computes pid likelihoods for pi, k, p, mu and stores them in the likelihood map
7  //with the map key used as pdg id. This is basically done by integrating the
8  //respective energy loss distribution within the chosen selector limits
9 
10  double weightP;
11  double weightK;
12  double weightPi;
13 
14  double dE=0;
15  double dx=0;
16  double momentum=0;
17 
18  for (Int_t k=0;k<cand->GetMvdHits(); k++) {
19  dE+=cand->GetMvdHitdE(k);
20  dx+=cand->GetMvdHitdx(k);
21  momentum+=cand->GetMvdHitMomentum(k);
22  }
23 
24  if (dx>0) {
25  double energyloss=dE/dx;
26  momentum=momentum/cand->GetMvdHits();
27 
28  //Proton selector
29  if (energyloss>=LowerProtonBoundary(momentum)) {
30  weightP=1-fPRemainder;
31  weightK=1-LandauIntegral((LowerProtonBoundary(momentum)-LowerBoundary(momentum, fkMass)-fkShift)/fkScale);
32  weightPi=1-LandauIntegral((LowerProtonBoundary(momentum)-LowerBoundary(momentum, fpiMass)-fpiShift)/fpiScale);
33 
34  //Kaon selector
35  } else if (energyloss>=LowerKaonBoundary(momentum)) {
36  weightP=fPRemainder;
38  -fKRemainder;
41 
42  //Pion selector
43  } else if (energyloss>=LowerPionBoundary(momentum)) {
44  weightP=0;
45  weightK=fKRemainder;
47  -fPiRemainder;
48 
49  //Electron selector
50  } else {
51  weightP=0;
52  weightK=0;
53  weightPi=fPiRemainder;
54  }
55  } else {
56  weightP=1;
57  weightK=1;
58  weightPi=1;
59  }
60 
61  //Muons have approximately the same distribution as pions.
62  double sum=weightP+weightK+2*weightPi;
63  weightP/=sum;
64  weightK/=sum;
65  weightPi/=sum;
66 
67  cand->SetLikelihood(211, weightPi);
68  cand->SetLikelihood(2212, weightP);
69  cand->SetLikelihood(321, weightK);
70  cand->SetLikelihood(13, weightPi);
71 }
static double LowerKaonBoundary(double momentum)
double GetMvdHitdx(int mvdhit) const
static double LowerBoundary(double p, double m)
static double fpiScale
static double fpiShift
static double LandauIntegral(double x)
double GetMvdHitMomentum(int mvdhit) const
static double fKRemainder
Double_t dE
Definition: anasim.C:58
static double fPiRemainder
static double fPRemainder
double dx
static double LowerPionBoundary(double momentum)
double GetMvdHitdE(int mvdhit) const
void SetLikelihood(int lundId, double likelihood)
static double LowerProtonBoundary(double momentum)
int GetMvdHits() const
double PndMvdIdealPidAlgo::LandauIntegral ( double  x)
staticprivate

Definition at line 95 of file PndMvdIdealPidAlgo.cxx.

References exp().

Referenced by CalcLikelihood().

95  {
96 //compute integral approximation of a Landau-p.d.f from -INF to x
97 //with expected value 0 and deviation 1. Hard coded numbers have
98 //been fitted within their respective intervals.
99 
100  if (x<-0.8)
101  //gauss
102  return 0.199785*exp(-pow(x+0.149198,2)*0.769779);
103  else if (x<0.5)
104  //linear
105  return 0.177214*(x+1.61437);
106  else
107  //power function
108  return 1-19.0054*pow(x+5.860003,-1.84611);
109 }
friend F32vec4 exp(const F32vec4 &a)
Definition: P4_F32vec4.h:109
Double_t x
double PndMvdIdealPidAlgo::LowerBoundary ( double  p,
double  m 
)
staticprivate

Definition at line 88 of file PndMvdIdealPidAlgo.cxx.

References fc, feb, feMass, and log().

Referenced by CalcLikelihood(), LowerKaonBoundary(), LowerPionBoundary(), and LowerProtonBoundary().

88  {
89 //Calculate the lower boundary of the energy loss distribution.
90 
91  double sqrfBeta=1/(1+pow(m/p,2));
92  return 4.9312e-05 * (log(2*feMass*fc*fc/feb*sqrfBeta/(1-sqrfBeta))-sqrfBeta)/sqrfBeta;
93 };
__m128 m
Definition: P4_F32vec4.h:28
friend F32vec4 log(const F32vec4 &a)
Definition: P4_F32vec4.h:110
Double_t p
Definition: anasim.C:58
double PndMvdIdealPidAlgo::LowerKaonBoundary ( double  momentum)
staticprivate

Definition at line 79 of file PndMvdIdealPidAlgo.cxx.

References fkMass, and LowerBoundary().

Referenced by CalcLikelihood().

79  {
80  return LowerBoundary(p+0.02, fkMass)-3e-4;
81 };
static double LowerBoundary(double p, double m)
Double_t p
Definition: anasim.C:58
double PndMvdIdealPidAlgo::LowerPionBoundary ( double  momentum)
staticprivate

Definition at line 83 of file PndMvdIdealPidAlgo.cxx.

References fpiMass, and LowerBoundary().

Referenced by CalcLikelihood().

83  {
84  return LowerBoundary(p+0.01, fpiMass)-3e-4;
85 };
static double LowerBoundary(double p, double m)
Double_t p
Definition: anasim.C:58
double PndMvdIdealPidAlgo::LowerProtonBoundary ( double  momentum)
staticprivate

Definition at line 75 of file PndMvdIdealPidAlgo.cxx.

References fpMass, and LowerBoundary().

Referenced by CalcLikelihood().

75  {
76  return LowerBoundary(p+0.02, fpMass)-5e-4;
77 };
static double LowerBoundary(double p, double m)
Double_t p
Definition: anasim.C:58

Member Data Documentation

float PndMvdIdealPidAlgo::fc =2.99792458e8
staticprivate

Definition at line 38 of file PndMvdIdealPidAlgo.h.

Referenced by LowerBoundary().

float PndMvdIdealPidAlgo::feb =0.14e-6
staticprivate

Definition at line 39 of file PndMvdIdealPidAlgo.h.

Referenced by LowerBoundary().

float PndMvdIdealPidAlgo::feMass =0.511e-3
staticprivate

Definition at line 37 of file PndMvdIdealPidAlgo.h.

Referenced by LowerBoundary().

float PndMvdIdealPidAlgo::fkMass =0.4937
staticprivate

Definition at line 35 of file PndMvdIdealPidAlgo.h.

Referenced by CalcLikelihood(), and LowerKaonBoundary().

double PndMvdIdealPidAlgo::fKRemainder =0.01
staticprivate

Definition at line 50 of file PndMvdIdealPidAlgo.h.

Referenced by CalcLikelihood().

double PndMvdIdealPidAlgo::fkScale =1.36362e-4
staticprivate

Definition at line 43 of file PndMvdIdealPidAlgo.h.

Referenced by CalcLikelihood().

double PndMvdIdealPidAlgo::fkShift =3.38598e-4
staticprivate

Definition at line 42 of file PndMvdIdealPidAlgo.h.

Referenced by CalcLikelihood().

float PndMvdIdealPidAlgo::fpiMass =0.1396
staticprivate

Definition at line 34 of file PndMvdIdealPidAlgo.h.

Referenced by CalcLikelihood(), and LowerPionBoundary().

double PndMvdIdealPidAlgo::fPiRemainder =0.001
staticprivate

Definition at line 51 of file PndMvdIdealPidAlgo.h.

Referenced by CalcLikelihood().

double PndMvdIdealPidAlgo::fpiScale =1.58696e-4
staticprivate

Definition at line 46 of file PndMvdIdealPidAlgo.h.

Referenced by CalcLikelihood().

double PndMvdIdealPidAlgo::fpiShift =3.09159e-4
staticprivate

Definition at line 45 of file PndMvdIdealPidAlgo.h.

Referenced by CalcLikelihood().

float PndMvdIdealPidAlgo::fpMass =0.9383
staticprivate

Definition at line 36 of file PndMvdIdealPidAlgo.h.

Referenced by LowerProtonBoundary().

double PndMvdIdealPidAlgo::fPRemainder =0.015
staticprivate

Definition at line 49 of file PndMvdIdealPidAlgo.h.

Referenced by CalcLikelihood().


The documentation for this class was generated from the following files: