CMS 3D CMS Logo

TkSimHitPrinter.cc
Go to the documentation of this file.
2 
3 #include <iomanip>
4 #include <fstream>
5 
6 #include "G4Track.hh"
7 
8 std::ofstream* TkSimHitPrinter::theFile(nullptr);
9 
11  if (theFile)
12  return;
13  const char* theName = filename.c_str();
14  theFile = new std::ofstream(theName, std::ios::out);
15 }
16 
18 
19 void TkSimHitPrinter::startNewSimHit(const std::string& s, const std::string& d, int i, int j, int k, int eve) {
20  (*theFile) << "Event: " << eve << " " << s << " " << d << " " << i << " Track " << j << " " << k;
21 }
22 
24  (*theFile) << "\n Local(cm): " << p.x() << " " << p.y() << " " << p.z() << " ; " << e.x() << " " << e.y() << " "
25  << e.z();
26 }
27 
29  (*theFile) << "\n Global(mm): " << p.x() << " " << p.y() << " " << p.z() << " ; " << e.x() << " " << e.y() << " "
30  << e.z();
31 }
32 
33 void TkSimHitPrinter::printHitData(const std::string& nam, float p, float de, float tof) const {
34  (*theFile) << "\n " << nam << " p(GeV): " << p << " Edep(GeV): " << de << " ToF: " << tof;
35 }
36 void TkSimHitPrinter::printGlobalMomentum(float px, float py, float pz) const {
37  (*theFile) << " Momentum " << px << " " << py << " " << pz << "\n";
38 }
void printHitData(const std::string &, float, float, float) const
static std::ofstream * theFile
void printGlobal(const Local3DPoint &, const Local3DPoint &) const
d
Definition: ztail.py:151
void printGlobalMomentum(float, float, float) const
TkSimHitPrinter(const std::string &)
void printLocal(const Local3DPoint &, const Local3DPoint &) const
void startNewSimHit(const std::string &, const std::string &, int, int, int, int)