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

#include <PndMvdSimplePidAlgo.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 LowerMuonBoundary (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 fmuMass =0.1058
 
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 feShift =2.96566e-3
 
static double feScale =1.88056e-4
 

Detailed Description

Definition at line 10 of file PndMvdSimplePidAlgo.h.

Member Function Documentation

void PndMvdSimplePidAlgo::CalcLikelihood ( PndMvdPidCand cand)
static

Definition at line 5 of file PndMvdSimplePidAlgo.cxx.

References dE, dx, feScale, feShift, fkMass, fkScale, fkShift, fpiMass, fpiScale, fpiShift, PndMvdPidCand::GetMvdHitdE(), PndMvdPidCand::GetMvdHitdx(), PndMvdPidCand::GetMvdHitMomentum(), PndMvdPidCand::GetMvdHits(), LandauIntegral(), LowerBoundary(), LowerKaonBoundary(), LowerMuonBoundary(), 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  double weightE;
14 
15  double dE=0;
16  double dx=0;
17  double momentum=0;
18 
19  for (Int_t k=0;k<cand->GetMvdHits(); k++) {
20  dE+=cand->GetMvdHitdE(k);
21  dx+=cand->GetMvdHitdx(k);
22  momentum+=cand->GetMvdHitMomentum(k);
23  }
24 
25  if (dx>0) {
26 
27  double energyloss=dE/dx;
28  momentum=momentum/cand->GetMvdHits();
29 
30  //Proton selector
31  if (energyloss>=LowerProtonBoundary(momentum)) {
32  if (momentum<0.4) {
33  weightP=0.92;
34  weightK=0.008;
35  } else {
36  weightP=0.97;
37  weightK=1-LandauIntegral((LowerProtonBoundary(momentum)-LowerBoundary(momentum, fkMass)-fkShift)/fkScale);
38  }
39  weightPi=1-LandauIntegral((LowerProtonBoundary(momentum)-LowerBoundary(momentum, fpiMass)-fpiShift)/fpiScale);
40  weightE=weightPi;
41 
42  //Kaon selector
43  } else if (energyloss>=LowerKaonBoundary(momentum)) {
44  if (momentum<0.4) {
45  weightP=0.06;
46  weightK=0.98;
47  } else {
48  weightP=0.03;
49  weightK=LandauIntegral((LowerProtonBoundary(momentum)-LowerBoundary(momentum, fkMass)-fkShift)/fkScale)-0.01;
50  }
55 
56  //Pion selector
57  } else if (energyloss>=LowerMuonBoundary(momentum)) {
58  weightK=0.005;
59  weightP=0.002;
60  weightPi=LandauIntegral((LowerKaonBoundary(momentum)-LowerBoundary(momentum, fpiMass)-fpiShift)/fpiScale)-0.001;
61  weightE=LandauIntegral((LowerKaonBoundary(momentum)-feShift)/feScale)
63 
64  //Electron selector
65  } else {
66  weightP=0;
67  weightPi=0.001;
68  weightK=0;
69  weightE=LandauIntegral((LowerMuonBoundary(momentum)-feShift)/feScale)+0.004;
70  }
71 
72  } else {
73  weightP=1;
74  weightK=1;
75  weightPi=1;
76  weightE=1;
77  }
78 
79  //Muons have approximately the same distribution as pions.
80  double sum=weightP+weightK+2*weightPi+weightE;
81  weightP/=sum;
82  weightK/=sum;
83  weightPi/=sum;
84  weightE/=sum;
85 
86  cand->SetLikelihood(211, weightPi);
87  cand->SetLikelihood(2212, weightP);
88  cand->SetLikelihood(321, weightK);
89  cand->SetLikelihood(13, weightPi);
90  cand->SetLikelihood(11, weightE);
91 }
double GetMvdHitdx(int mvdhit) const
static double LowerMuonBoundary(double momentum)
static double LowerKaonBoundary(double momentum)
static double LowerProtonBoundary(double momentum)
static double LandauIntegral(double x)
double GetMvdHitMomentum(int mvdhit) const
Double_t dE
Definition: anasim.C:58
double dx
double GetMvdHitdE(int mvdhit) const
void SetLikelihood(int lundId, double likelihood)
int GetMvdHits() const
static double LowerBoundary(double p, double m)
double PndMvdSimplePidAlgo::LandauIntegral ( double  x)
staticprivate

Definition at line 115 of file PndMvdSimplePidAlgo.cxx.

References exp().

