FairRoot/PandaRoot
Public Member Functions | Protected Attributes | List of all members
PndPidProbability Class Reference

#include <PndPidProbability.h>

Inheritance diagram for PndPidProbability:

Public Member Functions

 PndPidProbability ()
 
 PndPidProbability (Double_t e, Double_t mu, Double_t pi, Double_t k, Double_t p, Int_t idx=-1)
 
 ~PndPidProbability ()
 
Double_t GetElectronPdf () const
 
Double_t GetMuonPdf () const
 
Double_t GetPionPdf () const
 
Double_t GetKaonPdf () const
 
Double_t GetProtonPdf () const
 
Int_t GetIndex () const
 
Double_t GetElectronPidProb (PndPidProbability *flux=NULL) const
 
Double_t GetMuonPidProb (PndPidProbability *flux=NULL) const
 
Double_t GetPionPidProb (PndPidProbability *flux=NULL) const
 
Double_t GetKaonPidProb (PndPidProbability *flux=NULL) const
 
Double_t GetProtonPidProb (PndPidProbability *flux=NULL) const
 
Double_t GetSumProb (PndPidProbability *flux=NULL) const
 
void NormalizeTo (Double_t N=1.)
 
void SetElectronPdf (Double_t val)
 
void SetMuonPdf (Double_t val)
 
void SetPionPdf (Double_t val)
 
void SetKaonPdf (Double_t val)
 
void SetProtonPdf (Double_t val)
 
void SetIndex (Int_t idx)
 
PndPidProbabilityoperator*= (const PndPidProbability &a)
 
PndPidProbability operator* (const PndPidProbability &a)
 
void Print ()
 
void Reset ()
 

Protected Attributes

Double_t fElectronPdf
 
Double_t fMuonPdf
 
Double_t fPionPdf
 
Double_t fKaonPdf
 
Double_t fProtonPdf
 
Int_t fIndex
 

Detailed Description

Definition at line 16 of file PndPidProbability.h.

Constructor & Destructor Documentation

PndPidProbability::PndPidProbability ( )

Definition at line 14 of file PndPidProbability.cxx.

Referenced by operator*().

14  :
15  fElectronPdf(0.2),
16  fMuonPdf(0.2),
17  fPionPdf(0.2),
18  fKaonPdf(0.2),
19  fProtonPdf(0.2),
20  fIndex(-1)
21 {}
PndPidProbability::PndPidProbability ( Double_t  e,
Double_t  mu,
Double_t  pi,
Double_t  k,
Double_t  p,
Int_t  idx = -1 
)

Definition at line 23 of file PndPidProbability.cxx.

23  :
24  fElectronPdf(e),
25  fMuonPdf(mu),
26  fPionPdf(pi),
27  fKaonPdf(k),
28  fProtonPdf(p),
29  fIndex(idx)
30 {}
#define pi
Definition: createSTT.C:60
Double_t p
Definition: anasim.C:58
int idx[MAX]
Definition: autocutx.C:38
PndPidProbability::~PndPidProbability ( )

Definition at line 32 of file PndPidProbability.cxx.

33 {
34 }

Member Function Documentation

Double_t PndPidProbability::GetElectronPdf ( ) const
inline

Definition at line 25 of file PndPidProbability.h.

References fElectronPdf.

Referenced by PndPidMlAssociatorTask::Exec(), operator*(), and operator*=().

25 { return fElectronPdf; }
Double_t PndPidProbability::GetElectronPidProb ( PndPidProbability flux = NULL) const
inline

Definition at line 32 of file PndPidProbability.h.

References fElectronPdf, and GetSumProb().

Referenced by PndAnaPidCombiner::Apply(), PndSimpleAnalysis::FillGenericLists(), PndAnaTask::FillList(), and pid_check().

32 { if(flux==NULL) return fElectronPdf/GetSumProb(flux); else return fElectronPdf * flux->GetElectronPdf() / GetSumProb(flux); }
Double_t GetElectronPdf() const
Double_t GetSumProb(PndPidProbability *flux=NULL) const
Int_t PndPidProbability::GetIndex ( ) const
inline

Definition at line 30 of file PndPidProbability.h.

References fIndex.

Referenced by PndAnaPidCombiner::Apply(), operator*(), and pid_check().

30 { return fIndex;}
Double_t PndPidProbability::GetKaonPdf ( ) const
inline

Definition at line 28 of file PndPidProbability.h.

References fKaonPdf.

Referenced by PndPidMlAssociatorTask::Exec(), operator*(), and operator*=().

