MINT2
Public Member Functions | Private Attributes | List of all members
DalitzMCMC Class Reference

#include <DalitzMCMC.h>

Public Member Functions

 DalitzMCMC (const DalitzEventPattern &pat, const unsigned int &seed=0)
 
void FillEventList (DalitzEventList &evtList, const unsigned int &NEvents)
 
DalitzEvent GetFlatEvent ()
 

Private Attributes

const DalitzEventPattern _pat
 
const unsigned int _nbody
 
MINT::MinuitParameterSet _myOwnPSet
 
FitAmpSum _pdf
 
TLorentzVector _P
 
TGenPhaseSpace _event
 

Detailed Description

Definition at line 12 of file DalitzMCMC.h.

Constructor & Destructor Documentation

◆ DalitzMCMC()

DalitzMCMC::DalitzMCMC ( const DalitzEventPattern pat,
const unsigned int &  seed = 0 
)

Definition at line 8 of file DalitzMCMC.cpp.

10  : _pat(pat)
12  , _myOwnPSet()
13  , _pdf(_pat, &_myOwnPSet)
14 {
15  //Setup TGenPhaseSpace
16  _P.SetXYZM( 0.0, 0.0, 0.0, _pat[0].mass() );
17 
18  std::vector<double> masses(_nbody);
19  for( unsigned int i=0; i<_nbody; i++ )
20  masses[i] = _pat[i+1].mass();
21 
22  gRandom->SetSeed(seed);
23  _event.SetDecay(_P, _nbody, &masses[0]);
24 }
TLorentzVector _P
Definition: DalitzMCMC.h:38
MINT::MinuitParameterSet _myOwnPSet
Definition: DalitzMCMC.h:35
const DalitzEventPattern _pat
Definition: DalitzMCMC.h:32
FitAmpSum _pdf
Definition: DalitzMCMC.h:36
const unsigned int _nbody
Definition: DalitzMCMC.h:33
TGenPhaseSpace _event
Definition: DalitzMCMC.h:39

Member Function Documentation

◆ FillEventList()

void DalitzMCMC::FillEventList ( DalitzEventList evtList,
const unsigned int &  NEvents 
)

Uses the Metropolis-Hastings algorithm (Markov Chain) to sample a Dalitz plot ampitude-squared probability density and fill a DalitzEventList.

Definition at line 26 of file DalitzMCMC.cpp.

28 {
29  //Markov Chain
30  double ratio;
31 
32  //Start event
33  DalitzEvent candEvent_start = GetFlatEvent();
34 
35  //Next event
36  DalitzEvent candEvent_next;
37 
38  for( unsigned int i=0; i<NEvents; i++ ){
39  candEvent_next = GetFlatEvent();
40 
41  const double pdf_start = _pdf.Prob(candEvent_start);
42 
43  const double pdf_next = _pdf.Prob(candEvent_next);
44 
45  ratio = pdf_next/pdf_start;
46  if( ratio >= 1.0 ){
47  candEvent_start = candEvent_next;
48  evtList.Add(candEvent_next);
49  }else{
50  const double height = gRandom->Rndm();
51  if( height < ratio ){
52  candEvent_start = candEvent_next;
53  evtList.Add(candEvent_next);
54  }else{
55  evtList.Add(candEvent_start);
56  }
57  }
58  }
59 }
virtual bool Add(const EVENT_TYPE &evt)
Definition: EventList.h:63
DalitzEvent GetFlatEvent()
Definition: DalitzMCMC.cpp:61
virtual double Prob(IDalitzEvent &evt)
Definition: FitAmpSum.h:100
FitAmpSum _pdf
Definition: DalitzMCMC.h:36

◆ GetFlatEvent()

DalitzEvent DalitzMCMC::GetFlatEvent ( )

Performs hit-and-miss using TGenPhaseSpace to generate a uniformly distributed phase space event.

Definition at line 61 of file DalitzMCMC.cpp.

62 {
63  std::vector<TLorentzVector> p4_mumAndDgtr(_nbody+1);
64 
65  //Fill mother momentum
66  p4_mumAndDgtr[0] = _P;
67 
68  //Fill daughter momenta
69  while(true){
70  const double weight = _event.Generate();
71  const double height = gRandom->Uniform(1.0/weight);
72 
73  if( height < 1.0 ){
74  for( unsigned int i=0; i<_nbody; i++ )
75  p4_mumAndDgtr[i+1] = *(_event.GetDecay(i));
76 
77  break;
78  }
79  }
80 
81  const DalitzEvent flatEvent(_pat, p4_mumAndDgtr);
82  return flatEvent;
83 }
TLorentzVector _P
Definition: DalitzMCMC.h:38
const DalitzEventPattern _pat
Definition: DalitzMCMC.h:32
const unsigned int _nbody
Definition: DalitzMCMC.h:33
TGenPhaseSpace _event
Definition: DalitzMCMC.h:39

Member Data Documentation

◆ _event

TGenPhaseSpace DalitzMCMC::_event
private

Definition at line 39 of file DalitzMCMC.h.

◆ _myOwnPSet

MINT::MinuitParameterSet DalitzMCMC::_myOwnPSet
private

Definition at line 35 of file DalitzMCMC.h.

◆ _nbody

const unsigned int DalitzMCMC::_nbody
private

Definition at line 33 of file DalitzMCMC.h.

◆ _P

TLorentzVector DalitzMCMC::_P
private

Definition at line 38 of file DalitzMCMC.h.

◆ _pat

const DalitzEventPattern DalitzMCMC::_pat
private

Definition at line 32 of file DalitzMCMC.h.

◆ _pdf

FitAmpSum DalitzMCMC::_pdf
private

Definition at line 36 of file DalitzMCMC.h.


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