14 #include <sys/times.h> 56 toyFileName = app.
get_filename(toyFileName,
"examples/dalitz");
63 TH2F dalitzplot(
"dalitzplot",
71 std::vector<Observable> vars;
74 vars.push_back(eventNumber);
76 std::ifstream reader(toyFileName);
79 while(reader >> buffer) {
90 >> dummy >> m12 >> m13
93 >> dummy >> dummy >> dummy
99 >> dummy >> dummy >> dummy >> dummy >> dummy >> dummy >> dummy >> dummy >> dummy >> dummy >> dummy) {
118 dalitzplot.SetStats(
false);
119 dalitzplot.Draw(
"colz");
120 foo.SaveAs(
"dalitzplot.png");
136 bool fixAmps =
false;
140 fixAmps ?
Variable(
"rhom_amp_real", 0.714) :
Variable(
"rhom_amp_real", 0.714, 0.001, 0, 0),
141 fixAmps ?
Variable(
"rhom_amp_imag", -0.025) :
Variable(
"rhom_amp_imag", -0.025, 0.1, 0, 0),
149 fixAmps ?
Variable(
"rho0_amp_real", 0.565) :
Variable(
"rho0_amp_real", 0.565, 0.001, 0, 0),
150 fixAmps ?
Variable(
"rho0_amp_imag", 0.164) :
Variable(
"rho0_amp_imag", 0.164, 0.1, 0, 0),
156 Variable sharedMass(
"rhop_1450_mass", 1.465, 0.01, 1.0, 2.0);
157 Variable shareWidth(
"rhop_1450_width", 0.400, 0.01, 0.01, 5.0);
161 fixAmps ?
Variable(
"rhop_1450_amp_real", -0.174) :
Variable(
"rhop_1450_amp_real", -0.174, 0.001, 0, 0),
162 fixAmps ?
Variable(
"rhop_1450_amp_imag", -0.117) :
Variable(
"rhop_1450_amp_imag", -0.117, 0.1, 0, 0),
170 fixAmps ?
Variable(
"rho0_1450_amp_real", 0.325) :
Variable(
"rho0_1450_amp_real", 0.325, 0.001, 0, 0),
171 fixAmps ?
Variable(
"rho0_1450_amp_imag", 0.057) :
Variable(
"rho0_1450_amp_imag", 0.057, 0.1, 0, 0),
179 fixAmps ?
Variable(
"rhom_1450_amp_real", 0.788) :
Variable(
"rhom_1450_amp_real", 0.788, 0.001, 0, 0),
180 fixAmps ?
Variable(
"rhom_1450_amp_imag", 0.226) :
Variable(
"rhom_1450_amp_imag", 0.226, 0.1, 0, 0),
186 Variable sharedMass2(
"rhop_1700_mass", 1.720, 0.01, 1.6, 1.9);
187 Variable shareWidth2(
"rhop_1700_width", 0.250, 0.01, 0.1, 1.0);
191 fixAmps ?
Variable(
"rhop_1700_amp_real", 2.151) :
Variable(
"rhop_1700_amp_real", 2.151, 0.001, 0, 0),
192 fixAmps ?
Variable(
"rhop_1700_amp_imag", -0.658) :
Variable(
"rhop_1700_amp_imag", -0.658, 0.1, 0, 0),
200 fixAmps ?
Variable(
"rho0_1700_amp_real", 2.400) :
Variable(
"rho0_1700_amp_real", 2.400, 0.001, 0, 0),
201 fixAmps ?
Variable(
"rho0_1700_amp_imag", -0.734) :
Variable(
"rho0_1700_amp_imag", -0.734, 0.1, 0, 0),
209 fixAmps ?
Variable(
"rhom_1700_amp_real", 1.286) :
Variable(
"rhom_1700_amp_real", 1.286, 0.001, 0, 0),
210 fixAmps ?
Variable(
"rhom_1700_amp_imag", -1.532) :
Variable(
"rhom_1700_amp_imag", -1.532, 0.1, 0, 0),
218 :
Variable(
"f0_980_amp_real", 0.008 * (-
_mD02), 0.001, 0, 0),
221 Variable(
"f0_980_mass", 0.980, 0.01, 0.8, 1.2),
222 Variable(
"f0_980_width", 0.044, 0.001, 0.001, 0.08),
228 :
Variable(
"f0_1370_amp_real", -0.058 * (-
_mD02), 0.001, 0, 0),
231 Variable(
"f0_1370_mass", 1.434, 0.01, 1.2, 1.6),
232 Variable(
"f0_1370_width", 0.173, 0.01, 0.01, 0.4),
238 :
Variable(
"f0_1500_amp_real", 0.057 * (-
_mD02), 0.001, 0, 0),
241 Variable(
"f0_1500_mass", 1.507, 0.01, 1.3, 1.7),
242 Variable(
"f0_1500_width", 0.109, 0.01, 0.01, 0.3),
248 :
Variable(
"f0_1710_amp_real", 0.070 * (-
_mD02), 0.001, 0, 0),
251 Variable(
"f0_1710_mass", 1.714, 0.01, 1.5, 2.9),
252 Variable(
"f0_1710_width", 0.140, 0.01, 0.01, 0.5),
262 Variable(
"f2_1270_mass", 1.2754, 0.01, 1.0, 1.5),
263 Variable(
"f2_1270_width", 0.1851, 0.01, 0.01, 0.4),
269 :
Variable(
"f0_600_amp_real", 0.068 * (-
_mD02), 0.001, 0, 0),
272 Variable(
"f0_600_mass", 0.500, 0.01, 0.3, 0.7),
273 Variable(
"f0_600_width", 0.400, 0.01, 0.2, 0.6),
279 fixAmps ?
Variable(
"nonr_amp_real", 0.5595 * (-1)) :
Variable(
"nonr_amp_real", 0.5595 * (-1), 0.001, 0, 0),
280 fixAmps ?
Variable(
"nonr_amp_imag", -0.108761 * (-1)) :
Variable(
"nonr_amp_imag", -0.108761 * (-1), 0.1, 0, 0));
302 for(vector<ResonancePdf *>::iterator res = dtop0pp.
resonances.begin(); res != dtop0pp.
resonances.end(); ++res) {
303 (*res)->setParameterConstantness(
true);
310 vector<Observable> observables = {
m12, m13};
313 eff =
new PolynomialPdf(
"constantEff", observables, coefficients, offsets, 0);
316 return new DalitzPlotPdf(
"signalPDF", m12, m13, eventNumber, dtop0pp, eff);
335 ProdPdf prodpdf{
"prodpdf", {signal}};
340 TH2F *dalitzplot = plotter.make2D();
341 dalitzplot->Draw(
"colz");
343 foo.SaveAs(
"dalitzpdf.png");
348 int main(
int argc,
char **argv) {
351 std::string filename =
"dalitz_toyMC_000.txt";
352 app.add_option(
"-f,--filename,filename", filename,
"File to read in",
true)->check(GooFit::ExistingFile);
355 app.add_flag(
"-m,--make-toy", make_toy,
"Make a toy instead of reading a file in");
359 GooFit::setROOTStyle();
375 ProdPdf prodpdf{
"prodpdf", {signal}};
389 }
catch(
const std::runtime_error &e) {
390 std::cerr << e.what() << std::endl;
size_t getNumEvents() const
std::vector< ResonancePdf * > resonances
void setNumBins(size_t num)
Set the number of bins.
Variable constantZero("constantZero", 0)
void fillDataSetMC(UnbinnedDataSet &dataset, size_t nTotal)
Fill a dataset with MC events.
Variable neutrlM("neutrlM", piZeroMass)
Variable motherM("motherM", _mD0)
void setValue(fptype val)
Set the value.
Special class for observables. Used in DataSets.
void getToyData(std::string toyFileName, GooFit::Application &app, DataSet &data)
size_t getNumBins() const
Get the number of bins.
fptype cpuGetM23(fptype massPZ, fptype massPM)
__host__ void setData(DataSet *data)
Variable constantOne("constantOne", 1)
Variable chargeM("chargeM", piPlusMass)
Variable fixedRhoWidth("rho_width", 0.1503, 0.01, 0.1, 0.2)
EventNumber * eventNumber
fptype getLowerLimit() const
Get the lower limit.
void makeToyData(DalitzPlotter &dplotter, UnbinnedDataSet &data)
const std::vector< Observable > & getObservables() const
fptype getValue() const
Get the value.
fptype getUpperLimit() const
Get the upper limit.
int main(int argc, char **argv)
__host__ void setDataSize(unsigned int dataSize, unsigned int evtSize=3)
ROOT::Minuit2::FunctionMinimum fit()
This runs the fit.
#define GOOFIT_PARSE(app,...)
virtual void addEvent()=0
Relativistic Breit-Wigner.
DalitzPlotPdf * makeSignalPdf(Observable m12, Observable m13, EventNumber eventNumber, GooPdf *eff=0)
This class makes it easy to make plots over 3 body Dalitz PDFs. You can use ROOT style value access o...
int runToyFit(DalitzPlotPdf *signal, UnbinnedDataSet *data)
Variable fixedRhoMass("rho_mass", 0.7758, 0.01, 0.7, 0.8)
Variable massSum("massSum", _mD0 *_mD0+2 *piPlusMass *piPlusMass+piZeroMass *piZeroMass)
std::string get_filename(const std::string &input_str, std::string base="") const