MINT2
DalitzEventList.h
Go to the documentation of this file.
1 #ifndef DALITZEVENTLIST_HH
2 #define DALITZEVENTLIST_HH
3 // author: Jonas Rademacker (Jonas.Rademacker@bristol.ac.uk)
4 // status: Mon 9 Feb 2009 19:18:00 GMT
5 
6 #include <string>
7 
8 #include "Mint/EventList.h"
9 #include "Mint/IDalitzEvent.h"
10 #include "Mint/IDalitzEventList.h"
12 #include "Mint/DalitzEvent.h"
14 //#include "Mint/IDalitzEventAccess.h"
15 //#include "Mint/IEventAccess.h"
16 #include "Mint/DalitzHistoSet.h"
17 
18 #include "Mint/PlotSet.h"
20 
21 #include "Mint/counted_ptr.h"
22 
23 class TRandom;
24 class TH1D;
25 class TH2D;
26 class TTree;
27 #include "TFile.h"
28 
29 class FitAmpSum;
30 
31 namespace MINT{
32  class IReturnReal;
33 }
34 
36 : public MINT::EventList<DalitzEvent>
37 {
38  static const std::string _className;
39  protected:
40  TFile* _file;
41  //MINT::counted_ptr<TFile> _file;
42 
43  public:
45  DalitzEventList(const DalitzEventList& other);
46  DalitzEventList(TNtupleD*);
47  virtual ~DalitzEventList();
48 
49  const std::string& className() const{return _className;}
50 
51  // virtual bool Add(const DalitzEvent& evt);
52  // virtual bool Add(const MINT::counted_ptr<DalitzEvent>& evtPtr);
53 
54  int generatePhaseSpaceEvents(int NumEvents
55  , const DalitzEventPattern& pat
56  , TRandom* rnd=0
57  );
58  int generateEvents(unsigned int NumEvents
59  , const DalitzEventPattern& pat
61  , TRandom* rnd
62  );
63 
64  TH1D* makePlot(const std::vector<int> sij
65  , const std::string& name
66  , MINT::IReturnRealForEvent<IDalitzEvent>* weightFunction=0
67  , int nbins = 100
68  , double units = GeV*GeV
69  , char opt = 's'
70  );
71 
72  TH2D* makePlot2D(const std::vector<int> sijIndicesX
73  ,const std::vector<int> sijIndicesY
74  , const std::string& name
75  , MINT::IReturnRealForEvent<IDalitzEvent>* weightFunction =0
76  , int nbins =10
77  , double units = GeV*GeV
78  , char opt ='s'// = s, m
79  );
80 
81  TNtupleD* makePlotNtp( const std::string& name_prefix="DalitzPlotNtp"
82  , MINT::IReturnRealForEvent<IDalitzEvent>* weightFunction =0
83  , double units = GeV*GeV
84  );
85 
86  DalitzHistoSet histoSet() const;
90 
91  bool makePlots(const std::string& filename) const;
92 
93  /*
94  units could be GeV*GeV, or MeV*MeV, where GeV
95  and MeV are from CLHEPSystemsOfUnits.h
96  weight is a function/class ptr. Set to zero to
97  just fill the histograms with events (weight=1)
98  */
99 
100 
101  PlotSet makeAllPlots( const std::string& name_prefix
102  , MINT::IReturnRealForEvent<IDalitzEvent>* weightFunction=0
103  , int nbins1D = 100
104  , int nbins2D = 10
105  , double units = GeV*GeV
106  );
107 
108 
109  bool save(const std::string& fname = "DalitzEvents.root") const;
110  bool fromFile(const std::string& fname = "DalitzEvents.root");
111 
112  TNtupleD* makeNtuple() const;
113  TNtupleD* makeNtuple(const std::string& ntpName) const;
114 
115  bool saveAsNtuple(const std::string& fname="DalitzEvents.root")const;
116  bool saveAsNtuple(const std::string& fname
117  , const std::string& ntpName
118  ) const;
119  bool fromNtuple(TTree* ntp);
120  bool fromNtuple(TTree* ntp, double num);
121 
122  bool fromNtupleFile(const std::string& fname="DalitzEvents.root");
123 
124 };
125 
126 #endif
127 //
bool fromFile(const std::string &fname="DalitzEvents.root")
virtual ~DalitzEventList()
TNtupleD * makeNtuple() const
DalitzHistoSet weighedReWeightedHistoSet(MINT::IReturnRealForEvent< IDalitzEvent > *w)
bool save(const std::string &fname="DalitzEvents.root") const
TH2D * makePlot2D(const std::vector< int > sijIndicesX, const std::vector< int > sijIndicesY, const std::string &name, MINT::IReturnRealForEvent< IDalitzEvent > *weightFunction=0, int nbins=10, double units=GeV *GeV, char opt='s')
DalitzHistoSet reWeightedHistoSet(MINT::IReturnRealForEvent< IDalitzEvent > *w)
bool fromNtupleFile(const std::string &fname="DalitzEvents.root")
static const std::string _className
int generateEvents(unsigned int NumEvents, const DalitzEventPattern &pat, MINT::IReturnRealForEvent< IDalitzEvent > *amps, TRandom *rnd)
DalitzHistoSet weightedHistoSet() const
TNtupleD * makePlotNtp(const std::string &name_prefix="DalitzPlotNtp", MINT::IReturnRealForEvent< IDalitzEvent > *weightFunction=0, double units=GeV *GeV)
bool makePlots(const std::string &filename) const
bool fromNtuple(TTree *ntp)
PlotSet makeAllPlots(const std::string &name_prefix, MINT::IReturnRealForEvent< IDalitzEvent > *weightFunction=0, int nbins1D=100, int nbins2D=10, double units=GeV *GeV)
static const double GeV
const std::string & className() const
DalitzHistoSet histoSet() const
bool saveAsNtuple(const std::string &fname="DalitzEvents.root") const
int generatePhaseSpaceEvents(int NumEvents, const DalitzEventPattern &pat, TRandom *rnd=0)
TH1D * makePlot(const std::vector< int > sij, const std::string &name, MINT::IReturnRealForEvent< IDalitzEvent > *weightFunction=0, int nbins=100, double units=GeV *GeV, char opt='s')