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

#include <Chi2Box.h>

Public Member Functions

 Chi2Box ()
 
 Chi2Box (const DalitzEventPattern &pat)
 
 Chi2Box (const DalitzArea &area)
 
 Chi2Box (const Chi2Box &other)
 
virtual ~Chi2Box ()
 
MINT::PolymorphVector< Chi2Boxsplit (int n=2)
 
void resetEventCounts ()
 
void resetAll ()
 
void enclosePhaseSpace (double safetyFactor=1.2)
 
bool addData (const IDalitzEvent &evt)
 
bool addData (const IDalitzEvent *evt)
 
bool addMC (const IDalitzEvent &evt, double weight)
 
bool addMC (const IDalitzEvent *evt, double weight)
 
int nData () const
 
int nMC () const
 
double weightedMC () const
 
double weightedMC2 () const
 
double rmsMC (int Ntotal) const
 
double t01Min () const
 
double t01Max () const
 
double s12Min () const
 
double s12Max () const
 
double s23Min () const
 
double s23Max () const
 
double s34Min () const
 
double s34Max () const
 
double t40Min () const
 
double t40Max () const
 
void print (std::ostream &os=std::cout) const
 

Private Attributes

DalitzArea _area
 
int _nData
 
int _nMC
 
double _nWeightedMC
 
double _weightMC_Squared
 

Detailed Description

Definition at line 11 of file Chi2Box.h.

Constructor & Destructor Documentation

◆ Chi2Box() [1/4]

Chi2Box::Chi2Box ( )

Definition at line 7 of file Chi2Box.cpp.

8  : _area()
9  , _nData(0)
10  , _nMC(0)
11  , _nWeightedMC(0.0)
12  , _weightMC_Squared(0.0)
13 {}
int _nData
Definition: Chi2Box.h:14
DalitzArea _area
Definition: Chi2Box.h:12
double _nWeightedMC
Definition: Chi2Box.h:16
double _weightMC_Squared
Definition: Chi2Box.h:18
int _nMC
Definition: Chi2Box.h:15

◆ Chi2Box() [2/4]

Chi2Box::Chi2Box ( const DalitzEventPattern pat)

Definition at line 14 of file Chi2Box.cpp.

15  : _area(pat)
16  , _nData(0)
17  , _nMC(0)
18  , _nWeightedMC(0.0)
19  , _weightMC_Squared(0.0)
20 {
22 }
void enclosePhaseSpace(double safetyFactor=1.2)
Definition: Chi2Box.cpp:38
int _nData
Definition: Chi2Box.h:14
DalitzArea _area
Definition: Chi2Box.h:12
double _nWeightedMC
Definition: Chi2Box.h:16
double _weightMC_Squared
Definition: Chi2Box.h:18
int _nMC
Definition: Chi2Box.h:15

◆ Chi2Box() [3/4]

Chi2Box::Chi2Box ( const DalitzArea area)

Definition at line 23 of file Chi2Box.cpp.

24  : _area(area)
25  , _nData(0)
26  , _nMC(0)
27  , _nWeightedMC(0.0)
28  , _weightMC_Squared(0.0)
29 {}
int _nData
Definition: Chi2Box.h:14
DalitzArea _area
Definition: Chi2Box.h:12
double _nWeightedMC
Definition: Chi2Box.h:16
double _weightMC_Squared
Definition: Chi2Box.h:18
int _nMC
Definition: Chi2Box.h:15

◆ Chi2Box() [4/4]

Chi2Box::Chi2Box ( const Chi2Box other)

Definition at line 30 of file Chi2Box.cpp.

31  : _area(other._area)
32  , _nData(other._nData)
33  , _nMC(other._nMC)
34  , _nWeightedMC(other._nWeightedMC)
36 {}
int _nData
Definition: Chi2Box.h:14
DalitzArea _area
Definition: Chi2Box.h:12
double _nWeightedMC
Definition: Chi2Box.h:16
double _weightMC_Squared
Definition: Chi2Box.h:18
int _nMC
Definition: Chi2Box.h:15

◆ ~Chi2Box()

virtual Chi2Box::~Chi2Box ( )
inlinevirtual

Definition at line 25 of file Chi2Box.h.

25 {}

Member Function Documentation

◆ addData() [1/2]

bool Chi2Box::addData ( const IDalitzEvent evt)

Definition at line 68 of file Chi2Box.cpp.

68  {
69  if(! _area.isInside(evt)) return false;
70  _nData++;
71  return true;
72 }
bool isInside(const IDalitzEvent &evt) const
Definition: DalitzArea.cpp:214
int _nData
Definition: Chi2Box.h:14
DalitzArea _area
Definition: Chi2Box.h:12

◆ addData() [2/2]

bool Chi2Box::addData ( const IDalitzEvent evt)

Definition at line 73 of file Chi2Box.cpp.

