|
15 | 15 | #include "MemoryAccessMomenta.h" // for MemoryAccessMomenta::neppM |
16 | 16 | #include "MemoryBuffers.h" // for HostBufferMomenta, DeviceBufferMomenta etc |
17 | 17 |
|
| 18 | +#ifdef __CADNA_ANALYSIS__ |
| 19 | +#include <cadna.h> |
| 20 | +#include <iomanip> |
| 21 | +#endif |
| 22 | + |
18 | 23 | //#ifdef __HIPCC__ |
19 | 24 | //#include <experimental/filesystem> // see |
20 | 25 | //https://rocm.docs.amd.com/en/docs-5.4.3/CHANGELOG.html#id79 #else #include |
@@ -409,6 +414,34 @@ paramCard; #endif |
409 | 414 | copyHostFromDevice( m_hstMEs, m_devMEs ); |
410 | 415 | #ifdef MGONGPUCPP_VERBOSE |
411 | 416 | flagAbnormalMEs( m_hstMEs.data(), m_nevt ); |
| 417 | +#ifdef __CADNA_ANALYSIS__ |
| 418 | + for(unsigned int ievt = 0 ; ievt< m_nevt; ievt++) |
| 419 | + { |
| 420 | + // Display momenta |
| 421 | + std::cout << "Momenta:" << std::endl; |
| 422 | + for( int ipar = 0; ipar < CPPProcess::npar; ipar++ ) |
| 423 | + { |
| 424 | + // NB: 'setw' affects only the next field (of any type) |
| 425 | + std::cout << std::scientific // fixed format: affects all floats (default precision: 6) |
| 426 | + << std::setw( 4 ) << ipar + 1 |
| 427 | + << std::setw( 14 ) << MemoryAccessMomenta::ieventAccessIp4IparConst( m_hstMomentaC.data(), ievt, 0, ipar ) |
| 428 | + << std::setw( 14 ) << MemoryAccessMomenta::ieventAccessIp4IparConst( m_hstMomentaC.data(), ievt, 1, ipar ) |
| 429 | + << std::setw( 14 ) << MemoryAccessMomenta::ieventAccessIp4IparConst( m_hstMomentaC.data(), ievt, 2, ipar ) |
| 430 | + << std::setw( 14 ) << MemoryAccessMomenta::ieventAccessIp4IparConst( m_hstMomentaC.data(), ievt, 3, ipar ) |
| 431 | + << std::endl |
| 432 | + << std::setw( 14 ) << MemoryAccessMomenta::ieventAccessIp4IparConst( m_hstMomentaC.data(), ievt, 0, ipar ).nb_significant_digit() |
| 433 | + << std::setw( 14 ) << MemoryAccessMomenta::ieventAccessIp4IparConst( m_hstMomentaC.data(), ievt, 1, ipar ).nb_significant_digit() |
| 434 | + << std::setw( 14 ) << MemoryAccessMomenta::ieventAccessIp4IparConst( m_hstMomentaC.data(), ievt, 2, ipar ).nb_significant_digit() |
| 435 | + << std::setw( 14 ) << MemoryAccessMomenta::ieventAccessIp4IparConst( m_hstMomentaC.data(), ievt, 3, ipar ).nb_significant_digit() |
| 436 | + << std::endl |
| 437 | + << std::defaultfloat; // default format: affects all floats |
| 438 | + } |
| 439 | + std::cout << std::string( 79, '-' ) << std::endl; |
| 440 | + std::cout << " Matrix element = " << m_hstMEs.data()[ievt] << " GeV^" << std::endl; |
| 441 | + std::cout << " Matrix element number of sig dig = " << m_hstMEs.data()[ievt].nb_significant_digit() << std::endl; |
| 442 | + std::cout << std::string( 79, '-' ) << std::endl; |
| 443 | + } |
| 444 | +#endif |
412 | 445 | #endif |
413 | 446 | copyHostFromDevice( m_hstSelHel, m_devSelHel ); |
414 | 447 | copyHostFromDevice( m_hstSelCol, m_devSelCol ); |
@@ -471,6 +504,34 @@ paramCard; #endif |
471 | 504 | m_pmek->computeMatrixElements( useChannelIds ); |
472 | 505 | #ifdef MGONGPUCPP_VERBOSE |
473 | 506 | flagAbnormalMEs( m_hstMEs.data(), m_nevt ); |
| 507 | +#ifdef __CADNA_ANALYSIS__ |
| 508 | + for(unsigned int ievt = 0 ; ievt< m_nevt; ievt++) |
| 509 | + { |
| 510 | + // Display momenta |
| 511 | + std::cout << "Momenta:" << std::endl; |
| 512 | + for( int ipar = 0; ipar < CPPProcess::npar; ipar++ ) |
| 513 | + { |
| 514 | + // NB: 'setw' affects only the next field (of any type) |
| 515 | + std::cout << std::scientific // fixed format: affects all floats (default precision: 6) |
| 516 | + << std::setw( 4 ) << ipar + 1 |
| 517 | + << std::setw( 14 ) << MemoryAccessMomenta::ieventAccessIp4IparConst( m_hstMomentaC.data(), ievt, 0, ipar ) |
| 518 | + << std::setw( 14 ) << MemoryAccessMomenta::ieventAccessIp4IparConst( m_hstMomentaC.data(), ievt, 1, ipar ) |
| 519 | + << std::setw( 14 ) << MemoryAccessMomenta::ieventAccessIp4IparConst( m_hstMomentaC.data(), ievt, 2, ipar ) |
| 520 | + << std::setw( 14 ) << MemoryAccessMomenta::ieventAccessIp4IparConst( m_hstMomentaC.data(), ievt, 3, ipar ) |
| 521 | + << std::endl |
| 522 | + << std::setw( 14 ) << MemoryAccessMomenta::ieventAccessIp4IparConst( m_hstMomentaC.data(), ievt, 0, ipar ).nb_significant_digit() |
| 523 | + << std::setw( 14 ) << MemoryAccessMomenta::ieventAccessIp4IparConst( m_hstMomentaC.data(), ievt, 1, ipar ).nb_significant_digit() |
| 524 | + << std::setw( 14 ) << MemoryAccessMomenta::ieventAccessIp4IparConst( m_hstMomentaC.data(), ievt, 2, ipar ).nb_significant_digit() |
| 525 | + << std::setw( 14 ) << MemoryAccessMomenta::ieventAccessIp4IparConst( m_hstMomentaC.data(), ievt, 3, ipar ).nb_significant_digit() |
| 526 | + << std::endl |
| 527 | + << std::defaultfloat; // default format: affects all floats |
| 528 | + } |
| 529 | + std::cout << std::string( 79, '-' ) << std::endl; |
| 530 | + std::cout << " Matrix element = " << m_hstMEs.data()[ievt] << " GeV^" << std::endl; |
| 531 | + std::cout << " Matrix element number of sig dig = " << m_hstMEs.data()[ievt].nb_significant_digit() << std::endl; |
| 532 | + std::cout << std::string( 79, '-' ) << std::endl; |
| 533 | + } |
| 534 | +#endif |
474 | 535 | #endif |
475 | 536 | if constexpr( std::is_same_v<FORTRANFPTYPE, fptype> ) |
476 | 537 | { |
|
0 commit comments