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 }
TkSimHitPrinter::~TkSimHitPrinter
~TkSimHitPrinter()
Definition: TkSimHitPrinter.cc:17
mps_fire.i
i
Definition: mps_fire.py:428
TkSimHitPrinter::startNewSimHit
void startNewSimHit(const std::string &, const std::string &, int, int, int, int)
Definition: TkSimHitPrinter.cc:19
multPhiCorr_741_25nsDY_cfi.py
py
Definition: multPhiCorr_741_25nsDY_cfi.py:12
AlCaHLTBitMon_ParallelJobs.p
p
Definition: AlCaHLTBitMon_ParallelJobs.py:153
TkSimHitPrinter::TkSimHitPrinter
TkSimHitPrinter(const std::string &)
Definition: TkSimHitPrinter.cc:10
alignCSCRings.s
s
Definition: alignCSCRings.py:92
corrVsCorr.filename
filename
Definition: corrVsCorr.py:123
dqmdumpme.k
k
Definition: dqmdumpme.py:60
Point3DBase< float, LocalTag >
TkSimHitPrinter::printGlobal
void printGlobal(const Local3DPoint &, const Local3DPoint &) const
Definition: TkSimHitPrinter.cc:28
AlCaHLTBitMon_QueryRunRegistry.string
string
Definition: AlCaHLTBitMon_QueryRunRegistry.py:256
TkSimHitPrinter::theFile
static std::ofstream * theFile
Definition: TkSimHitPrinter.h:23
TkSimHitPrinter::printLocal
void printLocal(const Local3DPoint &, const Local3DPoint &) const
Definition: TkSimHitPrinter.cc:23
TkSimHitPrinter::printHitData
void printHitData(const std::string &, float, float, float) const
Definition: TkSimHitPrinter.cc:33
multPhiCorr_741_25nsDY_cfi.px
px
Definition: multPhiCorr_741_25nsDY_cfi.py:10
TkSimHitPrinter.h
TkSimHitPrinter::printGlobalMomentum
void printGlobalMomentum(float, float, float) const
Definition: TkSimHitPrinter.cc:36
MillePedeFileConverter_cfg.out
out
Definition: MillePedeFileConverter_cfg.py:31
ztail.d
d
Definition: ztail.py:151
dqmiolumiharvest.j
j
Definition: dqmiolumiharvest.py:66
MillePedeFileConverter_cfg.e
e
Definition: MillePedeFileConverter_cfg.py:37