Referenced by CalcLikelihood().

115  {
116 //compute integral approximation of a Landau-p.d.f from -INF to x
117 //with expected value 0 and deviation 1. Hard coded numbers have
118 //been fitted within their respective intervals.
119 
120  if (x<-0.8)
121  //gauss
122  return 0.199785*exp(-pow(x+0.149198,2)*0.769779);
123  else if (x<0.5)
124  //linear
125  return 0.177214*(x+1.61437);
126  else
127  //power function
128  return 1-19.0054*pow(x+5.860003,-1.84611);
129 }
friend F32vec4 exp(const F32vec4 &a)
Definition: P4_F32vec4.h:109
Double_t x
double PndMvdSimplePidAlgo::LowerBoundary ( double  p,
double  m 
)
staticprivate

Definition at line 108 of file PndMvdSimplePidAlgo.cxx.

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

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

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

Definition at line 99 of file PndMvdSimplePidAlgo.cxx.

References fkMass, and LowerBoundary().

Referenced by CalcLikelihood().

99  {
100  return LowerBoundary(p+0.02, fkMass)-3e-4;
101 };
Double_t p
Definition: anasim.C:58
static double LowerBoundary(double p, double m)
double PndMvdSimplePidAlgo::LowerMuonBoundary ( double  momentum)
staticprivate

Definition at line 103 of file PndMvdSimplePidAlgo.cxx.

References fpiMass, and LowerBoundary().

Referenced by CalcLikelihood().

103  {
104  return LowerBoundary(p+0.01, fpiMass)-3e-4;
105 };
Double_t p
Definition: anasim.C:58
static double LowerBoundary(double p, double m)
double PndMvdSimplePidAlgo::LowerProtonBoundary ( double  momentum)
staticprivate

Definition at line 95 of file PndMvdSimplePidAlgo.cxx.

References fpMass, and LowerBoundary().

Referenced by CalcLikelihood().

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

Member Data Documentation

float PndMvdSimplePidAlgo::fc =2.99792458e8
staticprivate

Definition at line 39 of file PndMvdSimplePidAlgo.h.

Referenced by LowerBoundary().

float PndMvdSimplePidAlgo::feb =0.14e-6
staticprivate

Definition at line 40 of file PndMvdSimplePidAlgo.h.

Referenced by LowerBoundary().

float PndMvdSimplePidAlgo::feMass =0.511e-3
staticprivate

Definition at line 38 of file PndMvdSimplePidAlgo.h.

Referenced by LowerBoundary().

double PndMvdSimplePidAlgo::feScale =1.88056e-4
staticprivate

Definition at line 50 of file PndMvdSimplePidAlgo.h.

Referenced by CalcLikelihood().

double PndMvdSimplePidAlgo::feShift =2.96566e-3
staticprivate

Definition at line 49 of file PndMvdSimplePidAlgo.h.

Referenced by CalcLikelihood().

float PndMvdSimplePidAlgo::fkMass =0.4937
staticprivate

Definition at line 35 of file PndMvdSimplePidAlgo.h.

Referenced by CalcLikelihood(), and LowerKaonBoundary().

double PndMvdSimplePidAlgo::fkScale =1.36362e-4
staticprivate

Definition at line 44 of file PndMvdSimplePidAlgo.h.

Referenced by CalcLikelihood().

double PndMvdSimplePidAlgo::fkShift =3.38598e-4
staticprivate

Definition at line 43 of file PndMvdSimplePidAlgo.h.

Referenced by CalcLikelihood().

float PndMvdSimplePidAlgo::fmuMass =0.1058
staticprivate

Definition at line 37 of file PndMvdSimplePidAlgo.h.

float PndMvdSimplePidAlgo::fpiMass =0.1396
staticprivate

Definition at line 34 of file PndMvdSimplePidAlgo.h.

Referenced by CalcLikelihood(), and LowerMuonBoundary().

double PndMvdSimplePidAlgo::fpiScale =1.58696e-4
staticprivate

Definition at line 47 of file PndMvdSimplePidAlgo.h.

Referenced by CalcLikelihood().

double PndMvdSimplePidAlgo::fpiShift =3.09159e-4
staticprivate

Definition at line 46 of file PndMvdSimplePidAlgo.h.

Referenced by CalcLikelihood().

float PndMvdSimplePidAlgo::fpMass =0.9383
staticprivate

Definition at line 36 of file PndMvdSimplePidAlgo.h.

Referenced by LowerProtonBoundary().


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