26 #ifndef G4FastPathHadronicCrossSection_hh
27 #define G4FastPathHadronicCrossSection_hh
34 #include <unordered_map>
47 namespace G4FastPathHadronicCrossSection {
90 uint64_t cacheHitCount;
91 uint64_t initCyclesFastPath;
92 uint64_t invocationCountSlowPath;
93 uint64_t totalCyclesSlowPath;
94 uint64_t invocationCountFastPath;
95 uint64_t totalCyclesFastPath;
96 uint64_t invocationCountTriedOneLineCache;
97 uint64_t invocationCountOneLineCache;
114 uint64_t methodCalled;
115 uint64_t hitOneLineCache;
118 uint64_t sampleZandA;
134 return (lhs.first==rhs.first)&&(lhs.second == rhs.second);
147 std::less<G4CrossSectionDataStore_Key>
less;
196 static inline void logTiming( cycleCountEntry* , fastPathEntry* , timing& );
203 namespace G4FastPathHadronicCrossSection {
207 if ( cl !=
nullptr ) ++(cl->invocationCountTriedOneLineCache);
210 if ( cl !=
nullptr ) ++(cl->invocationCountOneLineCache);
212 inline void logHit(cycleCountEntry* cl) {
213 if ( cl !=
nullptr ) ++(cl->cacheHitCount);
217 if ( cl !=
nullptr ) ++(cl->invocationCountFastPath);
221 if ( cl !=
nullptr ) ++(cl->invocationCountSlowPath);
226 if ( cl !=
nullptr ) cl->initCyclesFastPath = tm.rdtsc_stop - tm.rdtsc_start;
230 if ( cl!=
nullptr ) cl->totalCyclesFastPath = tm.rdtsc_stop - tm.rdtsc_start;
234 if ( cl!=
nullptr ) cl->totalCyclesSlowPath = tm.rdtsc_stop - tm.rdtsc_start;
236 inline void logTiming( cycleCountEntry* entry , fastPathEntry* fast_entry, timing& timing)
238 if (fast_entry !=
nullptr ) {
239 if ( entry->invocationCountFastPath == 0 ) {
303 os<<
"#DEBUG COUNTERS: count="<<fp.count<<
" slowpath_sum="<<fp.slowpath_sum<<
" max_delta="<<fp.max_delta;
304 os<<
" min_delta="<<fp.min_delta<<
" sum_delta="<<fp.sum_delta<<
" sum_delta_square="<<fp.sum_delta_square<<
"\n";
310 #endif //G4FastPathHadronicCrossSection_hh