28 { return fKaonPdf; }
Double_t PndPidProbability::GetKaonPidProb ( PndPidProbability flux = NULL) const
inline

Definition at line 35 of file PndPidProbability.h.

References fKaonPdf, and GetSumProb().

Referenced by PndAnaPidCombiner::Apply(), PndSimpleAnalysis::FillGenericLists(), PndAnaTask::FillList(), and pid_check().

35 { if(flux==NULL) return fKaonPdf/GetSumProb(flux); else return fKaonPdf * flux->GetKaonPdf() / GetSumProb(flux); }
Double_t GetKaonPdf() const
Double_t GetSumProb(PndPidProbability *flux=NULL) const
Double_t PndPidProbability::GetMuonPdf ( ) const
inline

Definition at line 26 of file PndPidProbability.h.

References fMuonPdf.

Referenced by PndPidMlAssociatorTask::Exec(), operator*(), and operator*=().

26 { return fMuonPdf; }
Double_t PndPidProbability::GetMuonPidProb ( PndPidProbability flux = NULL) const
inline

Definition at line 33 of file PndPidProbability.h.

References fMuonPdf, and GetSumProb().

Referenced by PndAnaPidCombiner::Apply(), PndSimpleAnalysis::FillGenericLists(), PndAnaTask::FillList(), pid_check(), and test_check().

33 { if(flux==NULL) return fMuonPdf/GetSumProb(flux); else return fMuonPdf * flux->GetMuonPdf() / GetSumProb(flux); }
Double_t GetSumProb(PndPidProbability *flux=NULL) const
Double_t GetMuonPdf() const
Double_t PndPidProbability::GetPionPdf ( ) const
inline

Definition at line 27 of file PndPidProbability.h.

References fPionPdf.

Referenced by PndPidMlAssociatorTask::Exec(), operator*(), and operator*=().

27 { return fPionPdf; }
Double_t PndPidProbability::GetPionPidProb ( PndPidProbability flux = NULL) const
inline

Definition at line 34 of file PndPidProbability.h.

References fPionPdf, and GetSumProb().

Referenced by PndAnaPidCombiner::Apply(), PndSimpleAnalysis::FillGenericLists(), PndAnaTask::FillList(), and pid_check().

34 { if(flux==NULL) return fPionPdf/GetSumProb(flux); else return fPionPdf * flux->GetPionPdf() / GetSumProb(flux); }
Double_t GetSumProb(PndPidProbability *flux=NULL) const
Double_t GetPionPdf() const
Double_t PndPidProbability::GetProtonPdf ( ) const
inline

Definition at line 29 of file PndPidProbability.h.

References fProtonPdf.

Referenced by PndPidMlAssociatorTask::Exec(), operator*(), and operator*=().

29 { return fProtonPdf; }
Double_t PndPidProbability::GetProtonPidProb ( PndPidProbability flux = NULL) const
inline

Definition at line 36 of file PndPidProbability.h.

References fProtonPdf, and GetSumProb().

Referenced by PndAnaPidCombiner::Apply(), PndSimpleAnalysis::FillGenericLists(), PndAnaTask::FillList(), and pid_check().

36 { if(flux==NULL) return fProtonPdf/GetSumProb(flux); else return fProtonPdf * flux->GetProtonPdf() / GetSumProb(flux); }
Double_t GetSumProb(PndPidProbability *flux=NULL) const
Double_t GetProtonPdf() const
Double_t PndPidProbability::GetSumProb ( PndPidProbability flux = NULL) const
inline

Definition at line 38 of file PndPidProbability.h.

References fElectronPdf, fKaonPdf, fMuonPdf, fPionPdf, and fProtonPdf.

Referenced by PndAnaPidCombiner::Apply(), GetElectronPidProb(), GetKaonPidProb(), GetMuonPidProb(), GetPionPidProb(), GetProtonPidProb(), and NormalizeTo().

39  {
40  if(flux==NULL)
42  else return
43  fElectronPdf * flux->GetElectronPdf() +
44  fMuonPdf * flux->GetMuonPdf() +
45  fPionPdf * flux->GetPionPdf() +
46  fKaonPdf * flux->GetKaonPdf() +
47  fProtonPdf * flux->GetProtonPdf();
48  }
Double_t GetKaonPdf() const
Double_t GetElectronPdf() const
Double_t GetMuonPdf() const
Double_t GetProtonPdf() const
Double_t GetPionPdf() const
void PndPidProbability::NormalizeTo ( Double_t  N = 1.)

