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) return;
12  const char* theName = filename.c_str();
13  theFile = new std::ofstream(theName, std::ios::out);
14 }
15 
17 }
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()
25  <<" ; "<<e.x()<<" "<<e.y()<<" "<<e.z();
26 }
27 
29  (*theFile) << "\n Global(mm): "<<p.x()<<" "<<p.y()<<" "<<p.z()
30  <<" ; "<<e.x()<<" "<<e.y()<<" "<<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:63
void printGlobalMomentum(float, float, float) const
static std::ofstream * theFile
T z() const
Definition: PV3DBase.h:64
int k[5][pyjets_maxn]
void printGlobal(const Local3DPoint &, const Local3DPoint &) const
void printLocal(const Local3DPoint &, const Local3DPoint &) const
TkSimHitPrinter(const std::string &)
T x() const
Definition: PV3DBase.h:62
void startNewSimHit(const std::string &, const std::string &, int, int, int, int)