CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
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
T y() const
Definition: PV3DBase.h:60
void printGlobalMomentum(float, float, float) const
tuple d
Definition: ztail.py:151
static std::ofstream * theFile
T z() const
Definition: PV3DBase.h:61
void printGlobal(const Local3DPoint &, const Local3DPoint &) const
tuple filename
Definition: lut2db_cfg.py:20
void printLocal(const Local3DPoint &, const Local3DPoint &) const
TkSimHitPrinter(const std::string &)
T x() const
Definition: PV3DBase.h:59
void startNewSimHit(const std::string &, const std::string &, int, int, int, int)