Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2026-04-09 07:49:33

0001 #pragma once
0002 
0003 #include <string>
0004 #include <vector>
0005 
0006 struct sdebug
0007 {
0008     static constexpr const char* PREFIX = "    int " ; 
0009     static constexpr const char* SUFFIX = " ;" ; 
0010     static constexpr const char* LABELS = R"LITERAL(
0011     int addGenstep ;
0012     int beginPhoton ;
0013     int rjoinPhoton ;
0014     int resumePhoton ;
0015     int rjoin_resumePhoton ;
0016     int pointPhoton ;
0017     int finalPhoton ;
0018     int d12match_fail ;
0019     int rjoinPhotonCheck ;
0020     int rjoinPhotonCheck_flag_AB ;
0021     int rjoinPhotonCheck_flag_MI ;
0022     int rjoinPhotonCheck_flag_xor ;
0023     int rjoinPhotonCheck_flagmask_AB ;
0024     int rjoinPhotonCheck_flagmask_MI ;
0025     int rjoinPhotonCheck_flagmask_or ;
0026     int rjoinSeqCheck ;
0027     int rjoinSeqCheck_flag_AB ;
0028     int rjoinSeqCheck_flag_MI ;
0029     int rjoinSeqCheck_flag_xor ;
0030 )LITERAL";
0031 
0032     int addGenstep ;
0033     int beginPhoton ;
0034     int rjoinPhoton ;
0035     int resumePhoton ;
0036     int rjoin_resumePhoton ;
0037     int pointPhoton ;
0038     int finalPhoton ;
0039     int d12match_fail ;
0040     int rjoinPhotonCheck ;
0041     int rjoinPhotonCheck_flag_AB ;
0042     int rjoinPhotonCheck_flag_MI ;
0043     int rjoinPhotonCheck_flag_xor ;
0044     int rjoinPhotonCheck_flagmask_AB ;
0045     int rjoinPhotonCheck_flagmask_MI ;
0046     int rjoinPhotonCheck_flagmask_or ;
0047     int rjoinSeqCheck ;
0048     int rjoinSeqCheck_flag_AB ;
0049     int rjoinSeqCheck_flag_MI ;
0050     int rjoinSeqCheck_flag_xor ;
0051 
0052     void zero(); 
0053     std::string desc() const ; 
0054 };
0055 
0056 inline void sdebug::zero(){ *this = {} ; }
0057 
0058 #include <cassert>
0059 #include <string>
0060 #include <sstream>
0061 #include <iomanip>
0062 #include <csignal>
0063 
0064 inline std::string sdebug::desc() const 
0065 {
0066     std::vector<std::string> vars ; 
0067     sstr::PrefixSuffixParse(vars, PREFIX, SUFFIX, LABELS ); 
0068     bool expected_size = sizeof(sdebug) == sizeof(int)*vars.size();
0069     if(!expected_size) std::raise(SIGINT); 
0070     assert( expected_size ); 
0071     //const int* first = &addGenstep ;
0072     const int* first = (int*)this ;
0073     std::stringstream ss ; 
0074     ss << "sdebug::desc" << std::endl ; 
0075     for(int i=0 ; i < int(vars.size()) ; i++) ss << std::setw(40) << vars[i] << " : " << std::setw(10) << *(first+i) << std::endl; 
0076     std::string s = ss.str(); 
0077     return s ; 
0078 }
0079