18 const char* theName =
filename.c_str();
34 G4cout.setf(std::ios::right, std::ios::adjustfield);
35 G4cout.setf(std::ios::scientific, std::ios::floatfield);
37 G4cout <<
"SimHit in " <<
s << G4endl;
39 std::lock_guard<std::mutex> guard{fileMutex};
41 (*theFile).setf(std::ios::right, std::ios::adjustfield);
42 (*theFile).setf(std::ios::scientific | std::ios::uppercase | std::ios::showpos, std::ios::floatfield);
43 (*theFile).precision(5);
44 (*theFile) <<
"SimHit in " <<
s;
48 std::lock_guard<std::mutex> guard{fileMutex};
49 (*theFile) <<
"Event " <<
num << std::endl;
53 G4cout <<
" Id: " <<
id << G4endl;
54 std::lock_guard<std::mutex> guard{fileMutex};
57 (*theFile).setf(std::ios::right, std::ios::adjustfield);
62 G4cout <<
" Track: " <<
id << G4endl;
63 std::lock_guard<std::mutex> guard{fileMutex};
64 (*theFile) <<
" trk ";
66 (*theFile).setf(std::ios::right, std::ios::adjustfield);
71 G4cout <<
" Pabs: " << pabs << G4endl;
72 std::lock_guard<std::mutex> guard{fileMutex};
73 (*theFile) <<
" p " << pabs;
77 G4cout <<
" Eloss: " << eloss << G4endl;
78 std::lock_guard<std::mutex> guard{fileMutex};
79 (*theFile) <<
" e " << eloss;
83 G4cout <<
" Local(en/ex): " << localen.
x() <<
" " << localen.
y() <<
" " << localen.
z() <<
" / " << localex.
x() <<
" " 84 << localex.
y() <<
" " << localex.
z() << G4endl;
85 std::lock_guard<std::mutex> guard{fileMutex};
87 (*theFile).setf(std::ios::right, std::ios::adjustfield);
88 (*theFile).setf(std::ios::floatfield);
89 (*theFile).precision(6);
90 (*theFile) <<
" en/ex " << localen.
x() <<
" " << localen.
y() <<
" " << localen.
z() <<
" / " << localex.
x() <<
" " 91 << localex.
y() <<
" " << localex.
z();
95 G4cout <<
" Global(en): " << global.
x() <<
" " << global.
y() <<
" " << global.
z() << G4endl;
96 std::lock_guard<std::mutex> guard{fileMutex};
98 (*theFile).setf(std::ios::right, std::ios::adjustfield);
99 (*theFile).setf(std::ios::floatfield);
100 (*theFile).precision(6);
101 (*theFile) <<
" gl " << global.
x() <<
" " << global.
y() <<
" " << global.
z() << std::endl;
void printPabs(float) const
void printTrack(int) const
void printEloss(float) const
void printLocal(LocalPoint, LocalPoint) const
static std::atomic< std::ofstream * > theFile
SimHitPrinter(std::string)
void printGlobal(GlobalPoint) const
void startNewSimHit(std::string)