Index: version.info =================================================================== RCS file: /nfs/cleo3/cvsroot/Offline/src/EvtGenBase/version.info,v retrieving revision 1.3 retrieving revision 1.22 diff -c -r1.3 -r1.22 *** version.info 19 Feb 2004 18:25:19 -0000 1.3 --- version.info 1 Apr 2008 20:41:56 -0000 1.22 *************** *** 19,21 **** --- 19,178 ---- Old Tag: v01_00_01 New Tag: v01_01_00 Message: Moved static std::vector inside method to protect against what seems like an incorrect double delete on Linux + + Module : EvtGenBase + Date : Tue Jan 10 16:27:54 2006 + User : ryd + Old Tag: v01_01_00 + New Tag: v01_01_01 + Message: + + Added Gaussian generator in EvtRandom and made sure + 4-momentum is conserved in 1->1 decays. + Module : EvtGenBase + Date : Sun Jan 15 22:18:26 2006 + User : ryd + Old Tag: v01_01_01 + New Tag: v02_00_00 + Message: + + Merge with BABAR + Module : EvtGenBase + Date : Tue Jan 17 17:52:54 2006 + User : ryd + Old Tag: v02_00_00 + New Tag: v02_00_01 + Message: + + Fixed Experiment.hh to Experiment.h + Module : EvtGenBase + Date : Wed Jan 18 17:35:12 2006 + User : ryd + Old Tag: v02_00_01 + New Tag: v02_00_02 + Message: + Fix (by commenting out) code that does not compile on Sun. + + Module : EvtGenBase + Date : Wed Jan 25 13:56:49 2006 + User : ryd + Old Tag: v02_00_02 + New Tag: v02_00_03 + Message: + + Bug fix for decays that are barely + kinematically allowed. + + Module : EvtGenBase + Date : Thu Jan 26 19:18:26 2006 + User : ryd + Old Tag: v02_00_03 + New Tag: v02_00_04 + Message: + + Created EvtSpinType.cc to avoid dependencies in the headerfile + due to inlining. + Module : EvtGenBase + Date : Fri Jan 27 10:23:39 2006 + User : ryd + Old Tag: v02_00_04 + New Tag: v02_00_05 + Message: + + added missing header file + + Module : EvtGenBase + Date : Sat Feb 4 22:06:47 2006 + User : ryd + Old Tag: v02_00_05 + New Tag: v02_00_06 + Message: + + Improve error reporting when energy is not + enought to produce the initial particle. + Module : EvtGenBase + Date : Fri Mar 3 22:36:20 2006 + User : ryd + Old Tag: v02_00_06 + New Tag: v02_00_07 + Message: + Added code so that photons produced by PHOTOS are + decayed in EvtDecayAmp. + + Module : EvtGenBase + Date : Wed May 3 11:05:48 2006 + User : ryd + Old Tag: v02_00_07 + New Tag: v02_00_08 + Message: + Remove static that was added by mistake. (Fix from BABAR) + + Module : EvtGenBase + Date : Tue Jun 6 13:16:39 2006 + User : gregor + Old Tag: v02_00_08 + New Tag: v02_00_09 + Message: Eliminated compiler warnings + + Module : EvtGenBase + Date : Wed Jun 7 08:26:26 2006 + User : gregor + Old Tag: v02_00_09 + New Tag: v02_00_10 + Message: Needs virtual destructor + + Module : EvtGenBase + Date : Wed Jun 21 14:58:07 2006 + User : gregor + Old Tag: v02_00_10 + New Tag: v02_00_11 + Message: Eliminated returning pointer to stack, improved efficiency + + Module : EvtGenBase + Date : Sat Feb 17 22:07:04 2007 + User : ryd + Old Tag: v02_00_11 + New Tag: v02_00_12 + Message: + Fixed bug in EvtAmp.cc where too many elements in vector were copied. + + Module : EvtGenBase + Date : Thu Feb 22 00:11:10 2007 + User : ryd + Old Tag: v02_00_12 + New Tag: v02_00_13 + Message: + Fix operator= in EvtAmp. Before I had fixed the copy constructor. + + Module : EvtGenBase + Date : Thu Oct 18 22:48:59 2007 + User : ryd + Old Tag: v02_00_13 + New Tag: v02_01_00 + Message: + Added methods to store the 4-vectors pre-photos. + + Module : EvtGenBase + Date : Mon Oct 22 22:35:36 2007 + User : ryd + Old Tag: v02_01_00 + New Tag: v02_01_01 + Message: + Corrected typo + + Module : EvtGenBase + Date : Fri Mar 21 16:13:46 2008 + User : ponyisi + Old Tag: v02_01_01 + New Tag: v02_02_00 + Message: + Add new 'RemoveDecay' command to decay table parser; add Flatte lineshape + class; small change to EvtResonance2 to allow different angular distribution + + Module : EvtGenBase/ + Date : Tue Apr 1 16:41:56 2008 + User : ponyisi + Old Tag: v02_02_00 + New Tag: v02_03_00 + Message: + Add CopyDecay command so an alias can pick up the decays of the original Index: Class/Evt3Rank3C.cc =================================================================== RCS file: /nfs/cleo3/cvsroot/Offline/src/EvtGenBase/Class/Evt3Rank3C.cc,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -c -r1.1.1.1 -r1.2 *** Class/Evt3Rank3C.cc 7 Oct 2003 02:47:06 -0000 1.1.1.1 --- Class/Evt3Rank3C.cc 12 Jan 2006 16:08:15 -0000 1.2 *************** *** 17,22 **** --- 17,23 ---- // RYD September 14, 1996 Module created // //------------------------------------------------------------------------ + #include "Experiment/Experiment.h" #include #include Index: Class/EvtAbsLineShape.cc =================================================================== RCS file: /nfs/cleo3/cvsroot/Offline/src/EvtGenBase/Class/EvtAbsLineShape.cc,v retrieving revision 1.1.1.1 retrieving revision 1.3 diff -c -r1.1.1.1 -r1.3 *** Class/EvtAbsLineShape.cc 7 Oct 2003 02:47:06 -0000 1.1.1.1 --- Class/EvtAbsLineShape.cc 5 Feb 2006 03:05:00 -0000 1.3 *************** *** 18,23 **** --- 18,24 ---- // //------------------------------------------------------------------------ // + #include "Experiment/Experiment.h" #include #include #include *************** *** 29,34 **** --- 30,37 ---- #include "EvtGenBase/EvtTwoBodyVertex.hh" #include "EvtGenBase/EvtPropBreitWigner.hh" #include "EvtGenBase/EvtPDL.hh" + #include "EvtGenBase/EvtReport.hh" + using std::fstream; EvtAbsLineShape::EvtAbsLineShape() { } *************** *** 40,45 **** --- 43,49 ---- _includeDecayFact = false; _includeBirthFact = false; + _fixMassForMax =true; _mass=mass; _width=width; _spin=sp; *************** *** 69,75 **** _massMin=x._massMin; _width=x._width; _maxRange=x._maxRange; ! } EvtAbsLineShape& EvtAbsLineShape::operator=(const EvtAbsLineShape& x){ --- 73,79 ---- _massMin=x._massMin; _width=x._width; _maxRange=x._maxRange; ! _fixMassForMax = x._fixMassForMax; } EvtAbsLineShape& EvtAbsLineShape::operator=(const EvtAbsLineShape& x){ *************** *** 82,87 **** --- 86,92 ---- _width=x._width; _spin=x._spin; _maxRange=x._maxRange; + _fixMassForMax=x._fixMassForMax; return *this; } *************** *** 113,124 **** if ( _width< 0.0001) return _mass; //its not flat - but generated according to a BW double mMin=_massMin; double mMax=_massMax; if ( maxMass>-0.5 && maxMass< mMax) mMax=maxMass; double ymin = atan( 2.0*(mMin-_mass)/_width); double ymax = atan( 2.0*(mMax-_mass)/_width); ! return ( _mass + ((_width/2.0)*tan(EvtRandom::Flat(ymin,ymax)))); // return EvtRandom::Flat(_massMin,_massMax); }; --- 118,140 ---- if ( _width< 0.0001) return _mass; //its not flat - but generated according to a BW + if (maxMass>0&&maxMass<_massMin) { + report(ERROR,"EvtGen") << "In EvtAbsLineShape::getRandMass"<-0.5 && maxMass< mMax) mMax=maxMass; double ymin = atan( 2.0*(mMin-_mass)/_width); double ymax = atan( 2.0*(mMax-_mass)/_width); ! ! return ( _mass + ((_width/2.0)*tan(EvtRandom::Flat(ymin,ymax)))); // return EvtRandom::Flat(_massMin,_massMax); }; *************** *** 131,137 **** for (i=0; i #include #include *************** *** 28,33 **** --- 29,35 ---- #include "EvtGenBase/EvtId.hh" #include "EvtGenBase/EvtPDL.hh" #include "EvtGenBase/EvtParticle.hh" + using std::endl; *************** *** 50,56 **** } _nontrivial=amp._nontrivial; ! int namp=_pstates; for(i=0;i<_nontrivial;i++){ _nstate[i]=amp._nstate[i]; --- 52,58 ---- } _nontrivial=amp._nontrivial; ! int namp=1; for(i=0;i<_nontrivial;i++){ _nstate[i]=amp._nstate[i]; *************** *** 112,118 **** } if (_nontrivial>5) { ! report(ERROR,"EvtGen") << "Too many nontrivial states in EvtAmp!"<5) { ! report(ERROR,"EvtGen") << "Too many nontrivial states in EvtAmp!"<3){ ! //report(ERROR,"EvtGen") << "Can't handle so many states in EvtAmp!"<3){ ! //report(ERROR,"EvtGen") << "Can't handle so many states in EvtAmp!"<1&&a2._nontrivial==1); EvtAmp tmp; ! report(DEBUG,"EvtGen") << "EvtAmp::contract not written yet" << std::endl; return tmp; } --- 416,422 ---- assert(a2._pstates>1&&a2._nontrivial==1); EvtAmp tmp; ! report(DEBUG,"EvtGen") << "EvtAmp::contract not written yet" << endl; return tmp; } *************** *** 424,451 **** int i,list[10]; ! report(DEBUG,"EvtGen") << "Number of daugthers:"<<_ndaug< using std::vector; *************** *** 25,37 **** EvtAmpIndex::EvtAmpIndex(std::vector ind): _ind(ind), _state(ind.size()), ! _nstate(ind.size()), ! _size(ind.size()) { int i; ! for(i=0;i++;i<_size) { _state[i]=0; if (i==0){ _nstate[i]=1; --- 26,38 ---- EvtAmpIndex::EvtAmpIndex(std::vector ind): _ind(ind), + _size(ind.size()), _state(ind.size()), ! _nstate(ind.size()) { int i; ! for(i=0;i<_size;i++) { _state[i]=0; if (i==0){ _nstate[i]=1; *************** *** 45,64 **** void EvtAmpIndex::reset(){ int i; ! for(i=0;i++;i<_size) { _state[i]=0; } } bool EvtAmpIndex::next(){ int i; ! for(i=0;i++;i<_size) { _state[i]++; if (_state[i]<_ind[i]){ return true; } else{ ! _state[i]==0; } } return false; --- 46,65 ---- void EvtAmpIndex::reset(){ int i; ! for(i=0;i<_size;i++) { _state[i]=0; } } bool EvtAmpIndex::next(){ int i; ! for(i=0;i<_size;i++) { _state[i]++; if (_state[i]<_ind[i]){ return true; } else{ ! _state[i]=0; } } return false; *************** *** 69,75 **** int i; int ind=0; ! for(i=0;i++;i<_size) { ind+=_state[i]*_nstate[i]; } --- 70,76 ---- int i; int ind=0; ! for(i=0;i<_size;i++) { ind+=_state[i]*_nstate[i]; } Index: Class/EvtAmpSubIndex.cc =================================================================== RCS file: /nfs/cleo3/cvsroot/Offline/src/EvtGenBase/Class/EvtAmpSubIndex.cc,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -c -r1.1.1.1 -r1.2 *** Class/EvtAmpSubIndex.cc 7 Oct 2003 02:47:07 -0000 1.1.1.1 --- Class/EvtAmpSubIndex.cc 12 Jan 2006 16:08:15 -0000 1.2 *************** *** 18,23 **** --- 18,24 ---- // //------------------------------------------------------------------------ // + #include "Experiment/Experiment.h" #include "EvtGenBase/EvtAmpIndex.hh" #include "EvtGenBase/EvtAmpSubIndex.hh" #include *************** *** 25,38 **** EvtAmpSubIndex::EvtAmpSubIndex(EvtAmpIndex* ind,std::vector sub): - _sub(sub), _ind(ind), ! _nstate(sub.size()), ! _size(sub.size()) { int i; ! for(i=0;i++;i<_size) { if (i==0){ _nstate[i]=1; } --- 26,39 ---- EvtAmpSubIndex::EvtAmpSubIndex(EvtAmpIndex* ind,std::vector sub): _ind(ind), ! _sub(sub), ! _size(sub.size()), ! _nstate(sub.size()) { int i; ! for(i=0;i<_size;i++) { if (i==0){ _nstate[i]=1; } *************** *** 48,54 **** int i; int ind=0; ! for(i=0;i++;i<_size) { ind+=_ind->_state[_ind->_ind[i]]*_nstate[i]; } --- 49,55 ---- int i; int ind=0; ! for(i=0;i<_size;i++) { ind+=_ind->_state[_ind->_ind[i]]*_nstate[i]; } Index: Class/EvtBlattWeisskopf.cc =================================================================== RCS file: /nfs/cleo3/cvsroot/Offline/src/EvtGenBase/Class/EvtBlattWeisskopf.cc,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -c -r1.1.1.1 -r1.2 *** Class/EvtBlattWeisskopf.cc 7 Oct 2003 02:47:07 -0000 1.1.1.1 --- Class/EvtBlattWeisskopf.cc 12 Jan 2006 16:08:15 -0000 1.2 *************** *** 1,7 **** /******************************************************************************* * Project: BaBar detector at the SLAC PEP-II B-factory * Package: EvtGenBase ! * File: $Id: EvtBlattWeisskopf.cc,v 1.1.1.1 2003/10/07 02:47:07 ryd Exp $ * Author: Alexei Dvoretskii, dvoretsk@slac.stanford.edu, 2001-2002 * * Copyright (C) 2002 Caltech --- 1,8 ---- + #include "Experiment/Experiment.h" /******************************************************************************* * Project: BaBar detector at the SLAC PEP-II B-factory * Package: EvtGenBase ! * File: $Id: EvtBlattWeisskopf.cc,v 1.2 2006/01/12 16:08:15 ryd Exp $ * Author: Alexei Dvoretskii, dvoretsk@slac.stanford.edu, 2001-2002 * * Copyright (C) 2002 Caltech *************** *** 12,41 **** #include #include "EvtGenBase/EvtBlattWeisskopf.hh" #include "EvtGenBase/EvtReport.hh" EvtBlattWeisskopf::EvtBlattWeisskopf(int LL, double R, double p0) ! : _LL(LL), _R(R), _p0(p0) { if(R < 0) { ! report(INFO,"EvtGen") << "Radius " << R << " negative" << std::endl; assert(0); } ! _R = R; // compute formula for nominal momentum _F0 = compute(_p0); if(_F0 <= 0) { ! report(INFO,"EvtGen") << "Invalid nominal form factor computed " << _F0 << std::endl; assert(0); } } EvtBlattWeisskopf::EvtBlattWeisskopf(const EvtBlattWeisskopf& other) ! : _LL(other._LL), _R(other._R), _p0(other._p0), _F0(other._F0) {} EvtBlattWeisskopf::~EvtBlattWeisskopf() --- 13,43 ---- #include #include "EvtGenBase/EvtBlattWeisskopf.hh" #include "EvtGenBase/EvtReport.hh" + using std::endl; EvtBlattWeisskopf::EvtBlattWeisskopf(int LL, double R, double p0) ! : _LL(LL), _radial(R), _p0(p0) { if(R < 0) { ! report(INFO,"EvtGen") << "Radius " << R << " negative" << endl; assert(0); } ! _radial = R; // compute formula for nominal momentum _F0 = compute(_p0); if(_F0 <= 0) { ! report(INFO,"EvtGen") << "Invalid nominal form factor computed " << _F0 << endl; assert(0); } } EvtBlattWeisskopf::EvtBlattWeisskopf(const EvtBlattWeisskopf& other) ! : _LL(other._LL), _radial(other._radial), _p0(other._p0), _F0(other._F0) {} EvtBlattWeisskopf::~EvtBlattWeisskopf() *************** *** 44,50 **** double EvtBlattWeisskopf::operator()(double p) const { double ret = compute(p)/_F0; ! // report(INFO,"EvtGen") << p << " " << _p0 << " " << _F0 << " " << _LL << " " << _R << " " << ret << std::endl; return ret; } --- 46,52 ---- double EvtBlattWeisskopf::operator()(double p) const { double ret = compute(p)/_F0; ! // report(INFO,"EvtGen") << p << " " << _p0 << " " << _F0 << " " << _LL << " " << _radial << " " << ret << endl; return ret; } *************** *** 64,75 **** { if(p < 0) { ! report(INFO,"EvtGen") << "Momentum " << p << " negative in form factor calculation" << std::endl; assert(0); } else { ! double x = p*p*_R*_R; if(0 == _LL) return 1.; else --- 66,77 ---- { if(p < 0) { ! report(INFO,"EvtGen") << "Momentum " << p << " negative in form factor calculation" << endl; assert(0); } else { ! double x = p*p*_radial*_radial; if(0 == _LL) return 1.; else *************** *** 77,83 **** else if(2 == _LL) return sqrt(1.0/(1.0+x/3.0+x*x/9.0)); else { ! report(INFO,"EvtGen") << "Angular momentum " << _LL << " not implemented" << std::endl; assert(0); } } --- 79,85 ---- else if(2 == _LL) return sqrt(1.0/(1.0+x/3.0+x*x/9.0)); else { ! report(INFO,"EvtGen") << "Angular momentum " << _LL << " not implemented" << endl; assert(0); } } Index: Class/EvtBreitWignerPdf.cc =================================================================== RCS file: /nfs/cleo3/cvsroot/Offline/src/EvtGenBase/Class/EvtBreitWignerPdf.cc,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -c -r1.1.1.1 -r1.2 *** Class/EvtBreitWignerPdf.cc 7 Oct 2003 02:47:07 -0000 1.1.1.1 --- Class/EvtBreitWignerPdf.cc 12 Jan 2006 16:08:15 -0000 1.2 *************** *** 1,7 **** /******************************************************************************* * Project: BaBar detector at the SLAC PEP-II B-factory * Package: EvtGenBase ! * File: $Id: EvtBreitWignerPdf.cc,v 1.1.1.1 2003/10/07 02:47:07 ryd Exp $ * Author: Alexei Dvoretskii, dvoretsk@slac.stanford.edu, 2001-2002 * * Copyright (C) 2002 Caltech --- 1,8 ---- + #include "Experiment/Experiment.h" /******************************************************************************* * Project: BaBar detector at the SLAC PEP-II B-factory * Package: EvtGenBase ! * File: $Id: EvtBreitWignerPdf.cc,v 1.2 2006/01/12 16:08:15 ryd Exp $ * Author: Alexei Dvoretskii, dvoretsk@slac.stanford.edu, 2001-2002 * * Copyright (C) 2002 Caltech *************** *** 10,26 **** // Breit-Wigner shape PDF. If the width is zero it degenerates into a delta // function. The integral and its inverse can be still evaluated. - #include "EvtGenBase/EvtPatches.hh" #include ! #include #include #include "EvtGenBase/EvtBreitWignerPdf.hh" #include "EvtGenBase/EvtConst.hh" - #include "EvtGenBase/EvtInterval1D.hh" - #include "EvtGenBase/EvtReport.hh" ! EvtBreitWignerPdf::EvtBreitWignerPdf(double m0, double g0) ! : _m0(m0), _g0(g0) {} --- 11,25 ---- // Breit-Wigner shape PDF. If the width is zero it degenerates into a delta // function. The integral and its inverse can be still evaluated. #include ! #include #include + #include "EvtGenBase/EvtPatches.hh" #include "EvtGenBase/EvtBreitWignerPdf.hh" #include "EvtGenBase/EvtConst.hh" ! EvtBreitWignerPdf::EvtBreitWignerPdf(double min, double max, double m0, double g0) ! : EvtIntegPdf1D(min,max), _m0(m0), _g0(g0) {} *************** *** 38,49 **** double m = x.value(); if((0 == (m - _m0)) && (0. == _g0)) { ! report(INFO,"EvtGen") << "Delta function Breit-Wigner" << std::endl; assert(0); } double ret = _g0/EvtConst::twoPi/((m-_m0)*(m-_m0)+_g0*_g0/4); ! return ret; } --- 37,48 ---- double m = x.value(); if((0 == (m - _m0)) && (0. == _g0)) { ! printf("Delta function Breit-Wigner\n"); assert(0); } double ret = _g0/EvtConst::twoPi/((m-_m0)*(m-_m0)+_g0*_g0/4); ! return ret; } *************** *** 64,80 **** return itg; } - EvtValError EvtBreitWignerPdf::get_integral(const EvtInterval1D& ival) - { - return EvtValError(pdfIntegral(ival.max())-pdfIntegral(ival.min()),0.); - } - double EvtBreitWignerPdf::pdfIntegralInverse(double x) const { if(x < 0 || x > 1) { ! report(INFO,"EvtGen") << "Invalid integral value " << x << std::endl; assert(0); } --- 63,74 ---- return itg; } double EvtBreitWignerPdf::pdfIntegralInverse(double x) const { if(x < 0 || x > 1) { ! printf("Invalid integral value %f\n",x); assert(0); } Index: Class/EvtCGCoefSingle.cc =================================================================== RCS file: /nfs/cleo3/cvsroot/Offline/src/EvtGenBase/Class/EvtCGCoefSingle.cc,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -c -r1.1.1.1 -r1.2 *** Class/EvtCGCoefSingle.cc 7 Oct 2003 02:47:07 -0000 1.1.1.1 --- Class/EvtCGCoefSingle.cc 12 Jan 2006 16:08:16 -0000 1.2 *************** *** 19,24 **** --- 19,25 ---- // //------------------------------------------------------------------------ // + #include "Experiment/Experiment.h" #include #include #include *************** *** 26,40 **** #include "EvtGenBase/EvtCGCoefSingle.hh" #include "EvtGenBase/EvtOrthogVector.hh" - EvtCGCoefSingle::EvtCGCoefSingle(){ - - _j1=0; - _j2=0; - - _Jmax=0; - _Jmin=0; - - } EvtCGCoefSingle::~EvtCGCoefSingle(){ --- 27,32 ---- Index: Class/EvtCPUtil.cc =================================================================== RCS file: /nfs/cleo3/cvsroot/Offline/src/EvtGenBase/Class/EvtCPUtil.cc,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -c -r1.1.1.1 -r1.2 *** Class/EvtCPUtil.cc 7 Oct 2003 02:47:07 -0000 1.1.1.1 --- Class/EvtCPUtil.cc 12 Jan 2006 16:08:16 -0000 1.2 *************** *** 19,31 **** --- 19,37 ---- // //------------------------------------------------------------------------ // + #include "Experiment/Experiment.h" + #include "EvtGenBase/EvtPatches.hh" #include "EvtGenBase/EvtParticle.hh" #include "EvtGenBase/EvtScalarParticle.hh" #include "EvtGenBase/EvtRandom.hh" #include "EvtGenBase/EvtCPUtil.hh" #include "EvtGenBase/EvtPDL.hh" #include "EvtGenBase/EvtReport.hh" + #include "EvtGenBase/EvtSymTable.hh" + #include "EvtGenBase/EvtConst.hh" + #include + using std::endl; //added two functions for finding the fraction of B0 tags for decays into *************** *** 66,72 **** //this needs more thought... //double gamma_B = EvtPDL::getWidth(B0); ! //report(INFO,"EvtGen") << "gamma " << gamma_B<< std::endl; //double xd = deltam/gamma_B; //why is the width of B0 0 in PDL?? --- 72,78 ---- //this needs more thought... //double gamma_B = EvtPDL::getWidth(B0); ! //report(INFO,"EvtGen") << "gamma " << gamma_B<< endl; //double xd = deltam/gamma_B; //why is the width of B0 0 in PDL?? *************** *** 136,142 **** if (parent==0) { //report(ERROR,"EvtGen") << ! // "Warning CP violation with B having no parent!"<setLifetime(); t=p->getLifetime(); if (p->getId()==B0) otherb=B0B; --- 142,148 ---- if (parent==0) { //report(ERROR,"EvtGen") << ! // "Warning CP violation with B having no parent!"<setLifetime(); t=p->getLifetime(); if (p->getId()==B0) otherb=B0B; *************** *** 158,170 **** if (parent != 0 ) { //if (entryCount>1){ ! // report(INFO,"EvtGen") << "Double CP decay:"<getId().isAlias() ) { OtherB(p,t,otherb); return; } --- 164,177 ---- if (parent != 0 ) { //if (entryCount>1){ ! // report(INFO,"EvtGen") << "Double CP decay:"<getId().isAlias() ) { OtherB(p,t,otherb); + entryCount--; return; } *************** *** 208,214 **** } else { ! report(INFO,"EvtGen") << "We have an error here!!!!"<getId()!=UPS4) { //report(ERROR,"EvtGen") << ! // "Warning CP violation with B having no parent!"<getLifetime(); if (p->getId()==B0) otherb=B0B; if (p->getId()==B0B) otherb=B0; --- 264,270 ---- if (parent==0||parent->getId()!=UPS4) { //report(ERROR,"EvtGen") << ! // "Warning CP violation with B having no parent!"<getLifetime(); if (p->getId()==B0) otherb=B0B; if (p->getId()==B0B) otherb=B0; *************** *** 285,310 **** void EvtCPUtil::incoherentMix(const EvtId id, double &t, int &mix){ ! //added by Lange Jan4,2000 ! static EvtId BS0=EvtPDL::getId("B_s0"); ! static EvtId BSL=EvtPDL::getId("B_s0L"); ! static EvtId BSH=EvtPDL::getId("B_s0H"); ! double ctauL=EvtPDL::getctau(BSL); ! double ctauH=EvtPDL::getctau(BSH); double ctau=0.5*(ctauL+ctauH); double y=(ctauH-ctauL)/ctau; - //need to figure out how to get these parameters into the code... - double qoverp=1.0; - double x=25.0; - double fac; ! if(id==BS0){ fac=1.0/(qoverp*qoverp); } else{ --- 292,324 ---- void EvtCPUtil::incoherentMix(const EvtId id, double &t, int &mix){ ! int stdHepNum=EvtPDL::getStdHep(id); ! stdHepNum=abs(stdHepNum); ! ! EvtId partId=EvtPDL::evtIdFromStdHep(stdHepNum); ! ! std::string partName=EvtPDL::name(partId); ! std::string hname=partName+std::string("H"); ! std::string lname=partName+std::string("L"); ! EvtId lId=EvtPDL::getId(lname); ! EvtId hId=EvtPDL::getId(hname); ! double ctauL=EvtPDL::getctau(lId); ! double ctauH=EvtPDL::getctau(hId); double ctau=0.5*(ctauL+ctauH); double y=(ctauH-ctauL)/ctau; //need to figure out how to get these parameters into the code... + std::string qoverpParmName=std::string("qoverp_incohMix_")+partName; + std::string mdParmName=std::string("dm_incohMix_")+partName; + int ierr; + double qoverp=atof(EvtSymTable::Get(qoverpParmName,ierr).c_str()); + double x=atof(EvtSymTable::Get(mdParmName,ierr).c_str())*ctau/EvtConst::c; double fac; ! if(id==partId){ fac=1.0/(qoverp*qoverp); } else{ *************** *** 321,336 **** do{ t=-log(EvtRandom::Flat())*ctauL; ! prob=1+exp(y*t/ctau)+mixsign*2*exp(0.5*y*t/ctau)*cos(x*t); }while(prob<4*EvtRandom::Flat()); mix=0; if (mixsign==-1) mix=1; ! return; - - } --- 335,348 ---- do{ t=-log(EvtRandom::Flat())*ctauL; ! prob=1.0+exp(2.0*y*t/ctau)+mixsign*2.0*exp(y*t/ctau)*cos(x*t); }while(prob<4*EvtRandom::Flat()); mix=0; if (mixsign==-1) mix=1; ! return; } Index: Class/EvtComplex.cc =================================================================== RCS file: /nfs/cleo3/cvsroot/Offline/src/EvtGenBase/Class/EvtComplex.cc,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -c -r1.1.1.1 -r1.2 *** Class/EvtComplex.cc 7 Oct 2003 02:47:07 -0000 1.1.1.1 --- Class/EvtComplex.cc 12 Jan 2006 16:08:16 -0000 1.2 *************** *** 18,29 **** // //------------------------------------------------------------------------ // #include #include #include "EvtGenBase/EvtComplex.hh" ! std::ostream& operator<<(std::ostream& s, const EvtComplex& c){ s<<"("< #include #include "EvtGenBase/EvtComplex.hh" + using std::ostream; ! ostream& operator<<(ostream& s, const EvtComplex& c){ s<<"("< #include #include "EvtGenBase/EvtCyclic3.hh" + using std::ostream; using namespace EvtCyclic3; *************** *** 48,53 **** --- 50,56 ---- else if(i == B) return C; else if(i == C) return B; } + return A; } Perm EvtCyclic3::permutation(Index i1,Index i2,Index i3) *************** *** 56,61 **** --- 59,65 ---- if(i1 == A) return (i2 == B) ? ABC : ACB; if(i1 == B) return (i2 == C) ? BCA : BAC; if(i1 == C) return (i2 == A) ? CAB : CBA; + return ABC; } *************** *** 115,135 **** { assert(i != j); switch(i) { - case A: switch(j) { case B: return C; case C: return B; } - case B: - switch(j) { - case C: return A; - case A: return C; - } case C: switch(j) { case A: return B; case B: return A; } } assert(0); return A; // should never get here --- 119,141 ---- { assert(i != j); switch(i) { case A: switch(j) { case B: return C; case C: return B; + default: assert(0); + } + case B: + switch(j) { + case C: return A; + case A: return C; + default: assert(0); } case C: switch(j) { case A: return B; case B: return A; + default: assert(0); } } assert(0); return A; // should never get here *************** *** 243,249 **** } ! char* EvtCyclic3::c_str(Index i) { switch(i) { case A: return "A"; --- 249,256 ---- } ! const char * ! EvtCyclic3::c_str(Index i) { switch(i) { case A: return "A"; *************** *** 254,260 **** } ! char* EvtCyclic3::c_str(Pair i) { switch(i) { case BC: return "BC"; --- 261,268 ---- } ! const char * ! EvtCyclic3::c_str(Pair i) { switch(i) { case BC: return "BC"; *************** *** 264,270 **** assert(0); return 0; // sngh } ! char* EvtCyclic3::c_str(Perm p) { if(p == ABC) return "ABC"; if(p == BCA) return "BCA"; --- 272,279 ---- assert(0); return 0; // sngh } ! const char * ! EvtCyclic3::c_str(Perm p) { if(p == ABC) return "ABC"; if(p == BCA) return "BCA"; *************** *** 272,277 **** --- 281,287 ---- if(p == CBA) return "CBA"; if(p == BAC) return "BAC"; if(p == ACB) return "ACB"; + return "???"; } char* EvtCyclic3::append(const char* str, EvtCyclic3::Index i) *************** *** 295,301 **** } ! std::ostream& operator<<(std::ostream& os, EvtCyclic3::Index i) { switch(i) { case A: { os << "A"; return os; } --- 305,311 ---- } ! ostream& operator<<(ostream& os, EvtCyclic3::Index i) { switch(i) { case A: { os << "A"; return os; } *************** *** 306,312 **** } ! std::ostream& operator<<(std::ostream& os, EvtCyclic3::Pair i) { switch(i) { case BC: { os << "BC"; return os; } --- 316,322 ---- } ! ostream& operator<<(ostream& os, EvtCyclic3::Pair i) { switch(i) { case BC: { os << "BC"; return os; } *************** *** 315,321 **** } assert(0); return os; // should never get here } - - - - --- 325,327 ---- Index: Class/EvtDalitz2D.cc =================================================================== RCS file: Class/EvtDalitz2D.cc diff -N Class/EvtDalitz2D.cc *** Class/EvtDalitz2D.cc 7 Oct 2003 02:47:07 -0000 1.1.1.1 --- /dev/null 1 Jan 1970 00:00:00 -0000 *************** *** 1,69 **** - /******************************************************************************* - * Project: BaBar detector at the SLAC PEP-II B-factory - * Package: EvtGenBase - * File: $Id: EvtDalitz2D.cc,v 1.1.1.1 2003/10/07 02:47:07 ryd Exp $ - * Author: Alexei Dvoretskii, dvoretsk@slac.stanford.edu, 2001-2002 - * - * Copyright (C) 2002 Caltech - *******************************************************************************/ - - #include - #include "EvtGenBase/EvtDalitz2D.hh" - #include "EvtGenBase/EvtDalitzCoord.hh" - #include "EvtGenBase/EvtReport.hh" - - EvtDalitz2D::EvtDalitz2D() - {} - - EvtDalitz2D::EvtDalitz2D(const EvtDalitzPlot& thePlot) - : itsPlot(thePlot) - {} - - EvtDalitz2D::EvtDalitz2D(const EvtDalitz2D& other) - : EvtInterval(other), itsPlot(other.itsPlot) - {} - - EvtDalitz2D::~EvtDalitz2D() - {} - - - EvtDalitzPoint EvtDalitz2D::randomPoint() const - { - // To obtain a uniform distribution generate - // in terms of q's. Generate in a box that circumscribes the - // Dalitz plot. Accept points inside. If there are two - // many unsuccessful attempts it's a hint that the Dalitz plot - // area is tiny compared to the box. It's a pathological - // case. Abort. - - EvtCyclic3::Pair pair1 = EvtCyclic3::BC; - EvtCyclic3::Pair pair2 = EvtCyclic3::CA; - - int n = 0; - while(n++ < 1000) { - - double q1 = EvtRandom::Flat(itsPlot.qAbsMin(pair1),itsPlot.qAbsMax(pair2)); - double q2 = EvtRandom::Flat(itsPlot.qAbsMin(pair2),itsPlot.qAbsMax(pair2)); - - EvtDalitzCoord point(pair1,q1,pair2,q2); - EvtDalitzPoint x(itsPlot,point); - - if(x.isValid()) return x; - } - - report(INFO,"EvtGen") << "No point generated for dalitz plot after 1000 tries" << std::endl; - itsPlot.print(report(INFO,"EvtGen")); - assert(0); - } - - - void EvtDalitz2D::compute_size(int N) - { - itsSize = EvtValError(itsPlot.getArea(N),0.); - } - - - EvtInterval* EvtDalitz2D::clone() const - { - return new EvtDalitz2D(*this); - } --- 0 ---- Index: Class/EvtDalitzBwPdf.cc =================================================================== RCS file: Class/EvtDalitzBwPdf.cc diff -N Class/EvtDalitzBwPdf.cc *** Class/EvtDalitzBwPdf.cc 7 Oct 2003 02:47:07 -0000 1.1.1.1 --- /dev/null 1 Jan 1970 00:00:00 -0000 *************** *** 1,109 **** - /******************************************************************************* - * Project: BaBar detector at the SLAC PEP-II B-factory - * Package: EvtGenBase - * File: $Id: EvtDalitzBwPdf.cc,v 1.1.1.1 2003/10/07 02:47:07 ryd Exp $ - * Author: Alexei Dvoretskii, dvoretsk@slac.stanford.edu, 2001-2002 - * - * Copyright (C) 2002 Caltech - *******************************************************************************/ - - #include "EvtGenBase/EvtPatches.hh" - #include - #include "EvtGenBase/EvtDalitzBwPdf.hh" - #include "EvtGenBase/EvtDalitzCoord.hh" - #include "EvtGenBase/EvtDalitz2D.hh" - #include "EvtGenBase/EvtRandom.hh" - #include "EvtGenBase/EvtReport.hh" - - using EvtCyclic3::Pair; - - EvtDalitzBwPdf::EvtDalitzBwPdf(double m0, double g0, Pair i) - : _bw(m0,g0) ,_i(i) - {} - - - EvtDalitzBwPdf::EvtDalitzBwPdf(const EvtDalitzBwPdf& other) - : EvtPdf(other), EvtRandDist(other), - _bw(other._bw) ,_i(other._i) - {} - - - EvtDalitzBwPdf::~EvtDalitzBwPdf() - {} - - - // This will be a tweaked Breit-Wigner. Integration is actually - // over dm2=2mdm. To make it integrable, multiply by 2m0/2m. - // j is a coordinate perpendicular to i. - - EvtValError EvtDalitzBwPdf::compute_integral(const EvtDalitz2D& ival) - { - EvtCyclic3::Pair j = EvtCyclic3::next(_i); - int N = 1000; - EvtDalitzPlot dp = ival.getPlot(); - - double dh = (dp.qAbsMax(j) - dp.qAbsMin(j))/((double) N); - double sum = 0; - - // Trapezoidal integral - - int ii; - for(ii=1;ii #include #include "EvtGenBase/EvtDalitzCoord.hh" + using std::endl; + using std::ostream; using EvtCyclic3::Pair; *************** *** 40,53 **** _q1 == other._q1 && _q2 == other._q2); } ! void EvtDalitzCoord::print(std::ostream& os) const { ! os << _i1 << " " << _q1 << std::endl; ! os << _i2 << " " << _q2 << std::endl; } ! std::ostream& operator<<(std::ostream& os,const EvtDalitzCoord& p) { p.print(os); return os; --- 43,56 ---- _q1 == other._q1 && _q2 == other._q2); } ! void EvtDalitzCoord::print(ostream& os) const { ! os << _i1 << " " << _q1 << endl; ! os << _i2 << " " << _q2 << endl; } ! ostream& operator<<(ostream& os,const EvtDalitzCoord& p) { p.print(os); return os; Index: Class/EvtDalitzFlatPdf.cc =================================================================== RCS file: Class/EvtDalitzFlatPdf.cc diff -N Class/EvtDalitzFlatPdf.cc *** /dev/null 1 Jan 1970 00:00:00 -0000 --- Class/EvtDalitzFlatPdf.cc 12 Jan 2006 16:08:17 -0000 1.1 *************** *** 0 **** --- 1,67 ---- + #include "Experiment/Experiment.h" + /******************************************************************************* + * Project: BaBar detector at the SLAC PEP-II B-factory + * Package: EvtGenBase + * File: $Id: EvtDalitzFlatPdf.cc,v 1.1 2006/01/12 16:08:17 ryd Exp $ + * Author: Alexei Dvoretskii, dvoretsk@slac.stanford.edu, 2001-2002 + * + * Copyright (C) 2002 Caltech + *******************************************************************************/ + + #include "EvtGenBase/EvtPatches.hh" + #include "EvtGenBase/EvtDalitzFlatPdf.hh" + + EvtDalitzFlatPdf::EvtDalitzFlatPdf(const EvtDalitzPlot& dp) + : EvtPdf(), _dp(dp) + {} + + EvtDalitzFlatPdf::EvtDalitzFlatPdf(const EvtDalitzFlatPdf& other) + : EvtPdf(other), _dp(other._dp) + {} + + EvtDalitzFlatPdf::~EvtDalitzFlatPdf() + {} + + EvtPdf* EvtDalitzFlatPdf::clone() const + { + return new EvtDalitzFlatPdf(*this); + } + + double EvtDalitzFlatPdf::pdf(const EvtDalitzPoint&) const + { + return 1.; + } + + EvtValError EvtDalitzFlatPdf::compute_integral(int N) const + { + return EvtValError(_dp.getArea(N),0.); + } + + EvtDalitzPoint EvtDalitzFlatPdf::randomPoint() + { + // To obtain a uniform distribution generate + // in terms of q's. Generate in a box that circumscribes the + // Dalitz plot. Accept points inside. If there are two + // many unsuccessful attempts it's a hint that the Dalitz plot + // area is tiny compared to the box. It's a pathological + // case. Abort. + + EvtCyclic3::Pair pair1 = EvtCyclic3::BC; + EvtCyclic3::Pair pair2 = EvtCyclic3::CA; + + int n = 0; + int maxTries = 1000; + while(n++ < maxTries) { + + double q1 = EvtRandom::Flat(_dp.qAbsMin(pair1),_dp.qAbsMax(pair2)); + double q2 = EvtRandom::Flat(_dp.qAbsMin(pair2),_dp.qAbsMax(pair2)); + + EvtDalitzCoord point(pair1,q1,pair2,q2); + EvtDalitzPoint x(_dp,point); + + if(x.isValid()) return x; + } + + printf("No point generated for dalitz plot after %d tries\n",maxTries); + assert(0); + } Index: Class/EvtDalitzPlot.cc =================================================================== RCS file: /nfs/cleo3/cvsroot/Offline/src/EvtGenBase/Class/EvtDalitzPlot.cc,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -c -r1.1.1.1 -r1.2 *** Class/EvtDalitzPlot.cc 7 Oct 2003 02:47:07 -0000 1.1.1.1 --- Class/EvtDalitzPlot.cc 12 Jan 2006 16:08:17 -0000 1.2 *************** *** 1,6 **** //----------------------------------------------------------------------- // File and Version Information: ! // $Id: EvtDalitzPlot.cc,v 1.1.1.1 2003/10/07 02:47:07 ryd Exp $ // // Environment: // This software is part of the EvtGen package developed jointly --- 1,6 ---- //----------------------------------------------------------------------- // File and Version Information: ! // $Id: EvtDalitzPlot.cc,v 1.2 2006/01/12 16:08:17 ryd Exp $ // // Environment: // This software is part of the EvtGen package developed jointly *************** *** 13,30 **** // Module creator: // Alexei Dvoretskii, Caltech, 2001-2002. //----------------------------------------------------------------------- // Global 3-body Dalitz decay kinematics as defined by the mass // of the mother and the daughters. Spins are not considered. #include #include ! #include #include "EvtGenBase/EvtDalitzPlot.hh" #include "EvtGenBase/EvtTwoBodyVertex.hh" ! #include "EvtGenBase/EvtPartPropDb.hh" #include "EvtGenBase/EvtDecayMode.hh" - #include "EvtGenBase/EvtReport.hh" using namespace EvtCyclic3; --- 13,31 ---- // Module creator: // Alexei Dvoretskii, Caltech, 2001-2002. //----------------------------------------------------------------------- + #include "Experiment/Experiment.h" // Global 3-body Dalitz decay kinematics as defined by the mass // of the mother and the daughters. Spins are not considered. #include #include ! #include ! #include "EvtGenBase/EvtPatches.hh" #include "EvtGenBase/EvtDalitzPlot.hh" #include "EvtGenBase/EvtTwoBodyVertex.hh" ! #include "EvtGenBase/EvtPDL.hh" #include "EvtGenBase/EvtDecayMode.hh" using namespace EvtCyclic3; *************** *** 45,55 **** EvtDalitzPlot::EvtDalitzPlot(const EvtDecayMode& mode, double ldel, double rdel ) { ! assert(EvtPartPropDb::initialized()); ! _mA = EvtPartPropDb::getMass(mode.dau(A)); ! _mB = EvtPartPropDb::getMass(mode.dau(B)); ! _mC = EvtPartPropDb::getMass(mode.dau(C)); ! _bigM = EvtPartPropDb::getMass(mode.mother()); _ldel = ldel; _rdel = rdel; --- 46,56 ---- EvtDalitzPlot::EvtDalitzPlot(const EvtDecayMode& mode, double ldel, double rdel ) { ! _mA = EvtPDL::getMeanMass(EvtPDL::getId(mode.dau(A))); ! _mB = EvtPDL::getMeanMass(EvtPDL::getId(mode.dau(B))); ! _mC = EvtPDL::getMeanMass(EvtPDL::getId(mode.dau(C))); ! _bigM = EvtPDL::getMeanMass(EvtPDL::getId(mode.mother())); ! _ldel = ldel; _rdel = rdel; *************** *** 89,95 **** { if(_mA < 0 || _mB < 0 || _mC < 0 || _bigM <= 0 || _bigM - _mA - _mB - _mC < 0.) { ! report(INFO,"EvtGen") << "Invalid Dalitz plot " << _mA << " " << _mB << " " << _mC << " " << _bigM << std::endl; assert(0); } assert(_ldel <= 0.); --- 90,96 ---- { if(_mA < 0 || _mB < 0 || _mC < 0 || _bigM <= 0 || _bigM - _mA - _mB - _mC < 0.) { ! printf("Invalid Dalitz plot %f %f %f %f\n",_mA,_mB,_mC,_bigM); assert(0); } assert(_ldel <= 0.); *************** *** 297,304 **** double p2 = en*en - m(i)*m(i); if(p2 < 0) { ! report(INFO,"EvtGen") << "Bad value of p2 " << p2 << " " << i << " " << j ! << " " << en << " " << m(i) << std::endl; assert(0); } --- 298,304 ---- double p2 = en*en - m(i)*m(i); if(p2 < 0) { ! printf("Bad value of p2 %f %d %d %f %f\n",p2,i,j,en,m(i)); assert(0); } *************** *** 335,354 **** } ! void EvtDalitzPlot::print(std::ostream& os) const { // masses ! os << "Mass M " << bigM() << std::endl; ! os << "Mass mA " << _mA << std::endl; ! os << "Mass mB " << _mB << std::endl; ! os << "Mass mC " << _mC << std::endl; // limits ! os << "Limits qAB " << qAbsMin(AB) << " : " << qAbsMax(AB) << std::endl; ! os << "Limits qBC " << qAbsMin(BC) << " : " << qAbsMax(BC) << std::endl; ! os << "Limits qCA " << qAbsMin(CA) << " : " << qAbsMax(CA) << std::endl; ! ! os << "Sum q " << sum() << std::endl; ! os << "Limit qsum " << qSumMin() << " : " << qSumMax() << std::endl; } --- 335,353 ---- } ! void EvtDalitzPlot::print() const { // masses ! printf("Mass M %f\n",bigM()); ! printf("Mass mA %f\n",_mA); ! printf("Mass mB %f\n",_mB); ! printf("Mass mC %f\n",_mC); // limits ! printf("Limits qAB %f : %f\n",qAbsMin(AB),qAbsMax(AB)); ! printf("Limits qBC %f : %f\n",qAbsMin(BC),qAbsMax(BC)); ! printf("Limits qCA %f : %f\n",qAbsMin(CA),qAbsMax(CA)); ! printf("Sum q %f\n",sum()); ! printf("Limit qsum %f : %f\n",qSumMin(),qSumMax()); } Index: Class/EvtDalitzPoint.cc =================================================================== RCS file: /nfs/cleo3/cvsroot/Offline/src/EvtGenBase/Class/EvtDalitzPoint.cc,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -c -r1.1.1.1 -r1.2 *** Class/EvtDalitzPoint.cc 7 Oct 2003 02:47:08 -0000 1.1.1.1 --- Class/EvtDalitzPoint.cc 12 Jan 2006 16:08:17 -0000 1.2 *************** *** 1,15 **** /******************************************************************************* * Project: BaBar detector at the SLAC PEP-II B-factory * Package: EvtGenBase ! * File: $Id: EvtDalitzPoint.cc,v 1.1.1.1 2003/10/07 02:47:08 ryd Exp $ * Author: Alexei Dvoretskii, dvoretsk@slac.stanford.edu, 2001-2002 * * Copyright (C) 2002 Caltech *******************************************************************************/ #include - #include #include #include "EvtGenBase/EvtDalitzPoint.hh" using namespace EvtCyclic3; --- 1,17 ---- + #include "Experiment/Experiment.h" /******************************************************************************* * Project: BaBar detector at the SLAC PEP-II B-factory * Package: EvtGenBase ! * File: $Id: EvtDalitzPoint.cc,v 1.2 2006/01/12 16:08:17 ryd Exp $ * Author: Alexei Dvoretskii, dvoretsk@slac.stanford.edu, 2001-2002 * * Copyright (C) 2002 Caltech *******************************************************************************/ + #include "EvtGenBase/EvtPatches.hh" #include #include + #include #include "EvtGenBase/EvtDalitzPoint.hh" using namespace EvtCyclic3; *************** *** 177,186 **** } ! void EvtDalitzPoint::print(std::ostream& os) const { ! getDalitzPlot().print(os); ! os << _qAB << " " << _qBC << " " << _qCA << std::endl; } --- 179,188 ---- } ! void EvtDalitzPoint::print() const { ! getDalitzPlot().print(); ! printf("%f %f %f\n",_qAB,_qBC,_qCA); } Index: Class/EvtDalitzResPdf.cc =================================================================== RCS file: Class/EvtDalitzResPdf.cc diff -N Class/EvtDalitzResPdf.cc *** /dev/null 1 Jan 1970 00:00:00 -0000 --- Class/EvtDalitzResPdf.cc 12 Jan 2006 16:08:17 -0000 1.1 *************** *** 0 **** --- 1,105 ---- + #include "Experiment/Experiment.h" + /******************************************************************************* + * Project: BaBar detector at the SLAC PEP-II B-factory + * Package: EvtGenBase + * File: $Id: EvtDalitzResPdf.cc,v 1.1 2006/01/12 16:08:17 ryd Exp $ + * Author: Alexei Dvoretskii, dvoretsk@slac.stanford.edu, 2001-2002 + * + * Copyright (C) 2002 Caltech + *******************************************************************************/ + + #include + #include + #include "EvtGenBase/EvtPatches.hh" + #include "EvtGenBase/EvtConst.hh" + #include "EvtGenBase/EvtDalitzResPdf.hh" + #include "EvtGenBase/EvtDalitzCoord.hh" + #include "EvtGenBase/EvtRandom.hh" + using namespace EvtCyclic3; + + EvtDalitzResPdf::EvtDalitzResPdf(const EvtDalitzPlot& dp, + double _m0, double _g0, EvtCyclic3::Pair pair) + : EvtPdf(), + _dp(dp), _m0(_m0), _g0(_g0), _pair(pair) + {} + + + EvtDalitzResPdf::EvtDalitzResPdf(const EvtDalitzResPdf& other) + : EvtPdf(other), + _dp(other._dp),_m0(other._m0), _g0(other._g0), _pair(other._pair) + {} + + + EvtDalitzResPdf::~EvtDalitzResPdf() + {} + + EvtValError EvtDalitzResPdf::compute_integral(int N) const + { + assert(N != 0); + + EvtCyclic3::Pair i = _pair; + EvtCyclic3::Pair j = EvtCyclic3::next(i); + + // Trapezoidal integral + + double dh = (_dp.qAbsMax(j) - _dp.qAbsMin(j))/((double) N); + double sum = 0; + + int ii; + for(ii=1;iigetId(),getNDaug(),getDaugs()); ! //report(INFO,"EvtGen") << "Decaying " << EvtPDL::name(p->getId()) << std::endl; do{ _weight = 1.0; decay(p); rho=_amp2.getSpinDensity(); prob=p->getSpinDensityForward().NormalizedProb(rho); if (prob<0.0) { report(ERROR,"EvtGen")<<"Negative prob:"<getId().getId() ! <<" "<getChannel()<getSpinDensityForward(); ! report(ERROR,"EvtGen") << "rho decay:"<getSpinDensityForward(); ! report(DEBUG,"EvtGen") << "Decay density matrix:"<getId()).c_str()<getChannel()<getP4() << " " << p->mass() << std::endl; if( p->getParent()!=0){ report(DEBUG,"EvtGen") << "parent:" <getParent()->getId()).c_str()<getParent()->getChannel()<getId(),getNDaug(),getDaugs()); ! //report(INFO,"EvtGen") << "Decaying " << EvtPDL::name(p->getId()) << endl; ! //report(INFO,"EvtGen") << "with 1st daughter " << EvtPDL::name(p->getDaug(0)->getId()) << endl; do{ + + _daugsDecayedByParentModel=false; _weight = 1.0; decay(p); rho=_amp2.getSpinDensity(); + //int ddd=rho.GetDim(); + // report(INFO,"EvtGen") << "Get Dimension: " << ddd << endl; + prob=p->getSpinDensityForward().NormalizedProb(rho); if (prob<0.0) { report(ERROR,"EvtGen")<<"Negative prob:"<getId().getId() ! <<" "<getChannel()<getSpinDensityForward(); ! report(ERROR,"EvtGen") << "rho decay:"<getSpinDensityForward(); ! report(DEBUG,"EvtGen") << "Decay density matrix:"<getId()).c_str()<getChannel()<getP4() << " " << p->mass() << endl; if( p->getParent()!=0){ report(DEBUG,"EvtGen") << "parent:" <getParent()->getId()).c_str()<getParent()->getChannel()<getParent()->getDaug(i)->getId()).c_str() << " "; } ! report(DEBUG,"") << std::endl; report(DEBUG,"EvtGen") << "daughters :"; for (i=0;igetNDaug();i++){ --- 95,101 ---- p->getParent()->getDaug(i)->getId()).c_str() << " "; } ! report(DEBUG,"") << endl; report(DEBUG,"EvtGen") << "daughters :"; for (i=0;igetNDaug();i++){ *************** *** 94,105 **** p->getDaug(i)->getId()).c_str() << " "; } ! report(DEBUG,"") << std::endl; ! report(DEBUG,"EvtGen") << "daughter momenta :" << std::endl;; for (i=0;igetNDaug();i++){ report(DEBUG,"") << p->getDaug(i)->getP4() << " " << p->getDaug(i)->mass(); ! report(DEBUG,"") << std::endl; } } --- 103,114 ---- p->getDaug(i)->getId()).c_str() << " "; } ! report(DEBUG,"") << endl; ! report(DEBUG,"EvtGen") << "daughter momenta :" << endl;; for (i=0;igetNDaug();i++){ report(DEBUG,"") << p->getDaug(i)->getP4() << " " << p->getDaug(i)->mass(); ! report(DEBUG,"") << endl; } } *************** *** 110,120 **** prob_max = getProbMax(prob); ! //report(INFO,"EvtGen") << "Prob,prob_max,weight:"<setDecayProb(prob/prob_max); ! //report(INFO,"EvtGen") << "Prob,prob_max,weight:"<getSpinDensityForward()<getId()).c_str()<<"(channel:"<< ! p->getChannel()<<") with mass "<mass()<getNDaug();ii++){ report(DEBUG,"EvtGen") <<"Daughter "<getDaug(ii)->getId()).c_str()<<" with mass "<< ! p->getDaug(ii)->mass()<getSpinDensityForward()<getId()).c_str()<<"(channel:"<< ! p->getChannel()<<") with mass "<mass()<getNDaug();ii++){ report(DEBUG,"EvtGen") <<"Daughter "<getDaug(ii)->getId()).c_str()<<" with mass "<< ! p->getDaug(ii)->mass()<getNDaug() << " daughters\n"; - for(i=0;igetNDaug();i++){ - - rho.SetDim(_amp2.dstates[i]); ! if (_amp2.dstates[i]==1) { ! rho.Set(0,0,EvtComplex(1.0,0.0)); ! } ! else{ ! rho=ampcont.contract(_amp2._dnontrivial[i],_amp2); ! } ! if (!rho.Check()) { ! report(ERROR,"EvtGen") << "-------start error-------"<getId()).c_str()<<" "<getChannel()<<" "<getParent()->getId()).c_str()<getParent()->getParent()->getId()).c_str()<getParent()->getParent()->getParent()->getId()).c_str()<getDaug(i)->setSpinDensityForward(rho); - p->getDaug(i)->decay(); ! rho_list[i+1]=p->getDaug(i)->getSpinDensityBackward(); ! ! if (_amp2.dstates[i]!=1){ ! ampcont=ampcont.contract(_amp2._dnontrivial[i],rho_list[i+1]); } - - - } - - p->setSpinDensityBackward(_amp2.getBackwardSpinDensity(rho_list)); - - - if (!p->getSpinDensityBackward().Check()) { - - report(ERROR,"EvtGen")<<"rho_backward failed Check"<< - p->getId().getId()<<" "<getChannel()<getSpinDensityBackward(); - } if (getPHOTOS() || EvtRadCorr::alwaysRadCorr()) { EvtRadCorr::doRadCorr(p); } } --- 163,239 ---- ampcont=_amp2; } ! // it may be that the parent decay model has already ! // done the decay - this should be rare and the ! // model better know what it is doing.. ! ! if ( !daugsDecayedByParentModel() ){ ! ! //report(INFO,"EvtGen") << "Found " << p->getNDaug() << " daughters\n"; ! for(i=0;igetNDaug();i++){ ! rho.SetDim(_amp2.dstates[i]); ! ! if (_amp2.dstates[i]==1) { ! rho.Set(0,0,EvtComplex(1.0,0.0)); ! } ! else{ ! rho=ampcont.contract(_amp2._dnontrivial[i],_amp2); ! } ! ! if (!rho.Check()) { ! ! report(ERROR,"EvtGen") << "-------start error-------"<getId()).c_str()<<" "<getChannel()<<" "<getParent()->getId()).c_str()<getParent()->getParent()->getId()).c_str()<getParent()->getParent()->getParent()->getId()).c_str()<getDaug(i)->setSpinDensityForward(rho); ! p->getDaug(i)->decay(); ! ! rho_list[i+1]=p->getDaug(i)->getSpinDensityBackward(); ! ! if (_amp2.dstates[i]!=1){ ! ampcont=ampcont.contract(_amp2._dnontrivial[i],rho_list[i+1]); } ! ! } ! p->setSpinDensityBackward(_amp2.getBackwardSpinDensity(rho_list)); ! ! ! if (!p->getSpinDensityBackward().Check()) { ! ! report(ERROR,"EvtGen")<<"rho_backward failed Check"<< ! p->getId().getId()<<" "<getChannel()<getSpinDensityBackward(); ! } } if (getPHOTOS() || EvtRadCorr::alwaysRadCorr()) { + int n_daug_orig=p->getNDaug(); EvtRadCorr::doRadCorr(p); + int n_daug_new=p->getNDaug(); + for (int i=n_daug_orig;igetDaug(i)->decay(); + } } } Index: Class/EvtDecayBase.cc =================================================================== RCS file: /nfs/cleo3/cvsroot/Offline/src/EvtGenBase/Class/EvtDecayBase.cc,v retrieving revision 1.1.1.1 retrieving revision 1.3 diff -c -r1.1.1.1 -r1.3 *** Class/EvtDecayBase.cc 7 Oct 2003 02:47:08 -0000 1.1.1.1 --- Class/EvtDecayBase.cc 6 Jun 2006 17:15:54 -0000 1.3 *************** *** 18,23 **** --- 18,24 ---- // //------------------------------------------------------------------------ // + #include "Experiment/Experiment.h" #include #include #include *************** *** 28,33 **** --- 29,37 ---- #include "EvtGenBase/EvtPDL.hh" #include "EvtGenBase/EvtReport.hh" #include "EvtGenBase/EvtSpinType.hh" + #include + using std::endl; + using std::fstream; void EvtDecayBase::checkQ() { int i; int q=0; *************** *** 45,58 **** if ( q != qpar ) { report(ERROR,"EvtGen") <<_modelname.c_str()<< " generator expected " ! << " charge to be conserved, found:"<0) { --- 176,181 ---- *************** *** 213,223 **** for(i=0;i<_ndaug;i++){ report(INFO,"") << EvtPDL::name(_daug[i]).c_str() << " "; } ! report(INFO,"") << std::endl; ! report(INFO,"") << "This is fine for development, but must be provided for production."< 10000 ) { ! report(INFO,"EvtGen") << "Can not find a valid mass for: " << EvtPDL::name(p->getId()).c_str() <getParent() ) { if ( p->getParent()->getParent() ) { p->getParent()->getParent()->printTree(); ! report(INFO,"EvtGen") << p->getParent()->getParent()->mass() <getParent()->mass() <getParent()->printTree(); ! report(INFO,"EvtGen") << p->getParent()->mass() <printTree(); ! report(INFO,"EvtGen") << "maxokmass=" << maxOkMass << " " << EvtPDL::getMinMass(p->getId()) << " " << EvtPDL::getMaxMass(p->getId())<getNDaug() ) { for (i=0; igetNDaug(); i++) { report(INFO,"EvtGen") << p->getDaug(i)->mass()<<" "; } ! report(INFO,"EvtGen") << std::endl; } if ( maxOkMass >= EvtPDL::getMinMass(p->getId()) ) { report(INFO,"EvtGen") << "taking a default value\n"; --- 359,384 ---- while (!massOk) { count++; if ( count > 10000 ) { ! report(INFO,"EvtGen") << "Can not find a valid mass for: " << EvtPDL::name(p->getId()).c_str() <getParent() ) { if ( p->getParent()->getParent() ) { p->getParent()->getParent()->printTree(); ! report(INFO,"EvtGen") << p->getParent()->getParent()->mass() <getParent()->mass() <getParent()->printTree(); ! report(INFO,"EvtGen") << p->getParent()->mass() <printTree(); ! report(INFO,"EvtGen") << "maxokmass=" << maxOkMass << " " << EvtPDL::getMinMass(p->getId()) << " " << EvtPDL::getMaxMass(p->getId())<getNDaug() ) { for (i=0; igetNDaug(); i++) { report(INFO,"EvtGen") << p->getDaug(i)->mass()<<" "; } ! report(INFO,"EvtGen") << endl; } if ( maxOkMass >= EvtPDL::getMinMass(p->getId()) ) { report(INFO,"EvtGen") << "taking a default value\n"; *************** *** 445,459 **** if(count==10000) { report(ERROR,"EvtGen") <<"Decaying particle:"<< ! EvtPDL::name(p->getId()).c_str()<<" (m="<mass()<<")"<getId()).c_str()<<" (m="<mass()<<")"< p->mass()){ report(ERROR,"EvtGen") << "Parent mass="<mass() ! << "to light for daugthers."< p->mass()){ report(ERROR,"EvtGen") << "Parent mass="<mass() ! << "to light for daugthers."<-1) { ! report(ERROR,"EvtGen") << " or " << a2<-1) { ! report(ERROR,"EvtGen") << " or " << a3<-1) { ! report(ERROR,"EvtGen") << " or " << a4<-1) { ! report(ERROR,"EvtGen") << " or " << a2<-1) { ! report(ERROR,"EvtGen") << " or " << a3<-1) { ! report(ERROR,"EvtGen") << " or " << a4<-1) { report(ERROR,"EvtGen") << " or " << d2; } ! report(ERROR,"EvtGen") << " daughters but found:"<< _ndaug << std::endl; printSummary(); ! report(ERROR,"EvtGen") << "Will terminate execution!"<-1) { report(ERROR,"EvtGen") << " or " << d2; } ! report(ERROR,"EvtGen") << " daughters but found:"<< _ndaug << endl; printSummary(); ! report(ERROR,"EvtGen") << "Will terminate execution!"< useDs; + for ( int i=0; i<_ndaug; i++) useDs.push_back(0); + + for ( int i=0; i<_ndaug; i++) { + bool foundIt=false; + for ( int j=0; j<_ndaug; j++) { + if ( useDs[j] == 1 ) continue; + if ( _daug[i] == other._daug[j] && _daug[i].getAlias() == other._daug[j].getAlias()) { + foundIt=true; + useDs[j]=1; + break; + } + } + if ( foundIt==false) return false; + } + for ( int i=0; i<_ndaug; i++) if ( useDs[i]==0) return false; + + return true; + + } Index: Class/EvtDecayIncoherent.cc =================================================================== RCS file: /nfs/cleo3/cvsroot/Offline/src/EvtGenBase/Class/EvtDecayIncoherent.cc,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -c -r1.1.1.1 -r1.2 *** Class/EvtDecayIncoherent.cc 7 Oct 2003 02:47:08 -0000 1.1.1.1 --- Class/EvtDecayIncoherent.cc 12 Jan 2006 16:08:18 -0000 1.2 *************** *** 17,22 **** --- 17,23 ---- // DJL/RYD August 11, 1998 Module created // //------------------------------------------------------------------------ + #include "Experiment/Experiment.h" #include "EvtGenBase/EvtDecayBase.hh" #include "EvtGenBase/EvtDecayIncoherent.hh" *************** *** 32,39 **** --- 33,42 ---- //initialize this the hard way.. //Lange June 26, 2000 for (i=0; isetDecayProb(1.); EvtSpinDensity rho; *************** *** 46,71 **** } //Now decay the daughters. ! for(i=0;igetNDaug();i++){ ! //Need to set the spin density of the daughters to be ! //diagonal. ! rho.SetDiag(p->getDaug(i)->getSpinStates()); ! //if (p->getDaug(i)->getNDaug()==0){ //only do this if the user has not already set the //spin density matrix herself. ! //Lange June 26, 2000 if ( isDaughterSpinDensitySet(i)==0 ) { p->getDaug(i)->setSpinDensityForward(rho); } else{ //report(INFO,"EvtGen") << "spinDensitymatrix already set!!!\n"; EvtSpinDensity temp=p->getDaug(i)->getSpinDensityForward(); ! // report(INFO,"EvtGen") <getDaug(i)->decay(); //} ! } } --- 49,78 ---- } //Now decay the daughters. ! ! if ( !daugsDecayedByParentModel()) { ! ! for(i=0;igetNDaug();i++){ ! //Need to set the spin density of the daughters to be ! //diagonal. ! rho.SetDiag(p->getDaug(i)->getSpinStates()); ! //if (p->getDaug(i)->getNDaug()==0){ //only do this if the user has not already set the //spin density matrix herself. ! //Lange June 26, 2000 if ( isDaughterSpinDensitySet(i)==0 ) { p->getDaug(i)->setSpinDensityForward(rho); } else{ //report(INFO,"EvtGen") << "spinDensitymatrix already set!!!\n"; EvtSpinDensity temp=p->getDaug(i)->getSpinDensityForward(); ! // report(INFO,"EvtGen") <getDaug(i)->decay(); //} ! } ! } } Index: Class/EvtDecayMode.cc =================================================================== RCS file: /nfs/cleo3/cvsroot/Offline/src/EvtGenBase/Class/EvtDecayMode.cc,v retrieving revision 1.1.1.1 retrieving revision 1.4 diff -c -r1.1.1.1 -r1.4 *** Class/EvtDecayMode.cc 7 Oct 2003 02:47:08 -0000 1.1.1.1 --- Class/EvtDecayMode.cc 21 Jun 2006 18:27:19 -0000 1.4 *************** *** 1,6 **** //----------------------------------------------------------------------- // File and Version Information: ! // $Id: EvtDecayMode.cc,v 1.1.1.1 2003/10/07 02:47:08 ryd Exp $ // // Environment: // This software is part of the EvtGen package developed jointly --- 1,6 ---- //----------------------------------------------------------------------- // File and Version Information: ! // $Id: EvtDecayMode.cc,v 1.4 2006/06/21 18:27:19 gregor Exp $ // // Environment: // This software is part of the EvtGen package developed jointly *************** *** 13,18 **** --- 13,19 ---- // Module creator: // Alexei Dvoretskii, Caltech, 2001-2002. //----------------------------------------------------------------------- + #include "Experiment/Experiment.h" // Parses a decay string to identify the name // of the mother and of the daughters. The string should *************** *** 23,56 **** #include #include "EvtGenBase/EvtDecayMode.hh" #include "EvtGenBase/EvtReport.hh" using std::string; using std::vector; EvtDecayMode::EvtDecayMode(std::string mother,vector dau) ! : _mother(mother) { - unsigned i; - for(i=0;i #include "EvtGenBase/EvtDecayMode.hh" #include "EvtGenBase/EvtReport.hh" + using std::endl; + using std::ostream; using std::string; using std::vector; EvtDecayMode::EvtDecayMode(std::string mother,vector dau) ! : _mother(mother), ! _dau(dau) { } EvtDecayMode::EvtDecayMode(const EvtDecayMode& other) ! : _mother(other._mother), ! _dau(other._dau) { } *************** *** 60,81 **** // format, e.g. "B+ -> pi+ pi+ pi-" with all spaces string s(decay); - size_t i,j; // mother ! i = s.find_first_not_of(" "); ! j = s.find_first_of(" ",i); if(i == string::npos) { ! report(INFO,"EvtGen") << "No non-space character found" << std::endl; assert(0); } if(j == string::npos) { ! report(INFO,"EvtGen") << "No space before -> found" << std::endl; assert(0); } --- 51,71 ---- // format, e.g. "B+ -> pi+ pi+ pi-" with all spaces string s(decay); // mother ! string::size_type i = s.find_first_not_of(" "); ! string::size_type j = s.find_first_of(" ",i); if(i == string::npos) { ! report(INFO,"EvtGen") << "No non-space character found" << endl; assert(0); } if(j == string::npos) { ! report(INFO,"EvtGen") << "No space before -> found" << endl; assert(0); } *************** *** 85,91 **** j = s.find_first_of("->",j); if(i != j) { ! report(INFO,"EvtGen") << "Multiple mothers?" << i << "," << j << std::endl; assert(0); } j += 2; --- 75,81 ---- j = s.find_first_of("->",j); if(i != j) { ! report(INFO,"EvtGen") << "Multiple mothers?" << i << "," << j << endl; assert(0); } j += 2; *************** *** 129,185 **** return _dau[i].c_str(); } ! const char* EvtDecayMode::mode() const { string ret = _mother + string(" -> "); ! int i; ! for(i=0;i<_dau.size()-1;i++) ret += string(_dau[i]) + string(" "); ret += _dau[_dau.size()-1]; ! return ret.c_str(); } ! std::ostream& EvtDecayMode::print(std::ostream& os) const { os << _mother.c_str() << " ->"; ! unsigned i; ! for(i=0;i<_dau.size();i++) os << " " << _dau[i].c_str(); return os; } ! const char* EvtDecayMode::m(EvtCyclic3::Pair i) const { string s("m("); s.append(dau(first(i))); s.append(","); s.append(dau(second(i))); s.append(")"); ! return s.c_str(); } ! const char* EvtDecayMode::q(EvtCyclic3::Pair i) const { string s("q("); s.append(dau(first(i))); s.append(","); s.append(dau(second(i))); s.append(")"); ! return s.c_str(); } ! const char* EvtDecayMode::dal(EvtCyclic3::Pair i, EvtCyclic3::Pair j) const { string s(q(i)); s.append(":"); s.append(q(j)); ! return s.c_str(); } ! std::ostream& operator<<(std::ostream& os, const EvtDecayMode& mode) { mode.print(os); return os; --- 119,184 ---- return _dau[i].c_str(); } ! ! std::string ! EvtDecayMode::mode() const { string ret = _mother + string(" -> "); ! for(size_t i=0;i<_dau.size()-1;i++) ! { ! ret += _dau[i] + string(" "); ! } ret += _dau[_dau.size()-1]; ! return ret; } ! ostream& EvtDecayMode::print(ostream& os) const { os << _mother.c_str() << " ->"; ! for(size_t i=0;i<_dau.size();i++) ! { ! os << " " << _dau[i].c_str(); ! } return os; } ! std::string ! EvtDecayMode::m(EvtCyclic3::Pair i) const { string s("m("); s.append(dau(first(i))); s.append(","); s.append(dau(second(i))); s.append(")"); ! return s; } ! std::string ! EvtDecayMode::q(EvtCyclic3::Pair i) const { string s("q("); s.append(dau(first(i))); s.append(","); s.append(dau(second(i))); s.append(")"); ! return s; } ! std::string ! EvtDecayMode::dal(EvtCyclic3::Pair i, EvtCyclic3::Pair j) const { string s(q(i)); s.append(":"); s.append(q(j)); ! return s; } ! ostream& operator<<(ostream& os, const EvtDecayMode& mode) { mode.print(os); return os; Index: Class/EvtDecayParm.cc =================================================================== RCS file: /nfs/cleo3/cvsroot/Offline/src/EvtGenBase/Class/EvtDecayParm.cc,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -c -r1.1.1.1 -r1.2 *** Class/EvtDecayParm.cc 7 Oct 2003 02:47:08 -0000 1.1.1.1 --- Class/EvtDecayParm.cc 12 Jan 2006 16:08:18 -0000 1.2 *************** *** 18,29 **** --- 18,31 ---- // //------------------------------------------------------------------------ // + #include "Experiment/Experiment.h" #include #include #include #include #include "EvtGenBase/EvtDecayParm.hh" #include + using std::fstream; void EvtDecayParm::init(fcnPtr pfcn, int ndaug, int *daugs, int narg, double *args, std::string name) { Index: Class/EvtDecayProb.cc =================================================================== RCS file: /nfs/cleo3/cvsroot/Offline/src/EvtGenBase/Class/EvtDecayProb.cc,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -c -r1.1.1.1 -r1.2 *** Class/EvtDecayProb.cc 7 Oct 2003 02:47:08 -0000 1.1.1.1 --- Class/EvtDecayProb.cc 12 Jan 2006 16:08:18 -0000 1.2 *************** *** 17,22 **** --- 17,23 ---- // DJL/RYD August 11, 1998 Module created // //------------------------------------------------------------------------ + #include "Experiment/Experiment.h" #include "EvtGenBase/EvtDecayBase.hh" #include "EvtGenBase/EvtDecayProb.hh" *************** *** 25,30 **** --- 26,32 ---- #include "EvtGenBase/EvtRandom.hh" #include "EvtGenBase/EvtPDL.hh" #include "EvtGenBase/EvtReport.hh" + using std::endl; void EvtDecayProb::makeDecay(EvtParticle* p){ *************** *** 34,64 **** do{ _weight=1.0; decay(p); ! //report(INFO,"EvtGen") << _weight << std::endl; ntimes--; _prob = _prob/_weight; dummy=getProbMax(_prob)*EvtRandom::Flat(); ! ! // report(INFO,"EvtGen") << _prob <<" "<getId()).c_str()<<"(channel:"<< ! p->getChannel()<<") with mass "<mass()<getNDaug();ii++){ report(DEBUG,"EvtGen") <<"Daughter "<getDaug(ii)->getId()).c_str()<<" with mass "<< ! p->getDaug(ii)->mass()<setDecayProb(_prob/getProbMax(_prob)); ! // report(INFO,"EvtGen") << _prob <<" "<getId()).c_str()<<"(channel:"<< ! p->getChannel()<<") with mass "<mass()<getNDaug();ii++){ report(DEBUG,"EvtGen") <<"Daughter "<getDaug(ii)->getId()).c_str()<<" with mass "<< ! p->getDaug(ii)->mass()<getNDaug();i++){ ! //Need to set the spin density of the daughters to be ! //diagonal. ! rho.SetDiag(p->getDaug(i)->getSpinStates()); ! p->getDaug(i)->setSpinDensityForward(rho); ! ! //Now decay the daughter. Really! ! p->getDaug(i)->decay(); ! } } --- 75,92 ---- //Now decay the daughters. ! if ( !daugsDecayedByParentModel()) { ! int i; ! for(i=0;igetNDaug();i++){ ! //Need to set the spin density of the daughters to be ! //diagonal. ! rho.SetDiag(p->getDaug(i)->getSpinStates()); ! p->getDaug(i)->setSpinDensityForward(rho); ! ! //Now decay the daughter. Really! ! p->getDaug(i)->decay(); ! } ! } } Index: Class/EvtDecayTable.cc =================================================================== RCS file: /nfs/cleo3/cvsroot/Offline/src/EvtGenBase/Class/EvtDecayTable.cc,v retrieving revision 1.1.1.1 retrieving revision 1.6 diff -c -r1.1.1.1 -r1.6 *** Class/EvtDecayTable.cc 7 Oct 2003 02:47:08 -0000 1.1.1.1 --- Class/EvtDecayTable.cc 1 Apr 2008 20:40:59 -0000 1.6 *************** *** 18,23 **** --- 18,24 ---- // //------------------------------------------------------------------------ // + #include "Experiment/Experiment.h" #include #include *************** *** 39,47 **** #include "EvtGenBase/EvtModelAlias.hh" #include "EvtGenBase/EvtRadCorr.hh" #include ! //static EvtModel modelist; ! ! static EvtSymTable symtable; static std::vector decaytable; --- 40,48 ---- #include "EvtGenBase/EvtModelAlias.hh" #include "EvtGenBase/EvtRadCorr.hh" #include ! using std::endl; ! using std::fstream; ! using std::ifstream; static std::vector decaytable; *************** *** 55,63 **** void EvtDecayTable::printSummary(){ ! int i; ! ! for(i=0;i temp_fcn_new_args(500); ! int temp_fcn_new_narg; ! EvtId temp_fcn_new_daug[MAX_DAUG]; EvtDecayBase* temp_fcn_new; - double temp_sbrfr; - double temp_massmin; - int temp_nmode; double brfrsum=0.0; --- 348,374 ---- double tnum=atof(parser.getToken(itoken++).c_str()); EvtId thisPart = EvtPDL::getId(pname); EvtPDL::reSetBlatt(thisPart,tnum); ! report(DEBUG,"EvtGen") <<"Redefined Blatt-Weisskopf factor " << EvtPDL::name(thisPart).c_str() << " to be " << tnum << endl; ! } else if ( token=="SetLineshapePW") { ! std::string pname; ! pname=parser.getToken(itoken++); ! EvtId thisPart = EvtPDL::getId(pname); ! std::string pnameD1=parser.getToken(itoken++); ! EvtId thisD1 = EvtPDL::getId(pnameD1); ! std::string pnameD2=parser.getToken(itoken++); ! EvtId thisD2 = EvtPDL::getId(pnameD2); ! int pw=atoi(parser.getToken(itoken++).c_str()); ! report(DEBUG,"EvtGen") <<"Redefined Partial wave for " << pname.c_str() << " to " << pnameD1.c_str() << " " << pnameD2.c_str() << " ("< temp_fcn_new_args; ! std::string name; int ierr; *************** *** 519,532 **** do{ name=parser.getToken(itoken++); if (name!=";") { ! temp_fcn_new_args[narg++]=symtable.Get(name,ierr); if (ierr) { report(ERROR,"EvtGen") <<"Reading arguments and found:"<< name.c_str()<<" on line:"<< ! parser.getLineofToken(itoken-1)< copyMe=modelAliasList[foundAnAlias].getArgList(); ! narg=copyMe.size(); ! int iTemp; ! for (iTemp=0; iTemp copyMe=modelAliasList[foundAnAlias].getArgList(); ! temp_fcn_new_args=copyMe; itoken++; } //Found one decay. *************** *** 560,566 **** temp_fcn_new->saveDecayInfo(ipar,n_daugh, daught, ! narg, temp_fcn_new_args, temp_fcn_new_model, brfr); --- 565,571 ---- temp_fcn_new->saveDecayInfo(ipar,n_daugh, daught, ! temp_fcn_new_args.size(), temp_fcn_new_args, temp_fcn_new_model, brfr); *************** *** 585,595 **** decaytable[ipar.getAlias()].finalize(); } ! else if (token!="End"){ report(ERROR,"EvtGen") << "Found unknown command:'"<= 0) { + sdaug = parser.getToken(itoken++); + daught[n_daugh++] = EvtPDL::getId(sdaug); + if (daught[n_daugh-1]==EvtId(-1,-1)) { + report(ERROR,"EvtGen") <<"Unknown particle name:"< temp_fcn_new_args; + std::string temp_fcn_new_model("PHSP"); + temp_fcn_new->saveDecayInfo(ipar, n_daugh, + daught, + 0, + temp_fcn_new_args, + temp_fcn_new_model, + 0.); + decaytable[ipar.getAlias()].removeMode(temp_fcn_new); + } + } while (token != "Enddecay"); + itoken++; + } + else if (token!="End"){ report(ERROR,"EvtGen") << "Found unknown command:'"< EvtPDL::getMinMass(temp) ) { report(INFO,"EvtGen") << "Given allowed decays, resetting minMass " << EvtPDL::name(temp).c_str() << " " ! << EvtPDL::getMinMass(temp) << " to " << minMass << std::endl; EvtPDL::reSetMassMin(temp,minMass); } } --- 713,719 ---- if ( minMass > EvtPDL::getMinMass(temp) ) { report(INFO,"EvtGen") << "Given allowed decays, resetting minMass " << EvtPDL::name(temp).c_str() << " " ! << EvtPDL::getMinMass(temp) << " to " << minMass << endl; EvtPDL::reSetMassMin(temp,minMass); } } Index: Class/EvtDiracParticle.cc =================================================================== RCS file: /nfs/cleo3/cvsroot/Offline/src/EvtGenBase/Class/EvtDiracParticle.cc,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -c -r1.1.1.1 -r1.2 *** Class/EvtDiracParticle.cc 7 Oct 2003 02:47:08 -0000 1.1.1.1 --- Class/EvtDiracParticle.cc 12 Jan 2006 16:08:18 -0000 1.2 *************** *** 18,23 **** --- 18,24 ---- // //------------------------------------------------------------------------ // + #include "Experiment/Experiment.h" #include #include #include *************** *** 28,33 **** --- 29,35 ---- #include "EvtGenBase/EvtReport.hh" #include "EvtGenBase/EvtSpinDensity.hh" #include "EvtGenBase/EvtGammaMatrix.hh" + using std::endl; EvtDiracParticle::~EvtDiracParticle(){} *************** *** 46,76 **** if (EvtPDL::getStdHep(part_n)==0){ report(ERROR,"EvtGen") << "Error in EvtDiracParticle::init, part_n=" ! << part_n.getId()<0){ ! spinor1_rest.set(EvtComplex(sqrt(2.0*mass()),0.0),EvtComplex(0.0,0.0), ! EvtComplex(0.0,0.0),EvtComplex(0.0,0.0)); ! spinor2_rest.set(EvtComplex(0.0,0.0),EvtComplex(sqrt(2.0*mass()),0.0), ! EvtComplex(0.0,0.0),EvtComplex(0.0,0.0)); ! spinor1_parent=boostTo(spinor1_rest,p4); ! spinor2_parent=boostTo(spinor2_rest,p4); } else{ ! spinor1_rest.set(EvtComplex(0.0,0.0),EvtComplex(0.0,0.0), EvtComplex(sqrt(2.0*mass()),0.0),EvtComplex(0.0,0.0)); ! spinor2_rest.set(EvtComplex(0.0,0.0),EvtComplex(0.0,0.0), EvtComplex(0.0,0.0),EvtComplex(sqrt(2.0*mass()),0.0)); ! spinor1_parent=boostTo(spinor1_rest,p4); ! spinor2_parent=boostTo(spinor2_rest,p4); --- 48,78 ---- if (EvtPDL::getStdHep(part_n)==0){ report(ERROR,"EvtGen") << "Error in EvtDiracParticle::init, part_n=" ! << part_n.getId()<0){ ! _spinorRest[0].set(EvtComplex(sqrt(2.0*mass()),0.0),EvtComplex(0.0,0.0), ! EvtComplex(0.0,0.0),EvtComplex(0.0,0.0)); ! _spinorRest[1].set(EvtComplex(0.0,0.0),EvtComplex(sqrt(2.0*mass()),0.0), ! EvtComplex(0.0,0.0),EvtComplex(0.0,0.0)); ! _spinorParent[0]=boostTo(_spinorRest[0],p4); ! _spinorParent[1]=boostTo(_spinorRest[1],p4); } else{ ! _spinorRest[0].set(EvtComplex(0.0,0.0),EvtComplex(0.0,0.0), EvtComplex(sqrt(2.0*mass()),0.0),EvtComplex(0.0,0.0)); ! _spinorRest[1].set(EvtComplex(0.0,0.0),EvtComplex(0.0,0.0), EvtComplex(0.0,0.0),EvtComplex(sqrt(2.0*mass()),0.0)); ! _spinorParent[0]=boostTo(_spinorRest[0],p4); ! _spinorParent[1]=boostTo(_spinorRest[1],p4); *************** *** 80,123 **** } - EvtDiracSpinor EvtDiracParticle::spParent(int i) const { - - EvtDiracSpinor temp; - - switch(i) { - - case 0: - return spinor1_parent; - case 1: - return spinor2_parent; - default: - report(ERROR,"EvtGen") <<"Error invalid spinor number " - <0){ spplus.set(1.0,0.0,0.0,0.0); spminus.set(0.0,1.0,0.0,0.0); } else { ! spplus.set(0.0,0.0,0.0,1.0); ! spminus.set(0.0,0.0,1.0,0.0); } - - EvtDiracSpinor sp0=sp(0); - EvtDiracSpinor sp1=sp(1); EvtSpinDensity R; R.SetDim(2); ! R.Set(0,0,(spplus*sp0)/sqrt(2*m)); ! R.Set(0,1,(spplus*sp1)/sqrt(2*m)); ! R.Set(1,0,(spminus*sp0)/sqrt(2*m)); ! R.Set(1,1,(spminus*sp1)/sqrt(2*m)); return R; --- 89,113 ---- EvtDiracSpinor spplus; EvtDiracSpinor spminus; ! double sqmt2=sqrt(2.*(getP4().mass())); if (EvtPDL::getStdHep(getId())>0){ spplus.set(1.0,0.0,0.0,0.0); spminus.set(0.0,1.0,0.0,0.0); } else { ! spplus.set(0.0,0.0,1.0,0.0); ! spminus.set(0.0,0.0,0.0,1.0); } + EvtSpinDensity R; R.SetDim(2); ! for (int i=0; i<2; i++) { ! R.Set(0,i,(spplus*_spinorRest[i])/sqmt2); ! R.Set(1,i,(spminus*_spinorRest[i])/sqmt2); ! } ! return R; *************** *** 155,190 **** double beta, double gamma) const{ EvtDiracSpinor spplus; EvtDiracSpinor spminus; ! double m=getP4().mass(); if (EvtPDL::getStdHep(getId())>0){ spplus.set(1.0,0.0,0.0,0.0); spminus.set(0.0,1.0,0.0,0.0); } else { ! spplus.set(0.0,0.0,0.0,1.0); ! spminus.set(0.0,0.0,1.0,0.0); } - EvtDiracSpinor sp0=sp(0); - EvtDiracSpinor sp1=sp(1); - spplus.applyRotateEuler(alpha,beta,gamma); spminus.applyRotateEuler(alpha,beta,gamma); - EvtSpinDensity R; R.SetDim(2); ! R.Set(0,0,(spplus*sp0)/sqrt(2*m)); ! R.Set(0,1,(spplus*sp1)/sqrt(2*m)); ! R.Set(1,0,(spminus*sp0)/sqrt(2*m)); ! R.Set(1,1,(spminus*sp1)/sqrt(2*m)); return R; } --- 118,151 ---- double beta, double gamma) const{ + EvtDiracSpinor spplus; EvtDiracSpinor spminus; ! double sqmt2=sqrt(2.*(getP4().mass())); if (EvtPDL::getStdHep(getId())>0){ spplus.set(1.0,0.0,0.0,0.0); spminus.set(0.0,1.0,0.0,0.0); } else { ! spplus.set(0.0,0.0,1.0,0.0); ! spminus.set(0.0,0.0,0.0,1.0); } spplus.applyRotateEuler(alpha,beta,gamma); spminus.applyRotateEuler(alpha,beta,gamma); EvtSpinDensity R; R.SetDim(2); ! for (int i=0; i<2; i++) { ! R.Set(0,i,(spplus*_spinorRest[i])/sqmt2); ! R.Set(1,i,(spminus*_spinorRest[i])/sqmt2); ! } return R; } + Index: Class/EvtDiracSpinor.cc =================================================================== RCS file: /nfs/cleo3/cvsroot/Offline/src/EvtGenBase/Class/EvtDiracSpinor.cc,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -c -r1.1.1.1 -r1.2 *** Class/EvtDiracSpinor.cc 7 Oct 2003 02:47:08 -0000 1.1.1.1 --- Class/EvtDiracSpinor.cc 12 Jan 2006 16:08:18 -0000 1.2 *************** *** 18,23 **** --- 18,24 ---- // //------------------------------------------------------------------------ // + #include "Experiment/Experiment.h" #include #include #include "EvtGenBase/EvtDiracSpinor.hh" *************** *** 26,35 **** --- 27,42 ---- #include "EvtGenBase/EvtReport.hh" #include "EvtGenBase/EvtVector4C.hh" #include "EvtGenBase/EvtTensor4C.hh" + using std::ostream; EvtDiracSpinor::~EvtDiracSpinor(){} + EvtDiracSpinor::EvtDiracSpinor(const EvtComplex& sp0,const EvtComplex& sp1, + const EvtComplex& sp2,const EvtComplex& sp3){ + set(sp0,sp1,sp2,sp3); + } + void EvtDiracSpinor::set(const EvtComplex& sp0,const EvtComplex& sp1, const EvtComplex& sp2,const EvtComplex& sp3){ *************** *** 41,47 **** spinor[i]=sp; } ! std::ostream& operator<<(std::ostream& s, const EvtDiracSpinor& sp){ s <<"["<conj(); // first conjugate, then multiply with gamma0 + EvtGammaMatrix g0 = EvtGammaMatrix::g0(); + EvtDiracSpinor result; // automatically initialized to 0 + + for (int i=0; i<4; ++i) + for (int j=0; j<4; ++j) + result.spinor[i] += d.spinor[j] * g0.gamma[i][j]; + + return result; + } Index: Class/EvtEvalHelAmp.cc =================================================================== RCS file: /nfs/cleo3/cvsroot/Offline/src/EvtGenBase/Class/EvtEvalHelAmp.cc,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -c -r1.1.1.1 -r1.2 *** Class/EvtEvalHelAmp.cc 7 Oct 2003 02:47:09 -0000 1.1.1.1 --- Class/EvtEvalHelAmp.cc 12 Jan 2006 16:08:18 -0000 1.2 *************** *** 21,26 **** --- 21,27 ---- // //------------------------------------------------------------------------ // + #include "Experiment/Experiment.h" #include #include "EvtGenBase/EvtParticle.hh" #include "EvtGenBase/EvtPDL.hh" *************** *** 31,36 **** --- 32,38 ---- #include "EvtGenBase/EvtConst.hh" #include "EvtGenBase/EvtdFunction.hh" #include "EvtGenBase/EvtAmp.hh" + using std::endl; EvtEvalHelAmp::~EvtEvalHelAmp() { *************** *** 137,146 **** } } - - - - int i; //find the allowed helicities (actually 2*times the helicity!) fillHelicity(_lambdaA2,_nA,_JA2); --- 139,144 ---- *************** *** 161,167 **** double EvtEvalHelAmp::probMax(){ ! double c=1.0/sqrt(4*EvtConst::pi/(2*_JA2+1)); int ia,ib,ic; --- 159,165 ---- double EvtEvalHelAmp::probMax(){ ! double c=1.0/sqrt(4*EvtConst::pi/(_JA2+1)); int ia,ib,ic; *************** *** 208,214 **** double theta=acos(pB.get(3)/pB.d3mag()); double phi=atan2(pB.get(2),pB.get(1)); ! double c=sqrt((2*_JA2+1)/(4*EvtConst::pi)); int ia,ib,ic; --- 206,212 ---- double theta=acos(pB.get(3)/pB.d3mag()); double phi=atan2(pB.get(2),pB.get(1)); ! double c=sqrt((_JA2+1)/(4*EvtConst::pi)); int ia,ib,ic; *************** *** 256,262 **** } else{ amp.vertex(ib,ic,_amp[ia][ib][ic]); ! //report(INFO,"EvtGen") << "ib,ic:"<0.000001*prob1){ ! report(INFO,"EvtGen") << "prob1,prob2:"<0.000001*prob1){ ! report(INFO,"EvtGen") << "prob1,prob2:"< + #include "EvtGenBase/EvtVector4R.hh" + #include "EvtGenBase/EvtKine.hh" + #include "EvtGenBase/EvtComplex.hh" + #include "EvtGenBase/EvtFlatte.hh" + #include "EvtGenBase/EvtReport.hh" + #include "EvtGenBase/EvtConst.hh" + + EvtFlatte::~EvtFlatte(){} + + //operator + + EvtFlatte& EvtFlatte::operator = ( const EvtFlatte &n) + { + if ( &n == this ) return *this; + _p4_p = n._p4_p; + _p4_d1 = n._p4_d1; + _p4_d2 = n._p4_d2; + _ampl = n._ampl; + _theta = n._theta; + _mass = n._mass; + _params = n._params; + // _m1a = n._m1a; + // _m1b = n._m1b; + // _g1 = n._g1; + // _m2a = n._m2a; + // _m2b = n._m2b; + // _g2 = n._g2; + return *this; + } + + //constructor + + EvtFlatte::EvtFlatte(const EvtVector4R& p4_p, const EvtVector4R& p4_d1, + const EvtVector4R& p4_d2, double ampl, + double theta, double mass, + vector& params + // double m1a, double m1b, double g1, + // double m2a, double m2b, double g2 + ): + _p4_p(p4_p),_p4_d1(p4_d1), _p4_d2(p4_d2), _ampl(ampl), _theta(theta), + _mass(mass), + _params(params) + // _m1a(m1a), _m1b(m1b), _g1(g1), + // _m2a(m2a), _m2b(m2b), _g2(g2) + {} + + //amplitude function + + EvtComplex EvtFlatte::resAmpl() { + + double pi180inv = 1.0/EvtConst::radToDegrees; + + // EvtComplex ampl(cos(_theta*pi180inv), sin(_theta*pi180inv)); + // ampl *= _ampl; + + // SCALARS ONLY + double mR = (_p4_d1+_p4_d2).mass(); + + EvtComplex w; + + for (vector::const_iterator param = _params.begin(); + param != _params.end(); + ++param) { + + double m1 = (*param).m1(); double m2 = (*param).m2(); + double g = (*param).g(); + w += (g*g + *sqrtCplx((1-((m1-m2)*(m1-m2))/(mR*mR))* + (1-((m1+m2)*(m1+m2))/(mR*mR)))); + // cout << m1 << " " << mR << " " << w << endl; + } + + EvtComplex denom = _mass*_mass - mR*mR - EvtComplex(0,1)*w; + EvtComplex ampl = _ampl*EvtComplex(cos(_theta*pi180inv), sin(_theta*pi180inv))/denom; + // cout << abs(1/denom) << endl; + return ampl; + } + + + Index: Class/EvtGammaMatrix.cc =================================================================== RCS file: /nfs/cleo3/cvsroot/Offline/src/EvtGenBase/Class/EvtGammaMatrix.cc,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -c -r1.1.1.1 -r1.2 *** Class/EvtGammaMatrix.cc 7 Oct 2003 02:47:10 -0000 1.1.1.1 --- Class/EvtGammaMatrix.cc 12 Jan 2006 16:08:19 -0000 1.2 *************** *** 18,30 **** // //------------------------------------------------------------------------ // #include #include #include "EvtGenBase/EvtComplex.hh" #include "EvtGenBase/EvtGammaMatrix.hh" #include "EvtGenBase/EvtDiracSpinor.hh" #include "EvtGenBase/EvtReport.hh" ! EvtGammaMatrix::EvtGammaMatrix(){ int i,j; --- 18,35 ---- // //------------------------------------------------------------------------ // + #include "Experiment/Experiment.h" #include #include + #include #include "EvtGenBase/EvtComplex.hh" #include "EvtGenBase/EvtGammaMatrix.hh" #include "EvtGenBase/EvtDiracSpinor.hh" #include "EvtGenBase/EvtReport.hh" ! #include "EvtGenBase/EvtTensor4C.hh" ! #include "EvtGenBase/EvtVector4C.hh" ! using std::endl; ! using std::ostream; EvtGammaMatrix::EvtGammaMatrix(){ int i,j; *************** *** 36,41 **** --- 41,52 ---- } } + EvtGammaMatrix operator*(const EvtGammaMatrix& g, const EvtComplex& c) + { + return c*g; + } + + EvtGammaMatrix operator*(const EvtComplex& c,const EvtGammaMatrix& g){ int i,j; *************** *** 52,64 **** } ! std::ostream& operator<<(std::ostream& s, const EvtGammaMatrix& g){ ! s<<"["< 3 || nu > 3) + { + report(ERROR, "EvtSigmaTensor") << "Expected index between 0 and 3, but found " << nu << "!" << endl; + assert(0); + } + return sigma[mu][nu]; + + } + + const EvtGammaMatrix& EvtGammaMatrix::sigmaLower(unsigned int mu, unsigned int nu) + { + const EvtComplex I(0, 1); + EvtGammaMatrix a, b; + static EvtGammaMatrix sigma[4][4]; + static bool hasBeenCalled = false; + static const EvtTensor4C eta = EvtTensor4C::g(); + + if (!hasBeenCalled) // has to be initialized only at the first call + { + // lower index + for (int i=0; i<4; ++i) + { + a = eta.get(i, 0)*g0() + eta.get(i, 1)*g1() + eta.get(i, 2)*g2() + eta.get(i, 3)*g3(); + for (int j=0; j<4; ++j) + { + b = eta.get(j, 0)*g0() + eta.get(j, 1)*g1() + eta.get(j, 2)*g2() + eta.get(j, 3)*g3(); + sigma[i][j] = I/2 * (a*b - b*a); + } + } + } + return sigma[mu][nu]; + } + + + EvtGammaMatrix slash(const EvtVector4C& p) + { + return EvtGammaMatrix::g0()*p.get(0) + EvtGammaMatrix::g1()*p.get(1) + EvtGammaMatrix::g2()*p.get(2) + EvtGammaMatrix::g3()*p.get(3); + } Index: Class/EvtGenBase.cc =================================================================== RCS file: /nfs/cleo3/cvsroot/Offline/src/EvtGenBase/Class/EvtGenBase.cc,v retrieving revision 1.2 retrieving revision 1.3 diff -c -r1.2 -r1.3 *** Class/EvtGenBase.cc 19 Feb 2004 18:24:41 -0000 1.2 --- Class/EvtGenBase.cc 10 May 2005 13:01:12 -0000 1.3 *************** *** 10,20 **** // // Author: Anders Ryd // Created: Fri Sep 12 15:49:13 EDT 2003 ! // $Id: EvtGenBase.cc,v 1.2 2004/02/19 18:24:41 ryd Exp $ // // Revision history // // $Log: EvtGenBase.cc,v $ // Revision 1.2 2004/02/19 18:24:41 ryd // Moved static std::vector inside method to protect against what seems like an incorrect double delete on Linux // --- 10,23 ---- // // Author: Anders Ryd // Created: Fri Sep 12 15:49:13 EDT 2003 ! // $Id: EvtGenBase.cc,v 1.3 2005/05/10 13:01:12 ryd Exp $ // // Revision history // // $Log: EvtGenBase.cc,v $ + // Revision 1.3 2005/05/10 13:01:12 ryd + // Comment out rotation in EvtMTree.cc + // // Revision 1.2 2004/02/19 18:24:41 ryd // Moved static std::vector inside method to protect against what seems like an incorrect double delete on Linux // *************** *** 47,53 **** static const char* const kFacilityString = "EvtGenBase.EvtGenBase" ; // ---- cvs-based strings (Id and Tag with which file was checked out) ! static const char* const kIdString = "$Id: EvtGenBase.cc,v 1.2 2004/02/19 18:24:41 ryd Exp $"; static const char* const kTagString = "$Name: $"; // --- 50,56 ---- static const char* const kFacilityString = "EvtGenBase.EvtGenBase" ; // ---- cvs-based strings (Id and Tag with which file was checked out) ! static const char* const kIdString = "$Id: EvtGenBase.cc,v 1.3 2005/05/10 13:01:12 ryd Exp $"; static const char* const kTagString = "$Name: $"; // Index: Class/EvtGenBaseCommand.cc =================================================================== RCS file: /nfs/cleo3/cvsroot/Offline/src/EvtGenBase/Class/EvtGenBaseCommand.cc,v retrieving revision 1.2 retrieving revision 1.3 diff -c -r1.2 -r1.3 *** Class/EvtGenBaseCommand.cc 19 Feb 2004 18:24:41 -0000 1.2 --- Class/EvtGenBaseCommand.cc 10 May 2005 13:01:13 -0000 1.3 *************** *** 10,20 **** // // Author: Anders Ryd // Created: Fri Sep 12 15:49:13 EDT 2003 ! // $Id: EvtGenBaseCommand.cc,v 1.2 2004/02/19 18:24:41 ryd Exp $ // // Revision history // // $Log: EvtGenBaseCommand.cc,v $ // Revision 1.2 2004/02/19 18:24:41 ryd // Moved static std::vector inside method to protect against what seems like an incorrect double delete on Linux // --- 10,23 ---- // // Author: Anders Ryd // Created: Fri Sep 12 15:49:13 EDT 2003 ! // $Id: EvtGenBaseCommand.cc,v 1.3 2005/05/10 13:01:13 ryd Exp $ // // Revision history // // $Log: EvtGenBaseCommand.cc,v $ + // Revision 1.3 2005/05/10 13:01:13 ryd + // Comment out rotation in EvtMTree.cc + // // Revision 1.2 2004/02/19 18:24:41 ryd // Moved static std::vector inside method to protect against what seems like an incorrect double delete on Linux // *************** *** 50,56 **** static const char* const kFacilityString = "EvtGenBase.EvtGenBaseCommand" ; // ---- cvs-based strings (Id and Tag with which file was checked out) ! static const char* const kIdString = "$Id: EvtGenBaseCommand.cc,v 1.2 2004/02/19 18:24:41 ryd Exp $"; static const char* const kTagString = "$Name: $"; // --- 53,59 ---- static const char* const kFacilityString = "EvtGenBase.EvtGenBaseCommand" ; // ---- cvs-based strings (Id and Tag with which file was checked out) ! static const char* const kIdString = "$Id: EvtGenBaseCommand.cc,v 1.3 2005/05/10 13:01:13 ryd Exp $"; static const char* const kTagString = "$Name: $"; // Index: Class/EvtGenBaseInternalCommand.cc =================================================================== RCS file: /nfs/cleo3/cvsroot/Offline/src/EvtGenBase/Class/EvtGenBaseInternalCommand.cc,v retrieving revision 1.2 retrieving revision 1.3 diff -c -r1.2 -r1.3 *** Class/EvtGenBaseInternalCommand.cc 19 Feb 2004 18:24:41 -0000 1.2 --- Class/EvtGenBaseInternalCommand.cc 10 May 2005 13:01:13 -0000 1.3 *************** *** 10,20 **** // // Author: Anders Ryd // Created: Fri Sep 12 15:49:13 EDT 2003 ! // $Id: EvtGenBaseInternalCommand.cc,v 1.2 2004/02/19 18:24:41 ryd Exp $ // // Revision history // // $Log: EvtGenBaseInternalCommand.cc,v $ // Revision 1.2 2004/02/19 18:24:41 ryd // Moved static std::vector inside method to protect against what seems like an incorrect double delete on Linux // --- 10,23 ---- // // Author: Anders Ryd // Created: Fri Sep 12 15:49:13 EDT 2003 ! // $Id: EvtGenBaseInternalCommand.cc,v 1.3 2005/05/10 13:01:13 ryd Exp $ // // Revision history // // $Log: EvtGenBaseInternalCommand.cc,v $ + // Revision 1.3 2005/05/10 13:01:13 ryd + // Comment out rotation in EvtMTree.cc + // // Revision 1.2 2004/02/19 18:24:41 ryd // Moved static std::vector inside method to protect against what seems like an incorrect double delete on Linux // *************** *** 50,56 **** static const char* const kFacilityString = "EvtGenBase.EvtGenBaseInternalCommand" ; // ---- cvs-based strings (Id and Tag with which file was checked out) ! static const char* const kIdString = "$Id: EvtGenBaseInternalCommand.cc,v 1.2 2004/02/19 18:24:41 ryd Exp $"; static const char* const kTagString = "$Name: $"; // --- 53,59 ---- static const char* const kFacilityString = "EvtGenBase.EvtGenBaseInternalCommand" ; // ---- cvs-based strings (Id and Tag with which file was checked out) ! static const char* const kIdString = "$Id: EvtGenBaseInternalCommand.cc,v 1.3 2005/05/10 13:01:13 ryd Exp $"; static const char* const kTagString = "$Name: $"; // Index: Class/EvtGenBase_DONT_TOUCH.cc =================================================================== RCS file: /nfs/cleo3/cvsroot/Offline/src/EvtGenBase/Class/EvtGenBase_DONT_TOUCH.cc,v retrieving revision 1.2 retrieving revision 1.3 diff -c -r1.2 -r1.3 *** Class/EvtGenBase_DONT_TOUCH.cc 19 Feb 2004 18:24:41 -0000 1.2 --- Class/EvtGenBase_DONT_TOUCH.cc 10 May 2005 13:01:13 -0000 1.3 *************** *** 10,20 **** // // Author: Anders Ryd // Created: Fri Sep 12 15:49:14 EDT 2003 ! // $Id: EvtGenBase_DONT_TOUCH.cc,v 1.2 2004/02/19 18:24:41 ryd Exp $ // // Revision history // // $Log: EvtGenBase_DONT_TOUCH.cc,v $ // Revision 1.2 2004/02/19 18:24:41 ryd // Moved static std::vector inside method to protect against what seems like an incorrect double delete on Linux // --- 10,23 ---- // // Author: Anders Ryd // Created: Fri Sep 12 15:49:14 EDT 2003 ! // $Id: EvtGenBase_DONT_TOUCH.cc,v 1.3 2005/05/10 13:01:13 ryd Exp $ // // Revision history // // $Log: EvtGenBase_DONT_TOUCH.cc,v $ + // Revision 1.3 2005/05/10 13:01:13 ryd + // Comment out rotation in EvtMTree.cc + // // Revision 1.2 2004/02/19 18:24:41 ryd // Moved static std::vector inside method to protect against what seems like an incorrect double delete on Linux // *************** *** 36,42 **** // constants, enums and typedefs // // ---- cvs-based strings (Id and Tag with which file was checked out) ! static const char* const kIdString = "$Id: EvtGenBase_DONT_TOUCH.cc,v 1.2 2004/02/19 18:24:41 ryd Exp $"; static const char* const kTagString = "$Name: $"; // --- 39,45 ---- // constants, enums and typedefs // // ---- cvs-based strings (Id and Tag with which file was checked out) ! static const char* const kIdString = "$Id: EvtGenBase_DONT_TOUCH.cc,v 1.3 2005/05/10 13:01:13 ryd Exp $"; static const char* const kTagString = "$Name: $"; // Index: Class/EvtGenKine.cc =================================================================== RCS file: /nfs/cleo3/cvsroot/Offline/src/EvtGenBase/Class/EvtGenKine.cc,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -c -r1.1.1.1 -r1.2 *** Class/EvtGenKine.cc 7 Oct 2003 02:47:10 -0000 1.1.1.1 --- Class/EvtGenKine.cc 12 Jan 2006 16:08:19 -0000 1.2 *************** *** 19,24 **** --- 19,25 ---- // //------------------------------------------------------------------------ // + #include "Experiment/Experiment.h" #include #include "EvtGenBase/EvtGenKine.hh" #include "EvtGenBase/EvtRandom.hh" *************** *** 26,31 **** --- 27,33 ---- #include "EvtGenBase/EvtReport.hh" #include "EvtGenBase/EvtConst.hh" #include + using std::endl; double EvtPawt(double a,double b,double c) *************** *** 35,41 **** if (temp<=0) { //report(ERROR,"EvtGen")<<"Sqrt of negative number in EvtPhaseSpace\n"<< ! // "This seems to happen on AIX but I do not know why yet!"<wtmax) { report(ERROR,"EvtGen") << "wtmax to small in EvtPhaseSpace with " ! << ndaug <<" daughters"<wtmax) { report(ERROR,"EvtGen") << "wtmax to small in EvtPhaseSpace with " ! << ndaug <<" daughters"< #include Index: Class/EvtId.cc =================================================================== RCS file: /nfs/cleo3/cvsroot/Offline/src/EvtGenBase/Class/EvtId.cc,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -c -r1.1.1.1 -r1.2 *** Class/EvtId.cc 7 Oct 2003 02:47:10 -0000 1.1.1.1 --- Class/EvtId.cc 12 Jan 2006 16:08:19 -0000 1.2 *************** *** 18,29 **** // //------------------------------------------------------------------------ // #include "EvtGenBase/EvtId.hh" #include ! std::ostream& operator<<(std::ostream& s, const EvtId& id){ s<<"(Id="< + using std::ostream; ! ostream& operator<<(ostream& s, const EvtId& id){ s<<"(Id="< #include #include "EvtGenBase/EvtMacros.hh" #include "EvtGenBase/EvtIntegPdf1D.hh" - #include "EvtGenBase/EvtReport.hh" ! EvtIntegPdf1D::EvtIntegPdf1D() ! {} EvtIntegPdf1D::EvtIntegPdf1D(const EvtIntegPdf1D& other) ! : EvtPdf(other), EvtRandDist(other) {} EvtIntegPdf1D::~EvtIntegPdf1D() {} ! EvtValError EvtIntegPdf1D::compute_integral(const EvtInterval1D& ival) { ! double x1 = pdfIntegral(ival.min()); ! double x2 = pdfIntegral(ival.max()); return EvtValError(x2-x1,0.); } ! EvtPoint1D EvtIntegPdf1D::randomPoint(const EvtInterval1D& ival) { ! double min = ival.min(); ! double max = ival.max(); ! ! double itgmin = pdfIntegral(min); ! double itgmax = pdfIntegral(max); ! double itgrnd = EvtInterval1D(itgmin,itgmax).randomPoint().value(); ! return EvtPoint1D(min,max,pdfIntegralInverse(itgrnd)); } --- 1,46 ---- + #include "Experiment/Experiment.h" /******************************************************************************* * Project: BaBar detector at the SLAC PEP-II B-factory * Package: EvtGenBase ! * File: $Id: EvtIntegPdf1D.cc,v 1.2 2006/01/12 16:08:19 ryd Exp $ * Author: Alexei Dvoretskii, dvoretsk@slac.stanford.edu, 2001-2002 * * Copyright (C) 2002 Caltech *******************************************************************************/ #include + #include "EvtGenBase/EvtPatches.hh" #include "EvtGenBase/EvtMacros.hh" #include "EvtGenBase/EvtIntegPdf1D.hh" ! EvtIntegPdf1D::EvtIntegPdf1D(double min, double max) ! : EvtPdf(), _min(min), _max(max) ! { ! assert(min <= max); ! } EvtIntegPdf1D::EvtIntegPdf1D(const EvtIntegPdf1D& other) ! : EvtPdf(other), _min(other._min), _max(other._max) {} EvtIntegPdf1D::~EvtIntegPdf1D() {} ! EvtValError EvtIntegPdf1D::compute_integral() const { ! double x1 = pdfIntegral(_min); ! double x2 = pdfIntegral(_max); return EvtValError(x2-x1,0.); } ! EvtPoint1D EvtIntegPdf1D::randomPoint() { ! double itgmin = pdfIntegral(_min); ! double itgmax = pdfIntegral(_max); ! double itgrnd = EvtRandom::Flat(itgmin,itgmax); ! return EvtPoint1D(_min,_max,pdfIntegralInverse(itgrnd)); } Index: Class/EvtInterval1D.cc =================================================================== RCS file: Class/EvtInterval1D.cc diff -N Class/EvtInterval1D.cc *** Class/EvtInterval1D.cc 7 Oct 2003 02:47:12 -0000 1.1.1.1 --- /dev/null 1 Jan 1970 00:00:00 -0000 *************** *** 1,51 **** - /******************************************************************************* - * Project: BaBar detector at the SLAC PEP-II B-factory - * Package: EvtGenBase - * File: $Id: EvtInterval1D.cc,v 1.1.1.1 2003/10/07 02:47:12 ryd Exp $ - * Author: Alexei Dvoretskii, dvoretsk@slac.stanford.edu, 2001-2002 - * - * Copyright (C) 2002 Caltech - *******************************************************************************/ - - #include - #include - #include "EvtGenBase/EvtInterval1D.hh" - #include "EvtGenBase/EvtRandom.hh" - #include "EvtGenBase/EvtReport.hh" - - - EvtInterval1D::EvtInterval1D() - : _min(0), _max(0) - {} - - EvtInterval1D::EvtInterval1D(double min, double max) - : _min(min), _max(max) - { - if(_min > _max) report(INFO,"EvtGen") << "Invalid interval (" << _min << ":" << _max << ")" << std::endl; - itsSize = EvtValError(_max - _min,0.); - } - - EvtInterval1D::EvtInterval1D(const EvtInterval1D& other) - : EvtInterval(other), _min(other._min), _max(other._max) - {} - - EvtInterval1D::~EvtInterval1D() - {} - - EvtInterval* EvtInterval1D::clone() const - { - return new EvtInterval1D(*this); - } - - - EvtPoint1D EvtInterval1D::randomPoint() const - { - return EvtPoint1D(_min,_max,EvtRandom::Flat(_min,_max)); - } - - - void EvtInterval1D::print(std::ostream& os) const - { - os << "(" << _min << ":" << _max << ")" << std::endl; - } - --- 0 ---- Index: Class/EvtIntervalFlatPdf.cc =================================================================== RCS file: Class/EvtIntervalFlatPdf.cc diff -N Class/EvtIntervalFlatPdf.cc *** /dev/null 1 Jan 1970 00:00:00 -0000 --- Class/EvtIntervalFlatPdf.cc 12 Jan 2006 16:08:20 -0000 1.1 *************** *** 0 **** --- 1,47 ---- + #include "Experiment/Experiment.h" + /******************************************************************************* + * Project: BaBar detector at the SLAC PEP-II B-factory + * Package: EvtGenBase + * File: $Id: EvtIntervalFlatPdf.cc,v 1.1 2006/01/12 16:08:20 ryd Exp $ + * Author: Alexei Dvoretskii, dvoretsk@slac.stanford.edu, 2001-2002 + * + * Copyright (C) 2002 Caltech + *******************************************************************************/ + + #include "EvtGenBase/EvtPatches.hh" + #include + #include "EvtGenBase/EvtIntervalFlatPdf.hh" + #include "EvtGenBase/EvtRandom.hh" + + EvtIntervalFlatPdf::EvtIntervalFlatPdf(double min, double max) + : EvtPdf(), _min(min), _max(max) + { + assert(max >= min); + } + + EvtIntervalFlatPdf::EvtIntervalFlatPdf(const EvtIntervalFlatPdf& other) + : EvtPdf(other), _min(other._min), _max(other._max) + {} + + EvtIntervalFlatPdf::~EvtIntervalFlatPdf() + {} + + EvtPdf* EvtIntervalFlatPdf::clone() const + { + return new EvtIntervalFlatPdf(*this); + } + + double EvtIntervalFlatPdf::pdf(const EvtPoint1D&) const + { + return 1.; + } + + EvtValError EvtIntervalFlatPdf::compute_integral() const + { + return EvtValError(_max-_min,0.); + } + + EvtPoint1D EvtIntervalFlatPdf::randomPoint() + { + return EvtPoint1D(_min,_max,EvtRandom::Flat(_min,_max)); + } Index: Class/EvtKine.cc =================================================================== RCS file: /nfs/cleo3/cvsroot/Offline/src/EvtGenBase/Class/EvtKine.cc,v retrieving revision 1.1.1.1 retrieving revision 1.3 diff -c -r1.1.1.1 -r1.3 *** Class/EvtKine.cc 7 Oct 2003 02:47:12 -0000 1.1.1.1 --- Class/EvtKine.cc 12 Jan 2006 16:08:20 -0000 1.3 *************** *** 18,29 **** --- 18,33 ---- // //------------------------------------------------------------------------ // + #include "Experiment/Experiment.h" #include #include "EvtGenBase/EvtKine.hh" #include "EvtGenBase/EvtConst.hh" #include "EvtGenBase/EvtVector4R.hh" #include "EvtGenBase/EvtVector4C.hh" #include "EvtGenBase/EvtTensor4C.hh" + #include "EvtGenBase/EvtdFunction.hh" + #include "EvtGenBase/EvtReport.hh" + double EvtDecayAngle(const EvtVector4R& p,const EvtVector4R& q, *************** *** 103,105 **** --- 107,142 ---- } + // Calculate phi using the given 4 vectors (all in the same frame) + double EvtDecayAnglePhi( const EvtVector4R& z, const EvtVector4R& p, const + EvtVector4R& q, const EvtVector4R& d ) + { + double eq = (p * q) / p.mass(); + double ed = (p * d) / p.mass(); + double mq = q.mass(); + double q2 = p.mag2r3(q); + double qd = p.dotr3(q,d); + double zq = p.dotr3(z,q); + double zd = p.dotr3(z,d); + double alpha = (eq - mq)/(q2 * mq) * qd - ed/mq; + + double y = p.scalartripler3(z,q,d) + alpha * p.scalartripler3(z,q,q); + double x = (zq * (qd + alpha * q2) - q2 * (zd + alpha * zq)) / sqrt(q2); + + double phi = atan2(y,x); + + return phi<0 ? (phi+EvtConst::twoPi) : phi; + } + + + EvtComplex wignerD( int j, int m1, int m2, double phi, double theta, double + gamma ) + { + EvtComplex gp(0.0, -phi*m1); + EvtComplex gm(0.0, -gamma*m2); + //double d = EvtdFunction::d(j, m1, m2, theta); + + return exp( gp ) * EvtdFunction::d(j, m1, m2, theta) * exp( gm ); + } + + Index: Class/EvtMBreitWigner.cc =================================================================== RCS file: Class/EvtMBreitWigner.cc diff -N Class/EvtMBreitWigner.cc *** /dev/null 1 Jan 1970 00:00:00 -0000 --- Class/EvtMBreitWigner.cc 27 Jan 2006 00:16:08 -0000 1.3 *************** *** 0 **** --- 1,34 ---- + #include "Experiment/Experiment.h" + #include "EvtGenBase/EvtReport.hh" + #include "EvtGenBase/EvtMBreitWigner.hh" + + using std::endl; + + EvtMBreitWigner::EvtMBreitWigner( const EvtId& id, const vector& args ) + { + if( args.size() != 0 ) { + report(ERROR, "EvtGen")<<"Unknown input arguments passed in to lineshape."<& product ) const + { + static EvtComplex I(0.0, 1.0); + double mass = _node->get4vector(product).mass(); + + return sqrt(_width/( EvtConst::twoPi )) * 1/( mass - _resmass - I * _width/2 ); + } + + + EvtMLineShape * EvtMBreitWigner::duplicate() const + { + vector args; + EvtMLineShape* tmp=new EvtMBreitWigner( _id, args ); + return tmp; + } + Index: Class/EvtMHelAmp.cc =================================================================== RCS file: Class/EvtMHelAmp.cc diff -N Class/EvtMHelAmp.cc *** /dev/null 1 Jan 1970 00:00:00 -0000 --- Class/EvtMHelAmp.cc 6 Jun 2006 17:15:54 -0000 1.5 *************** *** 0 **** --- 1,128 ---- + #include "Experiment/Experiment.h" + #include "EvtGenBase/EvtMHelAmp.hh" + #include "EvtGenBase/EvtKine.hh" + #include "EvtGenBase/EvtReport.hh" + + using std::endl; + + EvtMHelAmp::EvtMHelAmp( const EvtId& id, EvtMLineShape * lineshape, + const vector& children, const vector& elem ) + { + _id = id; + _twospin = EvtSpinType::getSpin2( EvtPDL::getSpinType( id ) ); + _parent = NULL; + _lineshape = lineshape; + + _elem = elem; + + vector type; + for( size_t i=0; igetspintype() ); + const vector &res = children[i]->getresonance(); + for( size_t j=0; jsetparent( this ); + } + + // XXX New code - bugs could appear here XXX + _amp = EvtSpinAmp( type ); + vector index = _amp.iterinit(); + size_t i = 0; + do { + if( !_amp.allowed(index) ) + _amp( index ) = 0.0; + else if( abs(index[0] - index[1]) > _twospin ) + _amp( index ) = 0.0; + else { + _amp( index ) = elem[i]; + ++i; + } + } while( _amp.iterate( index ) ); + if(elem.size() != i) { + report(ERROR,"EvtGen") + <<"Wrong number of elements input in helicity amplitude."< 2 ) { + report(ERROR,"EvtGen") + <<"Helicity amplitude formalism can only handle two body resonances" + < & + product ) const + { + EvtVector4R d = _children[0]->get4vector(product); + double phi, theta; + + if( _parent == NULL ) { + + // This means that we're calculating the first level and we need to just + // calculate the polar and azymuthal angles daughters in rest frame of + // this (root) particle (this is automatic). + phi = atan2( d.get(1), d.get(2) ); + theta = acos( d.get(3)/d.d3mag() ); + + } else { + + // We have parents therefore calculate things in correct coordinate + // system + EvtVector4R p = _parent->get4vector(product); + EvtVector4R q = get4vector(product); + + // See if we have a grandparent - if no then the z-axis is defined by + // the z-axis of the root particle + EvtVector4R g = _parent->getparent()==NULL ? + EvtVector4R(0.0, 0.0, 0.0, 1.0) : + _parent->getparent()->get4vector(product); + + theta = acos(EvtDecayAngle(p, q, d)); + phi = EvtDecayAnglePhi( g, p, q, d ); + + } + + vector types( 3 ); + types[0] = getspintype(); + types[1] = _children[0]->getspintype(); + types[2] = _children[1]->getspintype(); + EvtSpinAmp amp( types, EvtComplex(0.0, 0.0) ); + vector index = amp.iterallowedinit(); + + do { + if( abs(index[1]-index[2]) > _twospin ) continue; + amp(index) += + conj(wignerD(_twospin,index[0],index[1]-index[2],phi,theta,0.0)) * + _amp(index[1],index[2]); + } while(amp.iterateallowed(index)); + + EvtSpinAmp amp0 = _children[0]->amplitude(product); + EvtSpinAmp amp1 = _children[1]->amplitude(product); + + amp.extcont( amp0, 1, 0 ); + amp.extcont( amp1, 1, 0 ); + + amp *= sqrt( ( _twospin + 1 ) / ( 2 * EvtConst::twoPi ) ) * + _children[0]->line(product) * _children[1]->line(product); + + return amp; + } + + EvtMNode * EvtMHelAmp::duplicate() const + { + vector children; + + for( size_t i=0; i<_children.size(); ++i ) { + children.push_back( _children[i]->duplicate() ); + } + + EvtMLineShape * lineshape = _lineshape->duplicate(); + EvtMHelAmp * ret = new EvtMHelAmp( _id, lineshape, children, _elem ); + lineshape->setres( ret ); + + return ret; + } Index: Class/EvtMNode.cc =================================================================== RCS file: Class/EvtMNode.cc diff -N Class/EvtMNode.cc *** /dev/null 1 Jan 1970 00:00:00 -0000 --- Class/EvtMNode.cc 12 Jan 2006 16:08:20 -0000 1.2 *************** *** 0 **** --- 1,16 ---- + #include "Experiment/Experiment.h" + #include "EvtGenBase/EvtMNode.hh" + + EvtVector4R EvtMNode::get4vector( const vector &product ) + const + { + + EvtVector4R res(0.0, 0.0, 0.0, 0.0); + vector::const_iterator iter; + + for( iter = _resonance.begin(); iter != _resonance.end(); ++iter ) + res += product[ *iter ]; + + return res; + + } Index: Class/EvtMParticle.cc =================================================================== RCS file: Class/EvtMParticle.cc diff -N Class/EvtMParticle.cc *** /dev/null 1 Jan 1970 00:00:00 -0000 --- Class/EvtMParticle.cc 12 Jan 2006 16:08:20 -0000 1.3 *************** *** 0 **** --- 1,26 ---- + #include "Experiment/Experiment.h" + #include "EvtGenBase/EvtMParticle.hh" + #include "EvtGenBase/EvtSpinType.hh" + + EvtMParticle::EvtMParticle( int label, const EvtId& id ) + { + _id = id; + _twospin = EvtSpinType::getSpin2( EvtPDL::getSpinType( id ) ); + _resonance.push_back( label ); + } + + EvtSpinAmp EvtMParticle::amplitude( const vector &product) const + { + vector types( 2, getspintype() ); + EvtSpinAmp amp( types, EvtComplex( 0.0, 0.0 ) ); + + for( int i=-_twospin; i<=_twospin; i+=2 ) + amp(i, i) = EvtComplex( 1.0, 0.0 ); + + return amp; + } + + EvtMNode * EvtMParticle::duplicate() const + { + return new EvtMParticle( _resonance[0], _id ); + } Index: Class/EvtMRes.cc =================================================================== RCS file: Class/EvtMRes.cc diff -N Class/EvtMRes.cc *** /dev/null 1 Jan 1970 00:00:00 -0000 --- Class/EvtMRes.cc 6 Jun 2006 17:15:55 -0000 1.2 *************** *** 0 **** --- 1,8 ---- + #include "EvtGenBase/EvtMRes.hh" + + EvtMRes::~EvtMRes() + { + for(size_t i=0; i<_children.size(); ++i) { + delete _children[i]; + } + } Index: Class/EvtMTree.cc =================================================================== RCS file: Class/EvtMTree.cc diff -N Class/EvtMTree.cc *** /dev/null 1 Jan 1970 00:00:00 -0000 --- Class/EvtMTree.cc 6 Jun 2006 17:15:55 -0000 1.6 *************** *** 0 **** --- 1,442 ---- + #include + #include + #include + + #include "EvtGenBase/EvtParticle.hh" + + #include "EvtGenBase/EvtMTree.hh" + #include "EvtGenBase/EvtConst.hh" + #include "EvtGenBase/EvtKine.hh" + #include "EvtGenBase/EvtReport.hh" + + // Make sure to include Lineshapes here + #include "EvtGenBase/EvtMTrivialLS.hh" + #include "EvtGenBase/EvtMBreitWigner.hh" + + // Make sure to include Parametrizations + #include "EvtGenBase/EvtMHelAmp.hh" + + using std::endl; + + EvtMTree::EvtMTree( const EvtId * idtbl, int ndaug ) + { + for( int i=0; i EvtMTree::makeparticles( const string& strid ) + { + vector particles; + vector labels; + + for( size_t i = 0; i<_lbltbl.size(); ++i ) { + if( _lbltbl[i] == strid ) labels.push_back( i ); + } + + if( labels.size() == 0 ) { + report(ERROR,"EvtGen")<<"Error unknown particle label "<& lsarg, const string& type, + const vector& amps, const vector& children ) + { + EvtMRes * resonance = NULL; + EvtMLineShape * lineshape = NULL; + + if( ls=="BREITWIGNER" ) { + lineshape = new EvtMBreitWigner( id, lsarg ); + } else if( ls=="TRIVIAL" ) { + lineshape = new EvtMTrivialLS( id, lsarg ); + } else { + report(ERROR,"EvtGen")<<"Lineshape "<setres( resonance ); + + return resonance; + } + + void EvtMTree::parseerror( bool flag, ptype& c_iter, ptype& c_begin, + ptype& c_end ) + { + if(!flag) return; + + string error; + + while( c_begin != c_end ) { + if(c_begin == c_iter) { + error+='_'; + error+=*c_begin; + error+='_'; + } else + error+=*c_begin; + + ++c_begin; + } + + report(ERROR,"EvtGen")<<"Parse error at: "< EvtMTree::parseArg( ptype &c_iter, ptype &c_begin, ptype &c_end ) + { + vector arg; + + if( *c_iter != '[' ) return arg; + ++c_iter; + + string temp; + while(true) { + parseerror( c_iter == c_end || parsecheck(*c_iter, "[()"), + c_iter, c_begin, c_end ); + + if( *c_iter == ']' ) { + ++c_iter; + if(temp.size() > 0) arg.push_back( temp ); + break; + } + + if( *c_iter == ',') { + arg.push_back( temp ); + temp.clear(); + ++c_iter; + continue; + } + + temp += *c_iter; + ++c_iter; + } + parseerror(c_iter == c_end || *c_iter != ',', c_iter, c_begin, c_end); + ++c_iter; + + return arg; + } + + vector EvtMTree::parseAmps( ptype &c_iter, + ptype &c_begin, ptype &c_end ) + { + vector parg = parseArg( c_iter, c_begin, c_end ); + parseerror( parg.size() == 0, c_iter, c_begin, c_end ); + + // Get parametrization amplitudes + vector::iterator amp_iter = parg.begin(); + vector::iterator amp_end = parg.end(); + vector amps; + + while( amp_iter != amp_end ) { + const char * nptr; + char * endptr = NULL; + double amp=0.0, phase=0.0; + + nptr = (*amp_iter).c_str(); + amp = strtod(nptr, &endptr); + parseerror( nptr==endptr, c_iter, c_begin, c_end ); + + ++amp_iter; + parseerror( amp_iter == amp_end, c_iter, c_begin, c_end ); + + nptr = (*amp_iter).c_str(); + phase = strtod(nptr, &endptr); + parseerror( nptr==endptr, c_iter, c_begin, c_end ); + + amps.push_back( amp*exp(EvtComplex(0.0, phase)) ); + + ++amp_iter; + } + + return amps; + } + + vector EvtMTree::duplicate( const vector& list ) const + { + vector newlist; + + for(size_t i=0; iduplicate() ); + } + return newlist; + } + + // XXX Warning it is unsafe to use cl1 after a call to this function XXX + vector< vector > EvtMTree::unionChildren( const string& nodestr, + vector< vector >& cl1 ) + { + vector cl2 = parsenode( nodestr, false ); + vector< vector > cl; + + if( cl1.size() == 0 ) { + for( size_t i=0; i temp(1, cl2[i]); + cl.push_back( temp ); + } + + return cl; + } + + for( size_t i=0; i temp; + temp = duplicate( cl1[i] ); + temp.push_back( cl2[j]->duplicate() ); + + cl.push_back( temp ); + } + } + + for( size_t i=0; i > EvtMTree::parseChildren( ptype &c_iter, + ptype &c_begin, ptype &c_end ) + { + bool test = true; + int pcount=0; + string nodestr; + vector< vector > children; + + parseerror(c_iter == c_end || *c_iter != '[', c_iter, c_begin, c_end ); + ++c_iter; + + while( test ) { + parseerror( c_iter==c_end || pcount < 0, c_iter, c_begin, c_end ); + + switch( *c_iter ) { + case ')': + --pcount; + nodestr += *c_iter; + break; + case '(': + ++pcount; + nodestr += *c_iter; + break; + case ']': + if( pcount==0 ) { + children = unionChildren( nodestr, children ); + test=false; + } else { + nodestr += *c_iter; + } + break; + case ',': + if( pcount==0 ) { + children = unionChildren( nodestr, children ); + nodestr.clear(); + } else { + nodestr += *c_iter; + } + break; + default: + nodestr += *c_iter; + break; + } + + ++c_iter; + } + + return children; + } + + vector EvtMTree::parsenode( const string& args, bool rootnode ) + { + ptype c_iter, c_begin, c_end; + + c_iter=c_begin=args.begin(); + c_end = args.end(); + + string strid = parseId( c_iter, c_begin, c_end ); + + // Case 1: Particle + if( c_iter == c_end ) return makeparticles( strid ); + + // Case 2: Resonance - parse further + EvtId id = EvtPDL::getId(strid); + parseerror(EvtId( -1, -1 )==id, c_iter, c_begin, c_end); + + string ls; + vector lsarg; + + if( rootnode ) { + ls = "TRIVIAL"; + } else { + // Get lineshape (e.g. BREITWIGNER) + ls = parseKey( c_iter, c_begin, c_end ); + lsarg = parseArg( c_iter, c_begin, c_end ); + } + + // Get resonance parametrization type (e.g. HELAMP) + string type = parseKey( c_iter, c_begin, c_end ); + vector amps = parseAmps( c_iter, c_begin, c_end ); + + // Children + vector > children = parseChildren( c_iter, c_begin, + c_end ); + + report(ERROR,"EvtGen")< resonances; + for(size_t i=0; i res = root->getresonance(); + vector check(res.size(), false); + + for( size_t i=0; i roots = parsenode( str, true ); + _norm = 0; + + for( size_t i=0; irotateToHelicityBasis(); + EvtSpinType::spintype type = EvtPDL::getSpinType(_root[0]->getid()); + int twospin = EvtSpinType::getSpin2(type); + + vector types(2, type); + EvtSpinAmp rot( types, EvtComplex(0.0, 0.0) ); + vector index = rot.iterallowedinit(); + do { + rot(index) = sd.Get((index[0]+twospin)/2,(index[1]+twospin)/2); + } while( rot.iterateallowed( index ) ); + + return rot; + } + + EvtSpinAmp EvtMTree::amplitude( EvtParticle * p ) const + { + vector product; + for(int i=0; igetNDaug(); ++i) { + product.push_back(p->getDaug(i)->getP4Lab()); + } + + if( _root.size() == 0 ) { + report(ERROR, "EvtGen")<<"No decay tree present."<amplitude( product ); + for( size_t i=1; i<_root.size(); ++i ) { + // Assume that helicity amplitude is returned + amp += _root[i]->amplitude( product ); + } + amp = _norm*amp; + + //ryd + return amp; + + // Do Rotation to Proper Frame + EvtSpinAmp newamp = getrotation( p ); + newamp.extcont(amp, 1, 0); + + return newamp; + } Index: Class/EvtMTrivialLS.cc =================================================================== RCS file: Class/EvtMTrivialLS.cc diff -N Class/EvtMTrivialLS.cc *** /dev/null 1 Jan 1970 00:00:00 -0000 --- Class/EvtMTrivialLS.cc 12 Jan 2006 16:08:20 -0000 1.2 *************** *** 0 **** --- 1,16 ---- + #include "Experiment/Experiment.h" + #include "EvtGenBase/EvtMTrivialLS.hh" + + EvtComplex EvtMTrivialLS::shape( const vector& product ) const + { + return EvtComplex(1.0, 0.0); + } + + EvtMLineShape* EvtMTrivialLS::duplicate() const + { + EvtId temp1; + vector temp2; + + EvtMLineShape* tmp=new EvtMTrivialLS(temp1, temp2); + return tmp; + } Index: Class/EvtManyDeltaFuncLineShape.cc =================================================================== RCS file: /nfs/cleo3/cvsroot/Offline/src/EvtGenBase/Class/EvtManyDeltaFuncLineShape.cc,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -c -r1.1.1.1 -r1.2 *** Class/EvtManyDeltaFuncLineShape.cc 7 Oct 2003 02:47:12 -0000 1.1.1.1 --- Class/EvtManyDeltaFuncLineShape.cc 12 Jan 2006 16:08:20 -0000 1.2 *************** *** 18,23 **** --- 18,24 ---- // Dvoretskii June 03, 2002 Reimplemented rollMass() // //------------------------------------------------------------------------ + #include "Experiment/Experiment.h" #include "EvtGenBase/EvtPatches.hh" #include "EvtGenBase/EvtManyDeltaFuncLineShape.hh" Index: Class/EvtMassAmp.cc =================================================================== RCS file: /nfs/cleo3/cvsroot/Offline/src/EvtGenBase/Class/EvtMassAmp.cc,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -c -r1.1.1.1 -r1.2 *** Class/EvtMassAmp.cc 7 Oct 2003 02:47:12 -0000 1.1.1.1 --- Class/EvtMassAmp.cc 12 Jan 2006 16:08:20 -0000 1.2 *************** *** 1,6 **** //----------------------------------------------------------------------- // File and Version Information: ! // $Id: EvtMassAmp.cc,v 1.1.1.1 2003/10/07 02:47:12 ryd Exp $ // // Environment: // This software is part of the EvtGen package developed jointly --- 1,6 ---- //----------------------------------------------------------------------- // File and Version Information: ! // $Id: EvtMassAmp.cc,v 1.2 2006/01/12 16:08:20 ryd Exp $ // // Environment: // This software is part of the EvtGen package developed jointly *************** *** 13,37 **** // Module creator: // Alexei Dvoretskii, Caltech, 2001-2002. //----------------------------------------------------------------------- #include "EvtGenBase/EvtMassAmp.hh" - #include "EvtGenBase/EvtInterval1D.hh" EvtMassAmp::EvtMassAmp(const EvtPropBreitWignerRel& prop, const EvtTwoBodyVertex& vd) ! : EvtAmplitude() ,_prop(prop), _vd(vd), _vb(0) ,_useBirthFact(false), _useDeathFact(false) ,_useBirthFactFF(false), _useDeathFactFF(false) {} EvtMassAmp::EvtMassAmp(const EvtMassAmp& other) ! : EvtAmplitude(other) ,_prop(other._prop), _vd(other._vd) ,_vb(other._vb ? new EvtTwoBodyVertex(*other._vb) : 0) ,_useBirthFact(other._useBirthFact) ,_useDeathFact(other._useDeathFact) ,_useBirthFactFF(other._useBirthFactFF) ,_useDeathFactFF(other._useDeathFactFF) {} --- 13,39 ---- // Module creator: // Alexei Dvoretskii, Caltech, 2001-2002. //----------------------------------------------------------------------- + #include "Experiment/Experiment.h" #include "EvtGenBase/EvtMassAmp.hh" EvtMassAmp::EvtMassAmp(const EvtPropBreitWignerRel& prop, const EvtTwoBodyVertex& vd) ! : EvtAmplitude() ,_prop(prop), _vd(vd), _vb(0) ,_useBirthFact(false), _useDeathFact(false) ,_useBirthFactFF(false), _useDeathFactFF(false) + ,_fixUpMassForMax(false) {} EvtMassAmp::EvtMassAmp(const EvtMassAmp& other) ! : EvtAmplitude(other) ,_prop(other._prop), _vd(other._vd) ,_vb(other._vb ? new EvtTwoBodyVertex(*other._vb) : 0) ,_useBirthFact(other._useBirthFact) ,_useDeathFact(other._useDeathFact) ,_useBirthFactFF(other._useBirthFactFF) ,_useDeathFactFF(other._useDeathFactFF) + ,_fixUpMassForMax(other._fixUpMassForMax) {} *************** *** 66,71 **** --- 68,76 ---- if ( (m+_vb->mB()) < _vb->mAB() ) { EvtTwoBodyKine vb(m,_vb->mB(),_vb->mAB()); amp *= _vb->phaseSpaceFactor(vb,EvtTwoBodyKine::AB); + if ( _fixUpMassForMax ) { + amp *= sqrt((vb.p() / _vb->pD())); + } if(_useBirthFactFF) { assert(_vb); *************** *** 80,86 **** // Decay vertex factors ! if(_useDeathFact) amp *= _vd.phaseSpaceFactor(vd,EvtTwoBodyKine::AB); if(_useDeathFactFF) amp *= _vd.formFactor(vd); return amp; --- 85,96 ---- // Decay vertex factors ! if(_useDeathFact) { ! amp *= _vd.phaseSpaceFactor(vd,EvtTwoBodyKine::AB); ! if ( _fixUpMassForMax ) { ! amp *= sqrt((vd.p() / _vd.pD())); ! } ! } if(_useDeathFactFF) amp *= _vd.formFactor(vd); return amp; Index: Class/EvtModel.cc =================================================================== RCS file: /nfs/cleo3/cvsroot/Offline/src/EvtGenBase/Class/EvtModel.cc,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -c -r1.1.1.1 -r1.2 *** Class/EvtModel.cc 7 Oct 2003 02:47:12 -0000 1.1.1.1 --- Class/EvtModel.cc 12 Jan 2006 16:08:21 -0000 1.2 *************** *** 18,23 **** --- 18,24 ---- // //------------------------------------------------------------------------ // + #include "Experiment/Experiment.h" #include #include #include *************** *** 29,40 **** #include "EvtGenBase/EvtModel.hh" #include "EvtGenBase/EvtPDL.hh" #include "EvtGenBase/EvtDecayParm.hh" - #include "EvtGenBase/EvtSymTable.hh" #include "EvtGenBase/EvtDecayBase.hh" #include "EvtGenBase/EvtParticleDecayList.hh" #include "EvtGenBase/EvtParser.hh" #include "EvtGenBase/EvtReport.hh" #include EvtModel* EvtModel::_instance=0; --- 30,41 ---- #include "EvtGenBase/EvtModel.hh" #include "EvtGenBase/EvtPDL.hh" #include "EvtGenBase/EvtDecayParm.hh" #include "EvtGenBase/EvtDecayBase.hh" #include "EvtGenBase/EvtParticleDecayList.hh" #include "EvtGenBase/EvtParser.hh" #include "EvtGenBase/EvtReport.hh" #include + using std::fstream; EvtModel* EvtModel::_instance=0; *************** *** 71,77 **** if (commandName!=""){ ! //report(DEBUG,"EvtGen") << "Adding command:"< 0 ) { - int i; - for ( i=0; i 0 ) { - int i; - for ( i=0; i 0 ) { ! int i; ! for ( i=0; i #include + #include #include #include #include *************** *** 23,28 **** --- 25,31 ---- #include "EvtGenBase/EvtMultiChannelParser.hh" #include "EvtGenBase/EvtDecayMode.hh" #include "EvtGenBase/EvtPDL.hh" + using std::string; using std::vector; *************** *** 55,69 **** std::string d = parser.getToken(i++); ! if(EvtPDL::getId(d.c_str()).getId() == -1) break; ! else { ! ! dauV.push_back(string(d.c_str())); ! } } EvtDecayMode mode(mother,dauV); ! report(INFO,"EvtGen") << "Decay File defines mode " << mode << std::endl; return mode; } --- 58,70 ---- std::string d = parser.getToken(i++); ! if(EvtPDL::getStdHep(EvtPDL::getId(d.c_str())) == 0) break; ! ! dauV.push_back(string(d.c_str())); } EvtDecayMode mode(mother,dauV); ! printf("Decay File defines mode %s\n",mode.mode().c_str()); return mode; } *************** *** 92,99 **** } if(i == N) { ! report(INFO,"EvtGen") << "No model " << model << " found in decay file " << file << std::endl; ! assert(0); } --- 93,100 ---- } if(i == N) { ! printf("No model %s found in decay file %s",model,file); ! exit(0); } *************** *** 109,115 **** if(i == N) { ! report(INFO,"EvtGen") << "No terminating ; found in decay file " << file << std::endl; assert(0); } --- 110,116 ---- if(i == N) { ! printf("No terminating ; found in decay file %s",file); assert(0); } *************** *** 129,135 **** if(v[0] == std::string("MAXPDF")) { _pdfMax = strtod(v[1].c_str(),tc); ! if(_pdfMax <= 0) { report(INFO,"EvtGen") << "Bad pdfMax=" << _pdfMax; assert(0); } } else if(v[0] == std::string("SCANPDF")) { --- 130,136 ---- if(v[0] == std::string("MAXPDF")) { _pdfMax = strtod(v[1].c_str(),tc); ! if(_pdfMax <= 0) { printf("Bad pdfMax=%f\n",_pdfMax); assert(0); } } else if(v[0] == std::string("SCANPDF")) { *************** *** 138,144 **** } else { ! report(INFO,"EvtGen") << "Error parsing decay file " << std::endl; assert(0); } --- 139,145 ---- } else { ! printf("Error parsing decay file\n"); assert(0); } *************** *** 149,155 **** int i = 2; assert(isKeyword(v[2])); ! while(i < v.size()) { int i0 = i; --- 150,156 ---- int i = 2; assert(isKeyword(v[2])); ! while(static_cast( i ) < v.size()) { int i0 = i; *************** *** 164,175 **** } std::vector params; if(!conjugate && v[i] == std::string("AMPLITUDE")) { while(!isKeyword(v[++i])) params.push_back(v[i]); _amp.push_back(params); ! EvtComplex c = parseComplexCoef(i,v); _ampCoef.push_back(c); continue; } else --- 165,181 ---- } std::vector params; + EvtComplex c; + int format; + if(!conjugate && v[i] == std::string("AMPLITUDE")) { while(!isKeyword(v[++i])) params.push_back(v[i]); _amp.push_back(params); ! ! parseComplexCoef(i,v,c,format); _ampCoef.push_back(c); + _coefFormat.push_back(format); continue; } else *************** *** 177,189 **** while(!isKeyword(v[++i])) params.push_back(v[i]); _ampConj.push_back(params); ! EvtComplex c = parseComplexCoef(i,v); _ampConjCoef.push_back(c); continue; } else { ! report(INFO,"EvtGen") << "Expect keyword, found parameter " << v[i].c_str() << std::endl; assert(0); } --- 183,196 ---- while(!isKeyword(v[++i])) params.push_back(v[i]); _ampConj.push_back(params); ! parseComplexCoef(i,v,c,format); _ampConjCoef.push_back(c); + _coefConjFormat.push_back(format); continue; } else { ! printf("Expect keyword, found parameter %s\n",v[i].c_str()); assert(0); } *************** *** 191,233 **** assert(i > i0); } ! report(INFO,"EvtGen") << "PARSING SUCCESSFUL " << std::endl; ! report(INFO,"EvtGen") << _amp.size() << " amplitude terms" << std::endl; ! report(INFO,"EvtGen") << _ampConj.size() << " conjugate amplitude terms" << std::endl; } ! EvtComplex EvtMultiChannelParser::parseComplexCoef(int& i, const std::vector& v) { // place holder for strtod char** tc = 0; assert(v[i++] == std::string("COEFFICIENT")); - EvtComplex c; if(v[i] == std::string("POLAR_DEG")) { double mag = strtod(v[i+1].c_str(),tc); double phaseRad = strtod(v[i+2].c_str(),tc)*EvtConst::pi/180.0; i += 3; ! return EvtComplex(mag*cos(phaseRad),mag*sin(phaseRad)); } else if(v[i] == std::string("POLAR_RAD")) { ! double mag = strtod(v[i+1].c_str(),tc); double phaseRad = strtod(v[i+2].c_str(),tc); i += 3; ! return EvtComplex(mag*cos(phaseRad),mag*sin(phaseRad)); } else if(v[i] == std::string("CARTESIAN")) { double re = strtod(v[i+1].c_str(),tc); double im = strtod(v[i+2].c_str(),tc); i += 3; ! return EvtComplex(re,im); } - else assert(0); } --- 198,247 ---- assert(i > i0); } ! printf("PARSING SUCCESSFUL\n"); ! printf("%d amplitude terms\n",_amp.size()); ! printf("%d conj amplitude terms\n",_ampConj.size()); } ! void EvtMultiChannelParser::parseComplexCoef(int& i, const std::vector& v, ! EvtComplex& c, int& format) { // place holder for strtod char** tc = 0; assert(v[i++] == std::string("COEFFICIENT")); if(v[i] == std::string("POLAR_DEG")) { double mag = strtod(v[i+1].c_str(),tc); double phaseRad = strtod(v[i+2].c_str(),tc)*EvtConst::pi/180.0; i += 3; ! c = EvtComplex(mag*cos(phaseRad),mag*sin(phaseRad)); ! format = POLAR_DEG; } else if(v[i] == std::string("POLAR_RAD")) { ! double mag = strtod(v[i+1].c_str(),tc); double phaseRad = strtod(v[i+2].c_str(),tc); i += 3; ! c = EvtComplex(mag*cos(phaseRad),mag*sin(phaseRad)); ! format = POLAR_RAD; } else if(v[i] == std::string("CARTESIAN")) { double re = strtod(v[i+1].c_str(),tc); double im = strtod(v[i+2].c_str(),tc); i += 3; ! c = EvtComplex(re,im); ! format = CARTESIAN; ! } ! else { ! ! printf("Invalid format %s for complex coefficient\n",v[i].c_str()); ! exit(0); } } Index: Class/EvtNeutrinoParticle.cc =================================================================== RCS file: /nfs/cleo3/cvsroot/Offline/src/EvtGenBase/Class/EvtNeutrinoParticle.cc,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -c -r1.1.1.1 -r1.2 *** Class/EvtNeutrinoParticle.cc 7 Oct 2003 02:47:12 -0000 1.1.1.1 --- Class/EvtNeutrinoParticle.cc 12 Jan 2006 16:08:21 -0000 1.2 *************** *** 18,23 **** --- 18,24 ---- // //------------------------------------------------------------------------ // + #include "Experiment/Experiment.h" #include #include #include *************** *** 26,31 **** --- 27,33 ---- #include "EvtGenBase/EvtVector4R.hh" #include "EvtGenBase/EvtPDL.hh" #include "EvtGenBase/EvtReport.hh" + using std::endl; EvtNeutrinoParticle::~EvtNeutrinoParticle(){} *************** *** 49,55 **** if (EvtPDL::getStdHep(part_n)==0){ report(ERROR,"EvtGen") << "Error in EvtNeutrinoParticle::init, part_n=" ! << part_n.getId()<0){ --- 51,57 ---- if (EvtPDL::getStdHep(part_n)==0){ report(ERROR,"EvtGen") << "Error in EvtNeutrinoParticle::init, part_n=" ! << part_n.getId()<0){ Index: Class/EvtOrthogVector.cc =================================================================== RCS file: /nfs/cleo3/cvsroot/Offline/src/EvtGenBase/Class/EvtOrthogVector.cc,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -c -r1.1.1.1 -r1.2 *** Class/EvtOrthogVector.cc 7 Oct 2003 02:47:12 -0000 1.1.1.1 --- Class/EvtOrthogVector.cc 12 Jan 2006 16:08:21 -0000 1.2 *************** *** 17,22 **** --- 17,23 ---- // Lange August 11, 2000 Created // //------------------------------------------------------------------------ + #include "Experiment/Experiment.h" #include #include *************** *** 24,29 **** --- 25,31 ---- #include #include #include "EvtGenBase/EvtOrthogVector.hh" + using std::fstream; EvtOrthogVector::EvtOrthogVector(int n, std::vector *vectors){ Index: Class/EvtPDL.cc =================================================================== RCS file: /nfs/cleo3/cvsroot/Offline/src/EvtGenBase/Class/EvtPDL.cc,v retrieving revision 1.2 retrieving revision 1.4 diff -c -r1.2 -r1.4 *** Class/EvtPDL.cc 19 Feb 2004 18:24:41 -0000 1.2 --- Class/EvtPDL.cc 6 Jun 2006 17:15:55 -0000 1.4 *************** *** 18,23 **** --- 18,24 ---- // //------------------------------------------------------------------------ // + #include "Experiment/Experiment.h" #include #include #include *************** *** 28,33 **** --- 29,37 ---- #include "EvtGenBase/EvtId.hh" #include "EvtGenBase/EvtParticle.hh" #include "EvtGenBase/EvtReport.hh" + using std::endl; + using std::fstream; + using std::ifstream; static int first=1; *************** *** 51,60 **** } void EvtPDL::readPDT(const std::string fname){ ! std::ifstream indec; indec.open(fname.c_str()); --- 55,69 ---- } + void EvtPDL::read(const char* fname) + { + readPDT(fname); + } + void EvtPDL::readPDT(const std::string fname){ ! ifstream indec; indec.open(fname.c_str()); *************** *** 73,79 **** EvtId i; if (!indec) { ! report(ERROR,"EvtGen") << "Could not open:"<( partlist().size() ) ) { ! for(size_t i=_firstAlias; i::iterator it=_particleNameLookup.find(std::string(name)); if (it==_particleNameLookup.end()) return EvtId(-1,-1); --- 275,295 ---- partlist().push_back(partlist()[num.getId()]); int entry=partlist().size()-1; partlist()[entry].setName(newname); ! if (_particleNameLookup.find(std::string(newname))!= ! _particleNameLookup.end()){ ! report(ERROR,"EvtGen")<<"The particle name:"<::iterator it=_particleNameLookup.find(std::string(name)); if (it==_particleNameLookup.end()) return EvtId(-1,-1); Index: Class/EvtParser.cc =================================================================== RCS file: /nfs/cleo3/cvsroot/Offline/src/EvtGenBase/Class/EvtParser.cc,v retrieving revision 1.1.1.1 retrieving revision 1.3 diff -c -r1.1.1.1 -r1.3 *** Class/EvtParser.cc 7 Oct 2003 02:47:12 -0000 1.1.1.1 --- Class/EvtParser.cc 6 Jun 2006 17:15:55 -0000 1.3 *************** *** 18,29 **** // //------------------------------------------------------------------------ // #include "EvtGenBase/EvtPatches.hh" #include ! #include ! #include #include "EvtGenBase/EvtParser.hh" #include "EvtGenBase/EvtReport.hh" #define MAXBUF 1024 --- 18,31 ---- // //------------------------------------------------------------------------ // + #include "Experiment/Experiment.h" #include "EvtGenBase/EvtPatches.hh" #include ! #include ! #include #include "EvtGenBase/EvtParser.hh" #include "EvtGenBase/EvtReport.hh" + using std::endl; #define MAXBUF 1024 *************** *** 65,71 **** fin.open(filename.c_str()); if (!fin) { ! report(ERROR,"EvtGen") << "Could not open file '"<>buf2){ i=0; int semicolon=0; --- 102,108 ---- }while(buf[i-1]!=0); //read each token ! std::istringstream ist(buf); while(ist>>buf2){ i=0; int semicolon=0; *************** *** 127,133 **** void EvtParser::addToken(int line,const std::string& string){ ! //report(INFO,"EvtGen") <<_ntoken<<" "< + using std::fstream; EvtPartProp::EvtPartProp(): _id(-1,-1) *************** *** 89,95 **** // _lineShape=new EvtAbsLineShape(mass,width,maxRange); _lineShape=new EvtRelBreitWignerBarrierFact(mass,width,maxRange,_spintype); - } void EvtPartProp::newLineShape(std::string type){ --- 91,96 ---- *************** *** 128,133 **** --- 129,144 ---- _lineShape->reSetWidth(width); } + void EvtPartProp::setPWForDecay( int spin, EvtId d1, EvtId d2) { + if (!_lineShape) ::abort(); + _lineShape->setPWForDecay(spin,d1,d2); + } + + void EvtPartProp::setPWForBirthL( int spin, EvtId par, EvtId othD) { + if (!_lineShape) ::abort(); + _lineShape->setPWForBirthL(spin,par,othD); + } + void EvtPartProp::reSetMassMin(double mass){ if (!_lineShape) ::abort(); Index: Class/EvtPartPropDb.cc =================================================================== RCS file: Class/EvtPartPropDb.cc diff -N Class/EvtPartPropDb.cc *** Class/EvtPartPropDb.cc 7 Oct 2003 02:47:12 -0000 1.1.1.1 --- /dev/null 1 Jan 1970 00:00:00 -0000 *************** *** 1,108 **** - /******************************************************************************* - * Project: BaBar detector at the SLAC PEP-II B-factory - * Package: EvtGenBase - * File: $Id: EvtPartPropDb.cc,v 1.1.1.1 2003/10/07 02:47:12 ryd Exp $ - * Author: Alexei Dvoretskii, dvoretsk@slac.stanford.edu, 2001-2002 - * - * Copyright (C) 2002 Caltech - *******************************************************************************/ - - #include - #include - #include - #include - #include "EvtGenBase/EvtPartPropDb.hh" - #include "EvtGenBase/EvtReport.hh" - - std::vector EvtPartPropDb::_names; - std::vector EvtPartPropDb::_masses; - std::vector EvtPartPropDb::_widths; - bool EvtPartPropDb::_init = false; - - EvtPartPropDb::EvtPartPropDb() - {} - - EvtPartPropDb::EvtPartPropDb(const char* fname) - { - readPDT(fname); - } - - EvtPartPropDb::~EvtPartPropDb() - {} - - void EvtPartPropDb::readPDT(const char* fname) - { - // Read evt.pdl file. Most code borrowed from EvtPDL - - std::ifstream indec(fname); - - char cmnd[100], xxxx[100], pname[100]; - int stdhepid; - double mass, pwidth, pmaxwidth; - int chg3, spin2; - double ctau; - int lundkc; - - if (!indec) { - report(INFO,"EvtGen") << "Could not open: "<< fname << std::endl; - assert(0); - } - - do{ - - char ch,ch1; - - do{ - - indec.get(ch); - if (ch=='\n') indec.get(ch); - if (ch!='*') { - indec.putback(ch); - } - else{ - while (indec.get(ch1),ch1!='\n'); - } - } while(ch=='*'); - - indec >> cmnd; - - if (strcmp(cmnd,"end")){ - - if (!strcmp(cmnd,"add")){ - - indec >> xxxx >> xxxx >> pname >> stdhepid; - indec >> mass >> pwidth >> pmaxwidth >> chg3 >> spin2 >> ctau >> lundkc; - - _names.push_back(pname); - _masses.push_back(mass); - _widths.push_back(pwidth); - } - } - }while(strcmp(cmnd,"end")); - - _init = true; - } - - double EvtPartPropDb::getMass(const char* name) - { - // simple linear search - - unsigned i; - for(i = 0; i < _names.size(); i++) { - - if(0 == strcmp(_names[i].c_str(),name)) return _masses[i]; - } - report(INFO,"EvtGen") << "No particle " << name << " found in table" << std::endl; - assert(0); - } - - double EvtPartPropDb::getWidth(const char* name) - { - unsigned i; - for(i = 0; i < _names.size(); i++) { - - if(0 == strcmp(_names[i].c_str(),name)) return _widths[i]; - } - report(INFO,"EvtGen") << "No particle " << name << " found in table" << std::endl; - assert(0); - } --- 0 ---- Index: Class/EvtParticle.cc =================================================================== RCS file: /nfs/cleo3/cvsroot/Offline/src/EvtGenBase/Class/EvtParticle.cc,v retrieving revision 1.1.1.1 retrieving revision 1.7 diff -c -r1.1.1.1 -r1.7 *** Class/EvtParticle.cc 7 Oct 2003 02:47:12 -0000 1.1.1.1 --- Class/EvtParticle.cc 23 Oct 2007 02:34:14 -0000 1.7 *************** *** 18,30 **** // //------------------------------------------------------------------------ // #include #include #include #include #include #include - #include #include "EvtGenBase/EvtParticle.hh" #include "EvtGenBase/EvtId.hh" #include "EvtGenBase/EvtRandom.hh" --- 18,30 ---- // //------------------------------------------------------------------------ // + #include "Experiment/Experiment.h" #include #include #include #include #include #include #include "EvtGenBase/EvtParticle.hh" #include "EvtGenBase/EvtId.hh" #include "EvtGenBase/EvtRandom.hh" *************** *** 44,52 **** #include "EvtGenBase/EvtGenKine.hh" #include "EvtGenBase/EvtCPUtil.hh" #include "EvtGenBase/EvtParticleFactory.hh" ! EvtParticle::~EvtParticle() {} EvtParticle::EvtParticle() { _ndaug=0; --- 44,58 ---- #include "EvtGenBase/EvtGenKine.hh" #include "EvtGenBase/EvtCPUtil.hh" #include "EvtGenBase/EvtParticleFactory.hh" + #include "EvtGenBase/EvtIdSet.hh" + using std::endl; + using std::fstream; ! ! EvtParticle::~EvtParticle() { ! delete _decayProb; ! } EvtParticle::EvtParticle() { _ndaug=0; *************** *** 58,63 **** --- 64,70 ---- _isInit=false; _validP4=false; _isDecayed=false; + _decayProb=0; // _mix=false; } *************** *** 128,136 **** void EvtParticle::setVectorSpinDensity(){ if (getSpinStates()!=3) { ! report(ERROR,"EvtGen")<<"Error in EvtParticle::setVectorSpinDensity"<getParent(); double parMass=-1.; ! if ( par ) { if ( par->hasValidP4() ) parMass=par->mass(); int i; for ( i=0;igetNDaug();i++) { --- 217,223 ---- // carefull - the parent mass might be fixed in stone.. EvtParticle* par=p->getParent(); double parMass=-1.; ! if ( par != 0 ) { if ( par->hasValidP4() ) parMass=par->mass(); int i; for ( i=0;igetNDaug();i++) { *************** *** 225,231 **** if ( _ndaug>0) { int ii; for(ii=0;ii<_ndaug;ii++){ ! if ( EvtPDL::getWidth(p->getDaug(ii)->getId()) > 0.0000001) p->getDaug(ii)->initDecay(useMinMass); else p->getDaug(ii)->setMass(EvtPDL::getMeanMass(p->getDaug(ii)->getId())); } --- 232,238 ---- if ( _ndaug>0) { int ii; for(ii=0;ii<_ndaug;ii++){ ! if ( _ndaug==1 || EvtPDL::getWidth(p->getDaug(ii)->getId()) > 0.0000001) p->getDaug(ii)->initDecay(useMinMass); else p->getDaug(ii)->setMass(EvtPDL::getMeanMass(p->getDaug(ii)->getId())); } *************** *** 253,259 **** } } if ( p->getParent() && _validP4==false ) { ! if ( !useMinMass ) p->setMass(EvtPDL::getRandMass(p->getId(),parId,_ndaug,dauId,othDauId,parMass,dauMasses)); else p->setMass(EvtPDL::getMinMass(p->getId())); } if ( parId) delete parId; --- 260,268 ---- } } if ( p->getParent() && _validP4==false ) { ! if ( !useMinMass ) { ! p->setMass(EvtPDL::getRandMass(p->getId(),parId,_ndaug,dauId,othDauId,parMass,dauMasses)); ! } else p->setMass(EvtPDL::getMinMass(p->getId())); } if ( parId) delete parId; *************** *** 263,274 **** return; } //Will include effects of mixing here //added by Lange Jan4,2000 static EvtId BS0=EvtPDL::getId("B_s0"); static EvtId BSB=EvtPDL::getId("anti-B_s0"); ! ! if (getId()==BS0||getId()==BSB){ double t; int mix; EvtCPUtil::incoherentMix(getId(), t, mix); --- 272,292 ---- return; } + //Will include effects of mixing here //added by Lange Jan4,2000 static EvtId BS0=EvtPDL::getId("B_s0"); static EvtId BSB=EvtPDL::getId("anti-B_s0"); ! static EvtId BD0=EvtPDL::getId("B0"); ! static EvtId BDB=EvtPDL::getId("anti-B0"); ! static EvtId U4S=EvtPDL::getId("Upsilon(4S)"); ! static EvtIdSet borUps(BS0,BSB,BD0,BDB,U4S); ! ! //only makes sense if there is no parent particle which is a B or an Upsilon ! bool hasBorUps=false; ! if ( getParent() && borUps.contains(getParent()->getId()) ) hasBorUps=true; ! // if ( (getNDaug()==0)&&(getParent()==0) && (getId()==BS0||getId()==BSB||getId()==BD0||getId()==BDB)){ ! if ( (getNDaug()==0 && !hasBorUps) && (getId()==BS0||getId()==BSB||getId()==BD0||getId()==BDB)){ double t; int mix; EvtCPUtil::incoherentMix(getId(), t, mix); *************** *** 283,292 **** EvtVector4R p_init(EvtPDL::getMass(BSB),0.0,0.0,0.0); scalar_part->init(BSB,p_init); } ! else{ EvtVector4R p_init(EvtPDL::getMass(BS0),0.0,0.0,0.0); scalar_part->init(BS0,p_init); } scalar_part->setLifetime(0); --- 301,318 ---- EvtVector4R p_init(EvtPDL::getMass(BSB),0.0,0.0,0.0); scalar_part->init(BSB,p_init); } ! else if (getId()==BSB) { EvtVector4R p_init(EvtPDL::getMass(BS0),0.0,0.0,0.0); scalar_part->init(BS0,p_init); } + else if (getId()==BD0) { + EvtVector4R p_init(EvtPDL::getMass(BDB),0.0,0.0,0.0); + scalar_part->init(BDB,p_init); + } + else if (getId()==BDB) { + EvtVector4R p_init(EvtPDL::getMass(BD0),0.0,0.0,0.0); + scalar_part->init(BD0,p_init); + } scalar_part->setLifetime(0); *************** *** 295,319 **** insertDaugPtr(0,scalar_part); _ndaug=1; ! p=scalar_part; } } EvtDecayBase *decayer; decayer = EvtDecayTable::GetDecayFunc(p); if ( decayer ) { p->makeDaughters(decayer->nRealDaughters(),decayer->getDaugs()); ! //report(INFO,"EvtGen") << "has inited " << p << std::endl; //then loop over the daughters and init their decay int i; ! for(i=0;i<_ndaug;i++){ if ( EvtPDL::getWidth(p->getDaug(i)->getId()) > 0.0000001) p->getDaug(i)->initDecay(useMinMass); else p->getDaug(i)->setMass(EvtPDL::getMeanMass(p->getDaug(i)->getId())); ! //report(INFO,"EvtGen") << "has inited " << p->getDaug(i) << std::endl; } } //figure masses in separate step... --- 321,350 ---- insertDaugPtr(0,scalar_part); _ndaug=1; ! _isInit=true; p=scalar_part; + p->initDecay(useMinMass); + return; + } } + if ( _ndaug==1 ) std::cout << "hi " << EvtPDL::name(this->getId()) << std::endl; EvtDecayBase *decayer; decayer = EvtDecayTable::GetDecayFunc(p); if ( decayer ) { p->makeDaughters(decayer->nRealDaughters(),decayer->getDaugs()); ! // report(INFO,"EvtGen") << "has found decay " << decayer->nRealDaughters() << endl; //then loop over the daughters and init their decay int i; ! for(i=0;igetNDaug();i++){ if ( EvtPDL::getWidth(p->getDaug(i)->getId()) > 0.0000001) p->getDaug(i)->initDecay(useMinMass); else p->getDaug(i)->setMass(EvtPDL::getMeanMass(p->getDaug(i)->getId())); ! // report(INFO,"EvtGen") << "has inited " << EvtPDL::name(p->getDaug(i)->getId()) << ! // " " << EvtPDL::name(p->getId()) << endl; } } //figure masses in separate step... *************** *** 322,331 **** int j; EvtId *dauId=0; double *dauMasses=0; ! if ( _ndaug > 0) { ! dauId=new EvtId[_ndaug]; ! dauMasses=new double[_ndaug]; ! for (j=0;j<_ndaug;j++) { dauId[j]=p->getDaug(j)->getId(); dauMasses[j]=p->getDaug(j)->mass(); } --- 353,363 ---- int j; EvtId *dauId=0; double *dauMasses=0; ! int nDaugT=p->getNDaug(); ! if ( nDaugT > 0) { ! dauId=new EvtId[nDaugT]; ! dauMasses=new double[nDaugT]; ! for (j=0;jgetDaug(j)->getId(); dauMasses[j]=p->getDaug(j)->mass(); } *************** *** 341,349 **** else othDauId=new EvtId(tempPar->getDaug(0)->getId()); } } ! if ( p->getParent() && _validP4==false ) { ! if ( !useMinMass ) p->setMass(EvtPDL::getRandMass(p->getId(),parId,_ndaug,dauId,othDauId,parMass,dauMasses)); ! else p->setMass(EvtPDL::getMinMass(p->getId())); } if ( parId) delete parId; if ( othDauId) delete othDauId; --- 373,383 ---- else othDauId=new EvtId(tempPar->getDaug(0)->getId()); } } ! if ( p->getParent() && p->hasValidP4()==false ) { ! if ( !useMinMass ) { ! p->setMass(EvtPDL::getRandMass(p->getId(),parId,p->getNDaug(),dauId,othDauId,parMass,dauMasses)); ! } ! else p->setMass(EvtPDL::getMinMass(p->getId())); } if ( parId) delete parId; if ( othDauId) delete othDauId; *************** *** 369,382 **** EvtDecayBase *decayer; decayer = EvtDecayTable::GetDecayFunc(p); // if ( decayer ) { ! // report(INFO,"EvtGen") << "calling decay for " << EvtPDL::name(p->getId()) << " " << p->mass() << " " << p->getP4() << " " << p->getNDaug() << " " << p << std::endl; ! // report(INFO,"EvtGen") << "NDaug= " << decayer->getNDaug() << std::endl; // int ti; // for ( ti=0; tigetNDaug(); ti++) ! // report(INFO,"EvtGen") << "Daug " << ti << " " << EvtPDL::name(decayer->getDaug(ti)) << std::endl; // } //if (p->_ndaug>0) { ! // report(INFO,"EvtGen") <<"Is decaying particle with daughters!!!!!"<getId()) << " " << p->mass() << " " << p->getP4() << " " << p->getNDaug() << " " << p << endl; ! // report(INFO,"EvtGen") << "NDaug= " << decayer->getNDaug() << endl; // int ti; // for ( ti=0; tigetNDaug(); ti++) ! // report(INFO,"EvtGen") << "Daug " << ti << " " << EvtPDL::name(decayer->getDaug(ti)) << endl; // } //if (p->_ndaug>0) { ! // report(INFO,"EvtGen") <<"Is decaying particle with daughters!!!!!"<makeDecay(p); ! } ! else{ ! p->_rhoBackward.SetDiag(p->getSpinStates()); ! } _isDecayed=true; ! return; ! } void EvtParticle::generateMassTree() { - - double massProb=1.; double ranNum=2.; int counter=0; --- 419,445 ---- //if there are already daughters, then this step is already done! // figure out the masses if ( _ndaug == 0 ) generateMassTree(); + static EvtId BS0=EvtPDL::getId("B_s0"); + static EvtId BSB=EvtPDL::getId("anti-B_s0"); + static EvtId BD0=EvtPDL::getId("B0"); + static EvtId BDB=EvtPDL::getId("anti-B0"); + if ( _ndaug==1 && (getId()==BS0||getId()==BSB||getId()==BD0||getId()==BDB) ) + getDaug(0)->decay(); + else{ //now we have accepted a set of masses - time ! if ( decayer ) { ! decayer->makeDecay(p); ! } ! else{ ! p->_rhoBackward.SetDiag(p->getSpinStates()); ! } ! } _isDecayed=true; ! return; } void EvtParticle::generateMassTree() { double massProb=1.; double ranNum=2.; int counter=0; *************** *** 408,420 **** while (massProbinitDecay(); massProb=p->compMassProb(); ranNum=EvtRandom::Flat(); counter++; if ( counter > 10000 ) { if ( counter == 10001 ) { ! report(INFO,"EvtGen") << "Too many iterations to determine the mass tree. Parent mass= "<< p->mass() << " " << massProb <printTree(); report(INFO,"EvtGen") << "will take next combo with non-zero likelihood\n"; } --- 447,461 ---- while (massProbinitDecay(); + //report(INFO,"EvtGen") << "calling massProb \n"; massProb=p->compMassProb(); ranNum=EvtRandom::Flat(); + //report(INFO,"EvtGen") << "end of iter " << massProb << endl; counter++; if ( counter > 10000 ) { if ( counter == 10001 ) { ! report(INFO,"EvtGen") << "Too many iterations to determine the mass tree. Parent mass= "<< p->mass() << " " << massProb <printTree(); report(INFO,"EvtGen") << "will take next combo with non-zero likelihood\n"; } *************** *** 422,427 **** --- 463,469 ---- if ( counter > 20000 ) { // one last try - take the minimum masses p->initDecay(true); + p->printTree(); massProb=p->compMassProb(); if ( massProb>0. ) { massProb=2.0; *************** *** 434,446 **** } } } ! //report(INFO,"EvtGen") << counter << std::endl; ! //p->printTree(); } double EvtParticle::compMassProb() { EvtParticle *p=this; double mass=p->mass(); double parMass=0.; if ( p->getParent()) { --- 476,490 ---- } } } ! //report(INFO,"EvtGen") << counter << endl; ! //p->printTree(); } double EvtParticle::compMassProb() { EvtParticle *p=this; + //report(INFO,"EvtGen") << "compMassProb " << endl; + //p->printTree(); double mass=p->mass(); double parMass=0.; if ( p->getParent()) { *************** *** 451,469 **** double *dMasses=0; int i; - if ( nDaug>0 ) { dMasses=new double[nDaug]; ! for (i=0; igetDaug(i)->mass(); ! } } double temp=1.0; - - temp=EvtPDL::getMassProb(p->getId(), mass, parMass, nDaug, dMasses); //If the particle already has a mass, we dont need to include //it in the probability calculation if ( (!p->getParent() || _validP4 ) && temp>0.0 ) temp=1.; --- 495,509 ---- double *dMasses=0; int i; if ( nDaug>0 ) { dMasses=new double[nDaug]; ! for (i=0; igetDaug(i)->mass(); } double temp=1.0; temp=EvtPDL::getMassProb(p->getId(), mass, parMass, nDaug, dMasses); + //report(INFO,"EvtGen") << temp << " " << EvtPDL::name(p->getId()) << endl; //If the particle already has a mass, we dont need to include //it in the probability calculation if ( (!p->getParent() || _validP4 ) && temp>0.0 ) temp=1.; *************** *** 490,500 **** //_genlifetime=1; _first=1; _isInit=false; ! //report(INFO,"EvtGen") << "calling deletedaughters " << EvtPDL::name(this->getId()) <deleteDaughters(); --- 530,539 ---- //_genlifetime=1; _first=1; _isInit=false; ! //report(INFO,"EvtGen") << "calling deletedaughters " << EvtPDL::name(this->getId()) <deleteDaughters(); *************** *** 508,514 **** report(ERROR,"EvtGen") << "and you have asked for the:"<_pBeforeFSR; + ptemp=this; + + while (ptemp->getParent()!=0) { + ptemp=ptemp->getParent(); + mom=ptemp->getP4(); + temp=boostTo(temp,mom); + } + return temp; + } + EvtVector4R EvtParticle::getP4Restframe() { return EvtVector4R(mass(),0.0,0.0,0.0); *************** *** 822,828 **** for(i=0;i<_ndaug;i++){ report(INFO,"") << EvtPDL::name(_daug[i]->getId()).c_str()<<" "; } ! report(INFO,"")<printTreeRec(newlevel); } --- 876,885 ---- for(i=0;i<_ndaug;i++){ report(INFO,"") << EvtPDL::name(_daug[i]->getId()).c_str()<<" "; } ! for(i=0;i<_ndaug;i++){ ! report(INFO,"") << _daug[i]->mass()<<" "; ! } ! report(INFO,"")<printTreeRec(newlevel); } *************** *** 831,845 **** void EvtParticle::printTree() const { ! report(INFO,"EvtGen") << "This is the current decay chain"<printTreeRec(0); ! report(INFO,"EvtGen") << "End of decay chain."<printTreeRec(0); ! report(INFO,"EvtGen") << "End of decay chain."<getId()); + if ( _daug[i]->getNDaug() > 0 ) { + retval+= " ("; + retval+= _daug[i]->treeStrRec(newlevel); + retval+= ") "; + } + else{ + if ( i!=_ndaug-1) retval+=" "; + } + } + + return retval; + } + + + std::string EvtParticle::treeStr() const { + + std::string retval=EvtPDL::name(_id); + retval+=" -> "; + + retval+=treeStrRec(0); + + return retval; + } + void EvtParticle::printParticle() const { switch (EvtPDL::getSpinType(_id)){ *************** *** 865,871 **** report(INFO,"EvtGen") << "This is a string:"<printTree(); bool resetDaughters=false; ! for (i=0; igetDaug(i)->getId() != daughters[i] ) resetDaughters=true; ! //report(INFO,"EvtGen") << this->getDaug(i)->getId() << " " << daughters[i] << std::endl; ! } if ( resetDaughters ) { // report(INFO,"EvtGen") << "reseting daughters\n"; //for (i=0; igetDaug(i)->getId()) << " " << EvtPDL::name(daughters[i]) << std::endl; //} bool t1=true; //but keep the decay channel of the parent. --- 1018,1034 ---- //report(INFO,"EvtGen") << "and this is\n"; //if ( this) this->printTree(); bool resetDaughters=false; ! if ( numdaughter != this->getNDaug() && this->getNDaug() > 0 ) resetDaughters=true; ! if ( numdaughter == this->getNDaug() ) ! for (i=0; igetDaug(i)->getId() != daughters[i] ) resetDaughters=true; ! //report(INFO,"EvtGen") << this->getDaug(i)->getId() << " " << daughters[i] << endl; ! } ! if ( resetDaughters ) { // report(INFO,"EvtGen") << "reseting daughters\n"; //for (i=0; igetDaug(i)->getId()) << " " << EvtPDL::name(daughters[i]) << endl; //} bool t1=true; //but keep the decay channel of the parent. *************** *** 947,970 **** double weight=0.; // EvtDecayBase::findMasses( this, numdaughter, daughters, mass ); //get the list of masses ! //report(INFO,"EvtGen") << "mpar= " << m_b << " " << this <getDaug(i)->mass(); ! // report(INFO,"EvtGen") << "mass " << i << " " << mass[i] << " " << this->getDaug(i) << std::endl; } if ( poleSize<-0.1) { ! EvtGenKine::PhaseSpace( numdaughter, mass, p4, m_b ); ! for(i=0;igetDaug(i)->init(daughters[i],p4[i]); } - } else { if ( numdaughter != 3 ) { report(ERROR,"EvtGen") << "Only can generate pole phase space " << "distributions for 3 body final states" ! << std::endl<<"Will terminate."<getDaug(i)->mass(); ! // report(INFO,"EvtGen") << "mass " << i << " " << mass[i] << " " << this->getDaug(i) << endl; } if ( poleSize<-0.1) { ! //special case to enforce 4-momentum conservation in 1->1 decays ! if (numdaughter==1) { ! this->getDaug(0)->init(daughters[0],EvtVector4R(m_b,0.0,0.0,0.0)); ! } ! else{ ! EvtGenKine::PhaseSpace( numdaughter, mass, p4, m_b ); ! for(i=0;igetDaug(i)->init(daughters[i],p4[i]); ! } } } else { if ( numdaughter != 3 ) { report(ERROR,"EvtGen") << "Only can generate pole phase space " << "distributions for 3 body final states" ! << endl<<"Will terminate."<getDaug(0)->init(daughters[0],p4[0]); this->getDaug(1)->init(daughters[1],p4[1]); this->getDaug(2)->init(daughters[2],p4[2]); --- 1070,1076 ---- (whichTwo1 == 0 && whichTwo2 == 1 ) ) { weight=EvtGenKine::PhaseSpacePole( m_b, mass[0], mass[1], mass[2], poleSize, p4); ! //report(INFO,"EvtGen") << "here " << weight << " " << poleSize << endl; this->getDaug(0)->init(daughters[0],p4[0]); this->getDaug(1)->init(daughters[1],p4[1]); this->getDaug(2)->init(daughters[2],p4[2]); *************** *** 999,1005 **** if ( !ok) { report(ERROR,"EvtGen") << "Invalid pair of particle to generate a pole dist" << whichTwo1 << " " << whichTwo2 ! << std::endl<<"Will terminate."<getId()) << std::endl; setChannel(0); } EvtParticle* pdaug; --- 1109,1115 ---- int i; if ( _channel < 0 ) { ! //report(INFO,"EvtGen") << "setting channel " << EvtPDL::name(this->getId()) << endl; setChannel(0); } EvtParticle* pdaug; *************** *** 1019,1025 **** if (_ndaug!=ndaugstore){ report(ERROR,"EvtGen") << "Asking to make a different number of " << "daughters than what was previously created." ! << std::endl<<"Will terminate."< #include #include *************** *** 30,35 **** --- 31,37 ---- #include "EvtGenBase/EvtId.hh" #include #include + using std::fstream; void EvtParticleDecay::printSummary(){ if (_decay!=0) _decay->printSummary(); Index: Class/EvtParticleDecayList.cc =================================================================== RCS file: /nfs/cleo3/cvsroot/Offline/src/EvtGenBase/Class/EvtParticleDecayList.cc,v retrieving revision 1.1.1.1 retrieving revision 1.5 diff -c -r1.1.1.1 -r1.5 *** Class/EvtParticleDecayList.cc 7 Oct 2003 02:47:13 -0000 1.1.1.1 --- Class/EvtParticleDecayList.cc 1 Apr 2008 20:40:59 -0000 1.5 *************** *** 18,23 **** --- 18,24 ---- // //------------------------------------------------------------------------ // + #include "Experiment/Experiment.h" #include "EvtGenBase/EvtPatches.hh" #include #include *************** *** 29,34 **** --- 30,37 ---- #include "EvtGenBase/EvtReport.hh" #include "EvtGenBase/EvtPDL.hh" #include "EvtGenBase/EvtStatus.hh" + using std::endl; + using std::fstream; EvtParticleDecayList::EvtParticleDecayList(const EvtParticleDecayList &o) { _nmode=o._nmode; *************** *** 72,77 **** --- 75,125 ---- } + EvtParticleDecayList& EvtParticleDecayList::operator=(const EvtParticleDecayList &o) { + if (this != &o) { + removeDecay(); + _nmode=o._nmode; + _rawbrfrsum=o._rawbrfrsum; + _decaylist=new EvtParticleDecayPtr[_nmode]; + + int i; + for(i=0;i<_nmode;i++){ + _decaylist[i]=new EvtParticleDecay; + + EvtDecayBase *tModel=o._decaylist[i]->getDecayModel(); + + EvtDecayBase *tModelNew=tModel->clone(); + if (tModel->getPHOTOS()){ + tModelNew->setPHOTOS(); + } + if (tModel->verbose()){ + tModelNew->setVerbose(); + } + if (tModel->summary()){ + tModelNew->setSummary(); + } + std::vector args; + int j; + for(j=0;jgetNArg();j++){ + args.push_back(tModel->getArgStr(j)); + } + tModelNew->saveDecayInfo(tModel->getParentId(),tModel->getNDaug(), + tModel->getDaugs(), + tModel->getNArg(), + args, + tModel->getModelName(), + tModel->getBranchingFraction()); + _decaylist[i]->setDecayModel(tModelNew); + + //_decaylist[i]->setDecayModel(tModel); + _decaylist[i]->setBrfrSum(o._decaylist[i]->getBrfrSum()); + _decaylist[i]->setMassMin(o._decaylist[i]->getMassMin()); + } + } + return *this; + + + } EvtParticleDecayList::~EvtParticleDecayList(){ *************** *** 131,137 **** } if (p->getChannel() >(-1)) { ! report(ERROR,"EvtGen") << "Internal error!!!"<getChannel() >(-1)) { ! report(ERROR,"EvtGen") << "Internal error!!!"<hasValidP4() ) { ! //report(INFO,"EvtGen") << "amazing " << EvtPDL::name(p->getId()) << " " << getDecay(i).getMassMin() << " "<mass() << " " << i << std::endl; if (getDecay(i).getMassMin() < p->mass() ) { p->setChannel(i); return getDecay(i).getDecayModel(); --- 205,211 ---- } if ( p->hasValidP4() ) { ! //report(INFO,"EvtGen") << "amazing " << EvtPDL::name(p->getId()) << " " << getDecay(i).getMassMin() << " "<mass() << " " << i << endl; if (getDecay(i).getMassMin() < p->mass() ) { p->setChannel(i); return getDecay(i).getDecayModel(); *************** *** 188,196 **** report(ERROR,"EvtGen") << "Could not decay:" <getId()).c_str() <<" with mass:"<mass() ! <<" will throw event away! "<getId()).c_str() <<" with mass:"<mass() ! <<" will throw event away! "<=_nmode) { report(ERROR,"EvtGen") <<"Error getting channel:" <=_nmode) { report(ERROR,"EvtGen") <<"Error getting channel:" <setBrfrSum(brfrsum); newlist[_nmode]->setMassMin(massmin); + EvtDecayBase *newDec=newlist[_nmode]->getDecayModel(); + for(i=0;i<_nmode;i++){ + if ( newDec->matchingDecay(*(newlist[i]->getDecayModel())) ) { + + //sometimes its ok.. + if ( newDec->getModelName() == "JETSET" || newDec->getModelName() == "PYTHIA" ) continue; + if ( newDec->getModelName() == "JSCONT" || newDec->getModelName() == "PYCONT" ) continue; + if ( newDec->getModelName() == "PYGAGA" ) continue; + if ( newDec->getModelName() == "LUNDAREALAW" ) continue; + report(ERROR,"EvtGen") << "Two matching decays with same parent in decay table\n"; + report(ERROR,"EvtGen") << "Please fix that\n"; + report(ERROR,"EvtGen") << "Parent " << EvtPDL::name(newDec->getParentId()).c_str() << endl; + for (int j=0; jgetNDaug(); j++) + report(ERROR,"EvtGen") << "Daughter " << EvtPDL::name(newDec->getDaug(j)).c_str() << endl; + assert(0); + } + } + if (_nmode!=0){ delete [] _decaylist; } *************** *** 267,272 **** --- 333,401 ---- } + void EvtParticleDecayList::removeMode(EvtDecayBase* decay) { + // here we will delete a decay with the same final state particles + // and recalculate the branching fractions for the remaining modes + int match = -1; + int i; + double match_bf; + + for(i=0;i<_nmode;i++){ + if ( decay->matchingDecay(*(_decaylist[i]->getDecayModel())) ) { + match = i; + } + } + + if (match < 0) { + report(ERROR,"EvtGen") << " Attempt to remove undefined mode for" << endl + << "Parent " << EvtPDL::name(decay->getParentId()).c_str() << endl + << "Daughters: "; + for (int j=0; jgetNDaug(); j++) + report(ERROR,"") << EvtPDL::name(decay->getDaug(j)).c_str() << " "; + report(ERROR,"") << endl; + ::abort(); + } + + if (match == 0) { + match_bf = _decaylist[match]->getBrfrSum(); + } else { + match_bf = (_decaylist[match]->getBrfrSum() + -_decaylist[match-1]->getBrfrSum()); + } + + double divisor = 1-match_bf; + if (divisor < 0.000001 && _nmode > 1) { + report(ERROR,"EvtGen") << "Removing requested mode leaves " + << EvtPDL::name(decay->getParentId()).c_str() + << " with zero sum branching fraction," << endl + << "but more than one decay mode remains. Aborting." + << endl; + ::abort(); + } + + EvtParticleDecayPtr* newlist=new EvtParticleDecayPtr[_nmode-1]; + + for(i=0;isetBrfrSum(newlist[i]->getBrfrSum()/divisor); + } + for(i=match+1; i<_nmode; i++) { + newlist[i-1]=_decaylist[i]; + newlist[i-1]->setBrfrSum((newlist[i-1]->getBrfrSum()-match_bf)/divisor); + } + + + delete [] _decaylist; + + _nmode--; + + _decaylist=newlist; + + if (_nmode == 0) { + delete [] _decaylist; + } + + } void EvtParticleDecayList::finalize(){ *************** *** 276,286 **** << "branching fraction sum greater than 0\n"; assert(0); } ! if (std::fabs(_rawbrfrsum-1.0)>0.0001) { report(INFO,"EvtGen") <<"Warning, sum of branching fractions for " <getDecayModel()->getParentId()).c_str() ! <<" is "<<_rawbrfrsum<0.0001) { report(INFO,"EvtGen") <<"Warning, sum of branching fractions for " <getDecayModel()->getParentId()).c_str() ! <<" is "<<_rawbrfrsum< - #include #include #include #include - #include #include "EvtGenBase/EvtParticle.hh" #include "EvtGenBase/EvtId.hh" #include "EvtGenBase/EvtPDL.hh" --- 18,28 ---- // //------------------------------------------------------------------------ // + #include "Experiment/Experiment.h" #include #include #include #include #include "EvtGenBase/EvtParticle.hh" #include "EvtGenBase/EvtId.hh" #include "EvtGenBase/EvtPDL.hh" *************** *** 38,43 **** --- 37,43 ---- #include "EvtGenBase/EvtHighSpinParticle.hh" #include "EvtGenBase/EvtReport.hh" #include "EvtGenBase/EvtParticleFactory.hh" + using std::endl; EvtParticle* EvtParticleFactory::particleFactory(EvtSpinType::spintype spinType){ *************** *** 79,88 **** return new EvtHighSpinParticle; } ! report(ERROR,"EvtGen")<<"Error in EvtParticleFactory::particleFactory"< #include #include *************** *** 25,30 **** --- 26,32 ---- #include "EvtGenBase/EvtPhotonParticle.hh" #include "EvtGenBase/EvtVector4C.hh" #include "EvtGenBase/EvtReport.hh" + using std::endl; EvtPhotonParticle::~EvtPhotonParticle(){} *************** *** 89,95 **** break; default: report(ERROR,"EvtGen") << "EvtPhotonParticle.cc: Asked " ! << "for state:"< #include "EvtGenBase/EvtPoint1D.hh" EvtPoint1D::EvtPoint1D() --- 11,17 ---- // Point on a finite 1-D interval. isValid shows whether for a given specification, // the coordinate _value is inside the interval defined by _min, _max. ! #include #include "EvtGenBase/EvtPoint1D.hh" EvtPoint1D::EvtPoint1D() *************** *** 28,42 **** EvtPoint1D::~EvtPoint1D() {} ! void EvtPoint1D::print(std::ostream& os) const { ! os << _value << " (" << _min << "," << _max << ")"; } - std::ostream& operator<<(std::ostream& os, const EvtPoint1D& p) - { - p.print(os); - return os; - } - - --- 29,36 ---- EvtPoint1D::~EvtPoint1D() {} ! void EvtPoint1D::print() const { ! printf("%f (%f : %f)\n",_value,_min,_max); } Index: Class/EvtPropBreitWigner.cc =================================================================== RCS file: /nfs/cleo3/cvsroot/Offline/src/EvtGenBase/Class/EvtPropBreitWigner.cc,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -c -r1.1.1.1 -r1.2 *** Class/EvtPropBreitWigner.cc 7 Oct 2003 02:47:13 -0000 1.1.1.1 --- Class/EvtPropBreitWigner.cc 12 Jan 2006 16:08:22 -0000 1.2 *************** *** 1,7 **** /******************************************************************************* * Project: BaBar detector at the SLAC PEP-II B-factory * Package: EvtGenBase ! * File: $Id: EvtPropBreitWigner.cc,v 1.1.1.1 2003/10/07 02:47:13 ryd Exp $ * Author: Alexei Dvoretskii, dvoretsk@slac.stanford.edu, 2001-2002 * * Copyright (C) 2002 Caltech --- 1,8 ---- + #include "Experiment/Experiment.h" /******************************************************************************* * Project: BaBar detector at the SLAC PEP-II B-factory * Package: EvtGenBase ! * File: $Id: EvtPropBreitWigner.cc,v 1.2 2006/01/12 16:08:22 ryd Exp $ * Author: Alexei Dvoretskii, dvoretsk@slac.stanford.edu, 2001-2002 * * Copyright (C) 2002 Caltech *************** *** 26,32 **** {} ! EvtAmplitude* EvtPropBreitWigner::clone() const { return new EvtPropBreitWigner(*this); } --- 27,33 ---- {} ! EvtAmplitude* EvtPropBreitWigner::clone() const { return new EvtPropBreitWigner(*this); } Index: Class/EvtPropBreitWignerRel.cc =================================================================== RCS file: /nfs/cleo3/cvsroot/Offline/src/EvtGenBase/Class/EvtPropBreitWignerRel.cc,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -c -r1.1.1.1 -r1.2 *** Class/EvtPropBreitWignerRel.cc 7 Oct 2003 02:47:13 -0000 1.1.1.1 --- Class/EvtPropBreitWignerRel.cc 12 Jan 2006 16:08:22 -0000 1.2 *************** *** 1,7 **** /******************************************************************************* * Project: BaBar detector at the SLAC PEP-II B-factory * Package: EvtGenBase ! * File: $Id: EvtPropBreitWignerRel.cc,v 1.1.1.1 2003/10/07 02:47:13 ryd Exp $ * Author: Alexei Dvoretskii, dvoretsk@slac.stanford.edu, 2001-2002 * * Copyright (C) 2002 Caltech --- 1,8 ---- + #include "Experiment/Experiment.h" /******************************************************************************* * Project: BaBar detector at the SLAC PEP-II B-factory * Package: EvtGenBase ! * File: $Id: EvtPropBreitWignerRel.cc,v 1.2 2006/01/12 16:08:22 ryd Exp $ * Author: Alexei Dvoretskii, dvoretsk@slac.stanford.edu, 2001-2002 * * Copyright (C) 2002 Caltech *************** *** 25,31 **** {} ! EvtAmplitude* EvtPropBreitWignerRel::clone() const { return new EvtPropBreitWignerRel(*this); } --- 26,32 ---- {} ! EvtAmplitude* EvtPropBreitWignerRel::clone() const { return new EvtPropBreitWignerRel(*this); } Index: Class/EvtPto3PAmp.cc =================================================================== RCS file: /nfs/cleo3/cvsroot/Offline/src/EvtGenBase/Class/EvtPto3PAmp.cc,v retrieving revision 1.1.1.1 retrieving revision 1.3 diff -c -r1.1.1.1 -r1.3 *** Class/EvtPto3PAmp.cc 7 Oct 2003 02:47:13 -0000 1.1.1.1 --- Class/EvtPto3PAmp.cc 27 Jan 2006 15:22:34 -0000 1.3 *************** *** 1,7 **** /******************************************************************************* * Project: BaBar detector at the SLAC PEP-II B-factory * Package: EvtGenBase ! * File: $Id: EvtPto3PAmp.cc,v 1.1.1.1 2003/10/07 02:47:13 ryd Exp $ * Author: Alexei Dvoretskii, dvoretsk@slac.stanford.edu, 2001-2002 * * Copyright (C) 2002 Caltech --- 1,8 ---- + #include "Experiment/Experiment.h" /******************************************************************************* * Project: BaBar detector at the SLAC PEP-II B-factory * Package: EvtGenBase ! * File: $Id: EvtPto3PAmp.cc,v 1.3 2006/01/27 15:22:34 ryd Exp $ * Author: Alexei Dvoretskii, dvoretsk@slac.stanford.edu, 2001-2002 * * Copyright (C) 2002 Caltech *************** *** 12,20 **** --- 13,23 ---- #include #include "EvtGenBase/EvtComplex.hh" #include "EvtGenBase/EvtPto3PAmp.hh" + #include "EvtGenBase/EvtReport.hh" #include "EvtGenBase/EvtDalitzCoord.hh" #include "EvtGenBase/EvtdFunction.hh" #include "EvtGenBase/EvtCyclic3.hh" + using std::endl; using EvtCyclic3::Index; using EvtCyclic3::Pair; *************** *** 22,28 **** EvtPto3PAmp::EvtPto3PAmp(EvtDalitzPlot dp, Pair pairAng, Pair pairRes, EvtSpinType::spintype spin, const EvtPropagator& prop, NumType typeN) ! : EvtAmplitude(), _pairAng(pairAng), _pairRes(pairRes), _spin(spin), _typeN(typeN), --- 25,31 ---- EvtPto3PAmp::EvtPto3PAmp(EvtDalitzPlot dp, Pair pairAng, Pair pairRes, EvtSpinType::spintype spin, const EvtPropagator& prop, NumType typeN) ! : EvtAmplitude(), _pairAng(pairAng), _pairRes(pairRes), _spin(spin), _typeN(typeN), *************** *** 35,41 **** EvtPto3PAmp::EvtPto3PAmp(const EvtPto3PAmp& other) ! : EvtAmplitude(other), _pairAng(other._pairAng), _pairRes(other._pairRes), _spin(other._spin), --- 38,44 ---- EvtPto3PAmp::EvtPto3PAmp(const EvtPto3PAmp& other) ! : EvtAmplitude(other), _pairAng(other._pairAng), _pairRes(other._pairRes), _spin(other._spin), *************** *** 190,198 **** // unphysical cosines indicate we are in big trouble double cosTh = x.cosTh(_pairAng,_pairRes); ! if(std::fabs(cosTh) > 1.) { ! report(INFO,"EvtGen") << "cosTh " << cosTh << std::endl; assert(0); } --- 193,201 ---- // unphysical cosines indicate we are in big trouble double cosTh = x.cosTh(_pairAng,_pairRes); ! if(fabs(cosTh) > 1.) { ! report(INFO,"EvtGen") << "cosTh " << cosTh << endl; assert(0); } Index: Class/EvtPto3PAmpFactory.cc =================================================================== RCS file: /nfs/cleo3/cvsroot/Offline/src/EvtGenBase/Class/EvtPto3PAmpFactory.cc,v retrieving revision 1.1.1.1 retrieving revision 1.3 diff -c -r1.1.1.1 -r1.3 *** Class/EvtPto3PAmpFactory.cc 7 Oct 2003 02:47:13 -0000 1.1.1.1 --- Class/EvtPto3PAmpFactory.cc 6 Jun 2006 17:15:55 -0000 1.3 *************** *** 1,6 **** //----------------------------------------------------------------------- // File and Version Information: ! // $Id: EvtPto3PAmpFactory.cc,v 1.1.1.1 2003/10/07 02:47:13 ryd Exp $ // // Environment: // This software is part of the EvtGen package developed jointly --- 1,6 ---- //----------------------------------------------------------------------- // File and Version Information: ! // $Id: EvtPto3PAmpFactory.cc,v 1.3 2006/06/06 17:15:55 gregor Exp $ // // Environment: // This software is part of the EvtGen package developed jointly *************** *** 13,25 **** // Module creator: // Alexei Dvoretskii, Caltech, 2001-2002. //----------------------------------------------------------------------- // AmpFactory for building a P -> 3P decay // (pseudoscalar to three pseudoscalars) #include - #include #include #include #include "EvtGenBase/EvtId.hh" --- 13,26 ---- // Module creator: // Alexei Dvoretskii, Caltech, 2001-2002. //----------------------------------------------------------------------- + #include "Experiment/Experiment.h" // AmpFactory for building a P -> 3P decay // (pseudoscalar to three pseudoscalars) #include #include + #include #include #include "EvtGenBase/EvtId.hh" *************** *** 33,64 **** #include "EvtGenBase/EvtPto3PAmpFactory.hh" #include "EvtGenBase/EvtPropBreitWigner.hh" #include "EvtGenBase/EvtPropBreitWignerRel.hh" ! #include "EvtGenBase/EvtDalitzBwPdf.hh" ! #include "EvtGenBase/EvtFlatPdf.hh" ! ! #define VERBOSE true using namespace EvtCyclic3; void EvtPto3PAmpFactory::processAmp(EvtComplex c, std::vector vv, bool conj) { ! if(VERBOSE) { ! report(INFO,"EvtGen") << "Make amplitude: "; unsigned i; ! for(i=0;i* amp = 0; ! EvtPdf* pdf = 0; std::string name; ! ! int i; if(vv[0] == "PHASESPACE") { ! pdf = new EvtFlatPdf(); ! amp = new EvtFlatAmp(); name = "NR"; } else if(vv[0] == "RESONANCE") { --- 34,63 ---- #include "EvtGenBase/EvtPto3PAmpFactory.hh" #include "EvtGenBase/EvtPropBreitWigner.hh" #include "EvtGenBase/EvtPropBreitWignerRel.hh" ! #include "EvtGenBase/EvtDalitzResPdf.hh" ! #include "EvtGenBase/EvtDalitzFlatPdf.hh" using namespace EvtCyclic3; void EvtPto3PAmpFactory::processAmp(EvtComplex c, std::vector vv, bool conj) { ! if(_verbose) { ! printf("Make amplitude\n"); unsigned i; ! for(i=0;i* amp = 0; ! EvtPdf* pdf = 0; std::string name; ! ! size_t i; if(vv[0] == "PHASESPACE") { ! pdf = new EvtDalitzFlatPdf(_dp); ! amp = new EvtFlatAmp(); name = "NR"; } else if(vv[0] == "RESONANCE") { *************** *** 72,78 **** double mR, gR; name = vv[2]; EvtId resId = EvtPDL::getId(vv[2]); ! if(VERBOSE) report(INFO,"EvtGen") << "Particles " << vv[1].c_str() << " form resonance " << vv[2].c_str() << std::endl; // If no valid particle name is given, assume that // it is the spin, the mass and the width of the particle. --- 71,77 ---- double mR, gR; name = vv[2]; EvtId resId = EvtPDL::getId(vv[2]); ! if(_verbose) printf("Particles %s form resonance %s\n",vv[1].c_str(),vv[2].c_str()); // If no valid particle name is given, assume that // it is the spin, the mass and the width of the particle. *************** *** 107,113 **** if(vv[3] != "ANGULAR") { ! if(VERBOSE) report(INFO,"EvtGen") << "Setting m(" << vv[2].c_str() << ")=" << vv[3].c_str() << " g(" << vv[2].c_str() << ")=" << vv[4].c_str() << std::endl; mR = strtod(vv[3].c_str(),0); gR = strtod(vv[4].c_str(),0); i = 4; --- 106,115 ---- if(vv[3] != "ANGULAR") { ! if(_verbose) ! printf("Setting m(%s)=%s g(%s)=%s\n", ! vv[2].c_str(),vv[3].c_str(),vv[2].c_str(),vv[4].c_str()); ! mR = strtod(vv[3].c_str(),0); gR = strtod(vv[4].c_str(),0); i = 4; *************** *** 116,130 **** // ANGULAR stanza ! assert(vv[++i] == "ANGULAR"); Pair pairAng = strToPair(vv[++i].c_str()); ! report(INFO,"EvtGen") << "Angle is measured between particles " << vv[i].c_str() << std::endl; // TYPE stanza assert(vv[++i] == "TYPE"); std::string type = vv[++i]; ! report(INFO,"EvtGen") << "Propagator type " << vv[i].c_str() << std::endl; if(type == "NBW") { --- 118,136 ---- // ANGULAR stanza ! if(vv[++i] != "ANGULAR") { ! ! printf("%s instead of ANGULAR\n",vv[i].c_str()); ! exit(0); ! } Pair pairAng = strToPair(vv[++i].c_str()); ! if(_verbose) printf("Angle is measured between particles %s\n",vv[i].c_str()); // TYPE stanza assert(vv[++i] == "TYPE"); std::string type = vv[++i]; ! if(_verbose) printf("Propagator type %s\n",vv[i].c_str()); if(type == "NBW") { *************** *** 167,173 **** i++; if(vv[++i] == "BLATTWEISSKOPF") { ! if(VERBOSE) report(INFO,"EvtGen") << "BVFF=" << vv[i].c_str() << std::endl; double R = strtod(vv[++i].c_str(),0); partAmp->set_fb(R); } --- 173,179 ---- i++; if(vv[++i] == "BLATTWEISSKOPF") { ! if(_verbose) printf("BVFF=%s\n",vv[i].c_str()); double R = strtod(vv[++i].c_str(),0); partAmp->set_fb(R); } *************** *** 177,183 **** i++; ! pdf = new EvtDalitzBwPdf(mR,gR,pairRes); amp = partAmp; } --- 183,189 ---- i++; ! pdf = new EvtDalitzResPdf(_dp,mR,gR,pairRes); amp = partAmp; } Index: Class/EvtRadCorr.cc =================================================================== RCS file: /nfs/cleo3/cvsroot/Offline/src/EvtGenBase/Class/EvtRadCorr.cc,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -c -r1.1.1.1 -r1.2 *** Class/EvtRadCorr.cc 7 Oct 2003 02:47:13 -0000 1.1.1.1 --- Class/EvtRadCorr.cc 12 Jan 2006 16:08:23 -0000 1.2 *************** *** 19,30 **** --- 19,32 ---- // //------------------------------------------------------------------------ // + #include "Experiment/Experiment.h" #include #include #include "EvtGenBase/EvtAbsRadCorr.hh" #include "EvtGenBase/EvtRadCorr.hh" #include "EvtGenBase/EvtReport.hh" + using std::endl; EvtAbsRadCorr* EvtRadCorr::_isrEngine=0; *************** *** 51,57 **** if (_isrEngine==0){ report(ERROR,"EvtGen") <<"No RadCorr model available in " ! <<"EvtRadCorr::doRadCorr()."< #include #include Index: Class/EvtRandom.cc =================================================================== RCS file: /nfs/cleo3/cvsroot/Offline/src/EvtGenBase/Class/EvtRandom.cc,v retrieving revision 1.1.1.1 retrieving revision 1.3 diff -c -r1.1.1.1 -r1.3 *** Class/EvtRandom.cc 7 Oct 2003 02:47:13 -0000 1.1.1.1 --- Class/EvtRandom.cc 12 Jan 2006 16:08:23 -0000 1.3 *************** *** 19,24 **** --- 19,25 ---- // //------------------------------------------------------------------------ // + #include "Experiment/Experiment.h" #include #include *************** *** 27,32 **** --- 28,36 ---- #include "EvtGenBase/EvtRandomEngine.hh" #include "EvtGenBase/EvtRandom.hh" #include "EvtGenBase/EvtReport.hh" + #include "EvtGenBase/EvtConst.hh" + + using std::endl; EvtRandomEngine* EvtRandom::_randomEngine=0; *************** *** 40,46 **** if (_randomEngine==0){ report(ERROR,"EvtGen") <<"No random engine available in " ! <<"EvtRandom::random()."< max ) { ! report(ERROR,"EvtGen") << "min>max in EvtRandom::Flat(" << min << "," << max << ")" < max ) { ! report(ERROR,"EvtGen") << "min>max in EvtRandom::Flat(" << min << "," << max << ")" < Index: Class/EvtRaritaSchwinger.cc =================================================================== RCS file: /nfs/cleo3/cvsroot/Offline/src/EvtGenBase/Class/EvtRaritaSchwinger.cc,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -c -r1.1.1.1 -r1.2 *** Class/EvtRaritaSchwinger.cc 7 Oct 2003 02:47:13 -0000 1.1.1.1 --- Class/EvtRaritaSchwinger.cc 12 Jan 2006 16:08:23 -0000 1.2 *************** *** 17,25 **** --- 17,28 ---- // RYD April 23, 2000 Module created // //------------------------------------------------------------------------ + #include "Experiment/Experiment.h" #include "EvtGenBase/EvtRaritaSchwinger.hh" + using std::endl; + using std::ostream; EvtRaritaSchwinger::~EvtRaritaSchwinger(){} *************** *** 133,147 **** } ! std::ostream& operator<<(std::ostream& s, const EvtRaritaSchwinger& rs){ int i,j; ! s<< std::endl; for(i=0;i<4;i++){ for(j=0;j<4;j++){ s << rs._rs[i][j]; } ! s << std::endl; } return s; --- 136,150 ---- } ! ostream& operator<<(ostream& s, const EvtRaritaSchwinger& rs){ int i,j; ! s<< endl; for(i=0;i<4;i++){ for(j=0;j<4;j++){ s << rs._rs[i][j]; } ! s << endl; } return s; Index: Class/EvtRaritaSchwingerParticle.cc =================================================================== RCS file: /nfs/cleo3/cvsroot/Offline/src/EvtGenBase/Class/EvtRaritaSchwingerParticle.cc,v retrieving revision 1.1.1.1 retrieving revision 1.4 diff -c -r1.1.1.1 -r1.4 *** Class/EvtRaritaSchwingerParticle.cc 7 Oct 2003 02:47:13 -0000 1.1.1.1 --- Class/EvtRaritaSchwingerParticle.cc 17 Jan 2006 22:51:01 -0000 1.4 *************** *** 18,23 **** --- 18,24 ---- // //------------------------------------------------------------------------ // + #include "Experiment/Experiment.h" #include #include #include *************** *** 27,32 **** --- 28,34 ---- #include "EvtGenBase/EvtVector4R.hh" #include "EvtGenBase/EvtPDL.hh" #include "EvtGenBase/EvtReport.hh" + using std::endl; EvtRaritaSchwingerParticle::~EvtRaritaSchwingerParticle(){} *************** *** 39,106 **** void EvtRaritaSchwingerParticle::init(EvtId id,const EvtVector4R& p4){ ! _validP4=true; ! setp(p4); ! setpart_num(id); ! ! if (EvtPDL::getStdHep(id)==0){ ! report(ERROR,"EvtGen") << "Error in EvtRaritaSchwingerParticle::init, part_n=" ! << id.getId()<0){ ! ! EvtDiracSpinor u1,u2; ! ! u1.set(EvtComplex(sqrt(2.0*mass()),0.0),EvtComplex(0.0,0.0), ! EvtComplex(0.0,0.0),EvtComplex(0.0,0.0)); ! u2.set(EvtComplex(0.0,0.0),EvtComplex(sqrt(2.0*mass()),0.0), ! EvtComplex(0.0,0.0),EvtComplex(0.0,0.0)); ! ! ! ! _spinorRest[0]=dirProd(e3,u1+u2); ! _spinorRest[1]=dirProd(e1+EvtComplex(0.0,1.0)*e2,u1); ! _spinorRest[2]=dirProd(e1-EvtComplex(0.0,1.0)*e2,u2); ! _spinorRest[3]=dirProd(e1,(u1+u2))+dirProd(EvtComplex(0.0,1.0)*e2,(u1-u2)); _spinor[0]=boostTo(_spinorRest[0],p4); _spinor[1]=boostTo(_spinorRest[1],p4); _spinor[2]=boostTo(_spinorRest[2],p4); _spinor[3]=boostTo(_spinorRest[3],p4); - - - } - else{ - - EvtDiracSpinor u1,u2; - - u1.set(EvtComplex(0.0,0.0),EvtComplex(0.0,0.0), - EvtComplex(sqrt(2.0*mass()),0.0),EvtComplex(0.0,0.0)); - u2.set(EvtComplex(0.0,0.0),EvtComplex(0.0,0.0), - EvtComplex(0.0,0.0),EvtComplex(sqrt(2.0*mass()),0.0)); - - - - _spinorRest[0]=dirProd(e3,(u1+u2)); - _spinorRest[1]=dirProd(e1+EvtComplex(0.0,1.0)*e2,u1); - _spinorRest[2]=dirProd(e1-EvtComplex(0.0,1.0)*e2,u2); - _spinorRest[3]=dirProd(e1,(u1+u2))+dirProd(EvtComplex(0.0,1.0)*e2,(u1-u2)); - _spinor[0]=boostTo(_spinorRest[0],p4); - _spinor[1]=boostTo(_spinorRest[1],p4); - _spinor[2]=boostTo(_spinorRest[2],p4); - _spinor[3]=boostTo(_spinorRest[3],p4); - - } ! setLifetime(); } --- 41,89 ---- void EvtRaritaSchwingerParticle::init(EvtId id,const EvtVector4R& p4){ ! _validP4=true; ! setp(p4); ! setpart_num(id); ! ! if (EvtPDL::getStdHep(id)==0){ ! report(ERROR,"EvtGen") << "Error in EvtRaritaSchwingerParticle::init, part_n=" ! << id.getId()<getP4().mass())); ! ! EvtDiracSpinor spplus; ! EvtDiracSpinor spminus; ! ! if (EvtPDL::getStdHep(getId())>0){ ! spplus.set(sqmt2,0.0,0.0,0.0); ! spminus.set(0.0,sqmt2,0.0,0.0); ! } else { ! spplus.set(0.0,0.0,sqmt2,0.0); ! spminus.set(0.0,0.0,0.0,sqmt2); ! } ! ! static EvtVector4C eplus(0.0,-1.0/sqrt(2.0),EvtComplex(0.0,-1.0/sqrt(2.0)),0.0); ! static EvtVector4C ezero(0.0,0.0,0.0,1.0); ! static EvtVector4C eminus(0.0,1.0/sqrt(2.0),EvtComplex(0.0,-1.0/sqrt(2.0)),0.0); ! ! _spinorRest[0]=dirProd(eplus,spplus); ! _spinorRest[1]=dirProd(sqrt(2.0/3.0)*ezero,spplus)+ ! dirProd(sqrt(1.0/3.0)*eplus,spminus); ! _spinorRest[2]=dirProd(sqrt(2.0/3.0)*ezero,spminus)+ ! dirProd(sqrt(1.0/3.0)*eminus,spplus); ! _spinorRest[3]=dirProd(eminus,spminus); _spinor[0]=boostTo(_spinorRest[0],p4); _spinor[1]=boostTo(_spinorRest[1],p4); _spinor[2]=boostTo(_spinorRest[2],p4); _spinor[3]=boostTo(_spinorRest[3],p4); ! setLifetime(); } *************** *** 119,136 **** EvtSpinDensity EvtRaritaSchwingerParticle::rotateToHelicityBasis() const{ EvtDiracSpinor spplus; EvtDiracSpinor spminus; - double m=getP4().mass(); - if (EvtPDL::getStdHep(getId())>0){ spplus.set(1.0,0.0,0.0,0.0); spminus.set(0.0,1.0,0.0,0.0); } else { ! spplus.set(0.0,0.0,0.0,1.0); ! spminus.set(0.0,0.0,1.0,0.0); } EvtVector4C eplus(0.0,-1.0/sqrt(2.0),EvtComplex(0.0,-1.0/sqrt(2.0)),0.0); --- 102,119 ---- EvtSpinDensity EvtRaritaSchwingerParticle::rotateToHelicityBasis() const{ + + double sqmt2=sqrt(2.0*(this->getP4().mass())); EvtDiracSpinor spplus; EvtDiracSpinor spminus; if (EvtPDL::getStdHep(getId())>0){ spplus.set(1.0,0.0,0.0,0.0); spminus.set(0.0,1.0,0.0,0.0); } else { ! spplus.set(0.0,0.0,1.0,0.0); ! spminus.set(0.0,0.0,0.0,1.0); } EvtVector4C eplus(0.0,-1.0/sqrt(2.0),EvtComplex(0.0,-1.0/sqrt(2.0)),0.0); *************** *** 144,177 **** dirProd(sqrt(1.0/3.0)*eminus,spplus); EvtRaritaSchwinger spmm=dirProd(eminus,spminus); ! ! EvtRaritaSchwinger sp0=spRS(0); ! EvtRaritaSchwinger sp1=spRS(1); ! EvtRaritaSchwinger sp2=spRS(2); ! EvtRaritaSchwinger sp3=spRS(3); EvtSpinDensity R; R.SetDim(4); ! ! R.Set(0,0,(sppp*sp0)/sqrt(2*m)); ! R.Set(0,1,(sppp*sp1)/sqrt(2*m)); ! R.Set(0,2,(sppp*sp2)/sqrt(2*m)); ! R.Set(0,3,(sppp*sp3)/sqrt(2*m)); ! ! R.Set(1,0,(spp*sp0)/sqrt(2*m)); ! R.Set(1,1,(spp*sp1)/sqrt(2*m)); ! R.Set(1,2,(spp*sp2)/sqrt(2*m)); ! R.Set(1,3,(spp*sp3)/sqrt(2*m)); ! ! R.Set(2,0,(spm*sp0)/sqrt(2*m)); ! R.Set(2,1,(spm*sp1)/sqrt(2*m)); ! R.Set(2,2,(spm*sp2)/sqrt(2*m)); ! R.Set(2,3,(spm*sp3)/sqrt(2*m)); ! ! R.Set(3,0,(spmm*sp0)/sqrt(2*m)); ! R.Set(3,1,(spmm*sp1)/sqrt(2*m)); ! R.Set(3,2,(spmm*sp2)/sqrt(2*m)); ! R.Set(3,3,(spmm*sp3)/sqrt(2*m)); return R; --- 127,144 ---- dirProd(sqrt(1.0/3.0)*eminus,spplus); EvtRaritaSchwinger spmm=dirProd(eminus,spminus); ! // EvtSpinDensity R; R.SetDim(4); ! ! ! for ( int i=0; i<4; i++) { ! R.Set(0,i,(sppp*_spinorRest[i])/sqmt2); ! R.Set(1,i,(spp*_spinorRest[i])/sqmt2); ! R.Set(2,i,(spm*_spinorRest[i])/sqmt2); ! R.Set(3,i,(spmm*_spinorRest[i])/sqmt2); ! } return R; *************** *** 185,198 **** EvtDiracSpinor spplus; EvtDiracSpinor spminus; - double m=getP4().mass(); - if (EvtPDL::getStdHep(getId())>0){ spplus.set(1.0,0.0,0.0,0.0); spminus.set(0.0,1.0,0.0,0.0); } else { ! spplus.set(0.0,0.0,0.0,1.0); ! spminus.set(0.0,0.0,1.0,0.0); } EvtVector4C eplus(0.0,-1.0/sqrt(2.0),EvtComplex(0.0,-1.0/sqrt(2.0)),0.0); --- 152,163 ---- EvtDiracSpinor spplus; EvtDiracSpinor spminus; if (EvtPDL::getStdHep(getId())>0){ spplus.set(1.0,0.0,0.0,0.0); spminus.set(0.0,1.0,0.0,0.0); } else { ! spplus.set(0.0,0.0,1.0,0.0); ! spminus.set(0.0,0.0,0.0,1.0); } EvtVector4C eplus(0.0,-1.0/sqrt(2.0),EvtComplex(0.0,-1.0/sqrt(2.0)),0.0); *************** *** 205,244 **** EvtRaritaSchwinger spm=dirProd(sqrt(2.0/3.0)*ezero,spminus)+ dirProd(sqrt(1.0/3.0)*eminus,spplus); EvtRaritaSchwinger spmm=dirProd(eminus,spminus); sppp.applyRotateEuler(alpha,beta,gamma); spp.applyRotateEuler(alpha,beta,gamma); spm.applyRotateEuler(alpha,beta,gamma); spmm.applyRotateEuler(alpha,beta,gamma); - - EvtRaritaSchwinger sp0=spRS(0); - EvtRaritaSchwinger sp1=spRS(1); - EvtRaritaSchwinger sp2=spRS(2); - EvtRaritaSchwinger sp3=spRS(3); - EvtSpinDensity R; R.SetDim(4); ! ! R.Set(0,0,(sppp*sp0)/sqrt(2*m)); ! R.Set(0,1,(sppp*sp1)/sqrt(2*m)); ! R.Set(0,2,(sppp*sp2)/sqrt(2*m)); ! R.Set(0,3,(sppp*sp3)/sqrt(2*m)); ! ! R.Set(1,0,(spp*sp0)/sqrt(2*m)); ! R.Set(1,1,(spp*sp1)/sqrt(2*m)); ! R.Set(1,2,(spp*sp2)/sqrt(2*m)); ! R.Set(1,3,(spp*sp3)/sqrt(2*m)); ! ! R.Set(2,0,(spm*sp0)/sqrt(2*m)); ! R.Set(2,1,(spm*sp1)/sqrt(2*m)); ! R.Set(2,2,(spm*sp2)/sqrt(2*m)); ! R.Set(2,3,(spm*sp3)/sqrt(2*m)); ! ! R.Set(3,0,(spmm*sp0)/sqrt(2*m)); ! R.Set(3,1,(spmm*sp1)/sqrt(2*m)); ! R.Set(3,2,(spmm*sp2)/sqrt(2*m)); ! R.Set(3,3,(spmm*sp3)/sqrt(2*m)); return R; --- 170,193 ---- EvtRaritaSchwinger spm=dirProd(sqrt(2.0/3.0)*ezero,spminus)+ dirProd(sqrt(1.0/3.0)*eminus,spplus); EvtRaritaSchwinger spmm=dirProd(eminus,spminus); + // sppp.applyRotateEuler(alpha,beta,gamma); spp.applyRotateEuler(alpha,beta,gamma); spm.applyRotateEuler(alpha,beta,gamma); spmm.applyRotateEuler(alpha,beta,gamma); EvtSpinDensity R; R.SetDim(4); ! ! double sqmt2=sqrt(2.0*(this->getP4().mass())); ! ! for ( int i=0; i<4; i++) { ! R.Set(0,i,(sppp*_spinorRest[i])/sqmt2); ! R.Set(1,i,(spp*_spinorRest[i])/sqmt2); ! R.Set(2,i,(spm*_spinorRest[i])/sqmt2); ! R.Set(3,i,(spmm*_spinorRest[i])/sqmt2); ! } return R; Index: Class/EvtRelBreitWignerBarrierFact.cc =================================================================== RCS file: /nfs/cleo3/cvsroot/Offline/src/EvtGenBase/Class/EvtRelBreitWignerBarrierFact.cc,v retrieving revision 1.1.1.1 retrieving revision 1.5 diff -c -r1.1.1.1 -r1.5 *** Class/EvtRelBreitWignerBarrierFact.cc 7 Oct 2003 02:47:13 -0000 1.1.1.1 --- Class/EvtRelBreitWignerBarrierFact.cc 6 Jun 2006 17:15:56 -0000 1.5 *************** *** 18,29 **** // Dvoretskii June 03, 2002 Reimplemented rollMass() // //------------------------------------------------------------------------ #include "EvtGenBase/EvtPatches.hh" #include "EvtGenBase/EvtPredGen.hh" - //12x - //#include "EvtGenBase/EvtAlgo.hh" #include "EvtGenBase/EvtRelBreitWignerBarrierFact.hh" #include "EvtGenBase/EvtTwoBodyVertex.hh" --- 18,28 ---- // Dvoretskii June 03, 2002 Reimplemented rollMass() // //------------------------------------------------------------------------ + #include "Experiment/Experiment.h" #include "EvtGenBase/EvtPatches.hh" #include "EvtGenBase/EvtPredGen.hh" #include "EvtGenBase/EvtRelBreitWignerBarrierFact.hh" #include "EvtGenBase/EvtTwoBodyVertex.hh" *************** *** 32,37 **** --- 31,37 ---- #include "EvtGenBase/EvtAmpPdf.hh" #include "EvtGenBase/EvtMassAmp.hh" #include "EvtGenBase/EvtSpinType.hh" + #include "EvtGenBase/EvtIntervalFlatPdf.hh" #include EvtRelBreitWignerBarrierFact::EvtRelBreitWignerBarrierFact() { *************** *** 51,56 **** --- 51,57 ---- _spin=sp; _blatt=3.0; _maxRange=maxRange; + _errorCond=false; double maxdelta = 15.0*width; *************** *** 67,98 **** if ( _massMin< 0. ) _massMin=0.; } ! EvtRelBreitWignerBarrierFact::EvtRelBreitWignerBarrierFact(const EvtRelBreitWignerBarrierFact& x) { ! _mass=x._mass; ! _width=x._width; ! _spin=x._spin; _massMax=x._massMax; _massMin=x._massMin; _blatt=x._blatt; _maxRange=x._maxRange; _includeDecayFact=x._includeDecayFact; _includeBirthFact=x._includeBirthFact; } ! EvtRelBreitWignerBarrierFact& EvtRelBreitWignerBarrierFact::operator=(const EvtRelBreitWignerBarrierFact& x){ _mass=x._mass; _massMax=x._massMax; _massMin=x._massMin; - _width=x._width; _blatt=x._blatt; _maxRange=x._maxRange; - _spin=x._spin; _includeDecayFact=x._includeDecayFact; _includeBirthFact=x._includeBirthFact; return *this; - } EvtAbsLineShape* EvtRelBreitWignerBarrierFact::clone() { --- 68,99 ---- if ( _massMin< 0. ) _massMin=0.; } ! EvtRelBreitWignerBarrierFact::EvtRelBreitWignerBarrierFact(const EvtRelBreitWignerBarrierFact& x) : ! EvtAbsLineShape(x._mass,x._width,x._maxRange,x._spin) ! { _massMax=x._massMax; _massMin=x._massMin; _blatt=x._blatt; _maxRange=x._maxRange; _includeDecayFact=x._includeDecayFact; _includeBirthFact=x._includeBirthFact; + _errorCond=x._errorCond; } ! EvtRelBreitWignerBarrierFact& EvtRelBreitWignerBarrierFact::operator=(const EvtRelBreitWignerBarrierFact& x) { _mass=x._mass; + _width=x._width; + _spin=x._spin; _massMax=x._massMax; _massMin=x._massMin; _blatt=x._blatt; _maxRange=x._maxRange; _includeDecayFact=x._includeDecayFact; _includeBirthFact=x._includeBirthFact; + _errorCond=x._errorCond; return *this; } EvtAbsLineShape* EvtRelBreitWignerBarrierFact::clone() { *************** *** 103,108 **** --- 104,110 ---- double EvtRelBreitWignerBarrierFact::getMassProb(double mass, double massPar,int nDaug, double *massDau) { + _errorCond=false; //return EvtAbsLineShape::getMassProb(mass,massPar,nDaug,massDau); if (nDaug!=2) return EvtAbsLineShape::getMassProb(mass,massPar,nDaug,massDau); *************** *** 112,120 **** for (i=0; i massPar) return 0.; } + if ( _errorCond ) return 0.; + // we did all the work in getRandMass return 1.; } double EvtRelBreitWignerBarrierFact::getRandMass(EvtId *parId,int nDaug, EvtId *dauId, EvtId *othDaugId, double maxMass, double *dauMasses) { + if ( nDaug!=2) return EvtAbsLineShape::getRandMass(parId,nDaug,dauId,othDaugId,maxMass,dauMasses); if ( _width< 0.00001) return _mass; *************** *** 141,156 **** int t2=EvtSpinType::getSpin2(spinD2); int t3=EvtSpinType::getSpin2(_spin); ! //There are some things I don't know how to deal with ! if ( t3>4) return EvtAbsLineShape::getRandMass(parId,nDaug,dauId,othDaugId,maxMass,dauMasses); ! if ( t1>4) return EvtAbsLineShape::getRandMass(parId,nDaug,dauId,othDaugId,maxMass,dauMasses); ! if ( t2>4) return EvtAbsLineShape::getRandMass(parId,nDaug,dauId,othDaugId,maxMass,dauMasses); ! ! //figure the min and max allowwed "spins" for the daughters state ! int Lmin=std::max(t3-t2-t1,std::max(t2-t3-t1,t1-t3-t2)); ! if (Lmin<0) Lmin=0; ! assert(Lmin==0||Lmin==2||Lmin==4); //double massD1=EvtPDL::getMeanMass(dauId[0]); //double massD2=EvtPDL::getMeanMass(dauId[1]); --- 146,176 ---- int t2=EvtSpinType::getSpin2(spinD2); int t3=EvtSpinType::getSpin2(_spin); ! int Lmin=-10; ! ! // the user has overridden the partial wave to use. ! for ( size_t vC=0; vC<_userSetPW.size(); vC++) { ! if ( ( dauId[0]==_userSetPWD1[vC] && dauId[1]==_userSetPWD2[vC] ) || ! ( dauId[0]==_userSetPWD2[vC] && dauId[1]==_userSetPWD1[vC] ) ) { ! ! Lmin=2*_userSetPW[vC]; ! } ! } ! ! // allow for special cases. ! if (Lmin<-1 ) { ! ! //There are some things I don't know how to deal with ! if ( t3>4) return EvtAbsLineShape::getRandMass(parId,nDaug,dauId,othDaugId,maxMass,dauMasses); ! if ( t1>4) return EvtAbsLineShape::getRandMass(parId,nDaug,dauId,othDaugId,maxMass,dauMasses); ! if ( t2>4) return EvtAbsLineShape::getRandMass(parId,nDaug,dauId,othDaugId,maxMass,dauMasses); ! ! //figure the min and max allowwed "spins" for the daughters state ! Lmin=std::max(t3-t2-t1,std::max(t2-t3-t1,t1-t3-t2)); ! if (Lmin<0) Lmin=0; ! assert(Lmin==0||Lmin==2||Lmin==4); ! } //double massD1=EvtPDL::getMeanMass(dauId[0]); //double massD2=EvtPDL::getMeanMass(dauId[1]); *************** *** 183,188 **** --- 203,215 ---- } + // allow user to override + for ( size_t vC=0; vC<_userSetBirthPW.size(); vC++) { + if ( *othDaugId==_userSetBirthOthD[vC] && *parId==_userSetBirthPar[vC] ) { + birthl=2*_userSetBirthPW[vC]; + } + } + } double massM=_massMax; if ( (maxMass > -0.5) && (maxMass < massM) ) massM=maxMass; *************** *** 196,202 **** vd.set_f(_blatt); EvtPropBreitWignerRel bw(_mass,_width); EvtMassAmp amp(bw,vd); ! if ( _includeDecayFact) { amp.addDeathFact(); amp.addDeathFactFF(); --- 223,230 ---- vd.set_f(_blatt); EvtPropBreitWignerRel bw(_mass,_width); EvtMassAmp amp(bw,vd); ! if ( _fixMassForMax) amp.fixUpMassForMax(); ! else std::cout << "problem problem\n"; if ( _includeDecayFact) { amp.addDeathFact(); amp.addDeathFactFF(); *************** *** 205,210 **** --- 233,240 ---- if ( _includeBirthFact ) { EvtTwoBodyVertex vb(_mass,massOthD,massParent,birthl/2); + //whoops 060116 + vb.set_f(_blatt); amp.setBirthVtx(vb); amp.addBirthFact(); amp.addBirthFactFF(); *************** *** 212,218 **** } ! EvtAmpPdf pdf(amp); // Estimate maximum and create predicate for accept reject --- 242,248 ---- } ! EvtAmpPdf pdf(amp); // Estimate maximum and create predicate for accept reject *************** *** 223,247 **** if ( maxMass>-0.5 && maxMass<_massMax) tempMax=maxMass; double tempMinMass=_massMin; if ( massD1+massD2 > _massMin) tempMinMass=massD1+massD2; if ( tempMaxLoc < tempMinMass) tempMaxLoc=tempMinMass; ! EvtPdfMax max(1.2*pdf.evaluate(EvtPoint1D(tempMinMass,tempMax,tempMaxLoc))); ! EvtPdfMax max2(1.2*pdf.evaluate(EvtPoint1D(tempMinMass,tempMax,(0.1*tempMax+tempMinMass)))); ! EvtPdfPred pred(pdf); pred.setMax(max); - - // Interval generator and accept reject generator ! EvtInterval1D ival(tempMinMass,tempMax); ! EvtIntervalGen gen(ival); ! EvtPredGen,EvtPdfPred > accrej(gen,pred); ! //12x ! //EvtAccRejGen,EvtPdfPred > accrej(gen,pred); ! ! // if ( std::fabs(_mass-1.273) < 0.01 ) ! // report(INFO,"EvtGen") << massD1 << " " << massD2 << " " << _mass << " " << _width << " " << tempMax << " " << tempMinMass << " " << max.value() << " " << max2.value() << std::endl; ! EvtPoint1D point = accrej(); return point.value(); }; --- 253,279 ---- if ( maxMass>-0.5 && maxMass<_massMax) tempMax=maxMass; double tempMinMass=_massMin; if ( massD1+massD2 > _massMin) tempMinMass=massD1+massD2; + + //redo sanity check - is there a solution to our problem. + //if not return an error condition that is caught by the + //mass prob calculation above. + if ( tempMinMass > tempMax ) { + _errorCond=true; + return tempMinMass; + } + if ( tempMaxLoc < tempMinMass) tempMaxLoc=tempMinMass; ! EvtPdfMax max(1.4*pdf.evaluate(EvtPoint1D(tempMinMass,tempMax,tempMaxLoc))); ! // EvtPdfMax max2(1.4*pdf.evaluate(EvtPoint1D(tempMinMass,tempMax,(0.1*tempMax+tempMinMass)))); ! EvtPdfPred pred(pdf); pred.setMax(max); ! EvtIntervalFlatPdf flat(tempMinMass,tempMax); ! EvtPdfGen gen(flat); ! EvtPredGen,EvtPdfPred > predgen(gen,pred); + EvtPoint1D point = predgen(); return point.value(); }; Index: Class/EvtReport.cc =================================================================== RCS file: /nfs/cleo3/cvsroot/Offline/src/EvtGenBase/Class/EvtReport.cc,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -c -r1.1.1.1 -r1.2 *** Class/EvtReport.cc 7 Oct 2003 02:47:13 -0000 1.1.1.1 --- Class/EvtReport.cc 12 Jan 2006 16:08:24 -0000 1.2 *************** *** 18,62 **** // //------------------------------------------------------------------------ // ! ! #if !defined(FILENAME_ONLY) /* relative path includes */ // system include files #include "EvtGenBase/EvtReport.hh" - // user include files - - #else /* filename-only includes */ - #include "functions.h" - #endif /* filename-only includes */ - // user include files // // constants, enums and typedefs // ! std::ostream& report( Severity severity , const char* facility ) { int printNoFacility=1; if ( ( facility == 0 ) && ( printNoFacility ==1) ) { ! std::cout << "There is no `facility' implemented in `report'" ! << std::endl ; printNoFacility = 0 ; } if ( severity < WARNING ) { if (facility[0]!=0){ ! std::cerr< #include "EvtGenBase/EvtVector4R.hh" #include "EvtGenBase/EvtKine.hh" *************** *** 25,30 **** --- 26,32 ---- #include "EvtGenBase/EvtResonance.hh" #include "EvtGenBase/EvtReport.hh" #include "EvtGenBase/EvtConst.hh" + using std::endl; EvtResonance::~EvtResonance(){} *************** *** 100,106 **** break; default: ! report(DEBUG,"EvtGen") << "EvtGen: wrong spin in EvtResonance" << std::endl; ampl = EvtComplex(0.0); break; --- 102,108 ---- break; default: ! report(DEBUG,"EvtGen") << "EvtGen: wrong spin in EvtResonance" << endl; ampl = EvtComplex(0.0); break; Index: Class/EvtResonance2.cc =================================================================== RCS file: /nfs/cleo3/cvsroot/Offline/src/EvtGenBase/Class/EvtResonance2.cc,v retrieving revision 1.1.1.1 retrieving revision 1.4 diff -c -r1.1.1.1 -r1.4 *** Class/EvtResonance2.cc 7 Oct 2003 02:47:14 -0000 1.1.1.1 --- Class/EvtResonance2.cc 21 Mar 2008 18:20:25 -0000 1.4 *************** *** 18,23 **** --- 18,24 ---- // //------------------------------------------------------------------------ // + #include "Experiment/Experiment.h" #include #include "EvtGenBase/EvtVector4R.hh" #include "EvtGenBase/EvtKine.hh" *************** *** 48,56 **** EvtResonance2::EvtResonance2(const EvtVector4R& p4_p, const EvtVector4R& p4_d1, const EvtVector4R& p4_d2, double ampl, ! double theta, double gamma, double bwm, int spin): _p4_p(p4_p),_p4_d1(p4_d1), _p4_d2(p4_d2),_ampl(ampl), _theta(theta), ! _gamma(gamma), _bwm(bwm), _spin(spin) {} //amplitude function --- 49,58 ---- EvtResonance2::EvtResonance2(const EvtVector4R& p4_p, const EvtVector4R& p4_d1, const EvtVector4R& p4_d2, double ampl, ! double theta, double gamma, double bwm, int spin, ! bool invmass_angdenom): _p4_p(p4_p),_p4_d1(p4_d1), _p4_d2(p4_d2),_ampl(ampl), _theta(theta), ! _gamma(gamma), _bwm(bwm), _spin(spin), _invmass_angdenom(invmass_angdenom) {} //amplitude function *************** *** 70,76 **** //listed particles (12) //angle 3 makes with 2 in rest frame of 12 (CS3) ! double cos_phi_0 = EvtDecayAngle(_p4_p, _p4_d1+_p4_d2, _p4_d1); //angle 3 makes with 1 in 12 is, of course, -cos_phi_0 //first compute several quantities...follow CLEO preprint 00-23 --- 72,78 ---- //listed particles (12) //angle 3 makes with 2 in rest frame of 12 (CS3) ! //double cos_phi_0 = EvtDecayAngle(_p4_p, _p4_d1+_p4_d2, _p4_d1); //angle 3 makes with 1 in 12 is, of course, -cos_phi_0 //first compute several quantities...follow CLEO preprint 00-23 *************** *** 84,89 **** --- 86,92 ---- double mC=p4_d3.mass(); double mR=_bwm; + double mdenom = _invmass_angdenom ? mAB : mR; double gammaR=_gamma; double pAB=sqrt( (((mAB*mAB-mA*mA-mB*mB)*(mAB*mAB-mA*mA-mB*mB)/4.0) - mA*mA*mB*mB)/(mAB*mAB)); *************** *** 98,127 **** // report(INFO,"EvtGen") << mAB<<" "<< mBC<<" "<< mAC<<" "<< mA<<" "<< mB<<" "<< mC<<" " ! // << mD<<" "<< mR<<" "<< gammaR<<" "<< pAB<<" "<< pR<<" "<< pD<<" "< #include + #include "EvtGenBase/EvtPatches.hh" #include "EvtGenBase/EvtScalarParticle.hh" #include "EvtGenBase/EvtVector4R.hh" Index: Class/EvtSecondary.cc =================================================================== RCS file: /nfs/cleo3/cvsroot/Offline/src/EvtGenBase/Class/EvtSecondary.cc,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -c -r1.1.1.1 -r1.2 *** Class/EvtSecondary.cc 7 Oct 2003 02:47:14 -0000 1.1.1.1 --- Class/EvtSecondary.cc 12 Jan 2006 16:08:24 -0000 1.2 *************** *** 18,29 **** --- 18,32 ---- // //------------------------------------------------------------------------ // + #include "Experiment/Experiment.h" #include "EvtGenBase/EvtPatches.hh" #include #include "EvtGenBase/EvtParticle.hh" #include "EvtGenBase/EvtPDL.hh" #include "EvtGenBase/EvtSecondary.hh" #include "EvtGenBase/EvtReport.hh" + using std::endl; + using std::ostream; void EvtSecondary::init(){ *************** *** 67,82 **** } report(ERROR,"EvtGen") << ! "More than 3 decay products in a secondary particle!"<prob) prob=probctl[1]; if (probctl[2]>prob) prob=probctl[2]; ! if (std::fabs(c)>1e-20){ double ctlx=-0.5*b/c; ! if (std::fabs(ctlx)<1.0){ double probtmp=a+b*ctlx+c*ctlx*ctlx; if (probtmp>prob) prob=probtmp; } --- 184,192 ---- if (probctl[1]>prob) prob=probctl[1]; if (probctl[2]>prob) prob=probctl[2]; ! if (fabs(c)>1e-20){ double ctlx=-0.5*b/c; ! if (fabs(ctlx)<1.0){ double probtmp=a+b*ctlx+c*ctlx*ctlx; if (probtmp>prob) prob=probtmp; } *************** *** 195,201 **** //report(DEBUG,"EvtGen") << "prob,probctl:"< maxfoundprob ) { maxfoundprob = prob; --- 196,202 ---- //report(DEBUG,"EvtGen") << "prob,probctl:"< maxfoundprob ) { maxfoundprob = prob; Index: Class/EvtSemiLeptonicBaryonAmp.cc =================================================================== RCS file: Class/EvtSemiLeptonicBaryonAmp.cc diff -N Class/EvtSemiLeptonicBaryonAmp.cc *** /dev/null 1 Jan 1970 00:00:00 -0000 --- Class/EvtSemiLeptonicBaryonAmp.cc 12 Jan 2006 16:08:24 -0000 1.1 *************** *** 0 **** --- 1,163 ---- + //-------------------------------------------------------------------------- + // + // Environment: + // This software is part of the EvtGen package developed jointly + // for the BaBar and CLEO collaborations. If you use all or part + // of it, please give an appropriate acknowledgement. + // + // Copyright Information: See EvtGen/COPYRIGHT + // Copyright (C) 1998 Caltech, UCSB + // + // Module: EvtSemiLeptonicBaryonAmp.cc + // + // Description: Routine to implement semileptonic decays to vector + // mesons. + // + // Modification history: + // + // Lange Oct 20, 2004 Module created. + // + //------------------------------------------------------------------------ + // + #include "Experiment/Experiment.h" + #include "EvtGenBase/EvtPatches.hh" + #include "EvtGenBase/EvtParticle.hh" + #include "EvtGenBase/EvtGenKine.hh" + #include "EvtGenBase/EvtPDL.hh" + #include "EvtGenBase/EvtReport.hh" + #include "EvtGenBase/EvtTensor4C.hh" + #include "EvtGenBase/EvtVector4C.hh" + #include "EvtGenBase/EvtDiracSpinor.hh" + #include "EvtGenBase/EvtSemiLeptonicBaryonAmp.hh" + #include "EvtGenBase/EvtId.hh" + #include "EvtGenBase/EvtAmp.hh" + #include "EvtGenBase/EvtSemiLeptonicFF.hh" + #include "EvtGenBase/EvtGammaMatrix.hh" + using std::endl; + + void EvtSemiLeptonicBaryonAmp::CalcAmp( EvtParticle *parent, + EvtAmp& amp, + EvtSemiLeptonicFF *FormFactors ) { + + static EvtId EM=EvtPDL::getId("e-"); + static EvtId MUM=EvtPDL::getId("mu-"); + static EvtId TAUM=EvtPDL::getId("tau-"); + static EvtId EP=EvtPDL::getId("e+"); + static EvtId MUP=EvtPDL::getId("mu+"); + static EvtId TAUP=EvtPDL::getId("tau+"); + + + //Add the lepton and neutrino 4 momenta to find q2 + + EvtVector4R q = parent->getDaug(1)->getP4() + + parent->getDaug(2)->getP4(); + double q2 = (q.mass2()); + + double f1v,f1a,f2v,f2a; + double m_meson = parent->getDaug(0)->mass(); + + FormFactors->getbaryonff(parent->getId(), + parent->getDaug(0)->getId(), + q2, + m_meson, + &f1v, + &f1a, + &f2v, + &f2a); + + EvtVector4R p4b; + p4b.set(parent->mass(),0.0,0.0,0.0); + + EvtVector4C temp_00_term1; + EvtVector4C temp_00_term2; + + EvtVector4C temp_01_term1; + EvtVector4C temp_01_term2; + + EvtVector4C temp_10_term1; + EvtVector4C temp_10_term2; + + EvtVector4C temp_11_term1; + EvtVector4C temp_11_term2; + + EvtDiracSpinor p0=parent->sp(0); + EvtDiracSpinor p1=parent->sp(1); + + EvtDiracSpinor d0=parent->getDaug(0)->spParent(0); + EvtDiracSpinor d1=parent->getDaug(0)->spParent(1); + + temp_00_term1.set(0,f1v*(d0*(EvtGammaMatrix::g0()*p0))); + temp_00_term2.set(0,f1a*(d0*((EvtGammaMatrix::g0()*EvtGammaMatrix::g5())*p0))); + temp_01_term1.set(0,f1v*(d0*(EvtGammaMatrix::g0()*p1))); + temp_01_term2.set(0,f1a*(d0*((EvtGammaMatrix::g0()*EvtGammaMatrix::g5())*p1))); + temp_10_term1.set(0,f1v*(d1*(EvtGammaMatrix::g0()*p0))); + temp_10_term2.set(0,f1a*(d1*((EvtGammaMatrix::g0()*EvtGammaMatrix::g5())*p0))); + temp_11_term1.set(0,f1v*(d1*(EvtGammaMatrix::g0()*p1))); + temp_11_term2.set(0,f1a*(d1*((EvtGammaMatrix::g0()*EvtGammaMatrix::g5())*p1))); + + temp_00_term1.set(1,f1v*(d0*(EvtGammaMatrix::g1()*p0))); + temp_00_term2.set(1,f1a*(d0*((EvtGammaMatrix::g1()*EvtGammaMatrix::g5())*p0))); + temp_01_term1.set(1,f1v*(d0*(EvtGammaMatrix::g1()*p1))); + temp_01_term2.set(1,f1a*(d0*((EvtGammaMatrix::g1()*EvtGammaMatrix::g5())*p1))); + temp_10_term1.set(1,f1v*(d1*(EvtGammaMatrix::g1()*p0))); + temp_10_term2.set(1,f1a*(d1*((EvtGammaMatrix::g1()*EvtGammaMatrix::g5())*p0))); + temp_11_term1.set(1,f1v*(d1*(EvtGammaMatrix::g1()*p1))); + temp_11_term2.set(1,f1a*(d1*((EvtGammaMatrix::g1()*EvtGammaMatrix::g5())*p1))); + + temp_00_term1.set(2,f1v*(d0*(EvtGammaMatrix::g2()*p0))); + temp_00_term2.set(2,f1a*(d0*((EvtGammaMatrix::g2()*EvtGammaMatrix::g5())*p0))); + temp_01_term1.set(2,f1v*(d0*(EvtGammaMatrix::g2()*p1))); + temp_01_term2.set(2,f1a*(d0*((EvtGammaMatrix::g2()*EvtGammaMatrix::g5())*p1))); + temp_10_term1.set(2,f1v*(d1*(EvtGammaMatrix::g2()*p0))); + temp_10_term2.set(2,f1a*(d1*((EvtGammaMatrix::g2()*EvtGammaMatrix::g5())*p0))); + temp_11_term1.set(2,f1v*(d1*(EvtGammaMatrix::g2()*p1))); + temp_11_term2.set(2,f1a*(d1*((EvtGammaMatrix::g2()*EvtGammaMatrix::g5())*p1))); + + temp_00_term1.set(3,f1v*(d0*(EvtGammaMatrix::g3()*p0))); + temp_00_term2.set(3,f1a*(d0*((EvtGammaMatrix::g3()*EvtGammaMatrix::g5())*p0))); + temp_01_term1.set(3,f1v*(d0*(EvtGammaMatrix::g3()*p1))); + temp_01_term2.set(3,f1a*(d0*((EvtGammaMatrix::g3()*EvtGammaMatrix::g5())*p1))); + temp_10_term1.set(3,f1v*(d1*(EvtGammaMatrix::g3()*p0))); + temp_10_term2.set(3,f1a*(d1*((EvtGammaMatrix::g3()*EvtGammaMatrix::g5())*p0))); + temp_11_term1.set(3,f1v*(d1*(EvtGammaMatrix::g3()*p1))); + temp_11_term2.set(3,f1a*(d1*((EvtGammaMatrix::g3()*EvtGammaMatrix::g5())*p1))); + + + + EvtVector4C l1,l2; + + EvtId l_num = parent->getDaug(1)->getId(); + if (l_num==EM||l_num==MUM||l_num==TAUM){ + + l1=EvtLeptonVACurrent(parent->getDaug(1)->spParent(0), + parent->getDaug(2)->spParentNeutrino()); + l2=EvtLeptonVACurrent(parent->getDaug(1)->spParent(1), + parent->getDaug(2)->spParentNeutrino()); + } + else{ + if (l_num==EP||l_num==MUP||l_num==TAUP){ + l1=EvtLeptonVACurrent(parent->getDaug(2)->spParentNeutrino(), + parent->getDaug(1)->spParent(0)); + l2=EvtLeptonVACurrent(parent->getDaug(2)->spParentNeutrino(), + parent->getDaug(1)->spParent(1)); + } + else{ + report(ERROR,"EvtGen") << "Wrong lepton number"<getDaug(1)->spParent(1)); } else{ ! report(ERROR,"EvtGen") << "Wrong lepton number"<getDaug(1)->spParent(1)); } else{ ! report(ERROR,"EvtGen") << "Wrong lepton number"< index = amp.iterinit(); + + os << ":"; + do { + os<<"<"; + for(size_t i=0; i"< EvtSpinAmp::calctwospin( const vector& type ) const + { + vector twospin; + + for( size_t i=0; i& type ) + { + int num = 1; + _type = type; + _twospin=calctwospin( type ); + + for( size_t i=0; i<_twospin.size(); ++i ) { + num*=_twospin[i]+1; + } + + _elem=vector( num ); + } + + EvtSpinAmp::EvtSpinAmp( const vector& type, const EvtComplex & val ) + { + int num = 1; + _type = type; + _twospin=calctwospin( type ); + + for( size_t i=0; i<_twospin.size(); ++i ) { + num*=_twospin[i]+1; + } + + _elem=vector( num, val ); + } + + EvtSpinAmp::EvtSpinAmp( const vector& type, + const vector& elem ) + { + int num = 1; + + _type = type; + _twospin=calctwospin( type ); + _elem=elem; + + for( size_t i=0; i<_twospin.size(); ++i ) { + num*=_twospin[i]+1; + } + + if(static_cast(_elem.size()) != num ) { + report(ERROR,"EvtGen")<<"Wrong number of elements input:" + <<_elem.size()<<" vs. "<& twospin ) const + { + if( _twospin == twospin ) + return; + + report( ERROR, "EvtGen" ) + <<"Dimension or order of tensors being operated on does not match" + <& index ) const + { + if( index.size()==0 ) { + report(ERROR,"EvtGen") << "EvtSpinAmp can't handle no indices" << endl; + ::abort(); + } + + if( index.size() != _twospin.size() ) { + report( ERROR, "EvtGen" ) << "Rank of EvtSpinAmp index does not match: " + <<_twospin.size()<<" expected "<=abs(index[i]) && _twospin[i]%2==index[i]%2 ) + continue; + report(ERROR,"EvtGen")<<"EvtSpinAmp index out of range" << endl; + report(ERROR,"EvtGen")<<" Index: "; + for(size_t j=0; j<_twospin.size(); ++j ) { + report(ERROR," ")<<_twospin[j]; + } + + report(ERROR, " ")<& index ) const + { + int trueindex = 0; + + for( size_t i = index.size()-1; i>0; --i ) { + trueindex += (index[i]+_twospin[i])/2; + trueindex *= _twospin[i-1]+1; + } + + trueindex += (index[0]+_twospin[0])/2; + + return trueindex; + } + + EvtComplex & EvtSpinAmp::operator()( const vector& index ) + { + checkindexargs( index ); + + size_t trueindex = findtrueindex(index); + if(trueindex >= _elem.size()) { + report(ERROR,"EvtGen")<<"indexing error "<& index ) const + { + checkindexargs( index ); + + size_t trueindex = findtrueindex(index); + if(trueindex >= _elem.size()) { + report(ERROR,"EvtGen")<<"indexing error "< index( _twospin.size() ); + + va_start(ap, i); + + index[0]=i; + for(size_t n=1; n<_twospin.size(); ++n ) { + index[n]=va_arg( ap, int ); + } + + va_end(ap); + + return (*this)( index ); + } + + const EvtComplex & EvtSpinAmp::operator()( int i, ... ) const + { + vector index( _twospin.size() ); + va_list ap; + + va_start(ap, i); + + index[0]=i; + for(size_t n=1; n<_twospin.size(); ++n ) { + index[n]=va_arg( ap, int ); + } + + va_end(ap); + + return (*this)( index ); + } + + EvtSpinAmp& EvtSpinAmp::operator=( const EvtSpinAmp& cont ) + { + _twospin=cont._twospin; + _elem=cont._elem; + _type=cont._type; + + return *this; + } + + EvtSpinAmp EvtSpinAmp::operator+( const EvtSpinAmp & cont ) const + { + checktwospin( cont._twospin ); + + EvtSpinAmp ret( cont ); + for( size_t i=0; i index(rank()+amp2.rank()); + vector index1(rank()), index2(amp2.rank()); + EvtSpinAmp amp; + + amp._twospin=_twospin; + amp._type=_type; + + for( size_t i=0; i( _elem.size() * amp2._elem.size() ); + + for( size_t i=0; i EvtSpinAmp::iterinit() const + { + vector init( _twospin.size() ); + + for( size_t i=0; i<_twospin.size(); ++i ) + init[i]=-_twospin[i]; + + return init; + } + + bool EvtSpinAmp::iterate( vector& index ) const + { + size_t last = _twospin.size() - 1; + + index[0]+=2; + for( size_t j=0; j _twospin[j] ) { + index[j] = -_twospin[j]; + index[j+1]+=2; + } + } + + return abs(index[last])<=_twospin[last]; + } + + // Test whether a particular index is an allowed one (specifically to deal with + // photons and possibly neutrinos) + bool EvtSpinAmp::allowed( const vector& index ) const + { + if( index.size() != _type.size() ) { + report(ERROR,"EvtGen") + <<"Wrong dimensino index input to allowed."<& index ) const + { + while(true) { + if(!iterate( index )) + return false; + if(allowed( index )) + return true; + } + } + + vector EvtSpinAmp::iterallowedinit() const + { + vector init = iterinit(); + while(!allowed(init)) { + iterate(init); + } + + return init; + } + + void EvtSpinAmp::intcont( int a, int b ) + { + int newrank=rank()-2; + if(newrank<=0) { + report(ERROR,"EvtGen")<<"EvtSpinAmp can't handle no indices" << endl; + ::abort(); + } + + if(_twospin[a]!=_twospin[b]) { + report(ERROR,"EvtGen") + <<"Contaction called on indices of different dimension" + < newtwospin( newrank ); + vector newtype( newrank ); + + for( int i=0, j=0; i < static_cast(_twospin.size()); ++i ){ + if(i==a || i==b) continue; + + newtwospin[j] = _twospin[i]; + newtype[j] = _type[i]; + ++j; + } + + EvtSpinAmp newamp( newtype ); + vector index( rank() ), newindex = newamp.iterinit(); + + for( int i=0; i #include #include *************** *** 25,30 **** --- 26,33 ---- #include "EvtGenBase/EvtComplex.hh" #include "EvtGenBase/EvtSpinDensity.hh" #include "EvtGenBase/EvtReport.hh" + using std::endl; + using std::ostream; EvtSpinDensity::EvtSpinDensity(const EvtSpinDensity& density){ *************** *** 124,130 **** double norm=0.0; if (dim!=d.dim) { ! report(ERROR,"EvtGen")<<"Not matching dimensions in NormalizedProb"<0.00000001*real(prob)) { ! report(ERROR,"EvtGen")<<"Imaginary probability:"<0.00000001*real(prob)) { ! report(ERROR,"EvtGen")<<"Imaginary probability:"<abs(rho[i][i])) { ! report(INFO,"EvtGen") << "Failing 1"< 0.00000001*(abs(rho[i][i])+abs(rho[j][j]))) { ! report(INFO,"EvtGen") << "Failing 2"< 0.00000001*(abs(rho[i][i])+abs(rho[j][j]))) { ! report(INFO,"EvtGen") << "Failing 3"<abs(rho[i][i])) { ! report(INFO,"EvtGen") << "Failing 1"< 0.00000001*(abs(rho[i][i])+abs(rho[j][j]))) { ! report(INFO,"EvtGen") << "Failing 2"< 0.00000001*(abs(rho[i][i])+abs(rho[j][j]))) { ! report(INFO,"EvtGen") << "Failing 3"< #include #include "EvtGenBase/EvtVector4R.hh" #include "EvtGenBase/EvtStdHep.hh" - //typedef long std::_Ios_Fmtflags; void EvtStdHep::init(){ _npart=0; --- 17,33 ---- // RYD March 11, 1998 Module created // //------------------------------------------------------------------------ + #include "Experiment/Experiment.h" #include #include #include "EvtGenBase/EvtVector4R.hh" #include "EvtGenBase/EvtStdHep.hh" + using std::endl; + using std::ios; + using std::ostream; + using std::setiosflags; void EvtStdHep::init(){ _npart=0; *************** *** 71,86 **** } /* ! std::ostream& operator<<(std::ostream& s, const EvtStdHep& stdhep){ int w=s.width(); int p=s.precision(); ! std::_Ios_Fmtflags f=s.flags(); ! s < #include #include #include "EvtGenBase/EvtStringParticle.hh" #include "EvtGenBase/EvtVector4R.hh" + #include "EvtGenBase/EvtReport.hh" EvtStringParticle::~EvtStringParticle(){ Index: Class/EvtSymTable.cc =================================================================== RCS file: /nfs/cleo3/cvsroot/Offline/src/EvtGenBase/Class/EvtSymTable.cc,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -c -r1.1.1.1 -r1.2 *** Class/EvtSymTable.cc 7 Oct 2003 02:47:14 -0000 1.1.1.1 --- Class/EvtSymTable.cc 12 Jan 2006 16:08:25 -0000 1.2 *************** *** 18,23 **** --- 18,24 ---- // //------------------------------------------------------------------------ // + #include "Experiment/Experiment.h" #include #include #include *************** *** 25,30 **** --- 26,35 ---- #include "EvtGenBase/EvtSymTable.hh" #include "EvtGenBase/EvtReport.hh" #include + using std::endl; + using std::fstream; + + std::map EvtSymTable::_symMap; EvtSymTable::~EvtSymTable(){} *************** *** 35,45 **** void EvtSymTable::Define(const std::string& symname,std::string d) { - int i; - if ( _symMap.find(symname)!=_symMap.end() ) { report(INFO,"EvtGen") << "Symbol:"< #include #include "EvtGenBase/EvtComplex.hh" #include "EvtGenBase/EvtVector3C.hh" #include "EvtGenBase/EvtTensor3C.hh" #include "EvtGenBase/EvtReport.hh" + using std::endl; + using std::ostream; EvtTensor3C::~EvtTensor3C(){} *************** *** 332,342 **** } ! std::ostream& operator<<(std::ostream& s,const EvtTensor3C& v){ ! s< #include #include #include "EvtGenBase/EvtComplex.hh" #include "EvtGenBase/EvtVector4C.hh" #include "EvtGenBase/EvtTensor4C.hh" + using std::endl; + using std::ostream; *************** *** 198,224 **** } - EvtTensor4C::EvtTensor4C(){ - - // int i,j; - - // for(i=0;i<4;i++){ - // for(j=0;j<4;j++){ - // t[i][j]=EvtComplex(0.0,0.0); - // } - // } - - } ! std::ostream& operator<<(std::ostream& s,const EvtTensor4C& t){ int i,j; ! s<< std::endl; for(i=0;i<4;i++){ for(j=0;j<4;j++){ s << t.t[i][j]; } ! s << std::endl; } return s; } --- 201,216 ---- } ! ostream& operator<<(ostream& s,const EvtTensor4C& t){ int i,j; ! s<< endl; for(i=0;i<4;i++){ for(j=0;j<4;j++){ s << t.t[i][j]; } ! s << endl; } return s; } *************** *** 242,265 **** t[3][2] = EvtComplex(0.0); } - EvtTensor4C::EvtTensor4C(double g00, double g11, double g22, double g33){ - t[0][0]=EvtComplex(g00); - t[1][1]=EvtComplex(g11); - t[2][2]=EvtComplex(g22); - t[3][3]=EvtComplex(g33); - t[0][1] = EvtComplex(0.0); - t[0][2] = EvtComplex(0.0); - t[0][3] = EvtComplex(0.0); - t[1][0] = EvtComplex(0.0); - t[1][2] = EvtComplex(0.0); - t[1][3] = EvtComplex(0.0); - t[2][0] = EvtComplex(0.0); - t[2][1] = EvtComplex(0.0); - t[2][3] = EvtComplex(0.0); - t[3][0] = EvtComplex(0.0); - t[3][1] = EvtComplex(0.0); - t[3][2] = EvtComplex(0.0); - } EvtTensor4C& EvtTensor4C::operator+=(const EvtTensor4C& t2){ --- 234,239 ---- Index: Class/EvtTensorParticle.cc =================================================================== RCS file: /nfs/cleo3/cvsroot/Offline/src/EvtGenBase/Class/EvtTensorParticle.cc,v retrieving revision 1.1.1.1 retrieving revision 1.3 diff -c -r1.1.1.1 -r1.3 *** Class/EvtTensorParticle.cc 7 Oct 2003 02:47:14 -0000 1.1.1.1 --- Class/EvtTensorParticle.cc 3 May 2006 15:04:24 -0000 1.3 *************** *** 18,23 **** --- 18,24 ---- // //------------------------------------------------------------------------ // + #include "Experiment/Experiment.h" #include #include #include *************** *** 46,93 **** setp(e,px,py,pz); setpart_num(part_n); ! eps1.setdiag(0.0,-1.0/sqrt(6.0),-1.0/sqrt(6.0), 2.0/sqrt(6.0)); ! eps2.setdiag(0.0,1.0/sqrt(2.0),-1.0/sqrt(2.0),0.0); ! eps3.setdiag(0.0,0.0,0.0,0.0); ! eps4.setdiag(0.0,0.0,0.0,0.0); ! eps5.setdiag(0.0,0.0,0.0,0.0); ! eps3.set(0,1,EvtComplex(0.0,0.0)); ! eps3.set(0,2,EvtComplex(0.0,0.0)); ! eps3.set(0,3,EvtComplex(0.0,0.0)); ! eps3.set(1,0,EvtComplex(0.0,0.0)); ! eps3.set(2,0,EvtComplex(0.0,0.0)); ! eps3.set(3,0,EvtComplex(0.0,0.0)); ! eps4.set(0,1,EvtComplex(0.0,0.0)); ! eps4.set(0,2,EvtComplex(0.0,0.0)); ! eps4.set(0,3,EvtComplex(0.0,0.0)); ! eps4.set(1,0,EvtComplex(0.0,0.0)); ! eps4.set(2,0,EvtComplex(0.0,0.0)); ! eps4.set(3,0,EvtComplex(0.0,0.0)); ! eps5.set(0,1,EvtComplex(0.0,0.0)); ! eps5.set(0,2,EvtComplex(0.0,0.0)); ! eps5.set(0,3,EvtComplex(0.0,0.0)); ! eps5.set(1,0,EvtComplex(0.0,0.0)); ! eps5.set(2,0,EvtComplex(0.0,0.0)); ! eps5.set(3,0,EvtComplex(0.0,0.0)); ! eps3.set(1,2,EvtComplex(1.0/sqrt(2.0),0.0)); ! eps3.set(2,1,EvtComplex(1.0/sqrt(2.0),0.0)); ! eps4.set(1,3,EvtComplex(1.0/sqrt(2.0),0.0)); ! eps4.set(3,1,EvtComplex(1.0/sqrt(2.0),0.0)); ! eps5.set(2,3,EvtComplex(1.0/sqrt(2.0),0.0)); ! eps5.set(3,2,EvtComplex(1.0/sqrt(2.0),0.0)); ! eps3.set(1,3,EvtComplex(0.0,0.0)); ! eps3.set(3,1,EvtComplex(0.0,0.0)); ! eps3.set(2,3,EvtComplex(0.0,0.0)); ! eps3.set(3,2,EvtComplex(0.0,0.0)); ! eps4.set(1,2,EvtComplex(0.0,0.0)); ! eps4.set(2,1,EvtComplex(0.0,0.0)); ! eps4.set(2,3,EvtComplex(0.0,0.0)); ! eps4.set(3,2,EvtComplex(0.0,0.0)); ! eps5.set(1,3,EvtComplex(0.0,0.0)); ! eps5.set(3,1,EvtComplex(0.0,0.0)); ! eps5.set(2,1,EvtComplex(0.0,0.0)); ! eps5.set(1,2,EvtComplex(0.0,0.0)); setLifetime(); --- 47,65 ---- setp(e,px,py,pz); setpart_num(part_n); ! eps[0].setdiag(0.0,-1.0/sqrt(6.0),-1.0/sqrt(6.0), 2.0/sqrt(6.0)); ! eps[1].setdiag(0.0,1.0/sqrt(2.0),-1.0/sqrt(2.0),0.0); ! eps[2].setdiag(0.0,0.0,0.0,0.0); ! eps[3].setdiag(0.0,0.0,0.0,0.0); ! eps[4].setdiag(0.0,0.0,0.0,0.0); ! ! eps[2].set(1,2,EvtComplex(1.0/sqrt(2.0),0.0)); ! eps[2].set(2,1,EvtComplex(1.0/sqrt(2.0),0.0)); ! eps[3].set(1,3,EvtComplex(1.0/sqrt(2.0),0.0)); ! eps[3].set(3,1,EvtComplex(1.0/sqrt(2.0),0.0)); ! eps[4].set(2,3,EvtComplex(1.0/sqrt(2.0),0.0)); ! eps[4].set(3,2,EvtComplex(1.0/sqrt(2.0),0.0)); setLifetime(); *************** *** 95,123 **** EvtTensor4C EvtTensorParticle::epsTensorParent(int i) const { ! EvtTensor4C temp; ! EvtVector4R p4_temp; ! ! switch (i){ ! case 0: ! temp = eps1; ! break; ! case 1: ! temp = eps2; ! break; ! case 2: ! temp = eps3; ! break; ! case 3: ! temp = eps4; ! break; ! case 4: ! temp = eps5; ! break; ! default: ! report(ERROR,"EvtGen") << "only 5 componets in EvtTensorParticle. ERROR \n"; ! ::abort(); ! } // switch temp.applyBoostTo(this->getP4()); return temp; --- 67,73 ---- EvtTensor4C EvtTensorParticle::epsTensorParent(int i) const { ! EvtTensor4C temp=eps[i]; temp.applyBoostTo(this->getP4()); return temp; *************** *** 127,151 **** EvtTensor4C EvtTensorParticle::epsTensor(int i) const { ! EvtTensor4C temp; ! ! switch (i){ ! case 0: ! return eps1; ! case 1: ! return eps2; ! case 2: ! return eps3; ! case 3: ! return eps4; ! case 4: ! return eps5; ! default: ! report(ERROR,"EvtGen") << "only 5 componets in EvtTensorParticle. ERROR \n"; ! ::abort(); ! } // switch ! ! return temp; } //eps --- 77,83 ---- EvtTensor4C EvtTensorParticle::epsTensor(int i) const { ! return eps[i]; } //eps *************** *** 154,226 **** EvtSpinDensity EvtTensorParticle::rotateToHelicityBasis() const{ ! EvtTensor4C epp,ep,ez,em,emm; - EvtVector4C eplus(0.0,-1.0/sqrt(2.0),EvtComplex(0.0,-1.0/sqrt(2.0)),0.0); - EvtVector4C ezero(0.0,0.0,0.0,1.0); - EvtVector4C eminus(0.0,1.0/sqrt(2.0),EvtComplex(0.0,-1.0/sqrt(2.0)),0.0); - - epp.zero(); - ep.zero(); - ez.zero(); - em.zero(); - emm.zero(); - - epp=directProd(eplus,eplus); - ep =(1/sqrt(2.0))*directProd(eplus,ezero) - +(1/sqrt(2.0))*directProd(ezero,eplus); - ez =(1/sqrt(6.0))*directProd(eplus,eminus) - +(2/sqrt(6.0))*directProd(ezero,ezero) - +(1/sqrt(6.0))*directProd(eminus,eplus); - em =(1/sqrt(2.0))*directProd(eminus,ezero) - +(1/sqrt(2.0))*directProd(ezero,eminus); - emm=directProd(eminus,eminus); - - epp=conj(epp); - ep=conj(ep); - ez=conj(ez); - em=conj(em); - emm=conj(emm); - - EvtTensor4C e1=epsTensor(0); - EvtTensor4C e2=epsTensor(1); - EvtTensor4C e3=epsTensor(2); - EvtTensor4C e4=epsTensor(3); - EvtTensor4C e5=epsTensor(4); EvtSpinDensity R; R.SetDim(5); ! R.Set(0,0,cont(epp,e1)); ! R.Set(0,1,cont(epp,e2)); ! R.Set(0,2,cont(epp,e3)); ! R.Set(0,3,cont(epp,e4)); ! R.Set(0,4,cont(epp,e5)); ! ! R.Set(1,0,cont(ep,e1)); ! R.Set(1,1,cont(ep,e2)); ! R.Set(1,2,cont(ep,e3)); ! R.Set(1,3,cont(ep,e4)); ! R.Set(1,4,cont(ep,e5)); ! ! R.Set(2,0,cont(ez,e1)); ! R.Set(2,1,cont(ez,e2)); ! R.Set(2,2,cont(ez,e3)); ! R.Set(2,3,cont(ez,e4)); ! R.Set(2,4,cont(ez,e5)); ! ! R.Set(3,0,cont(em,e1)); ! R.Set(3,1,cont(em,e2)); ! R.Set(3,2,cont(em,e3)); ! R.Set(3,3,cont(em,e4)); ! R.Set(3,4,cont(em,e5)); ! ! R.Set(4,0,cont(emm,e1)); ! R.Set(4,1,cont(emm,e2)); ! R.Set(4,2,cont(emm,e3)); ! R.Set(4,3,cont(emm,e4)); ! R.Set(4,4,cont(emm,e5)); ! return R; } --- 86,122 ---- EvtSpinDensity EvtTensorParticle::rotateToHelicityBasis() const{ ! static EvtVector4C eplus(0.0,-1.0/sqrt(2.0),EvtComplex(0.0,-1.0/sqrt(2.0)),0.0); ! static EvtVector4C ezero(0.0,0.0,0.0,1.0); ! static EvtVector4C eminus(0.0,1.0/sqrt(2.0),EvtComplex(0.0,-1.0/sqrt(2.0)),0.0); ! ! static EvtTensor4C dPpp(directProd(eplus,eplus)); ! static EvtTensor4C dPp0(directProd(eplus,ezero)); ! static EvtTensor4C dP0p(directProd(ezero,eplus)); ! static EvtTensor4C dPpm(directProd(eplus,eminus)); ! static EvtTensor4C dP00(directProd(ezero,ezero)); ! static EvtTensor4C dPmp(directProd(eminus,eplus)); ! static EvtTensor4C dPmm(directProd(eminus,eminus)); ! static EvtTensor4C dPm0(directProd(eminus,ezero)); ! static EvtTensor4C dP0m(directProd(ezero,eminus)); ! ! static EvtTensor4C es0(conj(dPpp)); ! static EvtTensor4C es1(conj((1/sqrt(2.0))*dPp0 +(1/sqrt(2.0))*dP0p)); ! static EvtTensor4C es2(conj((1/sqrt(6.0))*dPpm +(2/sqrt(6.0))*dP00 +(1/sqrt(6.0))*dPmp)); ! static EvtTensor4C es3(conj((1/sqrt(2.0))*dPm0 +(1/sqrt(2.0))*dP0m)); ! static EvtTensor4C es4(conj(dPmm)); EvtSpinDensity R; R.SetDim(5); ! for (int j=0; j<5; j++) { ! R.Set(0,j,cont(es0,eps[j])); ! R.Set(1,j,cont(es1,eps[j])); ! R.Set(2,j,cont(es2,eps[j])); ! R.Set(3,j,cont(es3,eps[j])); ! R.Set(4,j,cont(es4,eps[j])); ! } return R; } *************** *** 230,236 **** double beta, double gamma) const{ ! EvtTensor4C epp,ep,ez,em,emm; EvtVector4C eplus(0.0,-1.0/sqrt(2.0),EvtComplex(0.0,-1.0/sqrt(2.0)),0.0); EvtVector4C ezero(0.0,0.0,0.0,1.0); --- 126,132 ---- double beta, double gamma) const{ ! EvtTensor4C es[5]; EvtVector4C eplus(0.0,-1.0/sqrt(2.0),EvtComplex(0.0,-1.0/sqrt(2.0)),0.0); EvtVector4C ezero(0.0,0.0,0.0,1.0); *************** *** 240,314 **** ezero.applyRotateEuler(alpha,beta,gamma); eminus.applyRotateEuler(alpha,beta,gamma); ! ! epp.zero(); ! ep.zero(); ! ez.zero(); ! em.zero(); ! emm.zero(); ! epp=directProd(eplus,eplus); ! ep =(1/sqrt(2.0))*directProd(eplus,ezero) +(1/sqrt(2.0))*directProd(ezero,eplus); ! ez =(1/sqrt(6.0))*directProd(eplus,eminus) +(2/sqrt(6.0))*directProd(ezero,ezero) +(1/sqrt(6.0))*directProd(eminus,eplus); ! em =(1/sqrt(2.0))*directProd(eminus,ezero) +(1/sqrt(2.0))*directProd(ezero,eminus); ! emm=directProd(eminus,eminus); ! ! ! //epp.applyRotateEuler(alpha,beta,gamma); ! //ep.applyRotateEuler(alpha,beta,gamma); ! //ez.applyRotateEuler(alpha,beta,gamma); ! //em.applyRotateEuler(alpha,beta,gamma); ! //emm.applyRotateEuler(alpha,beta,gamma); ! ! epp=conj(epp); ! ep=conj(ep); ! ez=conj(ez); ! em=conj(em); ! emm=conj(emm); ! ! EvtTensor4C e1=epsTensor(0); ! EvtTensor4C e2=epsTensor(1); ! EvtTensor4C e3=epsTensor(2); ! EvtTensor4C e4=epsTensor(3); ! EvtTensor4C e5=epsTensor(4); EvtSpinDensity R; R.SetDim(5); ! R.Set(0,0,cont(epp,e1)); ! R.Set(0,1,cont(epp,e2)); ! R.Set(0,2,cont(epp,e3)); ! R.Set(0,3,cont(epp,e4)); ! R.Set(0,4,cont(epp,e5)); ! ! R.Set(1,0,cont(ep,e1)); ! R.Set(1,1,cont(ep,e2)); ! R.Set(1,2,cont(ep,e3)); ! R.Set(1,3,cont(ep,e4)); ! R.Set(1,4,cont(ep,e5)); ! ! R.Set(2,0,cont(ez,e1)); ! R.Set(2,1,cont(ez,e2)); ! R.Set(2,2,cont(ez,e3)); ! R.Set(2,3,cont(ez,e4)); ! R.Set(2,4,cont(ez,e5)); ! ! R.Set(3,0,cont(em,e1)); ! R.Set(3,1,cont(em,e2)); ! R.Set(3,2,cont(em,e3)); ! R.Set(3,3,cont(em,e4)); ! R.Set(3,4,cont(em,e5)); ! ! R.Set(4,0,cont(emm,e1)); ! R.Set(4,1,cont(emm,e2)); ! R.Set(4,2,cont(emm,e3)); ! R.Set(4,3,cont(emm,e4)); ! R.Set(4,4,cont(emm,e5)); return R; --- 136,161 ---- ezero.applyRotateEuler(alpha,beta,gamma); eminus.applyRotateEuler(alpha,beta,gamma); ! for (int i=0; i<5; i++) es[i].zero(); ! es[0]=directProd(eplus,eplus); ! es[1] =(1/sqrt(2.0))*directProd(eplus,ezero) +(1/sqrt(2.0))*directProd(ezero,eplus); ! es[2] =(1/sqrt(6.0))*directProd(eplus,eminus) +(2/sqrt(6.0))*directProd(ezero,ezero) +(1/sqrt(6.0))*directProd(eminus,eplus); ! es[3] =(1/sqrt(2.0))*directProd(eminus,ezero) +(1/sqrt(2.0))*directProd(ezero,eminus); ! es[4]=directProd(eminus,eminus); ! for (int i=0; i<5; i++) es[i]=conj(es[i]); EvtSpinDensity R; R.SetDim(5); ! for (int i=0; i<5; i++) ! for (int j=0; j<5; j++) ! R.Set(i,j,cont(es[i],eps[j])); return R; Index: Class/EvtTwoBodyKine.cc =================================================================== RCS file: /nfs/cleo3/cvsroot/Offline/src/EvtGenBase/Class/EvtTwoBodyKine.cc,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -c -r1.1.1.1 -r1.2 *** Class/EvtTwoBodyKine.cc 7 Oct 2003 02:47:14 -0000 1.1.1.1 --- Class/EvtTwoBodyKine.cc 12 Jan 2006 16:08:26 -0000 1.2 *************** *** 1,7 **** /******************************************************************************* * Project: BaBar detector at the SLAC PEP-II B-factory * Package: EvtGenBase ! * File: $Id: EvtTwoBodyKine.cc,v 1.1.1.1 2003/10/07 02:47:14 ryd Exp $ * Author: Alexei Dvoretskii, dvoretsk@slac.stanford.edu, 2001-2002 * * Copyright (C) 2002 Caltech --- 1,8 ---- + #include "Experiment/Experiment.h" /******************************************************************************* * Project: BaBar detector at the SLAC PEP-II B-factory * Package: EvtGenBase ! * File: $Id: EvtTwoBodyKine.cc,v 1.2 2006/01/12 16:08:26 ryd Exp $ * Author: Alexei Dvoretskii, dvoretsk@slac.stanford.edu, 2001-2002 * * Copyright (C) 2002 Caltech *************** *** 12,17 **** --- 13,20 ---- #include #include "EvtGenBase/EvtTwoBodyKine.hh" #include "EvtGenBase/EvtReport.hh" + using std::endl; + using std::ostream; EvtTwoBodyKine::EvtTwoBodyKine() *************** *** 23,29 **** { if(mAB < mA + mB) { ! report(INFO,"EvtGen") << mAB << " < " << mA << " + " << mB << std::endl; assert(0); } } --- 26,32 ---- { if(mAB < mA + mB) { ! report(INFO,"EvtGen") << mAB << " < " << mA << " + " << mB << endl; assert(0); } } *************** *** 87,101 **** } ! void EvtTwoBodyKine::print(std::ostream& os) const { ! os << " mA = " << _mA << std::endl; ! os << " mB = " << _mB << std::endl; ! os << "mAB = " << _mAB << std::endl; } ! std::ostream& operator<<(std::ostream& os, const EvtTwoBodyKine& p) { p.print(os); return os; --- 90,104 ---- } ! void EvtTwoBodyKine::print(ostream& os) const { ! os << " mA = " << _mA << endl; ! os << " mB = " << _mB << endl; ! os << "mAB = " << _mAB << endl; } ! ostream& operator<<(ostream& os, const EvtTwoBodyKine& p) { p.print(os); return os; Index: Class/EvtTwoBodyVertex.cc =================================================================== RCS file: /nfs/cleo3/cvsroot/Offline/src/EvtGenBase/Class/EvtTwoBodyVertex.cc,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -c -r1.1.1.1 -r1.2 *** Class/EvtTwoBodyVertex.cc 7 Oct 2003 02:47:15 -0000 1.1.1.1 --- Class/EvtTwoBodyVertex.cc 12 Jan 2006 16:08:26 -0000 1.2 *************** *** 1,7 **** /******************************************************************************* * Project: BaBar detector at the SLAC PEP-II B-factory * Package: EvtGenBase ! * File: $Id: EvtTwoBodyVertex.cc,v 1.1.1.1 2003/10/07 02:47:15 ryd Exp $ * Author: Alexei Dvoretskii, dvoretsk@slac.stanford.edu, 2001-2002 * * Copyright (C) 2002 Caltech --- 1,8 ---- + #include "Experiment/Experiment.h" /******************************************************************************* * Project: BaBar detector at the SLAC PEP-II B-factory * Package: EvtGenBase ! * File: $Id: EvtTwoBodyVertex.cc,v 1.2 2006/01/12 16:08:26 ryd Exp $ * Author: Alexei Dvoretskii, dvoretsk@slac.stanford.edu, 2001-2002 * * Copyright (C) 2002 Caltech *************** *** 12,17 **** --- 13,20 ---- #include #include "EvtGenBase/EvtMacros.hh" #include "EvtGenBase/EvtTwoBodyVertex.hh" + using std::endl; + using std::ostream; // Default ctor can sometimes be useful *************** *** 83,99 **** return ff; } ! void EvtTwoBodyVertex::print(std::ostream& os) const { ! os << " mA = " << mA() << std::endl; ! os << " mB = " << mB() << std::endl; ! os << "mAB = " << mAB() << std::endl; ! os << " L = " << _LL << std::endl; ! os << " p0 = " << _p0 << std::endl; } ! std::ostream& operator<<(std::ostream& os, const EvtTwoBodyVertex& v) { v.print(os); return os; --- 86,102 ---- return ff; } ! void EvtTwoBodyVertex::print(ostream& os) const { ! os << " mA = " << mA() << endl; ! os << " mB = " << mB() << endl; ! os << "mAB = " << mAB() << endl; ! os << " L = " << _LL << endl; ! os << " p0 = " << _p0 << endl; } ! ostream& operator<<(ostream& os, const EvtTwoBodyVertex& v) { v.print(os); return os; Index: Class/EvtValError.cc =================================================================== RCS file: /nfs/cleo3/cvsroot/Offline/src/EvtGenBase/Class/EvtValError.cc,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -c -r1.1.1.1 -r1.2 *** Class/EvtValError.cc 7 Oct 2003 02:47:15 -0000 1.1.1.1 --- Class/EvtValError.cc 12 Jan 2006 16:08:26 -0000 1.2 *************** *** 1,7 **** /******************************************************************************* * Project: BaBar detector at the SLAC PEP-II B-factory * Package: EvtGenBase ! * File: $Id: EvtValError.cc,v 1.1.1.1 2003/10/07 02:47:15 ryd Exp $ * Author: Alexei Dvoretskii, dvoretsk@slac.stanford.edu, 2001-2002 * * Copyright (C) 2002 Caltech --- 1,8 ---- + #include "Experiment/Experiment.h" /******************************************************************************* * Project: BaBar detector at the SLAC PEP-II B-factory * Package: EvtGenBase ! * File: $Id: EvtValError.cc,v 1.2 2006/01/12 16:08:26 ryd Exp $ * Author: Alexei Dvoretskii, dvoretsk@slac.stanford.edu, 2001-2002 * * Copyright (C) 2002 Caltech *************** *** 11,16 **** --- 12,19 ---- #include #include #include "EvtGenBase/EvtValError.hh" + using std::endl; + using std::ostream; EvtValError::EvtValError() : _valKnown(0), _val(0.), _errKnown(0), _err(0.) *************** *** 48,79 **** void EvtValError::operator*=(const EvtValError& other) { ! // First add errors in quadrature and modify error ! if(_errKnown && other._errKnown) { ! _err = _val * other._val * sqrt(prec()*prec() + other.prec() * other.prec()); ! } ! else { ! ! _errKnown = 0; ! } ! // modify the value ! ! assert(_valKnown); assert(other._valKnown); _val *= other._val; } ! void EvtValError::print(std::ostream& os) const { if(_valKnown) os << _val; else os << "Undef"; os << " +/- "; if(_errKnown) os << _err; else os << "Undef"; ! os << std::endl; } --- 51,89 ---- void EvtValError::operator*=(const EvtValError& other) { ! assert(_valKnown && other._valKnown); ! // Relative errors add in quadrature ! if(_errKnown && other._errKnown) _err = _val * other._val * sqrt(prec()*prec() + other.prec() * other.prec()); ! else _errKnown = 0; ! // Modify the value _val *= other._val; } + void EvtValError::operator/=(const EvtValError& other) + { + assert(_valKnown && other._valKnown && other._val != 0.); + + // Relative errors add in quadrature + if(_errKnown && other._errKnown) + _err = _val/other._val * sqrt(prec()*prec() + other.prec() * other.prec()); + else _errKnown = 0; + + // Modify the value + _val /= other._val; + } + ! void EvtValError::print(ostream& os) const { if(_valKnown) os << _val; else os << "Undef"; os << " +/- "; if(_errKnown) os << _err; else os << "Undef"; ! os << endl; } *************** *** 109,114 **** --- 119,131 ---- return ret; } + EvtValError operator/(const EvtValError& x1, const EvtValError& x2) + { + EvtValError ret(x1); + ret /= x2; + return ret; + } + EvtValError operator+(const EvtValError& x1, const EvtValError& x2) { *************** *** 134,140 **** } ! std::ostream& operator<<(std::ostream& os, const EvtValError& other) { other.print(os); return os; --- 151,157 ---- } ! ostream& operator<<(ostream& os, const EvtValError& other) { other.print(os); return os; Index: Class/EvtVector3C.cc =================================================================== RCS file: /nfs/cleo3/cvsroot/Offline/src/EvtGenBase/Class/EvtVector3C.cc,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -c -r1.1.1.1 -r1.2 *** Class/EvtVector3C.cc 7 Oct 2003 02:47:15 -0000 1.1.1.1 --- Class/EvtVector3C.cc 12 Jan 2006 16:08:26 -0000 1.2 *************** *** 18,27 **** --- 18,29 ---- // //------------------------------------------------------------------------ // + #include "Experiment/Experiment.h" #include #include #include "EvtGenBase/EvtComplex.hh" #include "EvtGenBase/EvtVector3C.hh" + using std::ostream; *************** *** 90,96 **** ! std::ostream& operator<<(std::ostream& s,const EvtVector3C& v){ s<<"("< #include #include "EvtGenBase/EvtVector3R.hh" + using std::ostream; *************** *** 69,75 **** v[2]=temp[2]; } ! std::ostream& operator<<(std::ostream& s,const EvtVector3R& v){ s<<"("< #include #include #include "EvtGenBase/EvtComplex.hh" #include "EvtGenBase/EvtVector4C.hh" + using std::ostream; EvtVector4C::EvtVector4C(){ *************** *** 151,157 **** } ! std::ostream& operator<<(std::ostream& s, const EvtVector4C& v){ s<<"("< #include #include #include "EvtGenBase/EvtVector4R.hh" #include "EvtGenBase/EvtVector3R.hh" + #include "EvtGenBase/EvtVector4C.hh" + #include "EvtGenBase/EvtTensor4C.hh" + + using std::ostream; *************** *** 92,98 **** } ! std::ostream& operator<<(std::ostream& s, const EvtVector4R& v){ s<<"("< #include #include *************** *** 36,44 **** setp(e,px,py,pz); setpart_num(part_n); ! eps1.set(0.0,1.0,0.0,0.0); ! eps2.set(0.0,0.0,1.0,0.0); ! eps3.set(0.0,0.0,0.0,1.0); setLifetime(); } --- 37,45 ---- setp(e,px,py,pz); setpart_num(part_n); ! _eps[0].set(0.0,1.0,0.0,0.0); ! _eps[1].set(0.0,0.0,1.0,0.0); ! _eps[2].set(0.0,0.0,0.0,1.0); setLifetime(); } *************** *** 49,127 **** setp(p4); setpart_num(part_n); ! eps1.set(0.0,1.0,0.0,0.0); ! eps2.set(0.0,0.0,1.0,0.0); ! eps3.set(0.0,0.0,0.0,1.0); setLifetime(); } - EvtVector4C EvtVectorParticle::epsParent(int i) const { - - EvtVector4C temp; - - switch(i) { - case 0: - temp=eps1; - break; - case 1: - temp=eps2; - break; - case 2: - temp=eps3; - break; - default: - report(ERROR,"EvtGen") <<"Error invalid vector number" - <getP4()); - } - - EvtVector4C EvtVectorParticle::eps(int i) const { - - switch(i) { - case 0: - return eps1; - case 1: - return eps2; - case 2: - return eps3; - default: - report(ERROR,"EvtGen") << "Error invalid number vector number:" - < #include #include *************** *** 28,44 **** double EvtdFunction::d(int j,int m1,int m2, double theta){ - //report(INFO,"EvtGen") << "j,m1,m2:"<|m1p| --- 29,38 ---- *************** *** 49,56 **** if ((m1p-m2p)%4!=0) signp=-signp; } - //report(INFO,"EvtGen") << "here11"<|m2| ! if (abs(m1) #include #include *************** *** 71,77 **** //fkw fact((_j+_m1)/2)*fact((_j-_m1)/2))/ //fkw (fact((_j+_m2-k)/2)*fact(k/2)*fact((_j-_m1-k)/2)*fact((k-_m2+_m1)/2)); ! //report(INFO,"EvtGen") << "k, coef:"< class EvtId; *************** *** 32,38 **** EvtAbsLineShape(); EvtAbsLineShape(double mass, double width, double maxRange, EvtSpinType::spintype sp); ! ~EvtAbsLineShape(); EvtAbsLineShape& operator=(const EvtAbsLineShape& x); EvtAbsLineShape(const EvtAbsLineShape& x); --- 34,40 ---- EvtAbsLineShape(); EvtAbsLineShape(double mass, double width, double maxRange, EvtSpinType::spintype sp); ! virtual ~EvtAbsLineShape(); EvtAbsLineShape& operator=(const EvtAbsLineShape& x); EvtAbsLineShape(const EvtAbsLineShape& x); *************** *** 52,61 **** --- 54,74 ---- virtual void reSetBlatt(double blatt) {}; void includeBirthFactor(bool yesno) { _includeBirthFact = yesno; } void includeDecayFactor(bool yesno) { _includeDecayFact = yesno; } + void setPWForDecay( int spin, EvtId d1, EvtId d2) { + _userSetPW.push_back(spin); + _userSetPWD1.push_back(d1); + _userSetPWD2.push_back(d2); + } + void setPWForBirthL( int spin, EvtId par, EvtId othD) { + _userSetBirthPW.push_back(spin); + _userSetBirthOthD.push_back(othD); + _userSetBirthPar.push_back(par); + } virtual double getRandMass(EvtId *parId, int nDaug, EvtId *dauId, EvtId *othDaugId,double maxMass, double *dauMasses); virtual double getMassProb(double mass, double massPar, int nDaug, double *massDau); + void fixForSP6() { _fixMassForMax=true;} protected: bool _includeDecayFact; *************** *** 65,72 **** --- 78,98 ---- double _massMax; double _width; double _maxRange; + + // allow for special cases where the default method of picking the + //lowest allowed partial wave for a decay is not the right answer. + // string is " " + //new 9/12/2003 Lange + std::vector _userSetPWD1,_userSetPWD2; + std::vector _userSetPW; + + // also do it for birth factors + std::vector _userSetBirthPar,_userSetBirthOthD; + std::vector _userSetBirthPW; + EvtSpinType::spintype _spin; + bool _fixMassForMax; }; #endif Index: EvtGenBase/EvtAbsRadCorr.hh =================================================================== RCS file: /nfs/cleo3/cvsroot/Offline/src/EvtGenBase/EvtGenBase/EvtAbsRadCorr.hh,v retrieving revision 1.1.1.1 retrieving revision 1.3 diff -c -r1.1.1.1 -r1.3 *** EvtGenBase/EvtAbsRadCorr.hh 7 Oct 2003 02:46:58 -0000 1.1.1.1 --- EvtGenBase/EvtAbsRadCorr.hh 7 Jun 2006 12:25:22 -0000 1.3 *************** *** 29,34 **** --- 29,35 ---- public: + virtual ~EvtAbsRadCorr() {} virtual void doRadCorr(EvtParticle *p)=0; private: Index: EvtGenBase/EvtAmpAmpPdf.hh =================================================================== RCS file: /nfs/cleo3/cvsroot/Offline/src/EvtGenBase/EvtGenBase/EvtAmpAmpPdf.hh,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -c -r1.1.1.1 -r1.2 *** EvtGenBase/EvtAmpAmpPdf.hh 7 Oct 2003 02:46:58 -0000 1.1.1.1 --- EvtGenBase/EvtAmpAmpPdf.hh 12 Jan 2006 16:09:51 -0000 1.2 *************** *** 1,7 **** /******************************************************************************* * Project: BaBar detector at the SLAC PEP-II B-factory * Package: EvtGenBase ! * File: $Id: EvtAmpAmpPdf.hh,v 1.1.1.1 2003/10/07 02:46:58 ryd Exp $ * Author: Alexei Dvoretskii, dvoretsk@slac.stanford.edu, 2001-2002 * * Copyright (C) 2002 Caltech --- 1,7 ---- /******************************************************************************* * Project: BaBar detector at the SLAC PEP-II B-factory * Package: EvtGenBase ! * File: $Id: EvtAmpAmpPdf.hh,v 1.2 2006/01/12 16:09:51 ryd Exp $ * Author: Alexei Dvoretskii, dvoretsk@slac.stanford.edu, 2001-2002 * * Copyright (C) 2002 Caltech *************** *** 20,36 **** enum {POSRE=0,NEGRE,POSIM,NEGIM}; ! template ! class EvtAmpAmpPdf : public EvtPdf { public: - typedef typename Interval::point_type Point; EvtAmpAmpPdf() {} ! EvtAmpAmpPdf(int type, const EvtAmplitude& amp1, const EvtAmplitude& amp2) ! : EvtPdf(), _type(type), _amp1(amp1.clone()), _amp2(amp2.clone()) {} ! EvtAmpAmpPdf(const EvtAmpAmpPdf& other) ! : EvtPdf(other), _type(other._type), COPY_PTR(_amp1), COPY_PTR(_amp2) {} virtual ~EvtAmpAmpPdf() { --- 20,35 ---- enum {POSRE=0,NEGRE,POSIM,NEGIM}; ! template ! class EvtAmpAmpPdf : public EvtPdf { public: EvtAmpAmpPdf() {} ! EvtAmpAmpPdf(int type, const EvtAmplitude& amp1, const EvtAmplitude& amp2) ! : EvtPdf(), _type(type), _amp1(amp1.clone()), _amp2(amp2.clone()) {} ! EvtAmpAmpPdf(const EvtAmpAmpPdf& other) ! : EvtPdf(other), _type(other._type), COPY_PTR(_amp1), COPY_PTR(_amp2) {} virtual ~EvtAmpAmpPdf() { *************** *** 38,46 **** delete _amp2; } ! virtual EvtAmpAmpPdf* clone() const { return new EvtAmpAmpPdf(*this); } ! virtual double pdf(const Point& p) const { EvtComplex amp1 = _amp1->evaluate(p); EvtComplex amp2 = _amp2->evaluate(p); --- 37,45 ---- delete _amp2; } ! virtual EvtAmpAmpPdf* clone() const { return new EvtAmpAmpPdf(*this); } ! virtual double pdf(const T& p) const { EvtComplex amp1 = _amp1->evaluate(p); EvtComplex amp2 = _amp2->evaluate(p); *************** *** 50,64 **** if(_type == NEGRE) return real(pr) < 0 ? -real(pr) : 0.; if(_type == POSIM) return imag(pr) > 0 ? imag(pr) : 0.; if(_type == NEGIM) return imag(pr) < 0 ? -imag(pr) : 0.; ! assert(0); } ! private: int _type; ! EvtAmplitude* _amp1; ! EvtAmplitude* _amp2; }; #endif --- 49,63 ---- if(_type == NEGRE) return real(pr) < 0 ? -real(pr) : 0.; if(_type == POSIM) return imag(pr) > 0 ? imag(pr) : 0.; if(_type == NEGIM) return imag(pr) < 0 ? -imag(pr) : 0.; ! assert(0); } ! private: int _type; ! EvtAmplitude* _amp1; ! EvtAmplitude* _amp2; }; #endif Index: EvtGenBase/EvtAmpFactory.hh =================================================================== RCS file: /nfs/cleo3/cvsroot/Offline/src/EvtGenBase/EvtGenBase/EvtAmpFactory.hh,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -c -r1.1.1.1 -r1.2 *** EvtGenBase/EvtAmpFactory.hh 7 Oct 2003 02:46:58 -0000 1.1.1.1 --- EvtGenBase/EvtAmpFactory.hh 12 Jan 2006 16:09:51 -0000 1.2 *************** *** 12,52 **** //------------------------------------------------------------------------ // Abstract amplitude factory parameterized by a vector of ! // strings. Derived classes construct the amplitude. The amplitude ! // factory is defined on a specific phase space interval and therefore ! // inherits from EvtIntervalFunc. #ifndef EVT_AMP_FACTORY_HH #define EVT_AMP_FACTORY_HH #include #include #include "EvtGenBase/EvtAmplitudeSum.hh" ! #include "EvtGenBase/EvtPoleCompPdfSum.hh" #include "EvtGenBase/EvtMultiChannelParser.hh" - #include "EvtGenBase/EvtFlatPdf.hh" #include "EvtGenBase/EvtAmpPdf.hh" #include "EvtGenBase/EvtPdfMax.hh" #include "EvtGenBase/EvtMacros.hh" ! template ! class EvtAmpFactory { ! public: - typedef typename Interval::point_type Point; - EvtAmpFactory() ! : _amp(0), _ampConj(0), _pc(0), _gen(0), _dm(0.) {} ! EvtAmpFactory(const EvtAmpFactory& other) : ! _amp(other._amp ? (EvtAmplitudeSum*) other._amp : 0), ! _ampConj(other._ampConj ? (EvtAmplitudeSum*) other._ampConj : 0), ! _pc(other._pc ? (EvtPoleCompPdfSum*) other._pc : 0), ! _gen(other._gen ? (EvtRandDistGen*) other._gen : 0), ! _dm(other._dm) {} virtual ~EvtAmpFactory() --- 12,48 ---- //------------------------------------------------------------------------ // Abstract amplitude factory parameterized by a vector of ! // strings. Derived classes construct the amplitude, and PDFs for sampling ! // points. #ifndef EVT_AMP_FACTORY_HH #define EVT_AMP_FACTORY_HH #include #include + #include #include "EvtGenBase/EvtAmplitudeSum.hh" ! #include "EvtGenBase/EvtPdfSum.hh" #include "EvtGenBase/EvtMultiChannelParser.hh" #include "EvtGenBase/EvtAmpPdf.hh" #include "EvtGenBase/EvtPdfMax.hh" #include "EvtGenBase/EvtMacros.hh" ! template ! class EvtAmpFactory { public: EvtAmpFactory() ! : _amp(0), _ampConj(0), _pc(0), _dm(0.), _verbose(false) {} ! EvtAmpFactory(const EvtAmpFactory& other) : ! _amp(other._amp ? (EvtAmplitudeSum*) other._amp : 0), ! _ampConj(other._ampConj ? (EvtAmplitudeSum*) other._ampConj : 0), ! _pc(other._pc ? (EvtPdfSum*) other._pc : 0), ! _dm(other._dm), ! _verbose(other._verbose) {} virtual ~EvtAmpFactory() *************** *** 54,76 **** if(_amp) delete _amp; if(_ampConj) delete _ampConj; if(_pc) delete _pc; - if(_gen) delete _gen; } ! virtual EvtAmpFactory* clone() const = 0; ! ! // Parsing. Building the amplitude. ! ! virtual void build(const Interval& ival, const EvtMultiChannelParser& parser) { ! // Make sure that the interval size has been computed ! assert(ival.sizeKnown()); ! ! _amp = new EvtAmplitudeSum(); ! _ampConj = new EvtAmplitudeSum(); ! _pc = new EvtPoleCompPdfSum(); ! report(INFO,"EvtGen") << "Amplitude with " << parser.getNAmp() << " terms" << std::endl; int i; for(i=0;i* clone() const = 0; ! virtual void build(const EvtMultiChannelParser& parser, int nItg) { ! _amp = new EvtAmplitudeSum(); ! _ampConj = new EvtAmplitudeSum(); ! _pc = new EvtPdfSum(); ! printf("Amplitude with %d terms\n",parser.getNAmp()); int i; for(i=0;i v = parser.ampConj(i); EvtComplex c = parser.ampConjCoef(i); processAmp(c,v,true); } ! ! if(_pc->nTerms() == 0) { ! ! report(INFO,"EvtGen") << "Trivial pole compensator" << std::endl; ! _pc->addOwnedTerm(1.,new EvtFlatPdf()); ! } ! ! report(INFO,"EvtGen") << "Create generator" << std::endl; ! _gen = new EvtRandDistGen(ival,*_pc); ! report(INFO,"EvtGen") << "End build" << std::endl; } - EvtPdfMax findMax(int N) - { - EvtAmpPdf pdf(*_amp); - EvtPdfDiv pdfdiv(pdf,*_pc); - EvtPdfPred pred(pdfdiv); - report(INFO,"EvtGen") << "Sampling PDF to find maximum " << N << " points" << std::endl; - assert(_gen); - pred.compute_max(iter(*_gen,N),iter(*_gen)); - EvtPdfMax p = pred.getMax(); - report(INFO,"EvtGen") << "Found Pdf maximum " << p.value() << std::endl; - - return p; - } - - EvtComplex amp(Point x) const - { - return _amp->evaluate(x); - } - EvtComplex ampConj(Point x) const - { - return _ampConj->evaluate(x); - } - double pc(Point x) const - { - return _pc->evaluate(x); - } - Point generate() const - { - assert(_gen); - return (*_gen)(); - } - - virtual void processAmp(EvtComplex c, std::vector v, bool conj = false) = 0; inline bool isCPModel() const { return (_ampConj->nTerms() > 0 ? true : false); } inline double dm() const { return _dm; } ! EvtAmplitudeSum* getAmp() { return _amp; } ! EvtPoleCompPdfSum* getPC() { return _pc; } ! EvtAmplitude* getAmp(int i) { return _amp->getTerm(i); } ! EvtPdf* getPC(int i) { return _pc->getPdf(i); } ! const char* compName(int i) { return _names[i].c_str(); } protected: ! EvtAmplitudeSum *_amp; // _owned_ amplitude ! EvtAmplitudeSum *_ampConj; // _owned_ conjugate amplitude ! EvtPoleCompPdfSum *_pc; // _ownded_ pole compensator ! EvtRandDistGen* _gen; // generator ! const Interval* _ival; // interval std::vector _names; // names of partial amplitudes double _dm; // Mass difference for conjugate amplitude ! }; --- 69,127 ---- processAmp(c,v); } ! printf("Conj. amplitude with %d terms\n",parser.getNAmpConj()); for(i=0;i v = parser.ampConj(i); EvtComplex c = parser.ampConjCoef(i); processAmp(c,v,true); } ! ! printf("Calculating pole compensator integrals %d steps\n",nItg); ! if(nItg > 0) _pc->getItg(nItg); ! ! printf("End build\n"); } virtual void processAmp(EvtComplex c, std::vector v, bool conj = false) = 0; inline bool isCPModel() const { return (_ampConj->nTerms() > 0 ? true : false); } inline double dm() const { return _dm; } + void setVerbose() { _verbose = true; } + ! EvtAmplitudeSum* getAmp() const { return _amp; } ! EvtAmplitudeSum* getAmpConj() const { return _ampConj; } ! EvtPdfSum* getPC() const { return _pc; } ! EvtAmplitude* getAmp(int i) const { return _amp->getTerm(i); } ! EvtPdf* getPC(int i) const { return _pc->getPdf(i); } ! const char* compName(int i) const { return _names[i].c_str(); } + EvtComplex getCoeff(int i) const { return _amp->c(i); } + + double getTermCoeff(int i) const { return abs2(_amp->c(i)); } + double getTermCoeff(int type, int i, int j) const + { + switch(type) { + + case 0: return 2*real(_amp->c(i)*conj(_amp->c(j))); //posre + case 1: return -2*real(_amp->c(i)*conj(_amp->c(j))); //negre + case 2: return -2*imag(_amp->c(i)*conj(_amp->c(j))); //posim + case 3: return 2*imag(_amp->c(i)*conj(_amp->c(j))); //negim + default: assert(0); + } + } + protected: ! EvtAmplitudeSum *_amp; // _owned_ amplitude ! EvtAmplitudeSum *_ampConj; // _owned_ conjugate amplitude ! EvtPdfSum *_pc; // _ownded_ pole compensator std::vector _names; // names of partial amplitudes double _dm; // Mass difference for conjugate amplitude ! bool _verbose; }; Index: EvtGenBase/EvtAmpPdf.hh =================================================================== RCS file: /nfs/cleo3/cvsroot/Offline/src/EvtGenBase/EvtGenBase/EvtAmpPdf.hh,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -c -r1.1.1.1 -r1.2 *** EvtGenBase/EvtAmpPdf.hh 7 Oct 2003 02:46:58 -0000 1.1.1.1 --- EvtGenBase/EvtAmpPdf.hh 12 Jan 2006 16:09:51 -0000 1.2 *************** *** 1,7 **** /******************************************************************************* * Project: BaBar detector at the SLAC PEP-II B-factory * Package: EvtGenBase ! * File: $Id: EvtAmpPdf.hh,v 1.1.1.1 2003/10/07 02:46:58 ryd Exp $ * Author: Alexei Dvoretskii, dvoretsk@slac.stanford.edu, 2001-2002 * * Copyright (C) 2002 Caltech --- 1,7 ---- /******************************************************************************* * Project: BaBar detector at the SLAC PEP-II B-factory * Package: EvtGenBase ! * File: $Id: EvtAmpPdf.hh,v 1.2 2006/01/12 16:09:51 ryd Exp $ * Author: Alexei Dvoretskii, dvoretsk@slac.stanford.edu, 2001-2002 * * Copyright (C) 2002 Caltech *************** *** 14,41 **** #include "EvtGenBase/EvtAmplitude.hh" #include "EvtGenBase/EvtPdf.hh" ! template ! class EvtAmpPdf : public EvtPdf { public: ! ! typedef typename Interval::point_type Point; EvtAmpPdf() {} ! EvtAmpPdf(const EvtAmplitude& amp) : EvtPdf(), _amp(amp.clone()) {} ! EvtAmpPdf(const EvtAmpPdf& other) : EvtPdf(other), COPY_PTR(_amp) {} virtual ~EvtAmpPdf() { delete _amp; } ! ! virtual EvtAmpPdf* clone() const { return new EvtAmpPdf(*this); } ! ! virtual double pdf(const Point& p) const { EvtComplex amp = _amp->evaluate(p); return real(amp)*real(amp) + imag(amp)*imag(amp); } ! private: ! EvtAmplitude* _amp; }; #endif --- 14,40 ---- #include "EvtGenBase/EvtAmplitude.hh" #include "EvtGenBase/EvtPdf.hh" ! template ! class EvtAmpPdf : public EvtPdf { public: ! EvtAmpPdf() {} ! EvtAmpPdf(const EvtAmplitude& amp) : EvtPdf(), _amp(amp.clone()) {} ! EvtAmpPdf(const EvtAmpPdf& other) : EvtPdf(other), COPY_PTR(_amp) {} virtual ~EvtAmpPdf() { delete _amp; } ! ! virtual EvtAmpPdf* clone() const { return new EvtAmpPdf(*this); } ! ! virtual double pdf(const T& p) const { EvtComplex amp = _amp->evaluate(p); return real(amp)*real(amp) + imag(amp)*imag(amp); } ! private: ! EvtAmplitude* _amp; }; #endif Index: EvtGenBase/EvtAmplitude.hh =================================================================== RCS file: /nfs/cleo3/cvsroot/Offline/src/EvtGenBase/EvtGenBase/EvtAmplitude.hh,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -c -r1.1.1.1 -r1.2 *** EvtGenBase/EvtAmplitude.hh 7 Oct 2003 02:46:59 -0000 1.1.1.1 --- EvtGenBase/EvtAmplitude.hh 12 Jan 2006 16:09:51 -0000 1.2 *************** *** 1,7 **** /******************************************************************************* * Project: BaBar detector at the SLAC PEP-II B-factory * Package: EvtGenBase ! * File: $Id: EvtAmplitude.hh,v 1.1.1.1 2003/10/07 02:46:59 ryd Exp $ * Author: Alexei Dvoretskii, dvoretsk@slac.stanford.edu, 2001-2002 * * Copyright (C) 2002 Caltech --- 1,7 ---- /******************************************************************************* * Project: BaBar detector at the SLAC PEP-II B-factory * Package: EvtGenBase ! * File: $Id: EvtAmplitude.hh,v 1.2 2006/01/12 16:09:51 ryd Exp $ * Author: Alexei Dvoretskii, dvoretsk@slac.stanford.edu, 2001-2002 * * Copyright (C) 2002 Caltech *************** *** 14,43 **** #include "EvtGenBase/EvtComplex.hh" ! template class EvtAmplitude { public: - typedef typename Interval::point_type Point; EvtAmplitude() {} EvtAmplitude(const EvtAmplitude&) {} virtual ~EvtAmplitude() {} ! virtual EvtAmplitude* clone() const = 0; ! EvtComplex evaluate(const Point& p) const { EvtComplex ret(0.,0.); if(p.isValid()) ret = amplitude(p); return ret; } - protected: // Derive in subclasses to define amplitude computation // for a fully constructed amplitude object. ! virtual EvtComplex amplitude(const Point&) const = 0; }; --- 14,41 ---- #include "EvtGenBase/EvtComplex.hh" ! template class EvtAmplitude { public: EvtAmplitude() {} EvtAmplitude(const EvtAmplitude&) {} virtual ~EvtAmplitude() {} ! virtual EvtAmplitude* clone() const = 0; ! EvtComplex evaluate(const T& p) const { EvtComplex ret(0.,0.); if(p.isValid()) ret = amplitude(p); return ret; } protected: // Derive in subclasses to define amplitude computation // for a fully constructed amplitude object. ! virtual EvtComplex amplitude(const T&) const = 0; }; Index: EvtGenBase/EvtAmplitudeSum.hh =================================================================== RCS file: /nfs/cleo3/cvsroot/Offline/src/EvtGenBase/EvtGenBase/EvtAmplitudeSum.hh,v retrieving revision 1.1.1.1 retrieving revision 1.3 diff -c -r1.1.1.1 -r1.3 *** EvtGenBase/EvtAmplitudeSum.hh 7 Oct 2003 02:46:59 -0000 1.1.1.1 --- EvtGenBase/EvtAmplitudeSum.hh 6 Jun 2006 17:16:00 -0000 1.3 *************** *** 1,7 **** /******************************************************************************* * Project: BaBar detector at the SLAC PEP-II B-factory * Package: EvtGenBase ! * File: $Id: EvtAmplitudeSum.hh,v 1.1.1.1 2003/10/07 02:46:59 ryd Exp $ * Author: Alexei Dvoretskii, dvoretsk@slac.stanford.edu, 2001-2002 * * Copyright (C) 2002 Caltech --- 1,7 ---- /******************************************************************************* * Project: BaBar detector at the SLAC PEP-II B-factory * Package: EvtGenBase ! * File: $Id: EvtAmplitudeSum.hh,v 1.3 2006/06/06 17:16:00 gregor Exp $ * Author: Alexei Dvoretskii, dvoretsk@slac.stanford.edu, 2001-2002 * * Copyright (C) 2002 Caltech *************** *** 10,38 **** #ifndef EVT_AMPLITUDE_SUM_HH #define EVT_AMPLITUDE_SUM_HH #include - #include #include "EvtGenBase/EvtAmplitude.hh" ! ! template ! class EvtAmplitudeSum : public EvtAmplitude { public: - typedef typename Interval::point_type Point; EvtAmplitudeSum() {} ! EvtAmplitudeSum(const EvtAmplitudeSum& other) ! : EvtAmplitude(other) { int i; for(i=0;i* amp = other.getTerm(i); assert(amp); ! EvtAmplitude* amp1 = amp->clone(); assert(amp1); _term.push_back(amp1); } --- 10,37 ---- #ifndef EVT_AMPLITUDE_SUM_HH #define EVT_AMPLITUDE_SUM_HH + #include + #include #include #include "EvtGenBase/EvtAmplitude.hh" ! template ! class EvtAmplitudeSum : public EvtAmplitude { public: EvtAmplitudeSum() {} ! EvtAmplitudeSum(const EvtAmplitudeSum& other) ! : EvtAmplitude(other) { int i; for(i=0;i* amp = other.getTerm(i); assert(amp); ! EvtAmplitude* amp1 = amp->clone(); assert(amp1); _term.push_back(amp1); } *************** *** 40,65 **** virtual ~EvtAmplitudeSum() { ! int i; for(i=0;i<_term.size();i++) { delete _term[i]; } } ! virtual EvtAmplitude* clone() const { ! return new EvtAmplitudeSum(*this); } ! ! void addTerm(EvtComplex c,const EvtAmplitude& amp) { _c.push_back(c); _term.push_back(amp.clone()); } ! ! void addOwnedTerm(EvtComplex c, EvtAmplitude* amp) { assert(amp); _c.push_back(c); --- 39,64 ---- virtual ~EvtAmplitudeSum() { ! size_t i; for(i=0;i<_term.size();i++) { delete _term[i]; } } ! virtual EvtAmplitude* clone() const { ! return new EvtAmplitudeSum(*this); } ! ! void addTerm(EvtComplex c,const EvtAmplitude& amp) { _c.push_back(c); _term.push_back(amp.clone()); } ! ! void addOwnedTerm(EvtComplex c, EvtAmplitude* amp) { assert(amp); _c.push_back(c); *************** *** 68,97 **** int nTerms() const { return _term.size(); } // number of terms ! void print(std::ostream& os) const { int N = nTerms(); ! os << "Amplitude has " << N << " terms" << std::endl; int i; for(i=0;ievaluate(p); --- 67,96 ---- int nTerms() const { return _term.size(); } // number of terms ! void print() const { int N = nTerms(); ! printf("Amplitude has %d terms\n",N); int i; for(i=0;i* getTerm(int i) const { return _term[i]; } protected: ! virtual EvtComplex amplitude(const T& p) const { if(_term.size() == 0) ! printf("Warning: amplitude sum has zero terms\n"); EvtComplex value = 0.; ! size_t i; for(i=0;i<_term.size();i++) { value+=_c[i]*_term[i]->evaluate(p); *************** *** 102,108 **** private: std::vector _c; // coefficients ! std::vector*> _term; // pointers to amplitudes }; --- 101,107 ---- private: std::vector _c; // coefficients ! std::vector*> _term; // pointers to amplitudes }; Index: EvtGenBase/EvtBlattWeisskopf.hh =================================================================== RCS file: /nfs/cleo3/cvsroot/Offline/src/EvtGenBase/EvtGenBase/EvtBlattWeisskopf.hh,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -c -r1.1.1.1 -r1.2 *** EvtGenBase/EvtBlattWeisskopf.hh 7 Oct 2003 02:46:59 -0000 1.1.1.1 --- EvtGenBase/EvtBlattWeisskopf.hh 12 Jan 2006 16:09:51 -0000 1.2 *************** *** 1,7 **** /******************************************************************************* * Project: BaBar detector at the SLAC PEP-II B-factory * Package: EvtGenBase ! * File: $Id: EvtBlattWeisskopf.hh,v 1.1.1.1 2003/10/07 02:46:59 ryd Exp $ * Author: Alexei Dvoretskii, dvoretsk@slac.stanford.edu, 2001-2002 * * Copyright (C) 2002 Caltech --- 1,7 ---- /******************************************************************************* * Project: BaBar detector at the SLAC PEP-II B-factory * Package: EvtGenBase ! * File: $Id: EvtBlattWeisskopf.hh,v 1.2 2006/01/12 16:09:51 ryd Exp $ * Author: Alexei Dvoretskii, dvoretsk@slac.stanford.edu, 2001-2002 * * Copyright (C) 2002 Caltech *************** *** 27,33 **** private: int _LL; // angular momentum of daughters ! double _R; // resonance radial parameter double _p0; double _F0; // formula evaluated at _p0 --- 27,33 ---- private: int _LL; // angular momentum of daughters ! double _radial; // resonance radial parameter double _p0; double _F0; // formula evaluated at _p0 Index: EvtGenBase/EvtBreitWignerPdf.hh =================================================================== RCS file: /nfs/cleo3/cvsroot/Offline/src/EvtGenBase/EvtGenBase/EvtBreitWignerPdf.hh,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -c -r1.1.1.1 -r1.2 *** EvtGenBase/EvtBreitWignerPdf.hh 7 Oct 2003 02:46:59 -0000 1.1.1.1 --- EvtGenBase/EvtBreitWignerPdf.hh 12 Jan 2006 16:09:51 -0000 1.2 *************** *** 1,7 **** /******************************************************************************* * Project: BaBar detector at the SLAC PEP-II B-factory * Package: EvtGenBase ! * File: $Id: EvtBreitWignerPdf.hh,v 1.1.1.1 2003/10/07 02:46:59 ryd Exp $ * Author: Alexei Dvoretskii, dvoretsk@slac.stanford.edu, 2001-2002 * * Copyright (C) 2002 Caltech --- 1,7 ---- /******************************************************************************* * Project: BaBar detector at the SLAC PEP-II B-factory * Package: EvtGenBase ! * File: $Id: EvtBreitWignerPdf.hh,v 1.2 2006/01/12 16:09:51 ryd Exp $ * Author: Alexei Dvoretskii, dvoretsk@slac.stanford.edu, 2001-2002 * * Copyright (C) 2002 Caltech *************** *** 18,40 **** public: ! EvtBreitWignerPdf(double m0, double g0); EvtBreitWignerPdf(const EvtBreitWignerPdf& other); virtual ~EvtBreitWignerPdf(); double pdf(const EvtPoint1D& x) const; ! EvtPdf* clone() const ! { ! return new EvtBreitWignerPdf(*this); ! } ! EvtRandDist* clone1() const { return new EvtBreitWignerPdf(*this); } double pdfIntegral(double m) const; double pdfIntegralInverse(double x) const; - - EvtValError get_integral(const EvtInterval1D& v); // accessors --- 18,35 ---- public: ! EvtBreitWignerPdf(double min, double max, double m0, double g0); EvtBreitWignerPdf(const EvtBreitWignerPdf& other); virtual ~EvtBreitWignerPdf(); double pdf(const EvtPoint1D& x) const; ! EvtPdf* clone() const { return new EvtBreitWignerPdf(*this); } + double pdfIntegral(double m) const; double pdfIntegralInverse(double x) const; // accessors Index: EvtGenBase/EvtCGCoefSingle.hh =================================================================== RCS file: /nfs/cleo3/cvsroot/Offline/src/EvtGenBase/EvtGenBase/EvtCGCoefSingle.hh,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -c -r1.1.1.1 -r1.2 *** EvtGenBase/EvtCGCoefSingle.hh 7 Oct 2003 02:46:59 -0000 1.1.1.1 --- EvtGenBase/EvtCGCoefSingle.hh 12 Jan 2006 16:09:51 -0000 1.2 *************** *** 28,42 **** public: ! EvtCGCoefSingle(); ~EvtCGCoefSingle(); - void init(int j1,int j2); double coef(int J,int M,int j1,int j2,int m1,int m2); private: double& cg(int J,int M, int m1, int m2); int _j1; --- 28,42 ---- public: ! EvtCGCoefSingle(int j1, int j2) {init(j1,j2);} ~EvtCGCoefSingle(); double coef(int J,int M,int j1,int j2,int m1,int m2); private: + void init(int j1,int j2); double& cg(int J,int M, int m1, int m2); int _j1; Index: EvtGenBase/EvtCyclic3.hh =================================================================== RCS file: /nfs/cleo3/cvsroot/Offline/src/EvtGenBase/EvtGenBase/EvtCyclic3.hh,v retrieving revision 1.1.1.1 retrieving revision 1.3 diff -c -r1.1.1.1 -r1.3 *** EvtGenBase/EvtCyclic3.hh 7 Oct 2003 02:46:59 -0000 1.1.1.1 --- EvtGenBase/EvtCyclic3.hh 22 Jun 2006 12:26:16 -0000 1.3 *************** *** 1,7 **** /******************************************************************************* * Project: BaBar detector at the SLAC PEP-II B-factory * Package: EvtGenBase ! * File: $Id: EvtCyclic3.hh,v 1.1.1.1 2003/10/07 02:46:59 ryd Exp $ * Author: Alexei Dvoretskii, dvoretsk@slac.stanford.edu, 2001-2002 * * Copyright (C) 2002 Caltech --- 1,7 ---- /******************************************************************************* * Project: BaBar detector at the SLAC PEP-II B-factory * Package: EvtGenBase ! * File: $Id: EvtCyclic3.hh,v 1.3 2006/06/22 12:26:16 gregor Exp $ * Author: Alexei Dvoretskii, dvoretsk@slac.stanford.edu, 2001-2002 * * Copyright (C) 2002 Caltech *************** *** 12,18 **** #ifndef EVT_CYCLIC3_HH #define EVT_CYCLIC3_HH ! class ostream; namespace EvtCyclic3 { --- 12,18 ---- #ifndef EVT_CYCLIC3_HH #define EVT_CYCLIC3_HH ! #include namespace EvtCyclic3 { *************** *** 63,71 **** // To string conversions ! char* c_str(Index i); ! char* c_str(Pair i); ! char* c_str(Perm i); // Useful name strings --- 63,71 ---- // To string conversions ! const char* c_str(Index i); ! const char* c_str(Pair i); ! const char* c_str(Perm i); // Useful name strings *************** *** 75,81 **** }; //where should these go? ! //std::ostream& operator<<(std::ostream&, EvtCyclic3::Index); ! //std::ostream& operator<<(std::ostream&, EvtCyclic3::Pair); #endif --- 75,81 ---- }; //where should these go? ! //ostream& operator<<(ostream&, EvtCyclic3::Index); ! //ostream& operator<<(ostream&, EvtCyclic3::Pair); #endif Index: EvtGenBase/EvtDalitzCoord.hh =================================================================== RCS file: /nfs/cleo3/cvsroot/Offline/src/EvtGenBase/EvtGenBase/EvtDalitzCoord.hh,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -c -r1.1.1.1 -r1.2 *** EvtGenBase/EvtDalitzCoord.hh 7 Oct 2003 02:46:59 -0000 1.1.1.1 --- EvtGenBase/EvtDalitzCoord.hh 12 Jan 2006 16:09:52 -0000 1.2 *************** *** 1,7 **** /******************************************************************************* * Project: BaBar detector at the SLAC PEP-II B-factory * Package: EvtGenBase ! * File: $Id: EvtDalitzCoord.hh,v 1.1.1.1 2003/10/07 02:46:59 ryd Exp $ * Author: Alexei Dvoretskii, dvoretsk@slac.stanford.edu, 2001-2002 * * Copyright (C) 2002 Caltech --- 1,7 ---- /******************************************************************************* * Project: BaBar detector at the SLAC PEP-II B-factory * Package: EvtGenBase ! * File: $Id: EvtDalitzCoord.hh,v 1.2 2006/01/12 16:09:52 ryd Exp $ * Author: Alexei Dvoretskii, dvoretsk@slac.stanford.edu, 2001-2002 * * Copyright (C) 2002 Caltech *************** *** 14,20 **** #include "EvtGenBase/EvtCyclic3.hh" ! class ostream; class EvtDalitzCoord { --- 14,20 ---- #include "EvtGenBase/EvtCyclic3.hh" ! #include class EvtDalitzCoord { Index: EvtGenBase/EvtDalitzFlatPdf.hh =================================================================== RCS file: EvtGenBase/EvtDalitzFlatPdf.hh diff -N EvtGenBase/EvtDalitzFlatPdf.hh *** /dev/null 1 Jan 1970 00:00:00 -0000 --- EvtGenBase/EvtDalitzFlatPdf.hh 12 Jan 2006 16:09:52 -0000 1.1 *************** *** 0 **** --- 1,40 ---- + /******************************************************************************* + * Project: BaBar detector at the SLAC PEP-II B-factory + * Package: EvtGenBase + * File: $Id: EvtDalitzFlatPdf.hh,v 1.1 2006/01/12 16:09:52 ryd Exp $ + * Author: Alexei Dvoretskii, dvoretsk@slac.stanford.edu, 2001-2002 + * + * Copyright (C) 2002 Caltech + *******************************************************************************/ + + /* + * Uniform PDF defined on a Dalitz plot. + */ + + #ifndef EVT_DALITZ_FLAT_PDF_HH + #define EVT_DALITZ_FLAT_PDF_HH + + #include + #include "EvtGenBase/EvtPdf.hh" + #include "EvtGenBase/EvtDalitzPlot.hh" + #include "EvtGenBase/EvtDalitzPoint.hh" + + class EvtDalitzFlatPdf : public EvtPdf { + public: + + EvtDalitzFlatPdf(const EvtDalitzPlot& dp); + EvtDalitzFlatPdf(const EvtDalitzFlatPdf& other); + virtual ~EvtDalitzFlatPdf(); + virtual EvtPdf* clone() const; + + virtual EvtValError compute_integral(int N) const; + virtual EvtDalitzPoint randomPoint(); + + protected: + + virtual double pdf(const EvtDalitzPoint&) const; + + EvtDalitzPlot _dp; + }; + + #endif Index: EvtGenBase/EvtDalitzPlot.hh =================================================================== RCS file: /nfs/cleo3/cvsroot/Offline/src/EvtGenBase/EvtGenBase/EvtDalitzPlot.hh,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -c -r1.1.1.1 -r1.2 *** EvtGenBase/EvtDalitzPlot.hh 7 Oct 2003 02:46:59 -0000 1.1.1.1 --- EvtGenBase/EvtDalitzPlot.hh 12 Jan 2006 16:09:52 -0000 1.2 *************** *** 1,6 **** //----------------------------------------------------------------------- // File and Version Information: ! // $Id: EvtDalitzPlot.hh,v 1.1.1.1 2003/10/07 02:46:59 ryd Exp $ // // Environment: // This software is part of the EvtGen package developed jointly --- 1,6 ---- //----------------------------------------------------------------------- // File and Version Information: ! // $Id: EvtDalitzPlot.hh,v 1.2 2006/01/12 16:09:52 ryd Exp $ // // Environment: // This software is part of the EvtGen package developed jointly *************** *** 20,32 **** #include #include "EvtGenBase/EvtCyclic3.hh" #include "EvtGenBase/EvtTwoBodyVertex.hh" ! ! class ostream; ! class EvtDecayMode; class EvtDalitzPlot { - - public: EvtDalitzPlot(); --- 20,28 ---- #include #include "EvtGenBase/EvtCyclic3.hh" #include "EvtGenBase/EvtTwoBodyVertex.hh" ! #include "EvtGenBase/EvtDecayMode.hh" class EvtDalitzPlot { public: EvtDalitzPlot(); *************** *** 100,106 **** double m(EvtCyclic3::Index i) const; ! void print(std::ostream& os) const; void sanityCheck() const; --- 96,102 ---- double m(EvtCyclic3::Index i) const; ! void print() const; void sanityCheck() const; Index: EvtGenBase/EvtDalitzPoint.hh =================================================================== RCS file: /nfs/cleo3/cvsroot/Offline/src/EvtGenBase/EvtGenBase/EvtDalitzPoint.hh,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -c -r1.1.1.1 -r1.2 *** EvtGenBase/EvtDalitzPoint.hh 7 Oct 2003 02:46:59 -0000 1.1.1.1 --- EvtGenBase/EvtDalitzPoint.hh 12 Jan 2006 16:09:52 -0000 1.2 *************** *** 1,7 **** /******************************************************************************* * Project: BaBar detector at the SLAC PEP-II B-factory * Package: EvtGenBase ! * File: $Id: EvtDalitzPoint.hh,v 1.1.1.1 2003/10/07 02:46:59 ryd Exp $ * Author: Alexei Dvoretskii, dvoretsk@slac.stanford.edu, 2001-2002 * * Copyright (C) 2002 Caltech --- 1,7 ---- /******************************************************************************* * Project: BaBar detector at the SLAC PEP-II B-factory * Package: EvtGenBase ! * File: $Id: EvtDalitzPoint.hh,v 1.2 2006/01/12 16:09:52 ryd Exp $ * Author: Alexei Dvoretskii, dvoretsk@slac.stanford.edu, 2001-2002 * * Copyright (C) 2002 Caltech *************** *** 24,31 **** #include "EvtGenBase/EvtDalitzCoord.hh" #include "EvtGenBase/EvtDalitzPlot.hh" - class ostream; - class EvtDalitzPoint { public: --- 24,29 ---- *************** *** 67,73 **** bool isValid() const; ! void print(std::ostream&) const; private: --- 65,71 ---- bool isValid() const; ! void print() const; private: Index: EvtGenBase/EvtDalitzResPdf.hh =================================================================== RCS file: EvtGenBase/EvtDalitzResPdf.hh diff -N EvtGenBase/EvtDalitzResPdf.hh *** /dev/null 1 Jan 1970 00:00:00 -0000 --- EvtGenBase/EvtDalitzResPdf.hh 12 Jan 2006 16:09:52 -0000 1.1 *************** *** 0 **** --- 1,59 ---- + /******************************************************************************* + * Project: BaBar detector at the SLAC PEP-II B-factory + * Package: EvtGenBase + * File: $Id: EvtDalitzResPdf.hh,v 1.1 2006/01/12 16:09:52 ryd Exp $ + * Author: Alexei Dvoretskii, dvoretsk@slac.stanford.edu, 2001-2002 + * + * Copyright (C) 2002 Caltech + *******************************************************************************/ + + /* + * Pole compensating function for terms that exibit a resonant structure + * in one dimension only. + * + * f = 1 g*m0 + * -- ------------------ + * pi (q-q0)^2 + g^2m0^2 + * + * m is the mass of the resonance, g is its width. The approximation works well for a narrow + * resonance. It is also readily integrable over the Dalitz plot coordinate to produce + * + * Int = 1/pi atan((q-q0)/(g*m0)) + */ + + #ifndef EVT_DALITZ_RES_PDF_HH + #define EVT_DALITZ_RES_PDF_HH + + #include "EvtGenBase/EvtPdf.hh" + #include "EvtGenBase/EvtDalitzPoint.hh" + #include "EvtGenBase/EvtCyclic3.hh" + + class EvtDalitzResPdf : public EvtPdf { + + public: + + EvtDalitzResPdf(const EvtDalitzPlot& dp,double m0, double g0, EvtCyclic3::Pair pairRes); + EvtDalitzResPdf(const EvtDalitzResPdf& other); + virtual ~EvtDalitzResPdf(); + + + EvtPdf* clone() const { return new EvtDalitzResPdf(*this); } + + virtual EvtValError compute_integral(int N) const; + virtual EvtDalitzPoint randomPoint(); + double pdfMaxValue() const; + + protected: + + virtual double pdf(const EvtDalitzPoint&) const; + + private: + + EvtDalitzPlot _dp; + double _m0; // mass + double _g0; // width + EvtCyclic3::Pair _pair; // resonant pair + }; + + #endif + Index: EvtGenBase/EvtDecayBase.hh =================================================================== RCS file: /nfs/cleo3/cvsroot/Offline/src/EvtGenBase/EvtGenBase/EvtDecayBase.hh,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -c -r1.1.1.1 -r1.2 *** EvtGenBase/EvtDecayBase.hh 7 Oct 2003 02:47:00 -0000 1.1.1.1 --- EvtGenBase/EvtDecayBase.hh 12 Jan 2006 16:09:52 -0000 1.2 *************** *** 55,60 **** --- 55,62 ---- EvtDecayBase(); virtual ~EvtDecayBase(); + virtual bool matchingDecay(const EvtDecayBase &other) const; + EvtId getParentId() {return _parent;} double getBranchingFraction() {return _brfr;} void disableCheckQ() {_chkCharge=0;}; *************** *** 102,110 **** // than they really have to fool aliases (VSSBMIX for example) virtual int nRealDaughters() { return _ndaug;} - protected: private: --- 104,114 ---- // than they really have to fool aliases (VSSBMIX for example) virtual int nRealDaughters() { return _ndaug;} + protected: + bool _daugsDecayedByParentModel; + bool daugsDecayedByParentModel() {return _daugsDecayedByParentModel;} private: *************** *** 123,129 **** int _verbose; - int defaultprobmax; double probmax; int ntimes_prob; --- 127,132 ---- Index: EvtGenBase/EvtDecayMode.hh =================================================================== RCS file: /nfs/cleo3/cvsroot/Offline/src/EvtGenBase/EvtGenBase/EvtDecayMode.hh,v retrieving revision 1.1.1.1 retrieving revision 1.3 diff -c -r1.1.1.1 -r1.3 *** EvtGenBase/EvtDecayMode.hh 7 Oct 2003 02:47:00 -0000 1.1.1.1 --- EvtGenBase/EvtDecayMode.hh 21 Jun 2006 18:27:23 -0000 1.3 *************** *** 1,6 **** //----------------------------------------------------------------------- // File and Version Information: ! // $Id: EvtDecayMode.hh,v 1.1.1.1 2003/10/07 02:47:00 ryd Exp $ // // Environment: // This software is part of the EvtGen package developed jointly --- 1,6 ---- //----------------------------------------------------------------------- // File and Version Information: ! // $Id: EvtDecayMode.hh,v 1.3 2006/06/21 18:27:23 gregor Exp $ // // Environment: // This software is part of the EvtGen package developed jointly *************** *** 21,27 **** #include #include "EvtGenBase/EvtCyclic3.hh" ! class ostream; class EvtDecayMode { --- 21,27 ---- #include #include "EvtGenBase/EvtCyclic3.hh" ! #include class EvtDecayMode { *************** *** 41,50 **** // Frequent name combinations ! const char* m(EvtCyclic3::Pair i) const; ! const char* q(EvtCyclic3::Pair i) const; ! const char* dal(EvtCyclic3::Pair i, EvtCyclic3::Pair j) const; ! const char* mode() const; private: --- 41,50 ---- // Frequent name combinations ! std::string m(EvtCyclic3::Pair i) const; ! std::string q(EvtCyclic3::Pair i) const; ! std::string dal(EvtCyclic3::Pair i, EvtCyclic3::Pair j) const; ! std::string mode() const; private: Index: EvtGenBase/EvtDecayTable.hh =================================================================== RCS file: /nfs/cleo3/cvsroot/Offline/src/EvtGenBase/EvtGenBase/EvtDecayTable.hh,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -c -r1.1.1.1 -r1.2 *** EvtGenBase/EvtDecayTable.hh 7 Oct 2003 02:47:00 -0000 1.1.1.1 --- EvtGenBase/EvtDecayTable.hh 12 Jan 2006 16:09:53 -0000 1.2 *************** *** 22,28 **** #define EVTDECAYTABLE_HH #include "EvtGenBase/EvtDecayBase.hh" ! //#include class EvtId; //Class to read in and handle the decays available --- 22,28 ---- #define EVTDECAYTABLE_HH #include "EvtGenBase/EvtDecayBase.hh" ! //#include class EvtId; //Class to read in and handle the decays available *************** *** 57,62 **** #endif - - - --- 57,59 ---- Index: EvtGenBase/EvtDiracParticle.hh =================================================================== RCS file: /nfs/cleo3/cvsroot/Offline/src/EvtGenBase/EvtGenBase/EvtDiracParticle.hh,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -c -r1.1.1.1 -r1.2 *** EvtGenBase/EvtDiracParticle.hh 7 Oct 2003 02:47:00 -0000 1.1.1.1 --- EvtGenBase/EvtDiracParticle.hh 12 Jan 2006 16:09:53 -0000 1.2 *************** *** 36,43 **** EvtDiracParticle(); virtual ~EvtDiracParticle(); void init(EvtId part_n,const EvtVector4R& p4); ! EvtDiracSpinor spParent(int) const; ! EvtDiracSpinor sp(int) const; EvtSpinDensity rotateToHelicityBasis() const; EvtSpinDensity rotateToHelicityBasis(double alpha, double beta, --- 36,43 ---- EvtDiracParticle(); virtual ~EvtDiracParticle(); void init(EvtId part_n,const EvtVector4R& p4); ! EvtDiracSpinor spParent(int i) const {return _spinorParent[i];} ! EvtDiracSpinor sp(int i) const {return _spinorRest[i];} EvtSpinDensity rotateToHelicityBasis() const; EvtSpinDensity rotateToHelicityBasis(double alpha, double beta, *************** *** 45,52 **** private: ! EvtDiracSpinor spinor1_rest,spinor2_rest; ! EvtDiracSpinor spinor1_parent,spinor2_parent; EvtDiracParticle(const EvtDiracParticle& d); EvtDiracParticle& operator=(const EvtDiracParticle& d); --- 45,52 ---- private: ! EvtDiracSpinor _spinorRest[2]; ! EvtDiracSpinor _spinorParent[2]; EvtDiracParticle(const EvtDiracParticle& d); EvtDiracParticle& operator=(const EvtDiracParticle& d); Index: EvtGenBase/EvtDiracSpinor.hh =================================================================== RCS file: /nfs/cleo3/cvsroot/Offline/src/EvtGenBase/EvtGenBase/EvtDiracSpinor.hh,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -c -r1.1.1.1 -r1.2 *** EvtGenBase/EvtDiracSpinor.hh 7 Oct 2003 02:47:00 -0000 1.1.1.1 --- EvtGenBase/EvtDiracSpinor.hh 12 Jan 2006 16:09:53 -0000 1.2 *************** *** 45,50 **** --- 45,51 ---- inline EvtDiracSpinor operator+(const EvtDiracSpinor& u1, const EvtDiracSpinor& u2); inline EvtDiracSpinor operator-(const EvtDiracSpinor& u1, const EvtDiracSpinor& u2); std::ostream& operator<<(std::ostream& s, const EvtDiracSpinor& c); + EvtDiracSpinor operator*(const EvtComplex& c, const EvtDiracSpinor& d); //===================== class EvtDiracSpinor { *************** *** 71,81 **** --- 72,87 ---- const EvtDiracSpinor& u2); friend EvtDiracSpinor operator-(const EvtDiracSpinor& u1, const EvtDiracSpinor& u2); + friend EvtDiracSpinor operator*(const EvtComplex& c, + const EvtDiracSpinor& d); + friend std::ostream& operator<<(std::ostream& s, const EvtDiracSpinor& c); public: inline EvtDiracSpinor(); + EvtDiracSpinor(const EvtComplex& sp0,const EvtComplex& sp1, + const EvtComplex& sp2,const EvtComplex& sp3); virtual ~EvtDiracSpinor(); inline EvtDiracSpinor(const EvtDiracSpinor& dspinor); inline EvtDiracSpinor& operator=(const EvtDiracSpinor& dspinor); *************** *** 91,96 **** --- 97,103 ---- void applyRotateEuler(double alpha,double beta,double gamma); void applyBoostTo(const EvtVector4R& p4); void applyBoostTo(const EvtVector3R& boost); + EvtDiracSpinor adjoint() const; private: Index: EvtGenBase/EvtFlatAmp.hh =================================================================== RCS file: /nfs/cleo3/cvsroot/Offline/src/EvtGenBase/EvtGenBase/EvtFlatAmp.hh,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -c -r1.1.1.1 -r1.2 *** EvtGenBase/EvtFlatAmp.hh 7 Oct 2003 02:47:00 -0000 1.1.1.1 --- EvtGenBase/EvtFlatAmp.hh 12 Jan 2006 16:09:53 -0000 1.2 *************** *** 1,7 **** /******************************************************************************* * Project: BaBar detector at the SLAC PEP-II B-factory * Package: EvtGenBase ! * File: $Id: EvtFlatAmp.hh,v 1.1.1.1 2003/10/07 02:47:00 ryd Exp $ * Author: Alexei Dvoretskii, dvoretsk@slac.stanford.edu, 2001-2002 * * Copyright (C) 2002 Caltech --- 1,7 ---- /******************************************************************************* * Project: BaBar detector at the SLAC PEP-II B-factory * Package: EvtGenBase ! * File: $Id: EvtFlatAmp.hh,v 1.2 2006/01/12 16:09:53 ryd Exp $ * Author: Alexei Dvoretskii, dvoretsk@slac.stanford.edu, 2001-2002 * * Copyright (C) 2002 Caltech *************** *** 14,30 **** #include "EvtGenBase/EvtAmplitude.hh" ! template ! class EvtFlatAmp : public EvtAmplitude { public: - typedef typename Interval::point_type Point; EvtFlatAmp() {} ! EvtFlatAmp(const EvtFlatAmp& other) : EvtAmplitude(other) {} virtual ~EvtFlatAmp() {} ! virtual EvtAmplitude* clone() const { return new EvtFlatAmp(*this); } ! virtual EvtComplex amplitude(const Point& p) const { return EvtComplex(1.,0.); } }; #endif --- 14,29 ---- #include "EvtGenBase/EvtAmplitude.hh" ! template ! class EvtFlatAmp : public EvtAmplitude { public: EvtFlatAmp() {} ! EvtFlatAmp(const EvtFlatAmp& other) : EvtAmplitude(other) {} virtual ~EvtFlatAmp() {} ! virtual EvtAmplitude* clone() const { return new EvtFlatAmp(*this); } ! virtual EvtComplex amplitude(const T& p) const { return EvtComplex(1.,0.); } }; #endif Index: EvtGenBase/EvtFlatte.hh =================================================================== RCS file: EvtGenBase/EvtFlatte.hh diff -N EvtGenBase/EvtFlatte.hh *** /dev/null 1 Jan 1970 00:00:00 -0000 --- EvtGenBase/EvtFlatte.hh 21 Mar 2008 18:07:46 -0000 1.1 *************** *** 0 **** --- 1,100 ---- + //-------------------------------------------------------------------------- + // + // Environment: + // This software is part of the EvtGen package developed jointly + // for the BaBar and CLEO collaborations. If you use all or part + // of it, please give an appropriate acknowledgement. + // + // Copyright Information: See EvtGen/COPYRIGHT + // Copyright (C) 1998 Caltech, UCSB + // + // Module: EvtGen/EvtFlatte.hh + // + // Description:resonance-defining class + // + // Modification history: + // + // ponyisi 18 Feb 2008 created + // + //------------------------------------------------------------------------ + + #ifndef EVTFLATTE_HH + #define EVTFLATTE_HH + + #include "EvtGenBase/EvtVector4R.hh" + #include + + using std::vector; + + class EvtComplex; + + // Helper class + + class EvtFlatteParam { + public: + EvtFlatteParam(double m1, double m2, double g): + _m1(m1), _m2(m2), _g(g) {} + + inline double m1() const { return _m1; } + inline double m2() const { return _m2; } + inline double g() const { return _g; } + + private: + double _m1, _m2, _g; + }; + + //class declaration + + class EvtFlatte { + public: + + //operator + EvtFlatte& operator = (const EvtFlatte &); + + //constructor with all information about the resonance + EvtFlatte(const EvtVector4R& p4_p, const EvtVector4R& p4_d1, + const EvtVector4R& p4_d2, + double ampl, double theta, + double mass, + vector& params + // double m1a = 0.0, double m1b = 0.0, double g1 = 0.0, + // double m2a = 0.0, double m2b = 0.0, double g2 = 0.0 + ); + + //destructor + virtual ~EvtFlatte(); + + //accessors + //return 4-momenta of the particles involved + inline const EvtVector4R& p4_p() { return _p4_p; } + inline const EvtVector4R& p4_d1() { return _p4_d1; } + inline const EvtVector4R& p4_d2() { return _p4_d2; } + + + //return amplitude + inline double amplitude() { return _ampl; } + + //return theta + inline double theta() { return _theta; } + + //return bwm + inline double mass() { return _mass; } + + //functions + + //calculate amplitude for this resonance + EvtComplex resAmpl(); + + private: + + inline EvtComplex sqrtCplx(double in) { return (in > 0) ? EvtComplex(sqrt(in), 0) : EvtComplex(0, sqrt(-in)); } + + EvtVector4R _p4_p, _p4_d1, _p4_d2; + double _ampl, _theta, _mass; + vector _params; + // double _m1a, _m1b, _g1; + // double _m2a, _m2b, _g2; + }; + + #endif + Index: EvtGenBase/EvtGammaMatrix.hh =================================================================== RCS file: /nfs/cleo3/cvsroot/Offline/src/EvtGenBase/EvtGenBase/EvtGammaMatrix.hh,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -c -r1.1.1.1 -r1.2 *** EvtGenBase/EvtGammaMatrix.hh 7 Oct 2003 02:47:00 -0000 1.1.1.1 --- EvtGenBase/EvtGammaMatrix.hh 12 Jan 2006 16:09:53 -0000 1.2 *************** *** 23,34 **** #define EVTGAMMAMATRIX_HH #include "EvtGenBase/EvtComplex.hh" ! //#include ! class ostream; ! class EvtDiracSpinor; class EvtGammaMatrix; EvtGammaMatrix operator*(const EvtComplex& c,const EvtGammaMatrix& g); EvtDiracSpinor operator*(const EvtGammaMatrix& g,const EvtDiracSpinor& d); EvtComplex operator*(const EvtDiracSpinor& d,const EvtDiracSpinor& dp); inline EvtGammaMatrix operator+(const EvtGammaMatrix& g1,const EvtGammaMatrix& g2); --- 23,37 ---- #define EVTGAMMAMATRIX_HH #include "EvtGenBase/EvtComplex.hh" ! #include "EvtGenBase/EvtDiracSpinor.hh" // needed for adjoint ! //#include ! #include class EvtGammaMatrix; + class EvtVector4C; EvtGammaMatrix operator*(const EvtComplex& c,const EvtGammaMatrix& g); + EvtGammaMatrix operator*(const EvtGammaMatrix& g, const EvtComplex& c); + EvtGammaMatrix operator/(const EvtGammaMatrix& g, const double d); EvtDiracSpinor operator*(const EvtGammaMatrix& g,const EvtDiracSpinor& d); EvtComplex operator*(const EvtDiracSpinor& d,const EvtDiracSpinor& dp); inline EvtGammaMatrix operator+(const EvtGammaMatrix& g1,const EvtGammaMatrix& g2); *************** *** 39,88 **** //===================== class EvtGammaMatrix { ! friend EvtGammaMatrix operator*(const EvtComplex& c,const EvtGammaMatrix& g); ! friend EvtDiracSpinor operator*(const EvtGammaMatrix& g,const EvtDiracSpinor& d); ! friend EvtComplex operator*(const EvtDiracSpinor& d,const EvtDiracSpinor& dp); ! friend EvtGammaMatrix operator+(const EvtGammaMatrix& g1,const EvtGammaMatrix& g2); ! friend EvtGammaMatrix operator-(const EvtGammaMatrix& g1,const EvtGammaMatrix& g2); ! friend EvtGammaMatrix operator*(const EvtGammaMatrix& g1,const EvtGammaMatrix& g2); ! friend std::ostream& operator<<(std::ostream& s, const EvtGammaMatrix& v); ! ! public: ! ! EvtGammaMatrix(); ! virtual ~EvtGammaMatrix(); ! EvtGammaMatrix(const EvtGammaMatrix& gm); ! EvtGammaMatrix& operator=(const EvtGammaMatrix& gm); ! ! void init(); ! //void dump(); ! static const EvtGammaMatrix& g0(); ! static const EvtGammaMatrix& g1(); ! static const EvtGammaMatrix& g2(); ! static const EvtGammaMatrix& g3(); ! static const EvtGammaMatrix& g5(); ! static const EvtGammaMatrix& id(); ! static const EvtGammaMatrix& va0(); ! static const EvtGammaMatrix& va1(); ! static const EvtGammaMatrix& va2(); ! static const EvtGammaMatrix& va3(); ! static const EvtGammaMatrix& v0(); ! static const EvtGammaMatrix& v1(); ! static const EvtGammaMatrix& v2(); ! static const EvtGammaMatrix& v3(); ! EvtGammaMatrix& operator+=(const EvtGammaMatrix &g); ! EvtGammaMatrix& operator-=(const EvtGammaMatrix &g); ! EvtGammaMatrix& operator*=(const EvtGammaMatrix &g); ! private: ! ! EvtComplex gamma[4][4]; ! }; inline EvtGammaMatrix operator+(const EvtGammaMatrix& g1,const EvtGammaMatrix& g2){ ! return EvtGammaMatrix(g1)+=g2; } inline EvtGammaMatrix operator-(const EvtGammaMatrix& g1,const EvtGammaMatrix& g2){ --- 42,96 ---- //===================== class EvtGammaMatrix { ! friend EvtGammaMatrix operator*(const EvtComplex& c,const EvtGammaMatrix& g); ! friend EvtGammaMatrix operator*(const EvtGammaMatrix& g, const EvtComplex& c); ! friend EvtGammaMatrix operator/(const EvtGammaMatrix& g, const double d); ! friend EvtDiracSpinor operator*(const EvtGammaMatrix& g,const EvtDiracSpinor& d); ! friend EvtComplex operator*(const EvtDiracSpinor& d,const EvtDiracSpinor& dp); ! friend EvtGammaMatrix operator+(const EvtGammaMatrix& g1,const EvtGammaMatrix& g2); ! friend EvtGammaMatrix operator-(const EvtGammaMatrix& g1,const EvtGammaMatrix& g2); ! friend EvtGammaMatrix operator*(const EvtGammaMatrix& g1,const EvtGammaMatrix& g2); ! friend std::ostream& operator<<(std::ostream& s, const EvtGammaMatrix& v); ! friend EvtDiracSpinor EvtDiracSpinor::adjoint() const; ! ! public: ! ! EvtGammaMatrix(); ! virtual ~EvtGammaMatrix(); ! EvtGammaMatrix(const EvtGammaMatrix& gm); ! EvtGammaMatrix& operator=(const EvtGammaMatrix& gm); ! ! void init(); ! //void dump(); ! static const EvtGammaMatrix& g0(); ! static const EvtGammaMatrix& g1(); ! static const EvtGammaMatrix& g2(); ! static const EvtGammaMatrix& g3(); ! static const EvtGammaMatrix& g5(); ! static const EvtGammaMatrix& id(); ! static const EvtGammaMatrix& va0(); ! static const EvtGammaMatrix& va1(); ! static const EvtGammaMatrix& va2(); ! static const EvtGammaMatrix& va3(); ! static const EvtGammaMatrix& v0(); ! static const EvtGammaMatrix& v1(); ! static const EvtGammaMatrix& v2(); ! static const EvtGammaMatrix& v3(); ! // Dirac sigma matrix with upper or lower indices (only one element) ! static const EvtGammaMatrix& sigmaUpper(unsigned int mu, unsigned int nu); ! static const EvtGammaMatrix& sigmaLower(unsigned int mu, unsigned int nu); ! ! EvtGammaMatrix& operator+=(const EvtGammaMatrix &g); ! EvtGammaMatrix& operator-=(const EvtGammaMatrix &g); ! EvtGammaMatrix& operator*=(const EvtGammaMatrix &g); ! private: ! EvtComplex gamma[4][4]; }; inline EvtGammaMatrix operator+(const EvtGammaMatrix& g1,const EvtGammaMatrix& g2){ ! return EvtGammaMatrix(g1)+=g2; } inline EvtGammaMatrix operator-(const EvtGammaMatrix& g1,const EvtGammaMatrix& g2){ *************** *** 93,98 **** return EvtGammaMatrix(g1)*=g2; } - #endif --- 101,114 ---- return EvtGammaMatrix(g1)*=g2; } + inline EvtGammaMatrix operator/(const EvtGammaMatrix& g, const double d) + { + return g * EvtComplex(1/d,0); + } + + // slash or Feynman dagger a 4-vector + EvtGammaMatrix slash(const EvtVector4C& p); + + #endif Index: EvtGenBase/EvtIntegPdf1D.hh =================================================================== RCS file: /nfs/cleo3/cvsroot/Offline/src/EvtGenBase/EvtGenBase/EvtIntegPdf1D.hh,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -c -r1.1.1.1 -r1.2 *** EvtGenBase/EvtIntegPdf1D.hh 7 Oct 2003 02:47:01 -0000 1.1.1.1 --- EvtGenBase/EvtIntegPdf1D.hh 12 Jan 2006 16:09:53 -0000 1.2 *************** *** 1,7 **** /******************************************************************************* * Project: BaBar detector at the SLAC PEP-II B-factory * Package: EvtGenBase ! * File: $Id: EvtIntegPdf1D.hh,v 1.1.1.1 2003/10/07 02:47:01 ryd Exp $ * Author: Alexei Dvoretskii, dvoretsk@slac.stanford.edu, 2001-2002 * * Copyright (C) 2002 Caltech --- 1,7 ---- /******************************************************************************* * Project: BaBar detector at the SLAC PEP-II B-factory * Package: EvtGenBase ! * File: $Id: EvtIntegPdf1D.hh,v 1.2 2006/01/12 16:09:53 ryd Exp $ * Author: Alexei Dvoretskii, dvoretsk@slac.stanford.edu, 2001-2002 * * Copyright (C) 2002 Caltech *************** *** 13,26 **** #define EVT_INTEG_PDF_1D_HH #include "EvtGenBase/EvtPdf.hh" ! #include "EvtGenBase/EvtRandDist.hh" ! #include "EvtGenBase/EvtInterval1D.hh" ! class EvtIntegPdf1D : public EvtPdf, public EvtRandDist { public: ! EvtIntegPdf1D(); EvtIntegPdf1D(const EvtIntegPdf1D&); virtual ~EvtIntegPdf1D(); --- 13,25 ---- #define EVT_INTEG_PDF_1D_HH #include "EvtGenBase/EvtPdf.hh" ! #include "EvtGenBase/EvtPoint1D.hh" ! class EvtIntegPdf1D : public EvtPdf { public: ! EvtIntegPdf1D(double min, double max); EvtIntegPdf1D(const EvtIntegPdf1D&); virtual ~EvtIntegPdf1D(); *************** *** 29,38 **** virtual double pdfIntegral(double x) const = 0; virtual double pdfIntegralInverse(double x) const = 0; ! EvtValError compute_integral(const EvtInterval1D&); ! ! EvtPoint1D randomPoint(const EvtInterval1D&); }; --- 28,40 ---- virtual double pdfIntegral(double x) const = 0; virtual double pdfIntegralInverse(double x) const = 0; ! virtual EvtValError compute_integral() const; ! virtual EvtPoint1D randomPoint(); + protected: + + double _min; + double _max; }; Index: EvtGenBase/EvtIntervalFlatPdf.hh =================================================================== RCS file: EvtGenBase/EvtIntervalFlatPdf.hh diff -N EvtGenBase/EvtIntervalFlatPdf.hh *** /dev/null 1 Jan 1970 00:00:00 -0000 --- EvtGenBase/EvtIntervalFlatPdf.hh 12 Jan 2006 16:09:53 -0000 1.1 *************** *** 0 **** --- 1,40 ---- + /******************************************************************************* + * Project: BaBar detector at the SLAC PEP-II B-factory + * Package: EvtGenBase + * File: $Id: EvtIntervalFlatPdf.hh,v 1.1 2006/01/12 16:09:53 ryd Exp $ + * Author: Alexei Dvoretskii, dvoretsk@slac.stanford.edu, 2001-2002 + * + * Copyright (C) 2002 Caltech + *******************************************************************************/ + + /* + * Uniform PDF defined on a 1D interval. + */ + + #ifndef EVT_INTERVAL_FLAT_PDF_HH + #define EVT_INTERVAL_FLAT_PDF_HH + + #include + #include "EvtGenBase/EvtPdf.hh" + #include "EvtGenBase/EvtPoint1D.hh" + + class EvtIntervalFlatPdf : public EvtPdf { + public: + + EvtIntervalFlatPdf(double min, double max); + EvtIntervalFlatPdf(const EvtIntervalFlatPdf& other); + virtual ~EvtIntervalFlatPdf(); + virtual EvtPdf* clone() const; + + virtual EvtValError compute_integral() const; + virtual EvtPoint1D randomPoint(); + + protected: + + virtual double pdf(const EvtPoint1D&) const; + + double _min; + double _max; + }; + + #endif Index: EvtGenBase/EvtKine.hh =================================================================== RCS file: /nfs/cleo3/cvsroot/Offline/src/EvtGenBase/EvtGenBase/EvtKine.hh,v retrieving revision 1.1.1.1 retrieving revision 1.3 diff -c -r1.1.1.1 -r1.3 *** EvtGenBase/EvtKine.hh 7 Oct 2003 02:47:01 -0000 1.1.1.1 --- EvtGenBase/EvtKine.hh 12 Jan 2006 16:09:54 -0000 1.3 *************** *** 22,27 **** --- 22,28 ---- #define EVTKINE_HH class EvtVector4R; + class EvtComplex; double EvtDecayAngle(const EvtVector4R&, const EvtVector4R&, const EvtVector4R&); *************** *** 36,42 **** // in the parent frame. // double EvtDecayPlaneNormalAngle(const EvtVector4R& p,const EvtVector4R& q, ! const EvtVector4R& d1,const EvtVector4R& d2); #endif --- 37,76 ---- // in the parent frame. // double EvtDecayPlaneNormalAngle(const EvtVector4R& p,const EvtVector4R& q, ! const EvtVector4R& d1,const EvtVector4R& d2); ! ! ! ! // Added by AJB ! // ! // Calculate phi (between 0 and 2 pi) of the daughter given the 4-momentum of ! // the grandparent, parent, resonance and the daughter. g, p, q and d need to ! // be in the same rest frame. Note that for the first level of the tree there ! // is no grandparent and thus <0,0,0,1> should be passed in for g. When there ! // is no parent the angles need to be calculated by simply by calculating polar ! // and azymuthal angles in the rest frame of the resonance (since this will ! // generally be the root particle and is generally at rest the polar and ! // azymuthal angels can simply be calculated. ! // ! double EvtDecayAnglePhi( const EvtVector4R& g, const EvtVector4R& p, ! const EvtVector4R& q, const EvtVector4R& d ); ! ! // Wigner big-D function in Jackson convention ! // ! // XXX NOTE XXX ! // - EvtDecayAngle returns the cos \theta and EvtdFunction requires theta ! // - In EvtdFunction j m1 and m2 are really 2 * j, 2 * m1, 2*m2 to deal with ! // spin 1/2 particles ! // ! EvtComplex wignerD( int j, int m1, int m2, double phi, double theta, ! double gamma ); ! #endif + + + + + + Index: EvtGenBase/EvtMBreitWigner.hh =================================================================== RCS file: EvtGenBase/EvtMBreitWigner.hh diff -N EvtGenBase/EvtMBreitWigner.hh *** /dev/null 1 Jan 1970 00:00:00 -0000 --- EvtGenBase/EvtMBreitWigner.hh 24 Dec 2004 16:18:36 -0000 1.1 *************** *** 0 **** --- 1,22 ---- + #ifndef __EVTMBREITWIGNER_HH__ + #define __EVTMBREITWIGNER_HH__ + + #include "EvtGenBase/EvtMRes.hh" + + class EvtMBreitWigner : public EvtMLineShape { + + public: + EvtMBreitWigner( const EvtId& id, const vector& args ); + ~EvtMBreitWigner( ) {}; + + EvtComplex shape( const vector& product ) const; + + EvtMLineShape * duplicate() const; + + private: + EvtId _id; + + double _width, _resmass; + }; + + #endif Index: EvtGenBase/EvtMHelAmp.hh =================================================================== RCS file: EvtGenBase/EvtMHelAmp.hh diff -N EvtGenBase/EvtMHelAmp.hh *** /dev/null 1 Jan 1970 00:00:00 -0000 --- EvtGenBase/EvtMHelAmp.hh 13 Jan 2005 17:25:36 -0000 1.2 *************** *** 0 **** --- 1,24 ---- + #ifndef __EVTMHELAMP_HH__ + #define __EVTMHELAMP_HH__ + + #include "EvtGenBase/EvtMRes.hh" + + class EvtMHelAmp : public EvtMRes { + + public: + + EvtMHelAmp( const EvtId& id, EvtMLineShape *, const + vector&, const vector& ); + virtual ~EvtMHelAmp() {}; + + EvtSpinAmp amplitude( const vector& product ) + const; + + EvtMNode * duplicate() const; + + private: + + vector _elem; + }; + + #endif Index: EvtGenBase/EvtMNode.hh =================================================================== RCS file: EvtGenBase/EvtMNode.hh diff -N EvtGenBase/EvtMNode.hh *** /dev/null 1 Jan 1970 00:00:00 -0000 --- EvtGenBase/EvtMNode.hh 12 Jan 2006 16:09:54 -0000 1.3 *************** *** 0 **** --- 1,72 ---- + #ifndef __EVTMNODE_HH__ + #define __EVTMNODE_HH__ + + #include "EvtGenBase/EvtVector4R.hh" + #include "EvtGenBase/EvtComplex.hh" + #include "EvtGenBase/EvtPDL.hh" + + #include "EvtGenBase/EvtSymTable.hh" + #include "EvtGenBase/EvtSpinAmp.hh" + + #include + using std::vector; + + #include + using std::string; + + class EvtMNode { + + public: + + EvtMNode() {} + virtual ~EvtMNode() {}; + + // calculate the amplitude associated event this->children return a + // vector of the form A_{\lambda this} and sum over allowed angular + // momenta of the children + virtual EvtSpinAmp amplitude( const vector + &product ) const = 0; + + // get the 4 vector associated with this node + EvtVector4R get4vector( const vector &product ) const; + + // get twice the spin of the particle + int getspin() const { return _twospin; } + EvtSpinType::spintype getspintype() const { return EvtPDL::getSpinType( _id ); } + + // get the id of this node + EvtId getid() const { return _id; } + + // return which particles this is a combination of + const vector & getresonance() const { return _resonance; } + + void setparent( EvtMNode * parent ) { _parent = parent; } + EvtMNode * getparent() const { return _parent; } + + // get the number of children that this node has + virtual int getnchild() const = 0; + + // return the value of the resonance shape + virtual EvtComplex line( const vector& product ) const=0; + + // return a pointer node + virtual EvtMNode * duplicate() const=0; + protected: + + // store the EvtId of the particle (just in case we need it to access + // further informatoin about it) + EvtId _id; + + // store TWICE the spin of this resonance (this is to deal with spin 1/2 + int _twospin; + + // store the particles that form this resonance, this should match up + // with the child nodes from below, and is calculated internally + vector _resonance; + + // store the parent node of this one + EvtMNode * _parent; + + }; + + #endif Index: EvtGenBase/EvtMParticle.hh =================================================================== RCS file: EvtGenBase/EvtMParticle.hh diff -N EvtGenBase/EvtMParticle.hh *** /dev/null 1 Jan 1970 00:00:00 -0000 --- EvtGenBase/EvtMParticle.hh 13 Jan 2005 17:25:36 -0000 1.2 *************** *** 0 **** --- 1,21 ---- + #ifndef __EVTMPARTICLE_HH__ + #define __EVTMPARTICLE_HH__ + + #include "EvtGenBase/EvtMNode.hh" + + class EvtMParticle : public EvtMNode { + + public: + + EvtMParticle( int label, const EvtId& id ); + virtual ~EvtMParticle() {} + EvtSpinAmp amplitude( const vector& product ) const; + int getnchild() const { return 0; } + + EvtComplex line( const vector& product ) const + { return EvtComplex(1.0, 0.0); } + + EvtMNode * duplicate() const; + }; + + #endif Index: EvtGenBase/EvtMRes.hh =================================================================== RCS file: EvtGenBase/EvtMRes.hh diff -N EvtGenBase/EvtMRes.hh *** /dev/null 1 Jan 1970 00:00:00 -0000 --- EvtGenBase/EvtMRes.hh 13 Jan 2005 17:25:36 -0000 1.2 *************** *** 0 **** --- 1,48 ---- + #ifndef __EVTMRES_HH__ + #define __EVTMRES_HH__ + + #include "EvtGenBase/EvtMNode.hh" + + class EvtMRes; + + class EvtMLineShape { + + public: + + virtual ~EvtMLineShape() {}; + + void setres( EvtMRes * n ) { _node = n; } + virtual EvtComplex shape( const vector& product ) const=0; + + virtual EvtMLineShape * duplicate() const=0; + + protected: + + EvtMRes * _node; + }; + + class EvtMRes : public EvtMNode { + + public: + + virtual ~EvtMRes(); + + int getnchild() const { return _children.size(); } + + virtual EvtComplex line( const vector& product ) const + { return _lineshape->shape( product ); } + + protected: + + // store the child nodes + vector _children; + + // store the parametrization amplitudes in some kind + EvtSpinAmp _amp; + + // store the lineshape of the resonance + EvtMLineShape * _lineshape; + + }; + + #endif Index: EvtGenBase/EvtMTree.hh =================================================================== RCS file: EvtGenBase/EvtMTree.hh diff -N EvtGenBase/EvtMTree.hh *** /dev/null 1 Jan 1970 00:00:00 -0000 --- EvtGenBase/EvtMTree.hh 10 Apr 2005 23:57:22 -0000 1.3 *************** *** 0 **** --- 1,64 ---- + #ifndef __EVTMTREE_HH__ + #define __EVTMTREE_HH__ + + #include "EvtGenBase/EvtPDL.hh" + #include "EvtGenBase/EvtSpinAmp.hh" + #include "EvtGenBase/EvtComplex.hh" + #include "EvtGenBase/EvtVector4R.hh" + + #include "EvtGenBase/EvtMNode.hh" + #include "EvtGenBase/EvtMParticle.hh" + #include "EvtGenBase/EvtMRes.hh" + + #include + using std::vector; + + #include + using std::string; + + typedef string::const_iterator ptype; + + class EvtParticle; + + class EvtMTree { + + public: + + EvtMTree( const EvtId * , int ); + ~EvtMTree( ); + + // return the invariant amplitude of the entire tree + EvtSpinAmp amplitude( EvtParticle * ) const; + + // add a decay tree to the list of trees that we posess + void addtree( const string& ); + + private: + + vector< EvtMNode * > _root; + vector _lbltbl; + double _norm; + + bool parsecheck( char , const string& ); + void parseerror( bool, ptype&, ptype&, ptype& ); + + string parseId( ptype&, ptype&, ptype& ); + string parseKey( ptype&, ptype&, ptype& ); + vector parseArg( ptype&, ptype&, ptype& ); + vector parseAmps( ptype&, ptype&, ptype& ); + vector duplicate( const vector& ) const; + vector > unionChildren( const string&, + vector >& ); + vector > parseChildren( ptype&, ptype&, ptype& ); + vector parsenode( const string& , bool ); + bool validTree( const EvtMNode * ) const; + + vector makeparticles( const string& ); + EvtMRes * makeresonance( const EvtId&, const string &, const + vector&, const string& , const vector& , + const vector& ); + + EvtSpinAmp getrotation( EvtParticle * ) const; + }; + + #endif Index: EvtGenBase/EvtMTrivialLS.hh =================================================================== RCS file: EvtGenBase/EvtMTrivialLS.hh diff -N EvtGenBase/EvtMTrivialLS.hh *** /dev/null 1 Jan 1970 00:00:00 -0000 --- EvtGenBase/EvtMTrivialLS.hh 24 Dec 2004 16:18:37 -0000 1.1 *************** *** 0 **** --- 1,18 ---- + #ifndef __EVTMTRIVIALLS_H__ + #define __EVTMTRIVIALLS_H__ + + #include "EvtGenBase/EvtMRes.hh" + + class EvtMTrivialLS : public EvtMLineShape { + + public: + + EvtMTrivialLS( const EvtId& id, const vector& args ) {}; + ~EvtMTrivialLS() {}; + + EvtComplex shape( const vector& product ) const; + + EvtMLineShape* duplicate() const; + }; + + #endif Index: EvtGenBase/EvtMacros.hh =================================================================== RCS file: /nfs/cleo3/cvsroot/Offline/src/EvtGenBase/EvtGenBase/EvtMacros.hh,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -c -r1.1.1.1 -r1.2 *** EvtGenBase/EvtMacros.hh 7 Oct 2003 02:47:01 -0000 1.1.1.1 --- EvtGenBase/EvtMacros.hh 12 Jan 2006 16:09:54 -0000 1.2 *************** *** 1,7 **** /******************************************************************************* * Project: BaBar detector at the SLAC PEP-II B-factory * Package: EvtGenBase ! * File: $Id: EvtMacros.hh,v 1.1.1.1 2003/10/07 02:47:01 ryd Exp $ * Author: Alexei Dvoretskii, dvoretsk@slac.stanford.edu, 2001-2002 * * Copyright (C) 2002 Caltech --- 1,7 ---- /******************************************************************************* * Project: BaBar detector at the SLAC PEP-II B-factory * Package: EvtGenBase ! * File: $Id: EvtMacros.hh,v 1.2 2006/01/12 16:09:54 ryd Exp $ * Author: Alexei Dvoretskii, dvoretsk@slac.stanford.edu, 2001-2002 * * Copyright (C) 2002 Caltech Index: EvtGenBase/EvtMassAmp.hh =================================================================== RCS file: /nfs/cleo3/cvsroot/Offline/src/EvtGenBase/EvtGenBase/EvtMassAmp.hh,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -c -r1.1.1.1 -r1.2 *** EvtGenBase/EvtMassAmp.hh 7 Oct 2003 02:47:02 -0000 1.1.1.1 --- EvtGenBase/EvtMassAmp.hh 12 Jan 2006 16:09:54 -0000 1.2 *************** *** 1,6 **** //----------------------------------------------------------------------- // File and Version Information: ! // $Id: EvtMassAmp.hh,v 1.1.1.1 2003/10/07 02:47:02 ryd Exp $ // // Environment: // This software is part of the EvtGen package developed jointly --- 1,6 ---- //----------------------------------------------------------------------- // File and Version Information: ! // $Id: EvtMassAmp.hh,v 1.2 2006/01/12 16:09:54 ryd Exp $ // // Environment: // This software is part of the EvtGen package developed jointly *************** *** 21,43 **** #ifndef EVT_MASSAMP_HH #define EVT_MASSAMP_HH ! #include "EvtGenBase/EvtInterval1D.hh" #include "EvtGenBase/EvtAmplitude.hh" #include "EvtGenBase/EvtPropBreitWignerRel.hh" #include "EvtGenBase/EvtTwoBodyVertex.hh" ! class EvtMassAmp : public EvtAmplitude { ! public: - EvtMassAmp(const EvtPropBreitWignerRel& prop, const EvtTwoBodyVertex& vd); EvtMassAmp(const EvtMassAmp& other); virtual ~EvtMassAmp(); virtual EvtComplex amplitude(const EvtPoint1D& p) const; ! virtual EvtMassAmp* clone() const { return new EvtMassAmp(*this); } void setBirthVtx(const EvtTwoBodyVertex& vb) --- 21,41 ---- #ifndef EVT_MASSAMP_HH #define EVT_MASSAMP_HH ! #include "EvtGenBase/EvtPoint1D.hh" #include "EvtGenBase/EvtAmplitude.hh" #include "EvtGenBase/EvtPropBreitWignerRel.hh" #include "EvtGenBase/EvtTwoBodyVertex.hh" ! class EvtMassAmp : public EvtAmplitude { public: EvtMassAmp(const EvtPropBreitWignerRel& prop, const EvtTwoBodyVertex& vd); EvtMassAmp(const EvtMassAmp& other); virtual ~EvtMassAmp(); virtual EvtComplex amplitude(const EvtPoint1D& p) const; ! virtual EvtAmplitude* clone() const { return new EvtMassAmp(*this); } void setBirthVtx(const EvtTwoBodyVertex& vb) *************** *** 49,54 **** --- 47,53 ---- void addDeathFact() { _useDeathFact = true; } void addBirthFactFF() { _useBirthFactFF = true; } void addDeathFactFF() { _useDeathFactFF = true; } + void fixUpMassForMax() { _fixUpMassForMax = true;} private: *************** *** 60,66 **** bool _useDeathFact; bool _useBirthFactFF; bool _useDeathFactFF; ! }; --- 59,65 ---- bool _useDeathFact; bool _useBirthFactFF; bool _useDeathFactFF; ! bool _fixUpMassForMax; }; Index: EvtGenBase/EvtModel.hh =================================================================== RCS file: /nfs/cleo3/cvsroot/Offline/src/EvtGenBase/EvtGenBase/EvtModel.hh,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -c -r1.1.1.1 -r1.2 *** EvtGenBase/EvtModel.hh 7 Oct 2003 02:47:02 -0000 1.1.1.1 --- EvtGenBase/EvtModel.hh 12 Jan 2006 16:09:54 -0000 1.2 *************** *** 24,30 **** #include "EvtGenBase/EvtDecayBase.hh" #include "EvtGenBase/EvtStringHash.hh" #include ! //#include //Class to read in and handle the decays available --- 24,30 ---- #include "EvtGenBase/EvtDecayBase.hh" #include "EvtGenBase/EvtStringHash.hh" #include ! //#include //Class to read in and handle the decays available Index: EvtGenBase/EvtMultiChannelParser.hh =================================================================== RCS file: /nfs/cleo3/cvsroot/Offline/src/EvtGenBase/EvtGenBase/EvtMultiChannelParser.hh,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -c -r1.1.1.1 -r1.2 *** EvtGenBase/EvtMultiChannelParser.hh 7 Oct 2003 02:47:02 -0000 1.1.1.1 --- EvtGenBase/EvtMultiChannelParser.hh 12 Jan 2006 16:09:54 -0000 1.2 *************** *** 1,6 **** //----------------------------------------------------------------------- // File and Version Information: ! // $Id: EvtMultiChannelParser.hh,v 1.1.1.1 2003/10/07 02:47:02 ryd Exp $ // // Environment: // This software is part of the EvtGen package developed jointly --- 1,6 ---- //----------------------------------------------------------------------- // File and Version Information: ! // $Id: EvtMultiChannelParser.hh,v 1.2 2006/01/12 16:09:54 ryd Exp $ // // Environment: // This software is part of the EvtGen package developed jointly *************** *** 26,35 **** class EvtDecayMode; class EvtMultiChannelParser { public: ! EvtMultiChannelParser() : _pdfMax(-1.), _nScan(0), _dm(0.) {} ~EvtMultiChannelParser() {} --- 26,37 ---- class EvtDecayMode; + enum {POLAR_RAD,POLAR_DEG,CARTESIAN}; + class EvtMultiChannelParser { public: ! EvtMultiChannelParser() : _pdfMax(-1.), _nScan(0), _dm(0.) {} ~EvtMultiChannelParser() {} *************** *** 38,44 **** void parse(const char* file, const char* model); void parse(const std::vector& v); ! static EvtComplex parseComplexCoef(int& i, const std::vector& v); static double parseRealCoef(int& i, const std::vector& v); static bool isKeyword(const std::string& s); --- 40,47 ---- void parse(const char* file, const char* model); void parse(const std::vector& v); ! static void parseComplexCoef(int& i, const std::vector& v, ! EvtComplex& c, int& format); static double parseRealCoef(int& i, const std::vector& v); static bool isKeyword(const std::string& s); *************** *** 51,56 **** --- 54,62 ---- inline EvtComplex ampCoef(int i) const { return _ampCoef[i]; } inline EvtComplex ampConjCoef(int i) const { return _ampConjCoef[i]; } + inline int coefFormat(int i) const { return _coefFormat[i]; } + inline int coefConjFormat(int i) const { return _coefConjFormat[i]; } + inline int getNAmp() const { return _amp.size(); } inline int getNAmpConj() const { return _ampConj.size(); } *************** *** 63,69 **** --- 69,77 ---- std::vector > _amp; std::vector > _ampConj; std::vector _ampCoef; + std::vector _coefFormat; std::vector _ampConjCoef; + std::vector _coefConjFormat; }; #endif Index: EvtGenBase/EvtPDL.hh =================================================================== RCS file: /nfs/cleo3/cvsroot/Offline/src/EvtGenBase/EvtGenBase/EvtPDL.hh,v retrieving revision 1.2 retrieving revision 1.4 diff -c -r1.2 -r1.4 *** EvtGenBase/EvtPDL.hh 19 Feb 2004 18:24:43 -0000 1.2 --- EvtGenBase/EvtPDL.hh 6 Jun 2006 17:16:00 -0000 1.4 *************** *** 38,43 **** --- 38,44 ---- ~EvtPDL(); + void read(const char* fname); void readPDT(const std::string fname); *************** *** 63,69 **** static std::string name(EvtId i){return partlist()[i.getAlias()].getName();} static void alias(EvtId num,const std::string& newname); static void aliasChgConj(EvtId a,EvtId abar); ! static int entries() { return partlist().size();} static void reSetMass(EvtId i, double mass) { partlist()[i.getId()].reSetMass(mass);} static void reSetWidth(EvtId i, double width) { partlist()[i.getId()].reSetWidth(width);} static void reSetMassMin(EvtId i, double mass) { partlist()[i.getId()].reSetMassMin(mass);} --- 64,70 ---- static std::string name(EvtId i){return partlist()[i.getAlias()].getName();} static void alias(EvtId num,const std::string& newname); static void aliasChgConj(EvtId a,EvtId abar); ! static size_t entries() { return partlist().size();} static void reSetMass(EvtId i, double mass) { partlist()[i.getId()].reSetMass(mass);} static void reSetWidth(EvtId i, double width) { partlist()[i.getId()].reSetWidth(width);} static void reSetMassMin(EvtId i, double mass) { partlist()[i.getId()].reSetMassMin(mass);} *************** *** 72,78 **** static void includeBirthFactor(EvtId i,bool yesno) {partlist()[i.getId()].includeBirthFactor(yesno);} static void includeDecayFactor(EvtId i,bool yesno) {partlist()[i.getId()].includeDecayFactor(yesno);} static void changeLS(EvtId i, std::string &newLS ) { partlist()[i.getId()].newLineShape(newLS);} ! private: void setUpConstsPdt(); --- 73,81 ---- static void includeBirthFactor(EvtId i,bool yesno) {partlist()[i.getId()].includeBirthFactor(yesno);} static void includeDecayFactor(EvtId i,bool yesno) {partlist()[i.getId()].includeDecayFactor(yesno);} static void changeLS(EvtId i, std::string &newLS ) { partlist()[i.getId()].newLineShape(newLS);} ! static void setPWForDecay(EvtId i, int spin, EvtId d1, EvtId d2) { partlist()[i.getId()].setPWForDecay(spin,d1,d2);} ! static void setPWForBirthL(EvtId i, int spin, EvtId par, EvtId othD) { partlist()[i.getId()].setPWForBirthL(spin,par,othD);} ! static void fixLSForSP6(EvtId i) { partlist()[i.getId()].fixLSForSP6();} private: void setUpConstsPdt(); *************** *** 80,87 **** static int _firstAlias; static int _nentries; ! static std::vector& partlist() { ! static std::vector s_partlist; return s_partlist; } --- 83,90 ---- static int _firstAlias; static int _nentries; ! static std::vector& partlist() { ! static std::vector s_partlist; return s_partlist; } *************** *** 92,97 **** #endif - - - --- 95,97 ---- Index: EvtGenBase/EvtPartProp.hh =================================================================== RCS file: /nfs/cleo3/cvsroot/Offline/src/EvtGenBase/EvtGenBase/EvtPartProp.hh,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -c -r1.1.1.1 -r1.2 *** EvtGenBase/EvtPartProp.hh 7 Oct 2003 02:47:02 -0000 1.1.1.1 --- EvtGenBase/EvtPartProp.hh 12 Jan 2006 16:09:54 -0000 1.2 *************** *** 27,33 **** #include #include "EvtGenBase/EvtAbsLineShape.hh" - class EvtAbsLineShape; class EvtPartProp { --- 27,32 ---- *************** *** 89,96 **** void reSetBlatt(double blatt); void includeBirthFactor(bool yesno); void includeDecayFactor(bool yesno); ! void EvtPartProp::newLineShape(std::string type); ! private: --- 88,97 ---- void reSetBlatt(double blatt); void includeBirthFactor(bool yesno); void includeDecayFactor(bool yesno); ! void newLineShape(std::string type); ! void setPWForDecay( int spin, EvtId d1, EvtId d2); ! void setPWForBirthL( int spin, EvtId par, EvtId othD); ! void fixLSForSP6() {_lineShape->fixForSP6();} private: Index: EvtGenBase/EvtParticle.hh =================================================================== RCS file: /nfs/cleo3/cvsroot/Offline/src/EvtGenBase/EvtGenBase/EvtParticle.hh,v retrieving revision 1.1.1.1 retrieving revision 1.3 diff -c -r1.1.1.1 -r1.3 *** EvtGenBase/EvtParticle.hh 7 Oct 2003 02:47:02 -0000 1.1.1.1 --- EvtGenBase/EvtParticle.hh 19 Oct 2007 02:47:08 -0000 1.3 *************** *** 21,32 **** #ifndef EVTPARTICLE_HH #define EVTPARTICLE_HH ! //#include #include #include "EvtGenBase/EvtVector4R.hh" #include "EvtGenBase/EvtSpinDensity.hh" #include "EvtGenBase/EvtId.hh" #include "EvtGenBase/EvtSpinType.hh" class EvtDiracSpinor; class EvtVector4C; --- 21,33 ---- #ifndef EVTPARTICLE_HH #define EVTPARTICLE_HH ! //#include #include #include "EvtGenBase/EvtVector4R.hh" #include "EvtGenBase/EvtSpinDensity.hh" #include "EvtGenBase/EvtId.hh" #include "EvtGenBase/EvtSpinType.hh" + #include class EvtDiracSpinor; class EvtVector4C; *************** *** 149,155 **** */ double initializePhaseSpace(int numdaughter,EvtId *daughters, double poleSize=-1., int whichTwo1=0, ! int whichTwo2=0); /** * Get pointer the the i:th daugther. --- 150,156 ---- */ double initializePhaseSpace(int numdaughter,EvtId *daughters, double poleSize=-1., int whichTwo1=0, ! int whichTwo2=1); /** * Get pointer the the i:th daugther. *************** *** 175,180 **** --- 176,188 ---- EvtVector4R getP4Lab(); /** + * Gets 4vector in the labframe for the 4-momentum befor FSR was + * generated in the parents decay. The lab frame is where the root + * particles momentum is measured. + */ + EvtVector4R getP4LabBeforeFSR(); + + /** * Gets 4vector in the particles restframe, i.e. this functiont will * return (m,0,0,0) */ *************** *** 231,237 **** /** * Sets the 4momentum in the parents restframe. */ ! void setP4(const EvtVector4R& p4){_p=p4;} /** * Retunrs the decay channel. --- 239,256 ---- /** * Sets the 4momentum in the parents restframe. */ ! void setP4(const EvtVector4R& p4){ ! _p=p4; ! _pBeforeFSR=p4; ! } ! ! void setP4WithFSR(const EvtVector4R& p4){ ! _p=p4; ! } ! ! void setFSRP4toZero(){ ! _pBeforeFSR.set(0.0,0.0,0.0,0.0); ! } /** * Retunrs the decay channel. *************** *** 253,258 **** --- 272,280 ---- void printTreeRec(int level) const; + std::string treeStr() const; + std::string treeStrRec(int level) const; + /** * Prints information for the particle. */ *************** *** 289,295 **** void setSpinDensityForward(const EvtSpinDensity& rho){_rhoForward=rho;} /** ! * Set forward spin density matric according to the density matrix * rho in the helicity amplitude basis. */ void setSpinDensityForwardHelicityBasis(const EvtSpinDensity& rho); --- 311,317 ---- void setSpinDensityForward(const EvtSpinDensity& rho){_rhoForward=rho;} /** ! * Set forward spin density matrix according to the density matrix * rho in the helicity amplitude basis. */ void setSpinDensityForwardHelicityBasis(const EvtSpinDensity& rho); *************** *** 350,359 **** bool isInitialized() {return _isInit;} bool hasValidP4() {return _validP4;} bool isDecayed() {return _isDecayed;} protected: ! void setp( double e, double px, double py, double pz) { _p.set(e,px,py,pz); } ! void setp( const EvtVector4R& p4 ) { _p =p4; } void setpart_num(EvtId particle_number ) { assert(_channel==-10|| --- 372,396 ---- bool isInitialized() {return _isInit;} bool hasValidP4() {return _validP4;} bool isDecayed() {return _isDecayed;} + + + // decay prob - only relevent if already decayed + // and is a scalar particle + // returned is a double* that should be prob/probMax + double* decayProb() {return _decayProb;} + void setDecayProb( double p); + + protected: ! void setp( double e, double px, double py, double pz) { ! _p.set(e,px,py,pz); ! _pBeforeFSR=_p; ! } ! void setp( const EvtVector4R& p4 ) { ! _p =p4; ! _pBeforeFSR=_p; ! } void setpart_num(EvtId particle_number ) { assert(_channel==-10|| *************** *** 372,377 **** --- 409,415 ---- int _first; EvtId _id; EvtVector4R _p; + EvtVector4R _pBeforeFSR; double _t; bool _isInit; bool _isDecayed; *************** *** 394,399 **** --- 432,439 ---- EvtParticle& operator=(const EvtParticle& p); EvtParticle(const EvtParticle& p); + double *_decayProb; + }; #endif Index: EvtGenBase/EvtParticleDecayList.hh =================================================================== RCS file: /nfs/cleo3/cvsroot/Offline/src/EvtGenBase/EvtGenBase/EvtParticleDecayList.hh,v retrieving revision 1.1.1.1 retrieving revision 1.4 diff -c -r1.1.1.1 -r1.4 *** EvtGenBase/EvtParticleDecayList.hh 7 Oct 2003 02:47:03 -0000 1.1.1.1 --- EvtGenBase/EvtParticleDecayList.hh 1 Apr 2008 20:41:07 -0000 1.4 *************** *** 39,51 **** ~EvtParticleDecayList(); int getNMode(){return _nmode;} void setNMode(int nmode); EvtDecayBase* getDecayModel(EvtParticle *p); - EvtDecayBase* getDecayModel(int imode) {return _decaylist[imode]->getDecayModel();} EvtParticleDecay& getDecay(int nchannel); --- 39,53 ---- ~EvtParticleDecayList(); + EvtParticleDecayList& operator=(const EvtParticleDecayList &o); + int getNMode(){return _nmode;} void setNMode(int nmode); EvtDecayBase* getDecayModel(EvtParticle *p); + EvtDecayBase* getDecayModel(int imode) {return _decaylist[imode]->getDecayModel();} EvtParticleDecay& getDecay(int nchannel); *************** *** 61,66 **** --- 63,69 ---- } void addMode(EvtDecayBase* decay,double brfr,double massmin); + void removeMode(EvtDecayBase* decay); void finalize(); void printSummary(); Index: EvtGenBase/EvtPdf.hh =================================================================== RCS file: /nfs/cleo3/cvsroot/Offline/src/EvtGenBase/EvtGenBase/EvtPdf.hh,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -c -r1.1.1.1 -r1.2 *** EvtGenBase/EvtPdf.hh 7 Oct 2003 02:47:03 -0000 1.1.1.1 --- EvtGenBase/EvtPdf.hh 12 Jan 2006 16:09:55 -0000 1.2 *************** *** 1,24 **** /******************************************************************************* * Project: BaBar detector at the SLAC PEP-II B-factory * Package: EvtGenBase ! * File: $Id: EvtPdf.hh,v 1.1.1.1 2003/10/07 02:47:03 ryd Exp $ * Author: Alexei Dvoretskii, dvoretsk@slac.stanford.edu, 2001-2002 * * Copyright (C) 2002 Caltech *******************************************************************************/ ! // Probability density function defined on a phase-space interval. ! // The function is positive-definite. It is normalized such that its integral ! // over the interval is unity. EvtPdf is a base class and can't be used as ! // a functor directly. Adapters are provided for STL-like use. ! #ifndef EVT_PDF_HH #define EVT_PDF_HH #include ! #include ! #include "EvtGenBase/EvtInterval.hh" #include "EvtGenBase/EvtValError.hh" #include "EvtGenBase/EvtPredGen.hh" #include "EvtGenBase/EvtStreamInputIterator.hh" --- 1,49 ---- /******************************************************************************* * Project: BaBar detector at the SLAC PEP-II B-factory * Package: EvtGenBase ! * File: $Id: EvtPdf.hh,v 1.2 2006/01/12 16:09:55 ryd Exp $ * Author: Alexei Dvoretskii, dvoretsk@slac.stanford.edu, 2001-2002 * * Copyright (C) 2002 Caltech *******************************************************************************/ ! /* ! * All classes are templated on the point type T ! * ! * EvtPdf: ! * ! * Probability density function defined on an interval of phase-space. ! * Integral over the interval can be calculated by Monte Carlo integration. ! * Some (but not all) PDFs are analytic in the sense that they can be integrated ! * by numeric quadrature and distributions can be generated according to them. ! * ! * EvtPdfGen: ! * ! * Generator adaptor. Can be used to generate random points ! * distributed according to the PDF for analytic PDFs. ! * ! * EvtPdfPred: ! * ! * Predicate adaptor for PDFs. Can be used for generating random points distributed ! * according to the PDF for any PDF using rejection method. (See "Numerical Recipes"). ! * ! * EvtPdfUnary: ! * ! * Adapter for generic algorithms. Evaluates the PDF and returns the value ! * ! * EvtPdfDiv: ! * ! * PDF obtained by division of one PDF by another. Because the two PDFs are ! * arbitrary this PDF is not analytic. When importance sampling is used the ! * original PDF is divided by the analytic comparison function. EvtPdfDiv is ! * used to represent the modified PDF. ! */ #ifndef EVT_PDF_HH #define EVT_PDF_HH #include ! #include #include "EvtGenBase/EvtValError.hh" #include "EvtGenBase/EvtPredGen.hh" #include "EvtGenBase/EvtStreamInputIterator.hh" *************** *** 26,157 **** #include "EvtGenBase/EvtMacros.hh" #include "EvtGenBase/EvtRandom.hh" ! // PDF ! template class EvtPdfUnary; ! template class EvtPdfDiv; ! ! template class EvtPdf { public: - typedef typename Interval::point_type Point; EvtPdf() {} EvtPdf(const EvtPdf& other) : _itg(other._itg) {} virtual ~EvtPdf() {} ! virtual EvtPdf* clone() const = 0; ! double evaluate(const Point& p) const ! { ! double ret = 0.; ! if(p.isValid()) ret = pdf(p); ! return ret; } ! // For some subclasses the following functions can be implemented ! virtual EvtValError compute_mc_integral(const Interval& ival, int N) ! { ! if(!ival.sizeKnown()) { ! report(INFO,"EvtGen") << "PDF defined on an interval with unknown size" << std::endl; ! assert(0); ! } ! EvtPdfUnary unary(*this); ! EvtIntervalGen gen(ival); ! EvtStreamInputIterator begin = iter(gen,N); ! EvtStreamInputIterator end; ! EvtValError avdev = average_and_dev(begin,end,unary); ! _itg = avdev * ival.getSize(); return _itg; } ! ! template ! EvtValError compute_mc_integral(const EvtPdf& pdf, EvtValError otherItg, Generator gen, int N) ! { ! EvtPdfDiv pdfdiv(*this,pdf); ! EvtPdfUnary unary(pdfdiv); ! ! EvtStreamInputIterator begin = iter(gen,N); ! EvtStreamInputIterator end; ! EvtValError av = average_and_dev(begin,end,unary); ! assert(otherItg.valueKnown()); ! _itg = otherItg * av; return _itg; } ! EvtValError getItg() const ! { ! if(!_itg.valueKnown()) { ! report(INFO,"EvtGen") << "PDF integral has not been calculated" << std::endl; ! assert(0); ! } ! return _itg; ! } protected: ! virtual double pdf(const Point&) const = 0; ! EvtValError _itg; }; - // PDF obtained by dividing one PDF through another. This is useful in pole compensation. - // Note, that the integral and maximum must be computed by sampling. No all-purpose analytical - // formula exists. The denominator should not be zero anywhere on the interval. The interval is the - // same as in the denominator. ! template class EvtPdfDiv : public EvtPdf { public: ! typedef typename Interval::point_type Point; ! EvtPdfDiv() ! : itsNum(0), itsDen(0) {} ! EvtPdfDiv(const EvtPdf& theNum, const EvtPdf& theDen) ! : EvtPdf(), itsNum(theNum.clone()), itsDen(theDen.clone()) {} ! EvtPdfDiv(const EvtPdfDiv& other) ! : EvtPdf(other), COPY_PTR(itsNum), COPY_PTR(itsDen) ! {} ! virtual ~EvtPdfDiv() ! { ! delete itsNum; ! delete itsDen; ! } ! virtual EvtPdf* clone() const ! { ! return new EvtPdfDiv(*this); ! } ! virtual double pdf(const Point& p) const ! { ! double num = itsNum->evaluate(p); ! double den = itsDen->evaluate(p); ! ! assert(den != 0); ! return num/den; ! } private: ! EvtPdf* itsNum; // numerator ! EvtPdf* itsDen; // denominator ! }; ! - // PDF accept/reject, model of STL adaptable predicate ! template class EvtPdfPred { public: ! ! typedef typename Interval::point_type Point; ! typedef Point argument_type; typedef bool result_type; EvtPdfPred() {} ! EvtPdfPred(const EvtPdf& thePdf) : itsPdf(thePdf.clone()) {} EvtPdfPred(const EvtPdfPred& other) : COPY_PTR(itsPdf), COPY_MEM(itsPdfMax) {} ~EvtPdfPred() { delete itsPdf; } --- 51,145 ---- #include "EvtGenBase/EvtMacros.hh" #include "EvtGenBase/EvtRandom.hh" ! template class EvtPdfPred; ! template class EvtPdfGen; ! template class EvtPdf { public: EvtPdf() {} EvtPdf(const EvtPdf& other) : _itg(other._itg) {} virtual ~EvtPdf() {} ! virtual EvtPdf* clone() const = 0; ! double evaluate(const T& p) const { ! if(p.isValid()) return pdf(p); ! else return 0.; } ! // Find PDF maximum. Points are sampled according to pc ! EvtPdfMax findMax(const EvtPdf& pc, int N); ! // Find generation efficiency. ! EvtValError findGenEff(const EvtPdf& pc, int N, int nFindMax); ! ! // Analytic integration. Calls cascade down until an overridden ! // method is called. + void setItg(EvtValError itg) {_itg = itg; } + + EvtValError getItg() const { + if(!_itg.valueKnown()) _itg = compute_integral(); return _itg; } ! EvtValError getItg(int N) const { ! if(!_itg.valueKnown()) _itg = compute_integral(N); return _itg; } + + virtual EvtValError compute_integral() const + //make sun happy - return something + { printf("Analytic integration of PDF is not defined\n"); assert(0); return compute_integral();} + virtual EvtValError compute_integral(int N) const { return compute_integral(); } ! // Monte Carlo integration. ! EvtValError compute_mc_integral(const EvtPdf& pc, int N); ! ! // Generation. Create predicate accept-reject generators. ! // nMax iterations will be used to find the maximum of the accept-reject predicate ! ! EvtPredGen,EvtPdfPred > accRejGen(const EvtPdf& pc, int nMax, double factor = 1.); ! ! virtual T randomPoint(); protected: ! virtual double pdf(const T&) const = 0; ! mutable EvtValError _itg; }; ! template class EvtPdfGen { public: + typedef T result_type; ! EvtPdfGen() : _pdf(0) {} ! EvtPdfGen(const EvtPdfGen& other) : ! _pdf(other._pdf ? other._pdf->clone() : 0) {} ! EvtPdfGen(const EvtPdf& pdf) : ! _pdf(pdf.clone()) {} ! ~EvtPdfGen() { delete _pdf;} ! result_type operator()() {return _pdf->randomPoint();} private: ! EvtPdf* _pdf; ! }; ! template class EvtPdfPred { public: ! typedef T argument_type; typedef bool result_type; EvtPdfPred() {} ! EvtPdfPred(const EvtPdf& thePdf) : itsPdf(thePdf.clone()) {} EvtPdfPred(const EvtPdfPred& other) : COPY_PTR(itsPdf), COPY_MEM(itsPdfMax) {} ~EvtPdfPred() { delete itsPdf; } *************** *** 159,205 **** { assert(itsPdf); assert(itsPdfMax.valueKnown()); ! double random = EvtRandom::Flat(0.,itsPdfMax.value()); return (random <= itsPdf->evaluate(p)); } ! ! EvtPdfMax getMax() const { return itsPdfMax; } ! void setMax(const EvtPdfMax& max) { itsPdfMax = max; } ! template void compute_max(InputIterator it, InputIterator end) { ! Point p = *it++; ! itsPdfMax = EvtPdfMax(p,itsPdf->evaluate(p)); ! // while(it != end) { ! //keep sun happy ! while(!(it == end)) { ! ! Point p = *it++; ! double val = itsPdf->evaluate(p); ! if(val > itsPdfMax.value()) itsPdfMax = EvtPdfMax(p,val); } } private: ! EvtPdf* itsPdf; ! EvtPdfMax itsPdfMax; }; ! // Adaptable unary function adapter ! ! template class EvtPdfUnary { public: - - typedef typename Interval::point_type Point; typedef double result_type; ! typedef Point argument_type; - EvtPdfUnary() {} ! EvtPdfUnary(const EvtPdf& thePdf) : itsPdf(thePdf.clone()) {} EvtPdfUnary(const EvtPdfUnary& other) : COPY_PTR(itsPdf) {} ~EvtPdfUnary() { delete itsPdf; } --- 147,186 ---- { assert(itsPdf); assert(itsPdfMax.valueKnown()); ! double random = EvtRandom::Flat(0.,itsPdfMax.value()); return (random <= itsPdf->evaluate(p)); } ! ! EvtPdfMax getMax() const { return itsPdfMax; } ! void setMax(const EvtPdfMax& max) { itsPdfMax = max; } ! template void compute_max(InputIterator it, InputIterator end, ! double factor = 1.) { ! T p = *it++; ! itsPdfMax = EvtPdfMax(p,itsPdf->evaluate(p)*factor); ! while(!(it == end)) { ! T p = *it++; ! double val = itsPdf->evaluate(p)*factor; ! if(val > itsPdfMax.value()) itsPdfMax = EvtPdfMax(p,val); } } private: ! EvtPdf* itsPdf; ! EvtPdfMax itsPdfMax; }; ! template class EvtPdfUnary { public: typedef double result_type; ! typedef T argument_type; EvtPdfUnary() {} ! EvtPdfUnary(const EvtPdf& thePdf) : itsPdf(thePdf.clone()) {} EvtPdfUnary(const EvtPdfUnary& other) : COPY_PTR(itsPdf) {} ~EvtPdfUnary() { delete itsPdf; } *************** *** 209,250 **** double ret = itsPdf->evaluate(p); return ret; } ! private: ! EvtPdf* itsPdf; }; ! // Accept reject generator on the interval ! template ! EvtPredGen,EvtPdfPred > ! pdf_acc_rej(EvtPdf& pdf, Interval& source, int nFindMax = 0) ! { ! EvtIntervalGen gen(source); ! EvtPdfPred pred(pdf); - assert(pred.getMax().valueKnown() || nFindMax > 0); - pred.compute_max(iter(gen,nFindMax),iter(gen)); ! return EvtPredGen,EvtPdfPred >(gen,pred); } ! // Pole compensation accept reject ! template ! EvtPredGen > ! pdf_acc_rej(EvtPdf& pdf, EvtPdf& source, Generator gen, int nFindMax) { ! EvtPdfDiv pdfdiv(pdf,source); ! EvtPdfPred pred(pdfdiv); ! assert(nFindMax > 0); ! pred.compute_max(iter(gen,nFindMax),iter(gen)); ! return EvtPredGen >(gen,pred); } #endif --- 190,310 ---- double ret = itsPdf->evaluate(p); return ret; } ! private: ! EvtPdf* itsPdf; }; ! template class EvtPdfDiv : public EvtPdf { ! public: ! EvtPdfDiv() : itsNum(0), itsDen(0) {} ! EvtPdfDiv(const EvtPdf& theNum, const EvtPdf& theDen) ! : EvtPdf(), itsNum(theNum.clone()), itsDen(theDen.clone()) ! {} ! EvtPdfDiv(const EvtPdfDiv& other) ! : EvtPdf(other), COPY_PTR(itsNum), COPY_PTR(itsDen) ! {} ! virtual ~EvtPdfDiv() { delete itsNum; delete itsDen; } ! virtual EvtPdf* clone() const ! { return new EvtPdfDiv(*this); } ! ! virtual double pdf(const T& p) const ! { ! double num = itsNum->evaluate(p); ! double den = itsDen->evaluate(p); ! assert(den != 0); ! return num/den; ! } ! ! private: ! ! EvtPdf* itsNum; // numerator ! EvtPdf* itsDen; // denominator ! }; ! template ! EvtPdfMax EvtPdf::findMax(const EvtPdf& pc, int N) ! { ! EvtPdfPred pred(*this); ! EvtPdfGen gen(pc); ! pred.compute_max(iter(gen,N),iter(gen)); ! EvtPdfMax p = pred.getMax(); ! return p; } ! template ! EvtValError EvtPdf::findGenEff(const EvtPdf& pc, int N, int nFindMax) ! { ! assert(N > 0 || nFindMax > 0); ! EvtPredGen,EvtPdfPred > gen = accRejGen(pc,nFindMax); ! int i; ! for(i=0;i ! EvtValError EvtPdf::compute_mc_integral(const EvtPdf& pc, int N) { ! assert(N > 0); ! EvtValError otherItg = pc.getItg(); ! EvtPdfDiv pdfdiv(*this,pc); ! EvtPdfUnary unary(pdfdiv); ! ! EvtPdfGen gen(pc); ! EvtStreamInputIterator begin = iter(gen,N); ! EvtStreamInputIterator end; ! ! double sum = 0.; ! double sum2 = 0.; ! while(!(begin == end)) { ! ! double value = pdfdiv.evaluate(*begin++); ! sum += value; ! sum2 += value*value; ! } ! ! EvtValError x; ! if(N > 0) { ! double av = sum/((double) N); ! if(N > 1) { ! double dev2 = (sum2 - av*av*N)/((double) (N - 1)); ! // Due to numerical precision dev2 may sometimes be negative ! if(dev2 < 0.) dev2 = 0.; ! double error = sqrt(dev2/((double) N)); ! x = EvtValError(av,error); ! } ! else x = EvtValError(av); ! } ! _itg = x * pc.getItg(); ! return _itg; ! } ! template ! T EvtPdf::randomPoint() ! { ! printf("Function defined for analytic PDFs only\n"); ! assert(0); ! T temp; ! return temp; ! } ! ! template ! EvtPredGen,EvtPdfPred > ! EvtPdf::accRejGen(const EvtPdf& pc, int nMax, double factor) ! { ! EvtPdfGen gen(pc); ! EvtPdfDiv pdfdiv(*this,pc); ! EvtPdfPred pred(pdfdiv); ! pred.compute_max(iter(gen,nMax),iter(gen),factor); ! return EvtPredGen,EvtPdfPred >(gen,pred); } #endif Index: EvtGenBase/EvtPdfMax.hh =================================================================== RCS file: /nfs/cleo3/cvsroot/Offline/src/EvtGenBase/EvtGenBase/EvtPdfMax.hh,v retrieving revision 1.2 retrieving revision 1.3 diff -c -r1.2 -r1.3 *** EvtGenBase/EvtPdfMax.hh 2 Feb 2004 02:46:22 -0000 1.2 --- EvtGenBase/EvtPdfMax.hh 12 Jan 2006 16:09:55 -0000 1.3 *************** *** 1,7 **** /******************************************************************************* * Project: BaBar detector at the SLAC PEP-II B-factory * Package: EvtGenBase ! * File: $Id: EvtPdfMax.hh,v 1.2 2004/02/02 02:46:22 vk Exp $ * Author: Alexei Dvoretskii, dvoretsk@slac.stanford.edu, 2001-2002 * * Copyright (C) 2002 Caltech --- 1,7 ---- /******************************************************************************* * Project: BaBar detector at the SLAC PEP-II B-factory * Package: EvtGenBase ! * File: $Id: EvtPdfMax.hh,v 1.3 2006/01/12 16:09:55 ryd Exp $ * Author: Alexei Dvoretskii, dvoretsk@slac.stanford.edu, 2001-2002 * * Copyright (C) 2002 Caltech *************** *** 22,37 **** public: EvtPdfMax() ! : _valueKnown(false), _value(-1), _locKnown(false) {} EvtPdfMax(double value) ! : _valueKnown(true), _value(value), _locKnown(false) {} EvtPdfMax(Point p, double value) ! : _valueKnown(true), _value(value), _locKnown(true), _loc(p) {} EvtPdfMax(const EvtPdfMax& other) ! : COPY_MEM(_valueKnown), COPY_MEM(_value), COPY_MEM(_locKnown), COPY_MEM(_loc) {} ~EvtPdfMax() {} --- 22,37 ---- public: EvtPdfMax() ! : _value(-1),_valueKnown(false), _locKnown(false) {} EvtPdfMax(double value) ! : _value(value),_valueKnown(true), _locKnown(false) {} EvtPdfMax(Point p, double value) ! : _value(value), _valueKnown(true), _locKnown(true), _loc(p) {} EvtPdfMax(const EvtPdfMax& other) ! : COPY_MEM(_value), COPY_MEM(_valueKnown), COPY_MEM(_locKnown), COPY_MEM(_loc) {} ~EvtPdfMax() {} *************** *** 42,51 **** private: - bool _valueKnown; double _value; bool _locKnown; Point _loc; }; #endif --- 42,52 ---- private: double _value; + bool _valueKnown; bool _locKnown; Point _loc; + }; #endif Index: EvtGenBase/EvtPdfSum.hh =================================================================== RCS file: /nfs/cleo3/cvsroot/Offline/src/EvtGenBase/EvtGenBase/EvtPdfSum.hh,v retrieving revision 1.1.1.1 retrieving revision 1.3 diff -c -r1.1.1.1 -r1.3 *** EvtGenBase/EvtPdfSum.hh 7 Oct 2003 02:47:03 -0000 1.1.1.1 --- EvtGenBase/EvtPdfSum.hh 6 Jun 2006 17:16:00 -0000 1.3 *************** *** 1,7 **** /******************************************************************************* * Project: BaBar detector at the SLAC PEP-II B-factory * Package: EvtGenBase ! * File: $Id: EvtPdfSum.hh,v 1.1.1.1 2003/10/07 02:47:03 ryd Exp $ * Author: Alexei Dvoretskii, dvoretsk@slac.stanford.edu, 2001-2002 * * Copyright (C) 2002 Caltech --- 1,7 ---- /******************************************************************************* * Project: BaBar detector at the SLAC PEP-II B-factory * Package: EvtGenBase ! * File: $Id: EvtPdfSum.hh,v 1.3 2006/06/06 17:16:00 gregor Exp $ * Author: Alexei Dvoretskii, dvoretsk@slac.stanford.edu, 2001-2002 * * Copyright (C) 2002 Caltech *************** *** 12,111 **** #ifndef EVT_PDF_SUM_HH #define EVT_PDF_SUM_HH #include using std::vector; #include "EvtGenBase/EvtPdf.hh" ! template ! ! class EvtPdfSum : public EvtPdf { ! public: - typedef typename Interval::point_type Point; EvtPdfSum() {} ! EvtPdfSum(const EvtPdfSum& other) ! { ! unsigned i; ! for(i = 0; i < other.nTerms(); i++) { ! ! _c.push_back(other._c[i]); ! _term.push_back(other._term[i]->clone()); ! } ! } - virtual ~EvtPdfSum() - { - unsigned i; - for(i = 0; i < _c.size(); i++) { ! delete _term[i]; ! } ! } ! ! virtual EvtPdf* clone() const ! { ! return new EvtPdfSum(*this); ! } ! void addTerm(double c,const EvtPdf& pdf) ! { ! assert(c >= 0.); ! _c.push_back(c); ! _term.push_back(pdf.clone()); ! } ! void addOwnedTerm(double c, EvtPdf* pdf) ! { ! _c.push_back(c); ! _term.push_back(pdf); ! } int nTerms() const { return _term.size(); } // number of terms - - inline double c(int i) const { return _c[i]; } - inline EvtPdf* getPdf(int i) const { return _term[i]; } - - virtual EvtValError compute_mc_integral(const Interval& ival, int N) - { - if(!_itg.valueKnown()) { - - _itg = EvtValError(0.,0.); - unsigned i; - for(i=0; i < _c.size(); i++) { - - EvtValError x = _term[i]->compute_mc_integral(ival,N); - _termItg.push_back(x); - _itg += _c[i] * x; - } - } - - assert(_termItg.size() == nTerms()); - return _itg; - } ! protected: ! virtual double pdf(const Point& p) const ! { ! double ret = 0.; ! unsigned i; ! for(i=0; i < _c.size(); i++) { ! ! ret += _c[i] * _term[i]->evaluate(p); ! } ! return ret; ! } protected: vector _c; // coefficients ! vector*> _term; // pointers to pdfs ! ! std::vector _termItg; // integrals }; #endif --- 12,137 ---- #ifndef EVT_PDF_SUM_HH #define EVT_PDF_SUM_HH + #include #include using std::vector; #include "EvtGenBase/EvtPdf.hh" ! template ! class EvtPdfSum : public EvtPdf { public: EvtPdfSum() {} ! EvtPdfSum(const EvtPdfSum& other); ! virtual ~EvtPdfSum(); ! virtual EvtPdf* clone() const { return new EvtPdfSum(*this); } ! // Manipulate terms and coefficients ! void addTerm(double c,const EvtPdf& pdf) ! { assert(c >= 0.); _c.push_back(c); _term.push_back(pdf.clone()); } ! void addOwnedTerm(double c, EvtPdf* pdf) ! { _c.push_back(c); _term.push_back(pdf); } int nTerms() const { return _term.size(); } // number of terms ! inline double c(int i) const { return _c[i]; } ! inline EvtPdf* getPdf(int i) const { return _term[i]; } ! ! // Integrals ! ! virtual EvtValError compute_integral() const; ! virtual EvtValError compute_integral(int N) const; ! virtual T randomPoint(); protected: + virtual double pdf(const T& p) const; + vector _c; // coefficients ! vector*> _term; // pointers to pdfs }; + template + EvtPdfSum::EvtPdfSum(const EvtPdfSum& other) + : EvtPdf(other) + { + int i; + for(i = 0; i < other.nTerms(); i++) { + _c.push_back(other._c[i]); + _term.push_back(other._term[i]->clone()); + } + } + + template + EvtPdfSum::~EvtPdfSum() + { + size_t i; + for(i = 0; i < _c.size(); i++) delete _term[i]; + } + + + template + double EvtPdfSum::pdf(const T& p) const + { + double ret = 0.; + size_t i; + for(i=0; i < _c.size(); i++) ret += _c[i] * _term[i]->evaluate(p); + return ret; + } + + /* + * Compute the sum integral by summing all term integrals. + */ + + template + EvtValError EvtPdfSum::compute_integral() const + { + int i; + EvtValError itg(0.0,0.0); + for(i=0;igetItg(); + return itg; + } + + template + EvtValError EvtPdfSum::compute_integral(int N) const + { + int i; + EvtValError itg(0.0,0.0); + for(i=0;igetItg(N); + return itg; + } + + + /* + * Sample points randomly according to the sum of PDFs. First throw a random number uniformly + * between zero and the value of the sum integral. Using this random number select one + * of the PDFs. The generate a random point according to that PDF. + */ + + template + T EvtPdfSum::randomPoint() + { + if(!_itg.valueKnown()) _itg = compute_integral(); + + double max = _itg.value(); + double rnd = EvtRandom::Flat(0,max); + + double sum = 0.; + int i; + for(i = 0; i < nTerms(); i++) { + double itg = _term[i]->getItg().value(); + sum += _c[i] * itg; + if(sum > rnd) break; + } + + return _term[i]->randomPoint(); + } + #endif Index: EvtGenBase/EvtPoint1D.hh =================================================================== RCS file: /nfs/cleo3/cvsroot/Offline/src/EvtGenBase/EvtGenBase/EvtPoint1D.hh,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -c -r1.1.1.1 -r1.2 *** EvtGenBase/EvtPoint1D.hh 7 Oct 2003 02:47:03 -0000 1.1.1.1 --- EvtGenBase/EvtPoint1D.hh 12 Jan 2006 16:09:55 -0000 1.2 *************** *** 1,7 **** /******************************************************************************* * Project: BaBar detector at the SLAC PEP-II B-factory * Package: EvtGenBase ! * File: $Id: EvtPoint1D.hh,v 1.1.1.1 2003/10/07 02:47:03 ryd Exp $ * Author: Alexei Dvoretskii, dvoretsk@slac.stanford.edu, 2001-2002 * * Copyright (C) 2002 Caltech --- 1,7 ---- /******************************************************************************* * Project: BaBar detector at the SLAC PEP-II B-factory * Package: EvtGenBase ! * File: $Id: EvtPoint1D.hh,v 1.2 2006/01/12 16:09:55 ryd Exp $ * Author: Alexei Dvoretskii, dvoretsk@slac.stanford.edu, 2001-2002 * * Copyright (C) 2002 Caltech *************** *** 13,20 **** #ifndef EVT_POINT_1D_HH #define EVT_POINT_1D_HH - class iostream; - class EvtPoint1D { public: --- 13,18 ---- *************** *** 33,39 **** return _value; } ! void print(std::ostream& os) const; private: --- 31,37 ---- return _value; } ! void print() const; private: *************** *** 44,50 **** }; - std::ostream& operator<<(std::ostream& os, const EvtPoint1D& p); - #endif --- 42,46 ---- Index: EvtGenBase/EvtPointPred.hh =================================================================== RCS file: /nfs/cleo3/cvsroot/Offline/src/EvtGenBase/EvtGenBase/EvtPointPred.hh,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -c -r1.1.1.1 -r1.2 *** EvtGenBase/EvtPointPred.hh 7 Oct 2003 02:47:03 -0000 1.1.1.1 --- EvtGenBase/EvtPointPred.hh 12 Jan 2006 16:09:55 -0000 1.2 *************** *** 1,7 **** /******************************************************************************* * Project: BaBar detector at the SLAC PEP-II B-factory * Package: EvtGenBase ! * File: $Id: EvtPointPred.hh,v 1.1.1.1 2003/10/07 02:47:03 ryd Exp $ * Author: Alexei Dvoretskii, dvoretsk@slac.stanford.edu, 2001-2002 * * Copyright (C) 2002 Caltech --- 1,7 ---- /******************************************************************************* * Project: BaBar detector at the SLAC PEP-II B-factory * Package: EvtGenBase ! * File: $Id: EvtPointPred.hh,v 1.2 2006/01/12 16:09:55 ryd Exp $ * Author: Alexei Dvoretskii, dvoretsk@slac.stanford.edu, 2001-2002 * * Copyright (C) 2002 Caltech Index: EvtGenBase/EvtPredGen.hh =================================================================== RCS file: /nfs/cleo3/cvsroot/Offline/src/EvtGenBase/EvtGenBase/EvtPredGen.hh,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -c -r1.1.1.1 -r1.2 *** EvtGenBase/EvtPredGen.hh 7 Oct 2003 02:47:03 -0000 1.1.1.1 --- EvtGenBase/EvtPredGen.hh 12 Jan 2006 16:09:55 -0000 1.2 *************** *** 1,7 **** /******************************************************************************* * Project: BaBar detector at the SLAC PEP-II B-factory * Package: EvtGenBase ! * File: $Id: EvtPredGen.hh,v 1.1.1.1 2003/10/07 02:47:03 ryd Exp $ * Author: Alexei Dvoretskii, dvoretsk@slac.stanford.edu, 2001-2002 * * Copyright (C) 2002 Caltech --- 1,7 ---- /******************************************************************************* * Project: BaBar detector at the SLAC PEP-II B-factory * Package: EvtGenBase ! * File: $Id: EvtPredGen.hh,v 1.2 2006/01/12 16:09:55 ryd Exp $ * Author: Alexei Dvoretskii, dvoretsk@slac.stanford.edu, 2001-2002 * * Copyright (C) 2002 Caltech *************** *** 16,21 **** --- 16,23 ---- #ifndef EVT_PRED_GEN_HH #define EVT_PRED_GEN_HH + #include + template class EvtPredGen { *************** *** 24,63 **** typedef typename Generator::result_type result_type; EvtPredGen() {} EvtPredGen(Generator gen, Predicate pred) ! : itsGen(gen), itsPred(pred) {} EvtPredGen(const EvtPredGen& other) ! : itsGen(other.itsGen), itsPred(other.itsPred) {} ~EvtPredGen() {} ! result_type operator()() { int i = 0; int MAX = 10000; while(i++ < MAX) { result_type point = itsGen(); ! if(itsPred(point)) return point; } ! report(INFO,"EvtGen") << "No random point generated after " << MAX << " attempts." << std::endl; ! report(INFO,"EvtGen") << "Sharp peak? Consider using pole compensation." << std::endl; ! report(INFO,"EvtGen") << "I will now pick a point at random to return. " << std::endl; return itsGen(); - // assert(0); } protected: Generator itsGen; Predicate itsPred; }; --- 26,75 ---- typedef typename Generator::result_type result_type; EvtPredGen() + : itsTried(0), itsPassed(0) {} EvtPredGen(Generator gen, Predicate pred) ! : itsGen(gen), itsPred(pred), itsTried(0), itsPassed(0) {} EvtPredGen(const EvtPredGen& other) ! : itsGen(other.itsGen), itsPred(other.itsPred), ! itsTried(other.itsTried), itsPassed(other.itsPassed) {} ~EvtPredGen() {} ! result_type operator()() { int i = 0; int MAX = 10000; while(i++ < MAX) { + itsTried++; result_type point = itsGen(); ! if(itsPred(point)) { ! itsPassed++; ! return point; ! } } ! printf("No random point generated after %d attempts\n",MAX); ! printf("Sharp peak? Consider using pole compensation.\n"); ! printf("I will now pick a point at random to return.\n"); return itsGen(); } + inline int getTried() const { return itsTried; } + inline int getPassed() const { return itsPassed; } + protected: Generator itsGen; Predicate itsPred; + int itsTried; + int itsPassed; }; Index: EvtGenBase/EvtPropBreitWigner.hh =================================================================== RCS file: /nfs/cleo3/cvsroot/Offline/src/EvtGenBase/EvtGenBase/EvtPropBreitWigner.hh,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -c -r1.1.1.1 -r1.2 *** EvtGenBase/EvtPropBreitWigner.hh 7 Oct 2003 02:47:03 -0000 1.1.1.1 --- EvtGenBase/EvtPropBreitWigner.hh 12 Jan 2006 16:09:55 -0000 1.2 *************** *** 1,7 **** /******************************************************************************* * Project: BaBar detector at the SLAC PEP-II B-factory * Package: EvtGenBase ! * File: $Id: EvtPropBreitWigner.hh,v 1.1.1.1 2003/10/07 02:47:03 ryd Exp $ * Author: Alexei Dvoretskii, dvoretsk@slac.stanford.edu, 2001-2002 * * Copyright (C) 2002 Caltech --- 1,7 ---- /******************************************************************************* * Project: BaBar detector at the SLAC PEP-II B-factory * Package: EvtGenBase ! * File: $Id: EvtPropBreitWigner.hh,v 1.2 2006/01/12 16:09:55 ryd Exp $ * Author: Alexei Dvoretskii, dvoretsk@slac.stanford.edu, 2001-2002 * * Copyright (C) 2002 Caltech *************** *** 15,30 **** #include "EvtGenBase/EvtComplex.hh" #include "EvtGenBase/EvtPropagator.hh" ! ! class EvtPropBreitWigner : public EvtPropagator { ! public: EvtPropBreitWigner(double m0, double g0); EvtPropBreitWigner(const EvtPropBreitWigner& other); ~EvtPropBreitWigner(); ! EvtAmplitude* clone() const; protected: --- 15,28 ---- #include "EvtGenBase/EvtComplex.hh" #include "EvtGenBase/EvtPropagator.hh" ! class EvtPropBreitWigner : public EvtPropagator { public: EvtPropBreitWigner(double m0, double g0); EvtPropBreitWigner(const EvtPropBreitWigner& other); ~EvtPropBreitWigner(); ! EvtAmplitude* clone() const; protected: Index: EvtGenBase/EvtPropBreitWignerRel.hh =================================================================== RCS file: /nfs/cleo3/cvsroot/Offline/src/EvtGenBase/EvtGenBase/EvtPropBreitWignerRel.hh,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -c -r1.1.1.1 -r1.2 *** EvtGenBase/EvtPropBreitWignerRel.hh 7 Oct 2003 02:47:03 -0000 1.1.1.1 --- EvtGenBase/EvtPropBreitWignerRel.hh 12 Jan 2006 16:09:56 -0000 1.2 *************** *** 1,7 **** /******************************************************************************* * Project: BaBar detector at the SLAC PEP-II B-factory * Package: EvtGenBase ! * File: $Id: EvtPropBreitWignerRel.hh,v 1.1.1.1 2003/10/07 02:47:03 ryd Exp $ * Author: Alexei Dvoretskii, dvoretsk@slac.stanford.edu, 2001-2002 * * Copyright (C) 2002 Caltech --- 1,7 ---- /******************************************************************************* * Project: BaBar detector at the SLAC PEP-II B-factory * Package: EvtGenBase ! * File: $Id: EvtPropBreitWignerRel.hh,v 1.2 2006/01/12 16:09:56 ryd Exp $ * Author: Alexei Dvoretskii, dvoretsk@slac.stanford.edu, 2001-2002 * * Copyright (C) 2002 Caltech *************** *** 15,31 **** #include "EvtGenBase/EvtComplex.hh" #include "EvtGenBase/EvtPropagator.hh" - class EvtPropBreitWignerRel : public EvtPropagator { - - public: EvtPropBreitWignerRel(double m0, double g0); EvtPropBreitWignerRel(const EvtPropBreitWignerRel& other); ~EvtPropBreitWignerRel(); ! EvtAmplitude* clone() const; protected: --- 15,28 ---- #include "EvtGenBase/EvtComplex.hh" #include "EvtGenBase/EvtPropagator.hh" class EvtPropBreitWignerRel : public EvtPropagator { public: EvtPropBreitWignerRel(double m0, double g0); EvtPropBreitWignerRel(const EvtPropBreitWignerRel& other); ~EvtPropBreitWignerRel(); ! EvtAmplitude* clone() const; protected: Index: EvtGenBase/EvtPropagator.hh =================================================================== RCS file: /nfs/cleo3/cvsroot/Offline/src/EvtGenBase/EvtGenBase/EvtPropagator.hh,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -c -r1.1.1.1 -r1.2 *** EvtGenBase/EvtPropagator.hh 7 Oct 2003 02:47:03 -0000 1.1.1.1 --- EvtGenBase/EvtPropagator.hh 12 Jan 2006 16:09:56 -0000 1.2 *************** *** 1,7 **** /******************************************************************************* * Project: BaBar detector at the SLAC PEP-II B-factory * Package: EvtGenBase ! * File: $Id: EvtPropagator.hh,v 1.1.1.1 2003/10/07 02:47:03 ryd Exp $ * Author: Alexei Dvoretskii, dvoretsk@slac.stanford.edu, 2001-2002 * * Copyright (C) 2002 Caltech --- 1,7 ---- /******************************************************************************* * Project: BaBar detector at the SLAC PEP-II B-factory * Package: EvtGenBase ! * File: $Id: EvtPropagator.hh,v 1.2 2006/01/12 16:09:56 ryd Exp $ * Author: Alexei Dvoretskii, dvoretsk@slac.stanford.edu, 2001-2002 * * Copyright (C) 2002 Caltech *************** *** 15,31 **** #include #include "EvtGenBase/EvtComplex.hh" #include "EvtGenBase/EvtAmplitude.hh" ! #include "EvtGenBase/EvtInterval1D.hh" ! class EvtPropagator : public EvtAmplitude { ! public: EvtPropagator(double m0, double g0) : _m0(m0), _g0(g0) { ! assert(m0 > 0); ! assert(g0 >= 0); } EvtPropagator(const EvtPropagator& other) : _m0(other._m0), _g0(other._g0) --- 15,30 ---- #include #include "EvtGenBase/EvtComplex.hh" #include "EvtGenBase/EvtAmplitude.hh" ! #include "EvtGenBase/EvtPoint1D.hh" ! class EvtPropagator : public EvtAmplitude { public: EvtPropagator(double m0, double g0) : _m0(m0), _g0(g0) { ! assert(m0 > 0); ! assert(g0 >= 0); } EvtPropagator(const EvtPropagator& other) : _m0(other._m0), _g0(other._g0) Index: EvtGenBase/EvtPto3PAmp.hh =================================================================== RCS file: /nfs/cleo3/cvsroot/Offline/src/EvtGenBase/EvtGenBase/EvtPto3PAmp.hh,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -c -r1.1.1.1 -r1.2 *** EvtGenBase/EvtPto3PAmp.hh 7 Oct 2003 02:47:04 -0000 1.1.1.1 --- EvtGenBase/EvtPto3PAmp.hh 12 Jan 2006 16:09:56 -0000 1.2 *************** *** 1,7 **** /******************************************************************************* * Project: BaBar detector at the SLAC PEP-II B-factory * Package: EvtGenBase ! * File: $Id: EvtPto3PAmp.hh,v 1.1.1.1 2003/10/07 02:47:04 ryd Exp $ * Author: Alexei Dvoretskii, dvoretsk@slac.stanford.edu, 2001-2002 * * Copyright (C) 2002 Caltech --- 1,7 ---- /******************************************************************************* * Project: BaBar detector at the SLAC PEP-II B-factory * Package: EvtGenBase ! * File: $Id: EvtPto3PAmp.hh,v 1.2 2006/01/12 16:09:56 ryd Exp $ * Author: Alexei Dvoretskii, dvoretsk@slac.stanford.edu, 2001-2002 * * Copyright (C) 2002 Caltech *************** *** 18,29 **** #include "EvtGenBase/EvtTwoBodyVertex.hh" #include "EvtGenBase/EvtPropagator.hh" #include "EvtGenBase/EvtDalitzPoint.hh" - #include "EvtGenBase/EvtDalitz2D.hh" class EvtComplex; class EvtBlattWeisskopf; ! class EvtPto3PAmp : public EvtAmplitude { public: --- 18,28 ---- #include "EvtGenBase/EvtTwoBodyVertex.hh" #include "EvtGenBase/EvtPropagator.hh" #include "EvtGenBase/EvtDalitzPoint.hh" class EvtComplex; class EvtBlattWeisskopf; ! class EvtPto3PAmp : public EvtAmplitude { public: *************** *** 41,47 **** ~EvtPto3PAmp(); ! virtual EvtAmplitude* clone() const { return new EvtPto3PAmp(*this); } --- 40,46 ---- ~EvtPto3PAmp(); ! virtual EvtAmplitude* clone() const { return new EvtPto3PAmp(*this); } Index: EvtGenBase/EvtPto3PAmpFactory.hh =================================================================== RCS file: /nfs/cleo3/cvsroot/Offline/src/EvtGenBase/EvtGenBase/EvtPto3PAmpFactory.hh,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -c -r1.1.1.1 -r1.2 *** EvtGenBase/EvtPto3PAmpFactory.hh 7 Oct 2003 02:47:04 -0000 1.1.1.1 --- EvtGenBase/EvtPto3PAmpFactory.hh 12 Jan 2006 16:09:56 -0000 1.2 *************** *** 1,6 **** //----------------------------------------------------------------------- // File and Version Information: ! // $Id: EvtPto3PAmpFactory.hh,v 1.1.1.1 2003/10/07 02:47:04 ryd Exp $ // // Environment: // This software is part of the EvtGen package developed jointly --- 1,6 ---- //----------------------------------------------------------------------- // File and Version Information: ! // $Id: EvtPto3PAmpFactory.hh,v 1.2 2006/01/12 16:09:56 ryd Exp $ // // Environment: // This software is part of the EvtGen package developed jointly *************** *** 18,51 **** #define EVT_PTO3P_AMP_FACTORY_HH #include - using std::vector; #include - using std::string; #include "EvtGenBase/EvtComplex.hh" #include "EvtGenBase/EvtAmpFactory.hh" #include "EvtGenBase/EvtDalitzPlot.hh" ! #include "EvtGenBase/EvtDalitz2D.hh" ! class EvtPto3PAmpFactory : public EvtAmpFactory { public: ! EvtPto3PAmpFactory(const EvtDalitzPlot& dp) ! : EvtAmpFactory(), _dp(dp) {} EvtPto3PAmpFactory(const EvtPto3PAmpFactory& other) ! : EvtAmpFactory(other), _dp(other._dp) {} virtual ~EvtPto3PAmpFactory() {} ! ! virtual EvtAmpFactory* clone() const { return new EvtPto3PAmpFactory(*this); } ! virtual void processAmp(EvtComplex c, std::vector vv, bool conj); ! private: EvtDalitzPlot _dp; --- 18,49 ---- #define EVT_PTO3P_AMP_FACTORY_HH #include #include #include "EvtGenBase/EvtComplex.hh" #include "EvtGenBase/EvtAmpFactory.hh" #include "EvtGenBase/EvtDalitzPlot.hh" ! #include "EvtGenBase/EvtDalitzPoint.hh" ! class EvtPto3PAmpFactory : public EvtAmpFactory { public: ! EvtPto3PAmpFactory(const EvtDalitzPlot& dp) ! : EvtAmpFactory(), _dp(dp) {} EvtPto3PAmpFactory(const EvtPto3PAmpFactory& other) ! : EvtAmpFactory(other), _dp(other._dp) {} virtual ~EvtPto3PAmpFactory() {} ! ! virtual EvtAmpFactory* clone() const { return new EvtPto3PAmpFactory(*this); } ! virtual void processAmp(EvtComplex c, std::vector vv, bool conj); ! private: EvtDalitzPlot _dp; Index: EvtGenBase/EvtRandom.hh =================================================================== RCS file: /nfs/cleo3/cvsroot/Offline/src/EvtGenBase/EvtGenBase/EvtRandom.hh,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -c -r1.1.1.1 -r1.2 *** EvtGenBase/EvtRandom.hh 7 Oct 2003 02:47:04 -0000 1.1.1.1 --- EvtGenBase/EvtRandom.hh 10 Jan 2006 21:26:42 -0000 1.2 *************** *** 28,36 **** public: - static double Flat(double min, double max); - static double Flat(double max); static double Flat(); static double random(); --- 28,39 ---- public: static double Flat(); + static double Flat(double max); + static double Flat(double min, double max); + + //generate unit Gaussian + static double Gaussian(); static double random(); Index: EvtGenBase/EvtRelBreitWignerBarrierFact.hh =================================================================== RCS file: /nfs/cleo3/cvsroot/Offline/src/EvtGenBase/EvtGenBase/EvtRelBreitWignerBarrierFact.hh,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -c -r1.1.1.1 -r1.2 *** EvtGenBase/EvtRelBreitWignerBarrierFact.hh 7 Oct 2003 02:47:04 -0000 1.1.1.1 --- EvtGenBase/EvtRelBreitWignerBarrierFact.hh 25 Jan 2006 18:55:20 -0000 1.2 *************** *** 48,53 **** --- 48,54 ---- protected: double _blatt; + bool _errorCond; }; Index: EvtGenBase/EvtResonance2.hh =================================================================== RCS file: /nfs/cleo3/cvsroot/Offline/src/EvtGenBase/EvtGenBase/EvtResonance2.hh,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -c -r1.1.1.1 -r1.2 *** EvtGenBase/EvtResonance2.hh 7 Oct 2003 02:47:04 -0000 1.1.1.1 --- EvtGenBase/EvtResonance2.hh 21 Mar 2008 18:20:31 -0000 1.2 *************** *** 35,44 **** EvtResonance2& operator = (const EvtResonance2 &); //constructor with all information about the resonance EvtResonance2(const EvtVector4R& p4_p, const EvtVector4R& p4_d1, const EvtVector4R& p4_d2, double ampl = 0.0, double theta = 0.0, double gamma = 0.0, ! double bwm = 0.0, int spin = 0); //destructor virtual ~EvtResonance2(); --- 35,47 ---- EvtResonance2& operator = (const EvtResonance2 &); //constructor with all information about the resonance + // invmass_angdenom chooses whether to use the resonance mass (false) + // or the daughter invariant mass (true) for the denominators in + // angular distributions EvtResonance2(const EvtVector4R& p4_p, const EvtVector4R& p4_d1, const EvtVector4R& p4_d2, double ampl = 0.0, double theta = 0.0, double gamma = 0.0, ! double bwm = 0.0, int spin = 0, bool invmass_angdenom = false); //destructor virtual ~EvtResonance2(); *************** *** 75,80 **** --- 78,84 ---- EvtVector4R _p4_p, _p4_d1, _p4_d2; double _ampl, _theta, _gamma, _bwm; int _spin; + bool _invmass_angdenom; }; #endif Index: EvtGenBase/EvtSecondary.hh =================================================================== RCS file: /nfs/cleo3/cvsroot/Offline/src/EvtGenBase/EvtGenBase/EvtSecondary.hh,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -c -r1.1.1.1 -r1.2 *** EvtGenBase/EvtSecondary.hh 7 Oct 2003 02:47:04 -0000 1.1.1.1 --- EvtGenBase/EvtSecondary.hh 12 Jan 2006 16:09:56 -0000 1.2 *************** *** 25,31 **** const int EVTSECONDARYLENGTH =100; class EvtParticle; ! class ostream; class EvtSecondary { --- 25,31 ---- const int EVTSECONDARYLENGTH =100; class EvtParticle; ! #include class EvtSecondary { Index: EvtGenBase/EvtSemiLeptonicBaryonAmp.hh =================================================================== RCS file: EvtGenBase/EvtSemiLeptonicBaryonAmp.hh diff -N EvtGenBase/EvtSemiLeptonicBaryonAmp.hh *** /dev/null 1 Jan 1970 00:00:00 -0000 --- EvtGenBase/EvtSemiLeptonicBaryonAmp.hh 12 Jan 2006 16:09:56 -0000 1.1 *************** *** 0 **** --- 1,43 ---- + //-------------------------------------------------------------------------- + // + // Environment: + // This software is part of the EvtGen package developed jointly + // for the BaBar and CLEO collaborations. If you use all or part + // of it, please give an appropriate acknowledgement. + // + // Copyright Information: See EvtGen/COPYRIGHT + // Copyright (C) 1998 Caltech, UCSB + // + // Module: EvtGen/EvtSemiLeptonicBaryonAmp.hh + // + // Description: + // + // Modification history: + // + // Lange Oct 20, 2004 Created + // + //------------------------------------------------------------------------ + + #ifndef EVTSEMILEPTONICBARYONAMP_HH + #define EVTSEMILEPTONICBARYONAMP_HH + + #include "EvtGenBase/EvtSemiLeptonicAmp.hh" + + class EvtParticle; + class EvtAmp; + class EvtSemiLeptonicFF; + + class EvtSemiLeptonicBaryonAmp:public EvtSemiLeptonicAmp { + + public: + + //Daughters are initialized and have been added to the parent. + //No need to carry around the daughters seperately! + void CalcAmp( EvtParticle *parent,EvtAmp& amp, + EvtSemiLeptonicFF *FormFactors ); + + }; + + #endif + + Index: EvtGenBase/EvtSemiLeptonicFF.hh =================================================================== RCS file: /nfs/cleo3/cvsroot/Offline/src/EvtGenBase/EvtGenBase/EvtSemiLeptonicFF.hh,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -c -r1.1.1.1 -r1.2 *** EvtGenBase/EvtSemiLeptonicFF.hh 7 Oct 2003 02:47:04 -0000 1.1.1.1 --- EvtGenBase/EvtSemiLeptonicFF.hh 12 Jan 2006 16:09:56 -0000 1.2 *************** *** 38,43 **** --- 38,52 ---- double t, double mass, double *a1f, double *a2f, double *vf, double *a0f ) {return;} + virtual void getbaryonff(EvtId parent, EvtId daught, + double t, + double m_meson, + double *f1v, + double *f1a, + double *f2v, + double *f2a) {return;} + + }; #endif Index: EvtGenBase/EvtSpinAmp.hh =================================================================== RCS file: EvtGenBase/EvtSpinAmp.hh diff -N EvtGenBase/EvtSpinAmp.hh *** /dev/null 1 Jan 1970 00:00:00 -0000 --- EvtGenBase/EvtSpinAmp.hh 10 Apr 2005 23:57:22 -0000 1.4 *************** *** 0 **** --- 1,93 ---- + #ifndef __EVTSPINAMP_HH__ + #define __EVTSPINAMP_HH__ + + #include "EvtGenBase/EvtSpinType.hh" + #include "EvtGenBase/EvtComplex.hh" + + #include + using std::vector; + + #include + + class EvtSpinAmp; + EvtSpinAmp operator*( const EvtComplex&, const EvtSpinAmp& ); + EvtSpinAmp operator*( const EvtSpinAmp&, const EvtComplex& ); + EvtSpinAmp operator/( const EvtSpinAmp&, const EvtComplex& ); + + class EvtSpinAmp + { + + friend EvtSpinAmp operator*( const EvtComplex&, const EvtSpinAmp& ); + friend EvtSpinAmp operator*( const EvtSpinAmp&, const EvtComplex& ); + friend EvtSpinAmp operator/( const EvtSpinAmp&, const EvtComplex& ); + friend std::ostream& operator<< ( std::ostream&, const EvtSpinAmp& ); + + public: + + EvtSpinAmp( ) {}; + EvtSpinAmp( const vector& ); + EvtSpinAmp( const vector& , const EvtComplex& ); + EvtSpinAmp( const vector& , const vector& ); + EvtSpinAmp( const EvtSpinAmp & ); + + ~EvtSpinAmp( ) {}; + + // Input to the index functions are twice the magnetic quantum number + EvtComplex& operator()( const vector& ); + const EvtComplex& operator()( const vector& ) const; + EvtComplex& operator()( int, ... ); + const EvtComplex& operator()( int, ... ) const; + + EvtSpinAmp& operator=( const EvtSpinAmp& ); + + EvtSpinAmp operator+( const EvtSpinAmp& ) const; + EvtSpinAmp& operator+=( const EvtSpinAmp& ); + + EvtSpinAmp operator-( const EvtSpinAmp& ) const; + EvtSpinAmp& operator-=( const EvtSpinAmp& ); + + // Direct Product + EvtSpinAmp operator*( const EvtSpinAmp& ) const; + EvtSpinAmp& operator*=( const EvtSpinAmp& ); + + EvtSpinAmp& operator*=( const EvtComplex& ); + EvtSpinAmp& operator/=( const EvtComplex& ); + + // Contraction of amplitudes + void intcont( int, int ); + void extcont( const EvtSpinAmp &, int, int ); + + // assign this value to every member in the container + void assign( const EvtComplex & val ) { _elem.assign( _elem.size(), val ); } + + // get the order of the container + int rank( ) const { return _twospin.size(); } + + // get the dimension vector of the container + const vector & dims( ) const { return _twospin; } + + // set the elements and the dimensions of the vector - useful for something + // things eventough it is usually not the cleanest solution + void addspin( int twospin ) { _twospin.push_back( twospin ); } + void setelem( const vector &elem ) { _elem = elem; } + + bool iterate( vector& index ) const; + vector iterinit() const; + + bool allowed( const vector& index ) const; + bool iterateallowed( vector& index) const; + vector iterallowedinit() const; + + private: + + void checkindexargs( const vector& index ) const; + void checktwospin( const vector& twospin ) const; + int findtrueindex( const vector& index ) const; + vector calctwospin( const vector& type ) const; + + vector _type; + vector _twospin; + vector _elem; + }; + + #endif // __EVTSPINAMP__ Index: EvtGenBase/EvtSpinType.hh =================================================================== RCS file: /nfs/cleo3/cvsroot/Offline/src/EvtGenBase/EvtGenBase/EvtSpinType.hh,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -c -r1.1.1.1 -r1.2 *** EvtGenBase/EvtSpinType.hh 7 Oct 2003 02:47:05 -0000 1.1.1.1 --- EvtGenBase/EvtSpinType.hh 27 Jan 2006 00:16:45 -0000 1.2 *************** *** 22,28 **** #ifndef EVTSPINTYPE_HH #define EVTSPINTYPE_HH - #include "EvtGenBase/EvtReport.hh" class EvtSpinType{ --- 22,27 ---- *************** *** 31,93 **** enum spintype { SCALAR,VECTOR,TENSOR,DIRAC,PHOTON,NEUTRINO,STRING, RARITASCHWINGER,SPIN3,SPIN4,SPIN5HALF,SPIN7HALF}; ! static int getSpin2(spintype stype){ ! switch (stype){ ! case SCALAR: case STRING: ! return 0; ! case DIRAC: case NEUTRINO: ! return 1; ! case VECTOR: case PHOTON: ! return 2; ! case RARITASCHWINGER: ! return 3; ! case TENSOR: ! return 4; ! case SPIN5HALF: ! return 5; ! case SPIN3: ! return 6; ! case SPIN7HALF: ! return 7; ! case SPIN4: ! return 8; ! default: ! report(ERROR,"EvtGen")<<"Unknown spintype in EvtSpinType!"< #include "EvtGenBase/EvtVector4R.hh" ! class ostream; const int EVTSTDHEPLENGTH =1000; --- 21,29 ---- #ifndef EVTSTDHEP_HH #define EVTSTDHEP_HH ! //#include #include "EvtGenBase/EvtVector4R.hh" ! #include const int EVTSTDHEPLENGTH =1000; Index: EvtGenBase/EvtStdlibRandomEngine.hh =================================================================== RCS file: EvtGenBase/EvtStdlibRandomEngine.hh diff -N EvtGenBase/EvtStdlibRandomEngine.hh *** /dev/null 1 Jan 1970 00:00:00 -0000 --- EvtGenBase/EvtStdlibRandomEngine.hh 12 Jan 2006 16:09:57 -0000 1.1 *************** *** 0 **** --- 1,38 ---- + /******************************************************************************* + * Project: BaBar detector at the SLAC PEP-II B-factory + * Package: EvtGenBase + * File: $Id: EvtStdlibRandomEngine.hh,v 1.1 2006/01/12 16:09:57 ryd Exp $ + * Author: Alexei Dvoretskii, dvoretsk@slac.stanford.edu, 2001-2002 + * + * Copyright (C) 2002 Caltech + *******************************************************************************/ + + /* + * Interface to stdlib's random number generator + */ + + #ifndef EVT_STDLIB_RANDOM_ENGINE_HH + #define EVT_STDLIB_RANDOM_ENGINE_HH + + #include + #include "EvtGenBase/EvtRandomEngine.hh" + + class EvtStdlibRandomEngine : public EvtRandomEngine { + public: + + void setSeed(unsigned int seed) + { + srand(seed); + } + + virtual double random() + { + double x = rand(); + double y = RAND_MAX; + return x/y; + } + }; + + #endif + + Index: EvtGenBase/EvtStreamAdapter.hh =================================================================== RCS file: /nfs/cleo3/cvsroot/Offline/src/EvtGenBase/EvtGenBase/EvtStreamAdapter.hh,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -c -r1.1.1.1 -r1.2 *** EvtGenBase/EvtStreamAdapter.hh 7 Oct 2003 02:47:05 -0000 1.1.1.1 --- EvtGenBase/EvtStreamAdapter.hh 12 Jan 2006 16:09:57 -0000 1.2 *************** *** 1,7 **** /******************************************************************************* * Project: BaBar detector at the SLAC PEP-II B-factory * Package: EvtGenBase ! * File: $Id: EvtStreamAdapter.hh,v 1.1.1.1 2003/10/07 02:47:05 ryd Exp $ * Author: Alexei Dvoretskii, dvoretsk@slac.stanford.edu, 2001-2002 * * Copyright (C) 2002 Caltech --- 1,7 ---- /******************************************************************************* * Project: BaBar detector at the SLAC PEP-II B-factory * Package: EvtGenBase ! * File: $Id: EvtStreamAdapter.hh,v 1.2 2006/01/12 16:09:57 ryd Exp $ * Author: Alexei Dvoretskii, dvoretsk@slac.stanford.edu, 2001-2002 * * Copyright (C) 2002 Caltech Index: EvtGenBase/EvtStreamInputIterator.hh =================================================================== RCS file: /nfs/cleo3/cvsroot/Offline/src/EvtGenBase/EvtGenBase/EvtStreamInputIterator.hh,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -c -r1.1.1.1 -r1.2 *** EvtGenBase/EvtStreamInputIterator.hh 7 Oct 2003 02:47:05 -0000 1.1.1.1 --- EvtGenBase/EvtStreamInputIterator.hh 12 Jan 2006 16:09:57 -0000 1.2 *************** *** 1,7 **** /******************************************************************************* * Project: BaBar detector at the SLAC PEP-II B-factory * Package: EvtGenBase ! * File: $Id: EvtStreamInputIterator.hh,v 1.1.1.1 2003/10/07 02:47:05 ryd Exp $ * Author: Alexei Dvoretskii, dvoretsk@slac.stanford.edu, 2001-2002 * * Copyright (C) 2002 Caltech --- 1,7 ---- /******************************************************************************* * Project: BaBar detector at the SLAC PEP-II B-factory * Package: EvtGenBase ! * File: $Id: EvtStreamInputIterator.hh,v 1.2 2006/01/12 16:09:57 ryd Exp $ * Author: Alexei Dvoretskii, dvoretsk@slac.stanford.edu, 2001-2002 * * Copyright (C) 2002 Caltech Index: EvtGenBase/EvtSymTable.hh =================================================================== RCS file: /nfs/cleo3/cvsroot/Offline/src/EvtGenBase/EvtGenBase/EvtSymTable.hh,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -c -r1.1.1.1 -r1.2 *** EvtGenBase/EvtSymTable.hh 7 Oct 2003 02:47:05 -0000 1.1.1.1 --- EvtGenBase/EvtSymTable.hh 12 Jan 2006 16:09:57 -0000 1.2 *************** *** 30,46 **** public: EvtSymTable(); ! virtual ~EvtSymTable(); ! void Define(const std::string& name,std::string d); ! std::string Get(const std::string& name,int &ierr); private: ! std::map _symMap; }; #endif --- 30,51 ---- public: EvtSymTable(); ! ~EvtSymTable(); ! static void Define(const std::string& name,std::string d); ! static std::string Get(const std::string& name,int &ierr); private: ! static std::map _symMap; }; #endif + + + + + Index: EvtGenBase/EvtTensor4C.hh =================================================================== RCS file: /nfs/cleo3/cvsroot/Offline/src/EvtGenBase/EvtGenBase/EvtTensor4C.hh,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -c -r1.1.1.1 -r1.2 *** EvtGenBase/EvtTensor4C.hh 7 Oct 2003 02:47:05 -0000 1.1.1.1 --- EvtGenBase/EvtTensor4C.hh 12 Jan 2006 16:09:57 -0000 1.2 *************** *** 21,27 **** #ifndef EvtTensor4C_HH #define EvtTensor4C_HH ! //#include #include "EvtGenBase/EvtComplex.hh" //Class to handle 4D complex valued tensors. --- 21,27 ---- #ifndef EvtTensor4C_HH #define EvtTensor4C_HH ! //#include #include "EvtGenBase/EvtComplex.hh" //Class to handle 4D complex valued tensors. *************** *** 29,35 **** class EvtVector4C; class EvtVector4R; class EvtVector3R; ! class ostream; EvtTensor4C rotateEuler(const EvtTensor4C& e, double alpha,double beta,double gamma); EvtTensor4C boostTo(const EvtTensor4C& e, const EvtVector4R p4); --- 29,35 ---- class EvtVector4C; class EvtVector4R; class EvtVector3R; ! #include EvtTensor4C rotateEuler(const EvtTensor4C& e, double alpha,double beta,double gamma); EvtTensor4C boostTo(const EvtTensor4C& e, const EvtVector4R p4); *************** *** 49,55 **** EvtTensor4C operator+(const EvtTensor4C& t1,const EvtTensor4C& t2); inline EvtTensor4C operator-(const EvtTensor4C& t1,const EvtTensor4C& t2); - //================== class EvtTensor4C { friend EvtTensor4C rotateEuler(const EvtTensor4C& e, --- 49,54 ---- *************** *** 74,81 **** friend EvtTensor4C operator-(const EvtTensor4C& t1,const EvtTensor4C& t2); public: ! EvtTensor4C(); ! EvtTensor4C(double t00,double t11,double t22, double t33); EvtTensor4C(const EvtTensor4C& t1 ); virtual ~EvtTensor4C(); EvtTensor4C& operator=(const EvtTensor4C& t1); --- 73,83 ---- friend EvtTensor4C operator-(const EvtTensor4C& t1,const EvtTensor4C& t2); public: ! EvtTensor4C() {;} ! ! EvtTensor4C(double t00,double t11,double t22, double t33) { setdiag(t00,t11,t22,t33);} ! ! EvtTensor4C(const EvtTensor4C& t1 ); virtual ~EvtTensor4C(); EvtTensor4C& operator=(const EvtTensor4C& t1); Index: EvtGenBase/EvtTensorParticle.hh =================================================================== RCS file: /nfs/cleo3/cvsroot/Offline/src/EvtGenBase/EvtGenBase/EvtTensorParticle.hh,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -c -r1.1.1.1 -r1.2 *** EvtGenBase/EvtTensorParticle.hh 7 Oct 2003 02:47:05 -0000 1.1.1.1 --- EvtGenBase/EvtTensorParticle.hh 12 Jan 2006 16:09:57 -0000 1.2 *************** *** 45,51 **** private: ! EvtTensor4C eps1,eps2,eps3,eps4,eps5; EvtTensorParticle(const EvtTensorParticle& tensor); EvtTensorParticle& operator=(const EvtTensorParticle& tensor); --- 45,51 ---- private: ! EvtTensor4C eps[5];//eps1,eps2,eps3,eps4,eps5; EvtTensorParticle(const EvtTensorParticle& tensor); EvtTensorParticle& operator=(const EvtTensorParticle& tensor); Index: EvtGenBase/EvtTwoBodyKine.hh =================================================================== RCS file: /nfs/cleo3/cvsroot/Offline/src/EvtGenBase/EvtGenBase/EvtTwoBodyKine.hh,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -c -r1.1.1.1 -r1.2 *** EvtGenBase/EvtTwoBodyKine.hh 7 Oct 2003 02:47:05 -0000 1.1.1.1 --- EvtGenBase/EvtTwoBodyKine.hh 12 Jan 2006 16:09:57 -0000 1.2 *************** *** 1,7 **** /******************************************************************************* * Project: BaBar detector at the SLAC PEP-II B-factory * Package: EvtGenBase ! * File: $Id: EvtTwoBodyKine.hh,v 1.1.1.1 2003/10/07 02:47:05 ryd Exp $ * Author: Alexei Dvoretskii, dvoretsk@slac.stanford.edu, 2001-2002 * * Copyright (C) 2002 Caltech --- 1,7 ---- /******************************************************************************* * Project: BaBar detector at the SLAC PEP-II B-factory * Package: EvtGenBase ! * File: $Id: EvtTwoBodyKine.hh,v 1.2 2006/01/12 16:09:57 ryd Exp $ * Author: Alexei Dvoretskii, dvoretsk@slac.stanford.edu, 2001-2002 * * Copyright (C) 2002 Caltech *************** *** 12,18 **** #ifndef EVT_TWO_BODY_KINE_HH #define EVT_TWO_BODY_KINE_HH ! class ostream; class EvtTwoBodyKine { --- 12,18 ---- #ifndef EVT_TWO_BODY_KINE_HH #define EVT_TWO_BODY_KINE_HH ! #include class EvtTwoBodyKine { Index: EvtGenBase/EvtTwoBodyVertex.hh =================================================================== RCS file: /nfs/cleo3/cvsroot/Offline/src/EvtGenBase/EvtGenBase/EvtTwoBodyVertex.hh,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -c -r1.1.1.1 -r1.2 *** EvtGenBase/EvtTwoBodyVertex.hh 7 Oct 2003 02:47:05 -0000 1.1.1.1 --- EvtGenBase/EvtTwoBodyVertex.hh 12 Jan 2006 16:09:58 -0000 1.2 *************** *** 1,7 **** /******************************************************************************* * Project: BaBar detector at the SLAC PEP-II B-factory * Package: EvtGenBase ! * File: $Id: EvtTwoBodyVertex.hh,v 1.1.1.1 2003/10/07 02:47:05 ryd Exp $ * Author: Alexei Dvoretskii, dvoretsk@slac.stanford.edu, 2001-2002 * * Copyright (C) 2002 Caltech --- 1,7 ---- /******************************************************************************* * Project: BaBar detector at the SLAC PEP-II B-factory * Package: EvtGenBase ! * File: $Id: EvtTwoBodyVertex.hh,v 1.2 2006/01/12 16:09:58 ryd Exp $ * Author: Alexei Dvoretskii, dvoretsk@slac.stanford.edu, 2001-2002 * * Copyright (C) 2002 Caltech *************** *** 16,22 **** #include "EvtGenBase/EvtTwoBodyKine.hh" #include "EvtGenBase/EvtBlattWeisskopf.hh" ! class ostream; class EvtTwoBodyVertex { --- 16,22 ---- #include "EvtGenBase/EvtTwoBodyKine.hh" #include "EvtGenBase/EvtBlattWeisskopf.hh" ! #include class EvtTwoBodyVertex { Index: EvtGenBase/EvtValError.hh =================================================================== RCS file: /nfs/cleo3/cvsroot/Offline/src/EvtGenBase/EvtGenBase/EvtValError.hh,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -c -r1.1.1.1 -r1.2 *** EvtGenBase/EvtValError.hh 7 Oct 2003 02:47:05 -0000 1.1.1.1 --- EvtGenBase/EvtValError.hh 12 Jan 2006 16:09:58 -0000 1.2 *************** *** 1,7 **** /******************************************************************************* * Project: BaBar detector at the SLAC PEP-II B-factory * Package: EvtGenBase ! * File: $Id: EvtValError.hh,v 1.1.1.1 2003/10/07 02:47:05 ryd Exp $ * Author: Alexei Dvoretskii, dvoretsk@slac.stanford.edu, 2001-2002 * * Copyright (C) 2002 Caltech --- 1,7 ---- /******************************************************************************* * Project: BaBar detector at the SLAC PEP-II B-factory * Package: EvtGenBase ! * File: $Id: EvtValError.hh,v 1.2 2006/01/12 16:09:58 ryd Exp $ * Author: Alexei Dvoretskii, dvoretsk@slac.stanford.edu, 2001-2002 * * Copyright (C) 2002 Caltech *************** *** 35,40 **** --- 35,41 ---- double prec() const; void operator=(const EvtValError& other); void operator*=(const EvtValError& other); + void operator/=(const EvtValError& other); void operator+=(const EvtValError& other); void operator*=(double c); *************** *** 51,56 **** --- 52,58 ---- EvtValError operator*(const EvtValError& x1, const EvtValError& x2); + EvtValError operator/(const EvtValError& x1, const EvtValError& x2); EvtValError operator+(const EvtValError& x1, const EvtValError& x2); EvtValError operator*(const EvtValError& x,double c); EvtValError operator*(double c,const EvtValError& x); *************** *** 73,112 **** return EvtValError(((double) itsPassed)/((double) itsTried),sqrt(itsPassed)/((double) itsTried)); } - // Calculate average and standard deviation for a sequence. The functor must - // be an adaptable unary function returning a double. - - template - EvtValError average_and_dev(InputIterator it, InputIterator end, Functor f) - { - int N = 0; - double sum = 0.; - double sum2 = 0.; - //while(it != end) { - //make sun happy? - while(!(it == end)) { - - N++; - double value = f(*it++); - sum += value; - sum2 += value*value; - } - - EvtValError ret; - if(N > 0) { - - double av = sum/((double) N); - if(N > 1) { - - double dev2 = (sum2 - av*av*N)/((double) (N - 1)); - - double error = sqrt(dev2/((double) N)); - ret = EvtValError(av,error); - } - else ret = EvtValError(av); - } - - return ret; - } - #endif --- 75,78 ---- Index: EvtGenBase/EvtVector3C.hh =================================================================== RCS file: /nfs/cleo3/cvsroot/Offline/src/EvtGenBase/EvtGenBase/EvtVector3C.hh,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -c -r1.1.1.1 -r1.2 *** EvtGenBase/EvtVector3C.hh 7 Oct 2003 02:47:06 -0000 1.1.1.1 --- EvtGenBase/EvtVector3C.hh 12 Jan 2006 16:09:58 -0000 1.2 *************** *** 21,30 **** #ifndef EVTVECTOR3C_N #define EVTVECTOR3C_N ! //#include #include "EvtGenBase/EvtComplex.hh" #include "EvtGenBase/EvtVector3R.hh" ! class ostream; class EvtVector3C { --- 21,30 ---- #ifndef EVTVECTOR3C_N #define EVTVECTOR3C_N ! //#include #include "EvtGenBase/EvtComplex.hh" #include "EvtGenBase/EvtVector3R.hh" ! #include class EvtVector3C { Index: EvtGenBase/EvtVector3R.hh =================================================================== RCS file: /nfs/cleo3/cvsroot/Offline/src/EvtGenBase/EvtGenBase/EvtVector3R.hh,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -c -r1.1.1.1 -r1.2 *** EvtGenBase/EvtVector3R.hh 7 Oct 2003 02:47:06 -0000 1.1.1.1 --- EvtGenBase/EvtVector3R.hh 12 Jan 2006 16:09:58 -0000 1.2 *************** *** 21,29 **** #ifndef EVTVECTOR3R_HH #define EVTVECTOR3R_HH ! //#include //#include ! class ostream; class EvtVector3R { --- 21,29 ---- #ifndef EVTVECTOR3R_HH #define EVTVECTOR3R_HH ! //#include //#include ! #include class EvtVector3R { Index: EvtGenBase/EvtVector4C.hh =================================================================== RCS file: /nfs/cleo3/cvsroot/Offline/src/EvtGenBase/EvtGenBase/EvtVector4C.hh,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -c -r1.1.1.1 -r1.2 *** EvtGenBase/EvtVector4C.hh 7 Oct 2003 02:47:06 -0000 1.1.1.1 --- EvtGenBase/EvtVector4C.hh 12 Jan 2006 16:09:58 -0000 1.2 *************** *** 21,32 **** #ifndef EVTVECTOR4C_HH #define EVTVECTOR4C_HH ! //#include #include "EvtGenBase/EvtComplex.hh" #include "EvtGenBase/EvtVector3C.hh" #include "EvtGenBase/EvtVector4R.hh" ! class ostream; class EvtVector4C { --- 21,32 ---- #ifndef EVTVECTOR4C_HH #define EVTVECTOR4C_HH ! //#include #include "EvtGenBase/EvtComplex.hh" #include "EvtGenBase/EvtVector3C.hh" #include "EvtGenBase/EvtVector4R.hh" ! #include class EvtVector4C { Index: EvtGenBase/EvtVector4R.hh =================================================================== RCS file: /nfs/cleo3/cvsroot/Offline/src/EvtGenBase/EvtGenBase/EvtVector4R.hh,v retrieving revision 1.1.1.1 retrieving revision 1.3 diff -c -r1.1.1.1 -r1.3 *** EvtGenBase/EvtVector4R.hh 7 Oct 2003 02:47:06 -0000 1.1.1.1 --- EvtGenBase/EvtVector4R.hh 12 Jan 2006 16:09:58 -0000 1.3 *************** *** 64,72 **** --- 64,84 ---- EvtVector4R cross(const EvtVector4R& v2); double dot(const EvtVector4R& v2) const; double d3mag() const; + + // Added by AJB - calculate scalars in the rest frame of the current object + double scalartripler3( const EvtVector4R& p1, const EvtVector4R& p2, + const EvtVector4R& p3 ) const; + double dotr3( const EvtVector4R& p1, const EvtVector4R& p2 ) const; + double mag2r3( const EvtVector4R& p1 ) const; + double magr3( const EvtVector4R& p1 ) const; + + private: double v[4]; + + inline double Square( double x ) const { return x*x; } + }; Index: EvtGenBase/EvtVectorParticle.hh =================================================================== RCS file: /nfs/cleo3/cvsroot/Offline/src/EvtGenBase/EvtGenBase/EvtVectorParticle.hh,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -c -r1.1.1.1 -r1.2 *** EvtGenBase/EvtVectorParticle.hh 7 Oct 2003 02:47:06 -0000 1.1.1.1 --- EvtGenBase/EvtVectorParticle.hh 12 Jan 2006 16:09:58 -0000 1.2 *************** *** 21,26 **** --- 21,27 ---- #ifndef EVTVECTORPARTICLE_HH #define EVTVECTORPARTICLE_HH + #include "EvtGenBase/EvtVector4R.hh" #include "EvtGenBase/EvtVector4C.hh" #include "EvtGenBase/EvtParticle.hh" *************** *** 35,42 **** void init(EvtId part_n,double e,double px,double py,double pz); void init(EvtId part_n,const EvtVector4R& p); ! EvtVector4C epsParent(int i) const; ! EvtVector4C eps(int i) const; EvtSpinDensity rotateToHelicityBasis() const; EvtSpinDensity rotateToHelicityBasis(double alpha, double beta, --- 36,43 ---- void init(EvtId part_n,double e,double px,double py,double pz); void init(EvtId part_n,const EvtVector4R& p); ! EvtVector4C epsParent(int i) const {return boostTo(_eps[i],this->getP4());} ! EvtVector4C eps(int i) const {return _eps[i];} EvtSpinDensity rotateToHelicityBasis() const; EvtSpinDensity rotateToHelicityBasis(double alpha, double beta, *************** *** 44,50 **** private: ! EvtVector4C eps1,eps2,eps3; EvtVectorParticle(const EvtVectorParticle& vector); EvtVectorParticle& operator=(const EvtVectorParticle& vector); --- 45,51 ---- private: ! EvtVector4C _eps[3]; EvtVectorParticle(const EvtVectorParticle& vector); EvtVectorParticle& operator=(const EvtVectorParticle& vector);