|
EvtGen
2.0.0
Monte Carlo generator of particle decays, in particular the weak decays of heavy flavour particles such as B mesons.
|
Go to the documentation of this file. 54 if ( theDalitzTable == 0 ) { 62 return theDalitzTable; 67 std::vector<std::string>::iterator i = _readFiles.begin(); 69 if ( ( *i ).compare( dec_name ) == 0 ) { 80 << "EvtDalitzTable: Reading in xml parameter file " << dec_name 89 std::string decayParent = ""; 90 std::string daugStr = ""; 95 std::vector<std::pair<EvtCyclic3::Pair, EvtCyclic3::Pair>> angAndResPairs; 96 std::string shape( "" ); 98 double mass( 0. ), width( 0. ), FFp( 0. ), FFr( 0. ); 99 std::vector<EvtFlatteParam> flatteParams; 103 double aLass( 0. ), rLass( 0. ), BLass( 0. ), phiBLass( 0. ), RLass( 0. ), 104 phiRLass( 0. ), cutoffLass( -1. ); 107 parser. open( dec_name ); 109 bool endReached = false; 124 std::istringstream daugStream( daugStr ); 127 while ( std::getline( daugStream, daugh, ' ' ) ) { 132 if ( nDaughters != 3 ) { 134 << "Expected to find three daughters for dalitzDecay of " 135 << decayParent << " near line " 137 << "found " << nDaughters << endl; 139 << "Will terminate execution!" << endl; 153 } else if ( parser. getTagTitle() == "copyDalitz" ) { 156 int nCopyDaughters = 0; 157 EvtId copyDaughter[3]; 163 std::string copyDaugStr = parser. readAttribute( "copyDaughters" ); 171 std::istringstream daugStream( daugStr ); 172 std::istringstream copyDaugStream( copyDaugStr ); 175 while ( std::getline( daugStream, daugh, ' ' ) ) { 179 while ( std::getline( copyDaugStream, daugh, ' ' ) ) { 184 if ( nDaughters != 3 || nCopyDaughters != 3 ) { 186 << "Expected to find three daughters for copyDecay of " 187 << decayParent << " from " << copyParent 189 << "found " << nDaughters << " and " << nCopyDaughters 192 << "Will terminate execution!" << endl; 196 copyDecay( ipar, daughter, copypar, copyDaughter ); 206 flatteParams.clear(); 217 if ( ( real != -999. || imag != -999. ) && mag == -999. && 219 if ( real == -999. ) { 222 if ( imag == -999. ) { 228 if ( mag == -999. ) { 231 if ( phase == -999. ) { 246 if ( particle != "" ) { 248 if ( resId == EvtId( -1, -1 ) ) { 250 << "Unknown particle name:" << particle.c_str() 253 << "Will terminate execution!" << endl; 278 << "Unsupported spin near line " 291 if ( shape == "NonRes_Exp" ) { 294 if ( shape == "LASS" ) { 305 angAndResPairs.clear(); 307 std::string resDaugStr = parser. readAttribute( "resDaughters" ); 308 if ( resDaugStr != "" ) { 309 std::istringstream resDaugStream( resDaugStr ); 312 EvtId resDaughter[2]; 313 while ( std::getline( resDaugStream, resDaug, ' ' ) ) { 317 if ( nResDaug != 2 ) { 319 << "Resonance must have exactly 2 daughters near line " 327 << "Resonance daughters must match decay daughters near line " 332 cAmp /= sqrt( nRes ); 334 if ( angAndResPairs.empty() ) { 337 angAndResPairs.push_back( 341 angAndResPairs.push_back( 345 angAndResPairs.push_back( 351 angAndResPairs.push_back( std::make_pair( 356 << "Daughter pair must be 1, 2 or 3 near line " 364 std::vector<std::pair<EvtCyclic3::Pair, EvtCyclic3::Pair>>::iterator 365 it = angAndResPairs.begin(); 366 for ( ; it != angAndResPairs.end(); it++ ) { 367 std::pair<EvtCyclic3::Pair, EvtCyclic3::Pair> pairs = *it; 369 shape, dp, pairs.first, pairs.second, spinType, 370 mass, width, FFp, FFr, alpha, aLass, rLass, BLass, 371 phiBLass, RLass, phiRLass, cutoffLass ); 375 } else if ( parser. getTagTitle() == "/dalitzDecay" ) { 378 << "probMax is not defined for " << decayParent 379 << " -> " << daugStr << endl; 381 << "Will now estimate probMax. This may take a while. Once probMax is calculated, update the XML file to skip this step in future." 389 } else if ( verbose ) { 392 << " found in XML decay file near line " 402 flatteParams.push_back( param ); 403 } else if ( parser. getTagTitle() == "/resonance" ) { 404 std::vector<std::pair<EvtCyclic3::Pair, EvtCyclic3::Pair>>::iterator 405 it = angAndResPairs.begin(); 406 for ( ; it != angAndResPairs.end(); it++ ) { 407 std::pair<EvtCyclic3::Pair, EvtCyclic3::Pair> pairs = *it; 409 shape, dp, pairs.first, pairs.second, spinType, mass, 410 width, FFp, FFr, alpha, aLass, rLass, BLass, phiBLass, 411 RLass, phiRLass, cutoffLass ); 413 std::vector<EvtFlatteParam>::iterator flatteIt = 414 flatteParams.begin(); 415 for ( ; flatteIt != flatteParams.end(); flatteIt++ ) { 427 << "Either the decay file ended prematurely or the file is badly formed.\n" 428 << "Error occured near line" << parser. getLineNumber() << endl; 437 << "Unknown particle name:" << particle.c_str() << endl; 439 << "Will terminate execution!" << endl; 457 std::vector<EvtDalitzDecayInfo> copyTable = getDalitzTable( copy ); 458 std::vector<EvtDalitzDecayInfo>::iterator i = copyTable.begin(); 459 for ( ; i != copyTable.end(); i++ ) { 460 EvtId daughter1 = ( *i ).daughter1(); 461 EvtId daughter2 = ( *i ).daughter2(); 462 EvtId daughter3 = ( *i ).daughter3(); 464 if ( ( copyd[0] == daughter1 && copyd[1] == daughter2 && 465 copyd[2] == daughter3 ) || 466 ( copyd[0] == daughter1 && copyd[1] == daughter3 && 467 copyd[2] == daughter2 ) || 468 ( copyd[0] == daughter2 && copyd[1] == daughter1 && 469 copyd[2] == daughter3 ) || 470 ( copyd[0] == daughter2 && copyd[1] == daughter3 && 471 copyd[2] == daughter1 ) || 472 ( copyd[0] == daughter3 && copyd[1] == daughter1 && 473 copyd[2] == daughter2 ) || 474 ( copyd[0] == daughter3 && copyd[1] == daughter2 && 475 copyd[2] == daughter1 ) ) { 477 std::vector<std::pair<EvtComplex, EvtDalitzReso>>::const_iterator j = 478 ( *i ).getResonances().begin(); 479 for ( ; j != ( *i ).getResonances().end(); j++ ) { 488 << "Did not find dalitz decays for particle:" << copy << "\n"; 493 std::vector<EvtDalitzDecayInfo> table; 498 if ( table.empty() ) { 500 << "Did not find dalitz decays for particle:" << parent << "\n"; 509 double width, double FFp, double FFr, double alpha, double aLass, 510 double rLass, double BLass, double phiBLass, double RLass, double phiRLass, 513 if ( shape == "RBW" || shape == "RBW_CLEO" ) { 514 return EvtDalitzReso( dp, angPair, resPair, spinType, mass, width, 516 } else if ( shape == "RBW_CLEO_ZEMACH" ) { 517 return EvtDalitzReso( dp, angPair, resPair, spinType, mass, width, 519 } else if ( shape == "GS" || shape == "GS_CLEO" ) { 520 return EvtDalitzReso( dp, angPair, resPair, spinType, mass, width, 522 } else if ( shape == "GS_CLEO_ZEMACH" ) { 523 return EvtDalitzReso( dp, angPair, resPair, spinType, mass, width, 525 } else if ( shape == "GAUSS" || shape == "GAUSS_CLEO" ) { 526 return EvtDalitzReso( dp, angPair, resPair, spinType, mass, width, 528 } else if ( shape == "GAUSS_CLEO_ZEMACH" ) { 529 return EvtDalitzReso( dp, angPair, resPair, spinType, mass, width, 531 } else if ( shape == "Flatte" ) { 533 } else if ( shape == "LASS" ) { 534 return EvtDalitzReso( dp, resPair, mass, width, aLass, rLass, BLass, 535 phiBLass, RLass, phiRLass, cutoffLass, true ); 536 } else if ( shape == "NonRes" ) { 538 } else if ( shape == "NonRes_Linear" ) { 540 } else if ( shape == "NonRes_Exp" ) { 543 if ( shape != "NBW" ) 545 << "EvtDalitzTable: shape " << shape 546 << " is unknown. Defaulting to NBW." << endl; 547 return EvtDalitzReso( dp, angPair, resPair, spinType, mass, width, 554 std::vector<std::pair<EvtCyclic3::Pair, EvtCyclic3::Pair>>& angAndResPairs ) 557 if ( resDaughter[0] == daughter[0] && resDaughter[1] == daughter[1] ) { 558 angAndResPairs.push_back( 561 } else if ( resDaughter[0] == daughter[1] && resDaughter[1] == daughter[0] ) { 562 angAndResPairs.push_back( 567 if ( resDaughter[0] == daughter[1] && resDaughter[1] == daughter[2] ) { 568 angAndResPairs.push_back( 571 } else if ( resDaughter[0] == daughter[2] && resDaughter[1] == daughter[1] ) { 572 angAndResPairs.push_back( 577 if ( resDaughter[0] == daughter[2] && resDaughter[1] == daughter[0] ) { 578 angAndResPairs.push_back( 581 } else if ( resDaughter[0] == daughter[0] && resDaughter[1] == daughter[2] ) { 582 angAndResPairs.push_back( 596 double min( 0 ), max( 0 ), step( 0 ), min2( 0 ), max2( 0 ), step2( 0 ); 601 step = ( max - min ) / nStep; 602 for ( int i = 0; i < nStep; ++i ) { 603 double qAB = min + i * step; 606 step2 = ( max2 - min2 ) / nStep; 607 for ( int j = 0; j < nStep; ++j ) { 608 double qBC = min2 + j * step2; 611 double prob = calcProb( point, model ); 612 if ( prob > maxProb ) 620 step = ( max - min ) / nStep; 621 for ( int i = 0; i < nStep; ++i ) { 622 double qBC = min + i * step; 625 step2 = ( max2 - min2 ) / nStep; 626 for ( int j = 0; j < nStep; ++j ) { 627 double qCA = min2 + j * step2; 630 double prob = calcProb( point, model ); 631 if ( prob > maxProb ) 639 step = ( max - min ) / nStep; 640 for ( int i = 0; i < nStep; ++i ) { 641 double qCA = min + i * step; 644 step2 = ( max2 - min2 ) / nStep; 645 for ( int j = 0; j < nStep; ++j ) { 646 double qAB = min2 + j * step2; 649 double prob = calcProb( point, model ); 650 if ( prob > maxProb ) 655 << "Largest probability found was " << maxProb << endl; 657 << "Setting probMax to " << factor * maxProb << endl; 658 return factor * maxProb; 663 std::vector<std::pair<EvtComplex, EvtDalitzReso>> resonances = 667 std::vector<std::pair<EvtComplex, EvtDalitzReso>>::iterator i = 669 for ( ; i != resonances.end(); i++ ) { 670 std::pair<EvtComplex, EvtDalitzReso> res = ( *i ); 671 amp += res.first * res.second.evaluate( point );
double calcProbMax(EvtDalitzPlot dp, EvtDalitzDecayInfo *model)
double qAbsMin(EvtCyclic3::Pair i) const
static EvtSpinType::spintype getSpinType(EvtId i)
std::map< EvtId, std::vector< EvtDalitzDecayInfo > > _dalitztable
std::ostream & EvtGenReport(EvtGenSeverity severity, const char *facility=0)
double readAttributeDouble(std::string attribute, double defaultValue=-1.)
void addFlatteParam(const EvtFlatteParam ¶m)
void setProbMax(double probMax)
static double getMeanMass(EvtId i)
double abs2(const EvtComplex &c)
bool open(std::string filename)
std::string getTagTitle()
double qMin(EvtCyclic3::Pair i, EvtCyclic3::Pair j, double q) const
bool readAttributeBool(std::string attribute, bool defaultValue=false)
void addResonance(EvtComplex amp, EvtDalitzReso res)
void addDecay(EvtId parent, const EvtDalitzDecayInfo &dec)
int getDaughterPairs(EvtId *resDaughter, EvtId *daughter, std::vector< std::pair< EvtCyclic3::Pair, EvtCyclic3::Pair >> &angAndResPairs)
std::string getParentTagTitle()
const std::vector< std::pair< EvtComplex, EvtDalitzReso > > & getResonances() const
static EvtDalitzTable * getInstance(const std::string dec_name="", bool verbose=true)
static EvtId getId(const std::string &name)
double imag(const EvtComplex &c)
void readXMLDecayFile(const std::string dec_name, bool verbose=true)
double calcProb(EvtDalitzPoint point, EvtDalitzDecayInfo *model)
EvtDalitzReso getResonance(std::string shape, EvtDalitzPlot dp, EvtCyclic3::Pair angPair, EvtCyclic3::Pair resPair, EvtSpinType::spintype spinType, double mass, double width, double FFp, double FFr, double alpha, double aLass, double rLass, double BLass, double phiBLass, double RLass, double phiRLass, double cutoffLass)
static double getWidth(EvtId i)
int readAttributeInt(std::string attribute, int defaultValue=-1)
static const double radToDegrees
void copyDecay(EvtId parent, EvtId *daughters, EvtId copy, EvtId *copyd)
double qMax(EvtCyclic3::Pair i, EvtCyclic3::Pair j, double q) const
double qAbsMax(EvtCyclic3::Pair i) const
static double getMass(EvtId i)
std::vector< EvtDalitzDecayInfo > getDalitzTable(const EvtId &parent)
double real(const EvtComplex &c)
bool fileHasBeenRead(const std::string dec_name)
std::vector< std::string > _readFiles
std::string readAttribute(std::string attribute, std::string defaultValue="")
void checkParticle(std::string particle)
|