73  {
74  bool dbThis=false;
75  if(0 == evt) return false;
76  if(dbThis) cout << "Chi2Box::addData for pointers called" << endl;
77  if(! _area.isInside(*evt)) return false;
78  if(dbThis){
79  cout << "found data event inside area. This is the event:" << endl;
80  evt->print();
81  }
82 
83  _nData++;
84  return true;
85 }
bool isInside(const IDalitzEvent &evt) const
Definition: DalitzArea.cpp:214
int _nData
Definition: Chi2Box.h:14
DalitzArea _area
Definition: Chi2Box.h:12
virtual void print(std::ostream &os=std::cout) const =0

◆ addMC() [1/2]

bool Chi2Box::addMC ( const IDalitzEvent evt,
double  weight 
)

Definition at line 86 of file Chi2Box.cpp.

86  {
87  if(! _area.isInside(evt)) return false;
88  _nMC++;
89  _nWeightedMC += weight;
90  return true;
91 }
bool isInside(const IDalitzEvent &evt) const
Definition: DalitzArea.cpp:214
DalitzArea _area
Definition: Chi2Box.h:12
double _nWeightedMC
Definition: Chi2Box.h:16
int _nMC
Definition: Chi2Box.h:15

◆ addMC() [2/2]

bool Chi2Box::addMC ( const IDalitzEvent evt,
double  weight 
)

Definition at line 92 of file Chi2Box.cpp.

92  {
93  bool dbThis=false;
94  if(dbThis) cout << "Chi2Box::addMC for pointers called" << endl;
95  if(0 == evt) return false;
96  if(dbThis){
97  cout << "...area inside for this event:" << endl;
98  evt->print();
99  }
100  if(! _area.isInside(*evt)) return false;
101  _nMC++;
102  _nWeightedMC += weight;
103  _weightMC_Squared += weight*weight;
104 
105  if(dbThis) cout << "Chi2Box::addMC returning; have nMC = "<< _nMC << endl;
106  return true;
107 }
bool isInside(const IDalitzEvent &evt) const
Definition: DalitzArea.cpp:214
DalitzArea _area
Definition: Chi2Box.h:12
virtual void print(std::ostream &os=std::cout) const =0
double _nWeightedMC
Definition: Chi2Box.h:16
double _weightMC_Squared
Definition: Chi2Box.h:18
int _nMC
Definition: Chi2Box.h:15

◆ enclosePhaseSpace()

void Chi2Box::enclosePhaseSpace ( double  safetyFactor = 1.2)

Definition at line 38 of file Chi2Box.cpp.

38  {
39  bool dbThis=true;
40  if(dbThis) cout << "box: setting limits to phase space area" << endl;
41  _area.setAllLimitsToPhaseSpaceArea(safetyFactor);
42  if(dbThis) cout << "result: " << _area << endl;
43 }
void setAllLimitsToPhaseSpaceArea(double safetyFactor=1.0)
Definition: DalitzArea.cpp:165
DalitzArea _area
Definition: Chi2Box.h:12

◆ nData()

int Chi2Box::nData ( ) const

Definition at line 109 of file Chi2Box.cpp.

109  {
110  return _nData;
111 }
int _nData
Definition: Chi2Box.h:14

◆ nMC()

int Chi2Box::nMC ( ) const

Definition at line 112 of file Chi2Box.cpp.

112  {
113  return _nMC;
114 }
int _nMC
Definition: Chi2Box.h:15

◆ print()

void Chi2Box::print ( std::ostream &  os = std::cout) const

Definition at line 142 of file Chi2Box.cpp.

142  {
143  os << "box: with area " << _area;
144 }
DalitzArea _area
Definition: Chi2Box.h:12

◆ resetAll()

void Chi2Box::resetAll ( )

Definition at line 63 of file Chi2Box.cpp.

63  {
66 }
void enclosePhaseSpace(double safetyFactor=1.2)
Definition: Chi2Box.cpp:38
void resetEventCounts()
Definition: Chi2Box.cpp:57

◆ resetEventCounts()

void Chi2Box::resetEventCounts ( )

Definition at line 57 of file Chi2Box.cpp.

57  {
58  _nData = 0;
59  _nMC = 0;
60  _nWeightedMC=0.0;
61  _weightMC_Squared = 0.0;
62 }
int _nData
Definition: Chi2Box.h:14
double _nWeightedMC
Definition: Chi2Box.h:16
double _weightMC_Squared
Definition: Chi2Box.h:18
int _nMC
Definition: Chi2Box.h:15

◆ rmsMC()

double Chi2Box::rmsMC ( int  Ntotal) const

Definition at line 121 of file Chi2Box.cpp.

121  {
122  bool dbThis=false;
123  if(dbThis){
124  cout << Ntotal
125  << endl;
126  }
127  return weightedMC2();
128  /*
129  bool dbThis=false;
130  double dN = (double) Ntotal;
131  double msq = weightedMC2() /(dN);
132  double m = weightedMC() /(dN);
133  if(dbThis){
134  cout << "Chi2BoxSet::rmsMC() "
135  << " msq " << msq << " m " << m << " m*m " << m*m
136  << " rms " << msq - m*m
137  << endl;
138  }
139  return (msq - m*m) * dN;
140  */
141 }
double weightedMC2() const
Definition: Chi2Box.cpp:118

