FairRoot/PandaRoot
Functions
PndMvdAdvancedPidAlgo.cxx File Reference
#include "TMath.h"
#include "TRandom3.h"
#include "PndMvdAdvancedPidAlgo.h"
#include "PndMvdPidCand.h"

Go to the source code of this file.

Functions

 ClassImp (PndMvdAdvancedPidAlgo) void PndMvdAdvancedPidAlgo
 

Function Documentation

ClassImp ( PndMvdAdvancedPidAlgo  )

Definition at line 8 of file PndMvdAdvancedPidAlgo.cxx.

References dE, and dx.

12  {
13  //computes pid likelihoods for pi, k, p, mu, e and stores them in the likelihood
14  //map with the map key used as pdg id. This is basically done by integrating the
15  //respective energy loss distribution within the chosen selector limits
16 
17  double weight[kNPidType];
18  double dE=0;
19  double dx=0;
20  fmomentum=0;
21 
22  for (int k=0;k<cand->GetMvdHits(); k++) {
23  dE+=cand->GetMvdHitdE(k);
24  dx+=cand->GetMvdHitdx(k);
25  fmomentum+=cand->GetMvdHitMomentum(k);
26  }
27 
28  if (dx>0) {
29  fmomentum/=cand->GetMvdHits();
30  fenergyloss=dE/dx;
31  } else
32  fmomentum=-1; // whateva
33 
34  CalcLikelihood(weight);
35 
36  cand->SetLikelihood(2212, weight[kProton]);
37  cand->SetLikelihood(211, weight[kPion]);
38  cand->SetLikelihood(321, weight[kKaon]);
39  cand->SetLikelihood(13, weight[kMuon]);
40  cand->SetLikelihood(11, weight[kElectron]);
41 }
Double_t dE
Definition: anasim.C:58
double dx