BOSS 8.0.0
BESIII Offline Software System
Loading...
Searching...
No Matches
EvtDalitzFlatPdf.cc
Go to the documentation of this file.
1#include "EvtPatches.hh"
2/*******************************************************************************
3 * Project: BaBar detector at the SLAC PEP-II B-factory
4 * Package: EvtGenBase
5 * File: $Id: EvtDalitzFlatPdf.cc,v 1.1.1.2 2007/10/26 05:03:14 pingrg Exp $
6 * Author: Alexei Dvoretskii, dvoretsk@slac.stanford.edu, 2001-2002
7 *
8 * Copyright (C) 2002 Caltech
9 *******************************************************************************/
10
11#include "EvtDalitzFlatPdf.hh"
12#include "EvtPatches.hh"
13#include <cstdlib>
14
17
20
22
26
27double EvtDalitzFlatPdf::pdf( const EvtDalitzPoint& ) const { return 1.; }
28
30 return EvtValError( _dp.getArea( N ), 0. );
31}
32
34 // To obtain a uniform distribution generate
35 // in terms of q's. Generate in a box that circumscribes the
36 // Dalitz plot. Accept points inside. If there are two
37 // many unsuccessful attempts it's a hint that the Dalitz plot
38 // area is tiny compared to the box. It's a pathological
39 // case. Abort.
40
43
44 int n = 0;
45 int maxTries = 1000;
46 while ( n++ < maxTries )
47 {
48
49 double q1 = EvtRandom::Flat( _dp.qAbsMin( pair1 ), _dp.qAbsMax( pair2 ) );
50 double q2 = EvtRandom::Flat( _dp.qAbsMin( pair2 ), _dp.qAbsMax( pair2 ) );
51
52 EvtDalitzCoord point( pair1, q1, pair2, q2 );
53 EvtDalitzPoint x( _dp, point );
54
55 if ( x.isValid() ) return x;
56 }
57
58 printf( "No point generated for dalitz plot after %d tries\n", maxTries );
59 abort();
60}
const Int_t n
Double_t x[10]
EvtDalitzFlatPdf(const EvtDalitzPlot &dp)
virtual double pdf(const EvtDalitzPoint &) const
virtual EvtDalitzPoint randomPoint()
virtual ~EvtDalitzFlatPdf()
virtual EvtPdf< EvtDalitzPoint > * clone() const
virtual EvtValError compute_integral() const
Definition EvtPdf.hh:91
static double Flat()
Definition EvtRandom.cc:69