/***************************************************************************** * Project: RooFit * * Package: RooFitModels * * File: $$ * Authors: * * WV, Wouter Verkerke, UC Santa Barbara, verkerke@slac.stanford.edu * * DK, David Kirkby, UC Irvine, dkirkby@uci.edu * * AR, Anders Ryd, Cornell U., ryd@lepp.cornell.edu * * * * Copyright (c) 2000-2004, Regents of the University of California * * and Stanford University. All rights reserved. * * copyright (c) 2004 Cornell University * * * Redistribution and use in source and binary forms, * * with or without modification, are permitted according to the terms * * listed in LICENSE (http://roofit.sourceforge.net/license.txt) * *****************************************************************************/ // -- CLASS DESCRIPTION [PDF] -- //#include "BaBar/BaBar.hh" #include #include #include #include #include "RooFitModels/RooDEnergyImp.hh" #include "RooFitModels/RooParmFcn.hh" #include "RooFitCore/RooAbsReal.hh" #include "RooFitCore/RooRealVar.hh" #include "RooFitCore/RooArgSet.hh" ClassImp(RooDEnergyImp) static const char rcsid[] = "$Id: RooDEnergyImp.cc,v 1.3 2007/05/09 12:54:37 xs32 Exp xs32 $"; RooDEnergyImp::RooDEnergyImp(double mres,double gamma,double r, double sigmaE, double md, double Ebeam, double mc, int nbin){ m_mres=mres; m_gamma=gamma; m_r=r; m_sigmaE=sigmaE; m_md=md; m_Ebeam=Ebeam; m_mc=mc; //kludge as there are to few bins in the momentum convolution integral //nbin*=5; //static double pi=4*atan(1.0); //First convolve h and BE //function of E //E here is the energy of the psi'' double emin=2*md; double emax=2*Ebeam+20*sigmaE; //std::cout << "Ebeam, sigmaE:"<getX(i); int nintbin=200; double nsigma=10.0; double eintmax=2*Ebeam+nsigma*sigmaE; double eintmin=2*Ebeam-nsigma*sigmaE; double prob=0.0; double deint=(eintmax-eintmin)/nintbin; double eintlow=eintmin; double einthigh=eintlow+deint; while(einthigh100000){ // std::cout << "prob BW(e):"<set(i,prob*BW(e)); //std::cout <<"E:"<< e << " " << edist[i]<<" "<normalize(); //std::cout << "Done with first convolution"<print(); } RooDEnergyImp::~RooDEnergyImp(){ delete edist; } void RooDEnergyImp::BE(double e,double& A, double& B, double& C){ static double sqrt2pi=sqrt(8.0*atan(1.0)); double ecm=2.0*m_Ebeam; A=exp(-(e-ecm)*(e-ecm)/(2*m_sigmaE*m_sigmaE))/(sqrt2pi*m_sigmaE); B=-A*(e-ecm)/(m_sigmaE*m_sigmaE); C=-A/(m_sigmaE*m_sigmaE)+(e-ecm)*(e-ecm)*A/ (m_sigmaE*m_sigmaE*m_sigmaE*m_sigmaE); //return exp(-(e-m_mres)*(e-m_mres)/(2*m_sigmaE*m_sigmaE))/(sqrt2pi*m_sigmaE); } double RooDEnergyImp::h(double emin,double emax, double A, double B, double C){ //return integral from egamma-degamma/2 to egamma+degamma/2 assert(emingetVal(ecm); }