EIC Software
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
PndPidProbability.cxx
Go to the documentation of this file. Or view the newest version in sPHENIX GitHub for file PndPidProbability.cxx
1 
2 // //
3 // PndPidProbability //
4 // //
5 // Definition of the Panda pid probabilities . //
6 // //
7 // Author: Ralf Kliemt, Dresden/Turin/Bonn, 01.09.09 //
8 // //
10 
11 #include "PndPidProbability.h"
12 
13 
15 {
16  fElectronPdf = 1.;
17  fMuonPdf = 1.;
18  fPionPdf = 1.;
19  fKaonPdf = 1.;
20  fProtonPdf = 1.;
21  fIndex = -1;
22 }
23 
24 PndPidProbability::PndPidProbability(Double_t e, Double_t mu, Double_t pi, Double_t k, Double_t p, Int_t idx)
25 {
26  fElectronPdf = e;
27  fMuonPdf = mu;
28  fPionPdf = pi;
29  fKaonPdf = k;
30  fProtonPdf = p;
31  fIndex = idx;
32 }
33 
35 {
36 }
37 
39 {
40  return PndPidProbability(
42  a.GetMuonPdf() * fMuonPdf,
43  a.GetPionPdf() * fPionPdf,
44  a.GetKaonPdf() * fKaonPdf,
46  a.GetIndex() );
47 }
49 {
51  fMuonPdf *= a.GetMuonPdf();
52  fPionPdf *= a.GetPionPdf();
53  fKaonPdf *= a.GetKaonPdf();
54  fProtonPdf *= a.GetProtonPdf();
55  return *this;
56 }
57 
59 {
60  std::cout <<"PndPidProbability pdf's: "
61  <<"p(e)="<<fElectronPdf<<" "
62  <<"p(mu)="<<fMuonPdf<<" "
63  <<"p(pi)="<<fPionPdf<<" "
64  <<"p(K)="<<fKaonPdf<<" "
65  <<"p(P)="<<fProtonPdf<<" "
66  <<"index="<<fIndex
67  <<std::endl;
68 }
69 
71 {
72  fElectronPdf = 1.;
73  fMuonPdf = 1.;
74  fPionPdf = 1.;
75  fKaonPdf = 1.;
76  fProtonPdf = 1.;
77  fIndex = -1;
78 }
79 
81 {
82  Double_t scalefactor = GetSumProb();
83  if (scalefactor == 0) return;
84  scalefactor = N / scalefactor;
85  fElectronPdf*=scalefactor;
86  fMuonPdf*=scalefactor;
87  fPionPdf*=scalefactor;
88  fKaonPdf*=scalefactor;
89  fProtonPdf*=scalefactor;
90  return;
91 }
92 
93 
95