MINT2
TimeDependentGeneratorOld.h
Go to the documentation of this file.
1 #ifndef __TIMEDEPENDENTGENERATOROLD_H__
2 #define __TIMEDEPENDENTGENERATOROLD_H__
3 
4 #include "Mint/FitAmpSum.h"
5 #include "Mint/DalitzEvent.h"
6 #include "Mint/SignalGenerator.h"
7 #include <memory>
8 #include <list>
9 #include <map>
10 #include <complex>
11 #include <string>
12 #include <Mint/SplineGenerator.h>
13 
14 class TRandom3 ;
15 
16 // Class to generate time dependent phase space events.
18 
19 public :
20  // Class to hold the generator at a given time point.
21  class GenTimePoint {
22  public :
23  GenTimePoint(const double _decaytime, FitAmpSum* _model,
24  const double _integral, SignalGenerator* _generator) ;
25 
26  const double decaytime ;
27  const double integral ;
28  std::unique_ptr<FitAmpSum> model ;
29  std::unique_ptr<SignalGenerator> generator ;
30  } ;
31 
32  typedef std::list<GenTimePoint> GenList ;
33  typedef std::map<int, GenList> GenMap ;
34  typedef std::pair<std::complex<double>, std::complex<double> > AmpPair ;
35 
36  // Class to hold the tag (production flavour), decay time and
37  // Dalitz event that's generated.
38  class GenTimeEvent : public DalitzEvent {
39  public :
40  GenTimeEvent(const IDalitzEvent&, const int, const double,
41  const double smeareddecaytime = -999.) ;
42  GenTimeEvent(const IDalitzEvent&) ;
43  int getTag() const ;
44  void setTag(int) ;
45  double getDecayTime() const ;
46  void setDecayTime(double) ;
47  double getSmearedDecayTime() const ;
48  void setSmearedDecayTime(double) ;
50  static std::map<std::string, unsigned> infoNames ;
51  private :
52  static std::map<std::string, unsigned> makeInfoNames() ;
53  } ;
54 
55  // Take the CP conjugate of the head of the decay pattern.
57 
58  /* Constructor, takes:
59  name : the name of the generator and the directory in which the integrators will be saved.
60  overwrite : whether to overwrite the existing integrator files (if they exist).
61  rndm : The random number generator to use.
62  precision : The precision to which the integrals must be calculated.
63  pattern : The event pattern to be used (the CP conjugate will automatically be added).
64  width : the decay width in 1/ps.
65  deltam : the delta-mass in 1/ps.
66  deltagamma : the delta-gamma in 1/ps.
67  qoverp : the magnitude of q/p.
68  phi : the phase of q/p.
69  tmax : the maximum decay time that'll be generated.
70  ntimepoints : the number of points to sample between 0 and tmax when building the generators.
71  h_efficiency : (optional) histogram to which efficiency plot will be fitted
72  */
73  TimeDependentGeneratorOld(const std::string& name, const bool overwrite, TRandom3* rndm, double precision,
74  const DalitzEventPattern& pattern, double width, double deltam,
75  double deltagamma,
76  double qoverp, double phi, double tmax, int ntimepoints,
77  const bool saveIntegEvents = true, double tmin = 0., TH1F* h_efficiency = NULL,
78  float resWidth = 0.05, bool addExpEffects = false) ;
79 
80  // Get the coefficients of the amplitudes for the produced flavour and the mixed flavour
81  // given the tag and decay time.
82  AmpPair amplitude_coefficients(const int tag, const double decaytime) ;
83 
84  // Generate a flavour.
85  int generate_tag() const ;
86 
87  // Generate a decay time for the given flavour.
88  double generate_decay_time(const int tag) const ;
89 
90  // Generate a Dalitz event for the given flavour and decay time.
91  MINT::counted_ptr<IDalitzEvent> generate_dalitz_event(const int tag, const double decaytime) const ;
92 
93  // Generate a flavour, decay time and Dalitz event.
95 
96  // Get the decay time generators.
97  const std::map<int, SplineGenerator> time_generators() const ;
98 
99 private :
100  const std::string m_name ;
101  TRandom3* m_rndm ;
104 
105  const double m_width ;
106  const double m_deltam ;
107  const double m_deltagamma ;
108  const double m_qoverp ;
109  const double m_phi ;
110 
111  const double m_tmax ;
112  const double m_tmin ;
113  const int m_ntimepoints ;
114 
116 
117  std::map<int, SplineGenerator> m_timegenerators ;
118 
120  double m_precision ;
121 
123  TSpline3 m_efficiencyFit;
124 
125  float m_resWidth;
127 } ;
128 
129 #endif
TimeDependentGeneratorOld(const std::string &name, const bool overwrite, TRandom3 *rndm, double precision, const DalitzEventPattern &pattern, double width, double deltam, double deltagamma, double qoverp, double phi, double tmax, int ntimepoints, const bool saveIntegEvents=true, double tmin=0., TH1F *h_efficiency=NULL, float resWidth=0.05, bool addExpEffects=false)
const DalitzEventPattern m_cppattern
MINT::counted_ptr< IDalitzEvent > generate_dalitz_event(const int tag, const double decaytime) const
std::map< int, GenList > GenMap
const DalitzEventPattern m_pattern
static std::map< std::string, unsigned > infoNames
std::list< GenTimePoint > GenList
GenTimePoint(const double _decaytime, FitAmpSum *_model, const double _integral, SignalGenerator *_generator)
std::pair< std::complex< double >, std::complex< double > > AmpPair
AmpPair amplitude_coefficients(const int tag, const double decaytime)
std::map< int, SplineGenerator > m_timegenerators
double generate_decay_time(const int tag) const
GenTimeEvent(const IDalitzEvent &, const int, const double, const double smeareddecaytime=-999.)
const std::map< int, SplineGenerator > time_generators() const
static DalitzEventPattern anti(DalitzEventPattern pat)
std::unique_ptr< SignalGenerator > generator
static std::map< std::string, unsigned > makeInfoNames()
MINT::counted_ptr< IDalitzEvent > generate_event() const