Definition at line 78 of file PndPidProbability.cxx.

References Double_t, fElectronPdf, fKaonPdf, fMuonPdf, fPionPdf, fProtonPdf, and GetSumProb().

79 {
80  Double_t scalefactor = GetSumProb();
81  if (scalefactor == 0) return;
82  scalefactor = N / scalefactor;
83  fElectronPdf*=scalefactor;
84  fMuonPdf*=scalefactor;
85  fPionPdf*=scalefactor;
86  fKaonPdf*=scalefactor;
87  fProtonPdf*=scalefactor;
88  return;
89 }
Double_t
Double_t GetSumProb(PndPidProbability *flux=NULL) const
PndPidProbability PndPidProbability::operator* ( const PndPidProbability a)

Definition at line 36 of file PndPidProbability.cxx.

References fElectronPdf, fKaonPdf, fMuonPdf, fPionPdf, fProtonPdf, GetElectronPdf(), GetIndex(), GetKaonPdf(), GetMuonPdf(), GetPionPdf(), GetProtonPdf(), and PndPidProbability().

37 {
38  return PndPidProbability(
40  a.GetMuonPdf() * fMuonPdf,
41  a.GetPionPdf() * fPionPdf,
42  a.GetKaonPdf() * fKaonPdf,
44  a.GetIndex() );
45 }
Double_t GetKaonPdf() const
Int_t GetIndex() const
Double_t GetElectronPdf() const
Double_t GetMuonPdf() const
Double_t GetProtonPdf() const
Double_t GetPionPdf() const
PndPidProbability & PndPidProbability::operator*= ( const PndPidProbability a)

Definition at line 46 of file PndPidProbability.cxx.

References fElectronPdf, fKaonPdf, fMuonPdf, fPionPdf, fProtonPdf, GetElectronPdf(), GetKaonPdf(), GetMuonPdf(), GetPionPdf(), and GetProtonPdf().

47 {
49  fMuonPdf *= a.GetMuonPdf();
50  fPionPdf *= a.GetPionPdf();
51  fKaonPdf *= a.GetKaonPdf();
52  fProtonPdf *= a.GetProtonPdf();
53  return *this;
54 }
Double_t GetKaonPdf() const
Double_t GetElectronPdf() const
Double_t GetMuonPdf() const
Double_t GetProtonPdf() const
Double_t GetPionPdf() const
void PndPidProbability::Print ( )

Definition at line 56 of file PndPidProbability.cxx.

References fElectronPdf, fIndex, fKaonPdf, fMuonPdf, fPionPdf, and fProtonPdf.

57 {
58  std::cout <<"PndPidProbability pdf's: "
59  <<"p(e)="<<fElectronPdf<<" "
60  <<"p(mu)="<<fMuonPdf<<" "
61  <<"p(pi)="<<fPionPdf<<" "
62  <<"p(K)="<<fKaonPdf<<" "
63  <<"p(P)="<<fProtonPdf<<" "
64  <<"index="<<fIndex
65  <<std::endl;
66 }
void PndPidProbability::Reset ( )

Definition at line 68 of file PndPidProbability.cxx.

References fElectronPdf, fIndex, fKaonPdf, fMuonPdf, fPionPdf, and fProtonPdf.

Referenced by PndAnaPidCombiner::Apply().

69 {
70  fElectronPdf = 0.2 ;
71  fMuonPdf = 0.2 ;
72  fPionPdf = 0.2 ;
73  fKaonPdf = 0.2 ;
74  fProtonPdf = 0.2 ;
75  fIndex = -1;
76 }
void PndPidProbability::SetElectronPdf ( Double_t  val)
inline
void PndPidProbability::SetIndex ( Int_t  idx)
inline
void PndPidProbability::SetKaonPdf ( Double_t  val)
inline
void PndPidProbability::SetMuonPdf ( Double_t  val)
inline
void PndPidProbability::SetPionPdf ( Double_t  val)
inline
void PndPidProbability::SetProtonPdf ( Double_t  val)
inline

Member Data Documentation

Double_t PndPidProbability::fElectronPdf
protected
Int_t PndPidProbability::fIndex
protected

Definition at line 71 of file PndPidProbability.h.

Referenced by GetIndex(), Print(), Reset(), and SetIndex().

Double_t PndPidProbability::fKaonPdf
protected
Double_t PndPidProbability::fMuonPdf
protected
Double_t PndPidProbability::fPionPdf
protected
Double_t PndPidProbability::fProtonPdf
protected

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