FairRoot/PandaRoot
Functions
PndHypAdvancedPidAlgo.cxx File Reference
#include "TMath.h"
#include "TRandom3.h"
#include "PndHypAdvancedPidAlgo.h"
#include "PndHypPidCand.h"
#include <iostream>
#include "TROOT.h"

Go to the source code of this file.

Functions

 ClassImp (PndHypAdvancedPidAlgo) void PndHypAdvancedPidAlgo
 

Function Documentation

ClassImp ( PndHypAdvancedPidAlgo  )

Definition at line 9 of file PndHypAdvancedPidAlgo.cxx.

References dE, and dx.

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