76 <<
"EvtDalitzTable: Reading in xml parameter file " << dec_name
85 std::string decayParent =
"";
86 std::string daugStr =
"";
91 std::vector<std::pair<EvtCyclic3::Pair, EvtCyclic3::Pair>> angAndResPairs;
92 std::string shape(
"" );
94 double mass( 0. ), width( 0. ), FFp( 0. ), FFr( 0. );
95 std::vector<EvtFlatteParam> flatteParams;
99 double aLass( 0. ), rLass( 0. ), BLass( 0. ), phiBLass( 0. ), RLass( 0. ),
100 phiRLass( 0. ), cutoffLass( -1. );
103 parser.
open( dec_name );
105 bool endReached =
false;
120 std::istringstream daugStream( daugStr );
123 while ( std::getline( daugStream, daugh,
' ' ) ) {
128 if ( nDaughters != 3 ) {
130 <<
"Expected to find three daughters for dalitzDecay of "
131 << decayParent <<
" near line "
133 <<
"found " << nDaughters << endl;
135 <<
"Will terminate execution!" << endl;
149 }
else if ( parser.
getTagTitle() ==
"copyDalitz" ) {
151 int nCopyDaughters = 0;
152 EvtId copyDaughter[3];
158 std::string copyDaugStr = parser.
readAttribute(
"copyDaughters" );
166 std::istringstream daugStream( daugStr );
167 std::istringstream copyDaugStream( copyDaugStr );
170 while ( std::getline( daugStream, daugh,
' ' ) ) {
174 while ( std::getline( copyDaugStream, daugh,
' ' ) ) {
179 if ( nDaughters != 3 || nCopyDaughters != 3 ) {
181 <<
"Expected to find three daughters for copyDecay of "
182 << decayParent <<
" from " << copyParent
184 <<
"found " << nDaughters <<
" and " << nCopyDaughters
187 <<
"Will terminate execution!" << endl;
191 copyDecay( ipar, daughter, copypar, copyDaughter );
201 flatteParams.clear();
212 if ( (
real != -999. ||
imag != -999. ) && mag == -999. &&
214 if (
real == -999. ) {
217 if (
imag == -999. ) {
223 if ( mag == -999. ) {
226 if ( phase == -999. ) {
241 if ( particle !=
"" ) {
243 if ( resId ==
EvtId( -1, -1 ) ) {
245 <<
"Unknown particle name:" << particle.c_str()
248 <<
"Will terminate execution!" << endl;
273 <<
"Unsupported spin near line "
286 if ( shape ==
"NonRes_Exp" ) {
289 if ( shape ==
"LASS" ) {
300 angAndResPairs.clear();
302 std::string resDaugStr = parser.
readAttribute(
"resDaughters" );
303 if ( resDaugStr !=
"" ) {
304 std::istringstream resDaugStream( resDaugStr );
307 EvtId resDaughter[2];
308 while ( std::getline( resDaugStream, resDaug,
' ' ) ) {
312 if ( nResDaug != 2 ) {
314 <<
"Resonance must have exactly 2 daughters near line "
322 <<
"Resonance daughters must match decay daughters near line "
327 cAmp /= sqrt( nRes );
329 if ( angAndResPairs.empty() ) {
332 angAndResPairs.push_back(
336 angAndResPairs.push_back(
340 angAndResPairs.push_back(
346 angAndResPairs.push_back( std::make_pair(
351 <<
"Daughter pair must be 1, 2 or 3 near line "
359 std::vector<std::pair<EvtCyclic3::Pair, EvtCyclic3::Pair>>::iterator
360 it = angAndResPairs.begin();
361 for ( ; it != angAndResPairs.end(); it++ ) {
362 std::pair<EvtCyclic3::Pair, EvtCyclic3::Pair> pairs = *it;
364 shape, dp, pairs.first, pairs.second, spinType,
365 mass, width, FFp, FFr, alpha, aLass, rLass, BLass,
366 phiBLass, RLass, phiRLass, cutoffLass );
370 }
else if ( parser.
getTagTitle() ==
"/dalitzDecay" ) {
373 <<
"probMax is not defined for " << decayParent
374 <<
" -> " << daugStr << endl;
376 <<
"Will now estimate probMax. This may take a while. Once probMax is calculated, update the XML file to skip this step in future."
383 dalitzDecay =
nullptr;
384 }
else if ( verbose ) {
387 <<
" found in XML decay file near line "
397 flatteParams.push_back( param );
398 }
else if ( parser.
getTagTitle() ==
"/resonance" ) {
399 std::vector<std::pair<EvtCyclic3::Pair, EvtCyclic3::Pair>>::iterator
400 it = angAndResPairs.begin();
401 for ( ; it != angAndResPairs.end(); it++ ) {
402 std::pair<EvtCyclic3::Pair, EvtCyclic3::Pair> pairs = *it;
404 shape, dp, pairs.first, pairs.second, spinType, mass,
405 width, FFp, FFr, alpha, aLass, rLass, BLass, phiBLass,
406 RLass, phiRLass, cutoffLass );
408 std::vector<EvtFlatteParam>::iterator flatteIt =
409 flatteParams.begin();
410 for ( ; flatteIt != flatteParams.end(); flatteIt++ ) {
422 <<
"Either the decay file ended prematurely or the file is badly formed.\n"
423 <<
"Error occured near line" << parser.
getLineNumber() << endl;
452 std::vector<EvtDalitzDecayInfo> copyTable =
getDalitzTable( copy );
453 std::vector<EvtDalitzDecayInfo>::iterator i = copyTable.begin();
454 for ( ; i != copyTable.end(); i++ ) {
455 EvtId daughter1 = ( *i ).daughter1();
456 EvtId daughter2 = ( *i ).daughter2();
457 EvtId daughter3 = ( *i ).daughter3();
459 if ( ( copyd[0] == daughter1 && copyd[1] == daughter2 &&
460 copyd[2] == daughter3 ) ||
461 ( copyd[0] == daughter1 && copyd[1] == daughter3 &&
462 copyd[2] == daughter2 ) ||
463 ( copyd[0] == daughter2 && copyd[1] == daughter1 &&
464 copyd[2] == daughter3 ) ||
465 ( copyd[0] == daughter2 && copyd[1] == daughter3 &&
466 copyd[2] == daughter1 ) ||
467 ( copyd[0] == daughter3 && copyd[1] == daughter1 &&
468 copyd[2] == daughter2 ) ||
469 ( copyd[0] == daughter3 && copyd[1] == daughter2 &&
470 copyd[2] == daughter1 ) ) {
472 std::vector<std::pair<EvtComplex, EvtDalitzReso>>::const_iterator j =
473 ( *i ).getResonances().begin();
474 for ( ; j != ( *i ).getResonances().end(); j++ ) {
483 <<
"Did not find dalitz decays for particle:" << copy <<
"\n";
507 double width,
double FFp,
double FFr,
double alpha,
double aLass,
508 double rLass,
double BLass,
double phiBLass,
double RLass,
double phiRLass,
511 if ( shape ==
"RBW" || shape ==
"RBW_CLEO" ) {
512 return EvtDalitzReso( dp, angPair, resPair, spinType, mass, width,
514 }
else if ( shape ==
"RBW_CLEO_ZEMACH" ) {
515 return EvtDalitzReso( dp, angPair, resPair, spinType, mass, width,
517 }
else if ( shape ==
"GS" || shape ==
"GS_CLEO" ) {
518 return EvtDalitzReso( dp, angPair, resPair, spinType, mass, width,
520 }
else if ( shape ==
"GS_CLEO_ZEMACH" ) {
521 return EvtDalitzReso( dp, angPair, resPair, spinType, mass, width,
523 }
else if ( shape ==
"GAUSS" || shape ==
"GAUSS_CLEO" ) {
524 return EvtDalitzReso( dp, angPair, resPair, spinType, mass, width,
526 }
else if ( shape ==
"GAUSS_CLEO_ZEMACH" ) {
527 return EvtDalitzReso( dp, angPair, resPair, spinType, mass, width,
529 }
else if ( shape ==
"Flatte" ) {
531 }
else if ( shape ==
"LASS" ) {
532 return EvtDalitzReso( dp, resPair, mass, width, aLass, rLass, BLass,
533 phiBLass, RLass, phiRLass, cutoffLass,
true );
534 }
else if ( shape ==
"NonRes" ) {
536 }
else if ( shape ==
"NonRes_Linear" ) {
538 }
else if ( shape ==
"NonRes_Exp" ) {
541 if ( shape !=
"NBW" )
543 <<
"EvtDalitzTable: shape " << shape
544 <<
" is unknown. Defaulting to NBW." << endl;
545 return EvtDalitzReso( dp, angPair, resPair, spinType, mass, width,
552 std::vector<std::pair<EvtCyclic3::Pair, EvtCyclic3::Pair>>& angAndResPairs )
555 if ( resDaughter[0] == daughter[0] && resDaughter[1] == daughter[1] ) {
556 angAndResPairs.push_back(
559 }
else if ( resDaughter[0] == daughter[1] && resDaughter[1] == daughter[0] ) {
560 angAndResPairs.push_back(
565 if ( resDaughter[0] == daughter[1] && resDaughter[1] == daughter[2] ) {
566 angAndResPairs.push_back(
569 }
else if ( resDaughter[0] == daughter[2] && resDaughter[1] == daughter[1] ) {
570 angAndResPairs.push_back(
575 if ( resDaughter[0] == daughter[2] && resDaughter[1] == daughter[0] ) {
576 angAndResPairs.push_back(
579 }
else if ( resDaughter[0] == daughter[0] && resDaughter[1] == daughter[2] ) {
580 angAndResPairs.push_back(
594 double min( 0 ), max( 0 ), step( 0 ), min2( 0 ), max2( 0 ), step2( 0 );
599 step = ( max - min ) / nStep;
600 for (
int i = 0; i < nStep; ++i ) {
601 double qAB = min + i * step;
604 step2 = ( max2 - min2 ) / nStep;
605 for (
int j = 0; j < nStep; ++j ) {
606 double qBC = min2 + j * step2;
609 double prob =
calcProb( point, model );
610 if ( prob > maxProb )
618 step = ( max - min ) / nStep;
619 for (
int i = 0; i < nStep; ++i ) {
620 double qBC = min + i * step;
623 step2 = ( max2 - min2 ) / nStep;
624 for (
int j = 0; j < nStep; ++j ) {
625 double qCA = min2 + j * step2;
628 double prob =
calcProb( point, model );
629 if ( prob > maxProb )
637 step = ( max - min ) / nStep;
638 for (
int i = 0; i < nStep; ++i ) {
639 double qCA = min + i * step;
642 step2 = ( max2 - min2 ) / nStep;
643 for (
int j = 0; j < nStep; ++j ) {
644 double qAB = min2 + j * step2;
647 double prob =
calcProb( point, model );
648 if ( prob > maxProb )
653 <<
"Largest probability found was " << maxProb << endl;
655 <<
"Setting probMax to " << factor * maxProb << endl;
656 return factor * maxProb;
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)