MINT2
Chi2Binning.h
Go to the documentation of this file.
1 #ifndef MINTDALITZ_CHI2_BINNING_HH
2 #define MINTDALITZ_CHI2_BINNING_HH
3 
4 #include "Mint/Chi2Box.h"
5 #include "Mint/Chi2BoxSet.h"
7 
9 #include "Mint/IEventList.h"
10 #include "Mint/IDalitzEvent.h"
11 #include "Mint/DalitzEvent.h"
13 #include "Mint/IDalitzPdf.h"
14 
16 #include "TH1D.h"
17 
18 #include <vector>
19 #include <iostream>
20 
22  std::vector<Chi2BoxSet> _boxSets;
23  int _nData;
24  int _nMC;
26 
27  static int* __colourPalette;
28  static int __Ncol;
29  static void makeColourPaletteBlueGrey();
30  static void makeColourPaletteBlueWhite();
31  static void makeColourPaletteRGB();
32  static void makeColourPalette();
33  static int* getColourPalette();
34 
35  void setHistoColours();
36 
38  , int maxPerBin // compatibility
39  ) const; // will be removed in future.
41  , int maxPerBin
42  ) const;
43  int mergeBoxes(Chi2BoxSet& boxes, int minPerBin);
44 
45  void resetEventCounts();
48  // for backward compatibility
49  if(0 != dataPtr) fillData(*dataPtr);// will be removed in future
50  }
53  if(0 != mcPtr) fillMC(*mcPtr, pdf);
54  }
55  double normFactor() const;
56  void setBoxesNormFactors();
57  void sortByChi2();
58  public:
59  Chi2Binning();
61  , int minPerBin = 10
62  , int maxPerBin = 100
63  );
64 
67  , IDalitzPdf* pdf
68  , IFastAmplitudeIntegrable* fas=0// usually FitAmpSum*
69  );
70 
71 
73 
74  int numBins() const;
75 
76  double getChi2_perBin() const;
77  double chi2_ofBin(unsigned int i) const;
78  double getMaxChi2() const;
79  void print(std::ostream& os = std::cout) const;
80 
84  void drawChi2Distribution(const std::string& fname = "chi2Distribution.eps")const;
85 
86 };
87 
89  public:
90  bool operator()(const Chi2Box& a, const Chi2Box& b) const;
91 };
92 
94  public:
95  bool operator()(const Chi2BoxSet& a, const Chi2BoxSet& b) const;
96 };
97 
98 std::ostream& operator<<(std::ostream& os, const Chi2Binning& c2b);
99 
100 #endif
101 //
MINT::counted_ptr< TH1D > getChi2Distribution() const
static void makeColourPaletteBlueGrey()
Definition: Chi2Binning.cpp:21
double getChi2_perBin() const
double getMaxChi2() const
static void makeColourPaletteBlueWhite()
Definition: Chi2Binning.cpp:37
void setHistoColours()
static int * __colourPalette
Definition: Chi2Binning.h:27
Chi2BoxSet splitBoxes(MINT::IMinimalEventList< DalitzEvent > *events, int maxPerBin) const
static void makeColourPaletteRGB()
Definition: Chi2Binning.cpp:53
double setEventsAndPdf(MINT::IMinimalEventList< DalitzEvent > *data, MINT::IMinimalEventList< DalitzEvent > *mc, IDalitzPdf *pdf, IFastAmplitudeIntegrable *fas=0)
void drawChi2Distribution(const std::string &fname="chi2Distribution.eps") const
void resetEventCounts()
void fillMC(MINT::IMinimalEventList< DalitzEvent > &mc, IDalitzPdf *pdf)
double chi2_ofBin(unsigned int i) const
int createBinning(MINT::IMinimalEventList< DalitzEvent > *events, int minPerBin=10, int maxPerBin=100)
Definition: Chi2Binning.cpp:87
bool operator()(const Chi2BoxSet &a, const Chi2BoxSet &b) const
void setBoxesNormFactors()
static void makeColourPalette()
Definition: Chi2Binning.cpp:70
void fillData(MINT::IMinimalEventList< DalitzEvent > &data)
double _totalMCWeight
Definition: Chi2Binning.h:25
static int __Ncol
Definition: Chi2Binning.h:28
static int * getColourPalette()
Definition: Chi2Binning.cpp:76
void fillMC(MINT::IMinimalEventList< DalitzEvent > *mcPtr, IDalitzPdf *pdf)
Definition: Chi2Binning.h:52
DalitzHistoStackSet getMCHistoStack()
int numBins() const
std::vector< Chi2BoxSet > _boxSets
Definition: Chi2Binning.h:22
DalitzHistoStackSet getDataHistoStack()
void sortByChi2()
void setFas(IFastAmplitudeIntegrable *fas)
int mergeBoxes(Chi2BoxSet &boxes, int minPerBin)
void fillData(MINT::IMinimalEventList< DalitzEvent > *dataPtr)
Definition: Chi2Binning.h:47
std::ostream & operator<<(std::ostream &os, const Chi2Binning &c2b)
void print(std::ostream &os=std::cout) const
double normFactor() const
bool operator()(const Chi2Box &a, const Chi2Box &b) const