◆ s12Max()

double Chi2Box::s12Max ( ) const
inline

Definition at line 50 of file Chi2Box.h.

50 {return _area._s12.max();}
double max() const
DalitzArea _area
Definition: Chi2Box.h:12
DalitzCoordinate _s12
Definition: DalitzArea.h:51

◆ s12Min()

double Chi2Box::s12Min ( ) const
inline

Definition at line 49 of file Chi2Box.h.

49 {return _area._s12.min();}
double min() const
DalitzArea _area
Definition: Chi2Box.h:12
DalitzCoordinate _s12
Definition: DalitzArea.h:51

◆ s23Max()

double Chi2Box::s23Max ( ) const
inline

Definition at line 53 of file Chi2Box.h.

53 {return _area._s23.max();}
double max() const
DalitzArea _area
Definition: Chi2Box.h:12
DalitzCoordinate _s23
Definition: DalitzArea.h:51

◆ s23Min()

double Chi2Box::s23Min ( ) const
inline

Definition at line 52 of file Chi2Box.h.

52 {return _area._s23.min();}
double min() const
DalitzArea _area
Definition: Chi2Box.h:12
DalitzCoordinate _s23
Definition: DalitzArea.h:51

◆ s34Max()

double Chi2Box::s34Max ( ) const
inline

Definition at line 56 of file Chi2Box.h.

56 {return _area._s34.max();}
double max() const
DalitzArea _area
Definition: Chi2Box.h:12
DalitzCoordinate _s34
Definition: DalitzArea.h:51

◆ s34Min()

double Chi2Box::s34Min ( ) const
inline

Definition at line 55 of file Chi2Box.h.

55 {return _area._s34.min();}
double min() const
DalitzArea _area
Definition: Chi2Box.h:12
DalitzCoordinate _s34
Definition: DalitzArea.h:51

◆ split()

MINT::PolymorphVector< Chi2Box > Chi2Box::split ( int  n = 2)

Definition at line 45 of file Chi2Box.cpp.

45  {
46 
49 
50  for(unsigned int i=0; i < va.size(); i++){
51  Chi2Box b(va[i]);
52  vb[i]=b;
53  }
54  return vb;
55 }
std::vector< DalitzArea > split_in_all_dimensions(int n=2) const
Definition: DalitzArea.cpp:371
DalitzArea _area
Definition: Chi2Box.h:12
unsigned int size() const

◆ t01Max()

double Chi2Box::t01Max ( ) const
inline

Definition at line 47 of file Chi2Box.h.

47 {return _area._t01.max();}
double max() const
DalitzArea _area
Definition: Chi2Box.h:12
DalitzCoordinate _t01
Definition: DalitzArea.h:51

◆ t01Min()

double Chi2Box::t01Min ( ) const
inline

Definition at line 46 of file Chi2Box.h.

46 {return _area._t01.min();} // = s234
double min() const
DalitzArea _area
Definition: Chi2Box.h:12
DalitzCoordinate _t01
Definition: DalitzArea.h:51

◆ t40Max()

double Chi2Box::t40Max ( ) const
inline

Definition at line 59 of file Chi2Box.h.

59 {return _area._t40.max();}
double max() const
DalitzArea _area
Definition: Chi2Box.h:12
DalitzCoordinate _t40
Definition: DalitzArea.h:51

◆ t40Min()

double Chi2Box::t40Min ( ) const
inline

Definition at line 58 of file Chi2Box.h.

58 {return _area._t40.min();} // = s123
double min() const
DalitzArea _area
Definition: Chi2Box.h:12
DalitzCoordinate _t40
Definition: DalitzArea.h:51

◆ weightedMC()

double Chi2Box::weightedMC ( ) const

Definition at line 115 of file Chi2Box.cpp.

115  {
116  return _nWeightedMC;
117 }
double _nWeightedMC
Definition: Chi2Box.h:16

◆ weightedMC2()

double Chi2Box::weightedMC2 ( ) const

Definition at line 118 of file Chi2Box.cpp.

118  {
119  return _weightMC_Squared;
120 }
double _weightMC_Squared
Definition: Chi2Box.h:18

Member Data Documentation

◆ _area

DalitzArea Chi2Box::_area
private

Definition at line 12 of file Chi2Box.h.

◆ _nData

int Chi2Box::_nData
private

Definition at line 14 of file Chi2Box.h.

◆ _nMC

int Chi2Box::_nMC
private

Definition at line 15 of file Chi2Box.h.

◆ _nWeightedMC

double Chi2Box::_nWeightedMC
private

Definition at line 16 of file Chi2Box.h.

◆ _weightMC_Squared

double Chi2Box::_weightMC_Squared
private

Definition at line 18 of file Chi2Box.h.


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