MINT2
singleTopHatShape.cpp
Go to the documentation of this file.
1 #include <sstream>
2 
4 //#include "Mint/Utils.h"
5 #include "Mint/FlatFct.h"
6 
7 using namespace std;
8 using namespace MINT;
9 
11  , double mini, double maxi
12  , const std::string& namePrefix)
13  : _genFct(0)
14  , _theDecay(decay)
15  , _min_sij(mini)
16  , _max_sij(maxi)
17  , _prefix(namePrefix)
18 {
19  if(_theDecay.nDgtr() > 2 && ! (startOfDecayChain())){
20  std::cout << "WARNING: singleTopHatShape can only properly handle"
21  << "\n > two body decays."
22  << "\n > This: " << _theDecay.oneLiner()
23  << "\n > is a " << _theDecay.nDgtr() << " body decay."
24  << "\n > Please improve me."
25  << std::endl;
26  std::cout << " startOfDecayChain()? " << startOfDecayChain()
27  << std::endl;
28  }
29 }
31  : ILineshape()
32  , FitParDependent(other)
33  , _genFct(other._genFct)
34  , _theDecay(other._theDecay)
35  , _min_sij(other._min_sij)
36  , _max_sij(other._max_sij)
37  , _prefix(other._prefix)
38 {
39 }
40 
43  coord.setMinMax(_min_sij, _max_sij);
44  return coord;
45 }
46 
48  std::vector<int> asi = _theDecay.getVal().asi();
49  if(asi.size() < 2){
50  cout << "ERROR in singleTopHatShape::mumsRecoMass2() "
52  << ", " << _theDecay.getVal().name()
53  << " decays into " << asi.size() << " particles?\n"
54  << _theDecay
55  << endl;
56  }
57  double mumsRM = evt.sij(asi);
58  return mumsRM;
59 }
60 std::complex<double> singleTopHatShape::getValue(IDalitzEvent& evt) const{
61  double m = mumsRecoMass2(evt);
62  if(m >= min() && m < max()) return 1;
63  else return 0;
64 }
65 std::complex<double> singleTopHatShape::getVal(IDalitzEvent& evt){
66  return getValue(evt);
67 }
68 
69 
71  if(! _genFct){
73  fptr->setBoxLimits(min(), max());
74  fptr->setLimits(min(), max());
75 
77  }
78 }
79 
81  if(! _genFct){
83  }
84  return _genFct;
85 }
86 
87 std::string singleTopHatShape::name() const{
88  std::stringstream strm;
89  strm << "singleTopHatShape["
90  << min() << "," << max() << "]("
91  << prefix()
92  << _theDecay.oneLiner() << ")";
93  std::string ing;
94  strm >> ing;
95  return ing;
96 }
97 
98 void singleTopHatShape::print(IDalitzEvent& evt, std::ostream& out) const{
99  out << name()
100  << "\n\t> co-ordinate: " << getDalitzCoordinate()
101  << "\n\t> min, max sij: " << min() << ", " << max()
102  << "\n\t> sij: " << mumsRecoMass2(evt)
103  << "\n\t> This is the decay I'm looking at:"
104  << "\n" << prefix() << ", " << _theDecay
105  << " startOfDecayChain? " << startOfDecayChain()
106  << ", getValue " << getValue(evt);
107 }
108 void singleTopHatShape::print(std::ostream& out) const{
109  out << name()
110  << "\n\t> co-ordinate: " << getDalitzCoordinate()
111  << "\n\t> min, max sij: " << min() << ", " << max()
112  << "\n\t> This is the decay I'm looking at:"
113  << "\n" << prefix() << ", "<< _theDecay
114  << " startOfDecayChain? " << startOfDecayChain();
115 }
116 
117 
118 // ------
119 std::ostream& operator<<(std::ostream& out, const singleTopHatShape& ths){
120  ths.print(out);
121  return out;
122 }
123 
124 // ------
125 
126 
const std::string & prefix() const
void makeGeneratingFunction() const
virtual void setLimits(double sMin, double sMax)
Definition: FlatFct.cpp:32
virtual DalitzCoordinate getDalitzCoordinate(double nSigma=3) const
double max() const
virtual std::string name() const
virtual void setBoxLimits(double sMin, double sMax)
Definition: FlatFct.cpp:48
virtual std::complex< double > getValue(IDalitzEvent &evt) const
const AssociatedDecayTree & _theDecay
virtual double sij(const MINT::PolymorphVector< int > &indices) const =0
MINT::counted_ptr< IGenFct > _genFct
const ValueType & getVal() const
Definition: DDTree.h:102
virtual MINT::counted_ptr< IGenFct > generatingFunction() const
singleTopHatShape(const AssociatedDecayTree &decay, double mini, double maxi, const std::string &namePrefix="")
virtual void print(IDalitzEvent &evt, std::ostream &out=std::cout) const
static const double m
std::string name() const
double mumsRecoMass2(IDalitzEvent &evt) const
int nDgtr() const
Definition: DDTree.h:96
std::ostream & operator<<(std::ostream &out, const singleTopHatShape &ths)
void oneLiner(std::stringstream &seam, int generation=0) const
Definition: DDTree.h:375
const std::vector< int > & asi() const
bool startOfDecayChain() const
void setMinMax(double min, double max)
virtual std::complex< double > getVal(IDalitzEvent &evt)
double min() const