EIC Software
Reference for
EIC
simulation and reconstruction software on GitHub
Home page
Related Pages
Modules
Namespaces
Classes
Files
External Links
File List
File Members
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
14
PndPidProbability::PndPidProbability
()
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
34
PndPidProbability::~PndPidProbability
()
35
{
36
}
37
38
PndPidProbability
PndPidProbability::operator*
(
const
PndPidProbability
& a)
39
{
40
return
PndPidProbability
(
41
a.
GetElectronPdf
() *
fElectronPdf
,
42
a.
GetMuonPdf
() *
fMuonPdf
,
43
a.
GetPionPdf
() *
fPionPdf
,
44
a.
GetKaonPdf
() *
fKaonPdf
,
45
a.
GetProtonPdf
() *
fProtonPdf
,
46
a.
GetIndex
() );
47
}
48
PndPidProbability
&
PndPidProbability::operator*=
(
const
PndPidProbability
& a)
49
{
50
fElectronPdf
*= a.
GetElectronPdf
();
51
fMuonPdf
*= a.
GetMuonPdf
();
52
fPionPdf
*= a.
GetPionPdf
();
53
fKaonPdf
*= a.
GetKaonPdf
();
54
fProtonPdf
*= a.
GetProtonPdf
();
55
return
*
this
;
56
}
57
58
void
PndPidProbability::Print
()
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
70
void
PndPidProbability::Reset
()
71
{
72
fElectronPdf
= 1.;
73
fMuonPdf
= 1.;
74
fPionPdf
= 1.;
75
fKaonPdf
= 1.;
76
fProtonPdf
= 1.;
77
fIndex
= -1;
78
}
79
80
void
PndPidProbability::NormalizeTo
(Double_t
N
)
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
94
ClassImp
(
PndPidProbability
)
95
EicRoot
blob
master
pnddata
PidData
PndPidProbability.cxx
Built by
Jin Huang
. updated:
Mon Jan 22 2024 12:43:37
using
1.8.2 with
EIC GitHub integration