MINT2
DalitzHistoSet.h
Go to the documentation of this file.
1 #ifndef DALITZ_HISTO_SET_HH
2 #define DALITZ_HISTO_SET_HH
3 // author: Jonas Rademacker (Jonas.Rademacker@bristol.ac.uk)
4 // status: Mon 9 Feb 2009 19:17:58 GMT
5 
6 #include "Rtypes.h"
7 
8 #include <map>
9 #include <string>
11 #include "Mint/DalitzHistogram.h"
12 #include "Mint/DalitzCoordSet.h"
13 #include "TLegend.h"
14 
15 #include "Mint/PolymorphMap.h"
16 
17 class TTree;
18 class IDalitzEvent;
19 
20 class DalitzHistoSet : public MINT::PolymorphMap<DalitzCoordSet, DalitzHistogram>{
21  //mutable TTree* _tree;
22  std::string _name;
23  void makeHistograms(const DalitzEventPattern& pat);
24  bool makeDirectory(const std::string& asSubdirOf)const;
25  const std::string& makeName();
26 
27  std::map< DalitzCoordSet, DalitzHistogram> _theMap;
28  public:
29 
31  DalitzHistoSet(const DalitzHistoSet& other);
32  virtual ~DalitzHistoSet();
33  void add(const DalitzHistogram& histo, double weight=1);
34  void add(const DalitzHistoSet& hL, double weight=1);
35 
36  void multiply(const DalitzHistogram& hL);
37  void multiply(const DalitzHistoSet& hL);
38  void divide(const DalitzHistogram& hL);
39  void divide(const DalitzHistoSet& hL);
40 
41  void addEvent(const IDalitzEvent& evt, double weight=1);
42  void scale(double sf);
43  void setNormFactor(double sf=1);
44  void clearAllHistos();
45 
46  const std::string& name() const;
47  const std::string& dirName() const;
48  std::string fullDirListFname(const std::string& asSubdirOf = ".") const;
49  bool saveAsDir(const std::string& asSubdirOf=".") const;
50  bool retrieveFromDir(const std::string& asSubDirOf=".");
51  bool save(const std::string& filename="DalitzHistos.root") const;
52  bool draw(const std::string& baseName=""
53  , const std::string& drawOpt=""
54  , const std::string& format="eps") const;
55 
56  bool drawWithFit(const DalitzHistoSet& fit
57  , const std::string& baseName=""
58  , const std::string& format="eps"
59  , const std::string& fitDrawOpt="HIST C SAME"
60  ) const;
62  DalitzHistoSet& data
63  , DalitzHistoSet& fit
64  , std::vector<DalitzHistoSet>& amps
65  , const std::string& baseName =""
66  , const std::string& format = "eps"
67  , const std::string& fitDrawOpt = "HIST C SAME"
68  ) const;
69 
71  DalitzHistoSet& data
72  , DalitzHistoSet& fit , DalitzHistoSet& interference
73  , std::vector<DalitzHistoSet>& amps
74  , const std::string& baseName =""
75  , const std::string& format = "eps"
76  , const std::string& fitDrawOpt = "HIST C SAME"
77  ) const;
78 
79  bool drawWithFitNorm(const DalitzHistoSet& fit
80  , const std::string& baseName=""
81  , const std::string& format="eps"
82  , const std::string& fitDrawOpt="HIST C SAME"
83  ) const;
84 
85 
86  void setTitle(const std::string& title);
87  void setFillColour(Color_t fcolor);
88  void setLineColour(Color_t fcolor);
89 
90  double integral() const;
91 
92  DalitzHistoSet& operator*=(double sf);
93  DalitzHistoSet operator*(double sf) const;
94  DalitzHistoSet& operator/=(double sf);
95  DalitzHistoSet operator/(double sf) const;
97  DalitzHistoSet operator+(const DalitzHistoSet& rhs) const;
99  DalitzHistoSet operator-(const DalitzHistoSet& rhs) const;
101  DalitzHistoSet operator*(const DalitzHistoSet& rhs) const;
103  DalitzHistoSet operator/(const DalitzHistoSet& rhs) const;
104 };
105 
106 DalitzHistoSet operator*(double sf, const DalitzHistoSet& dhs);
107 
108 #endif
109 //
DalitzHistoSet & operator *=(double sf)
void scale(double sf)
bool drawWithFitNorm(const DalitzHistoSet &fit, const std::string &baseName="", const std::string &format="eps", const std::string &fitDrawOpt="HIST C SAME") const
void setFillColour(Color_t fcolor)
const std::string & name() const
std::string fullDirListFname(const std::string &asSubdirOf=".") const
DalitzHistoSet operator *(double sf) const
void divide(const DalitzHistogram &hL)
void makeHistograms(const DalitzEventPattern &pat)
DalitzHistoSet operator+(const DalitzHistoSet &rhs) const
void multiply(const DalitzHistogram &hL)
std::string _name
bool drawWithFit(const DalitzHistoSet &fit, const std::string &baseName="", const std::string &format="eps", const std::string &fitDrawOpt="HIST C SAME") const
bool retrieveFromDir(const std::string &asSubDirOf=".")
DalitzHistoSet & operator+=(const DalitzHistoSet &rhs)
DalitzHistoSet & operator-=(const DalitzHistoSet &rhs)
bool draw(const std::string &baseName="", const std::string &drawOpt="", const std::string &format="eps") const
void setLineColour(Color_t fcolor)
void setTitle(const std::string &title)
DalitzHistoSet operator/(double sf) const
bool drawWithFitAndEachAmps(DalitzHistoSet &data, DalitzHistoSet &fit, std::vector< DalitzHistoSet > &amps, const std::string &baseName="", const std::string &format="eps", const std::string &fitDrawOpt="HIST C SAME") const
std::map< DalitzCoordSet, DalitzHistogram > _theMap
DalitzHistoSet operator-(const DalitzHistoSet &rhs) const
bool makeDirectory(const std::string &asSubdirOf) const
void addEvent(const IDalitzEvent &evt, double weight=1)
double integral() const
bool drawWithFitAndEachAmpsAndInterference(DalitzHistoSet &data, DalitzHistoSet &fit, DalitzHistoSet &interference, std::vector< DalitzHistoSet > &amps, const std::string &baseName="", const std::string &format="eps", const std::string &fitDrawOpt="HIST C SAME") const
void setNormFactor(double sf=1)
bool saveAsDir(const std::string &asSubdirOf=".") const
virtual ~DalitzHistoSet()
DalitzHistoSet operator *(double sf, const DalitzHistoSet &dhs)
DalitzHistoSet & operator/=(double sf)
const std::string & dirName() const
bool save(const std::string &filename="DalitzHistos.root") const
void add(const DalitzHistogram &histo, double weight=1)
const std::string & makeName()