CMS 3D CMS Logo

List of all members | Public Member Functions | Static Private Attributes
TkSimHitPrinter Class Reference

#include <TkSimHitPrinter.h>

Public Member Functions

void printGlobal (const Local3DPoint &, const Local3DPoint &) const
 
void printGlobalMomentum (float, float, float) const
 
void printHitData (const std::string &, float, float, float) const
 
void printLocal (const Local3DPoint &, const Local3DPoint &) const
 
void startNewSimHit (const std::string &, const std::string &, int, int, int, int)
 
 TkSimHitPrinter (const std::string &)
 
 ~TkSimHitPrinter ()
 

Static Private Attributes

static std::ofstream * theFile
 

Detailed Description

Definition at line 12 of file TkSimHitPrinter.h.

Constructor & Destructor Documentation

TkSimHitPrinter::TkSimHitPrinter ( const std::string &  filename)

Definition at line 10 of file TkSimHitPrinter.cc.

References MillePedeFileConverter_cfg::out, and theFile.

10  {
11  if (theFile) return;
12  const char* theName = filename.c_str();
13  theFile = new std::ofstream(theName, std::ios::out);
14 }
static std::ofstream * theFile
TkSimHitPrinter::~TkSimHitPrinter ( )

Definition at line 16 of file TkSimHitPrinter.cc.

16  {
17 }

Member Function Documentation

void TkSimHitPrinter::printGlobal ( const Local3DPoint p,
const Local3DPoint e 
) const

Definition at line 28 of file TkSimHitPrinter.cc.

References PV3DBase< T, PVType, FrameType >::x(), PV3DBase< T, PVType, FrameType >::y(), and PV3DBase< T, PVType, FrameType >::z().

Referenced by TkAccumulatingSensitiveDetector::sendHit().

28  {
29  (*theFile) << "\n Global(mm): "<<p.x()<<" "<<p.y()<<" "<<p.z()
30  <<" ; "<<e.x()<<" "<<e.y()<<" "<<e.z();
31 }
T y() const
Definition: PV3DBase.h:63
T z() const
Definition: PV3DBase.h:64
T x() const
Definition: PV3DBase.h:62
void TkSimHitPrinter::printGlobalMomentum ( float  px,
float  py,
float  pz 
) const

Definition at line 36 of file TkSimHitPrinter.cc.

Referenced by TkAccumulatingSensitiveDetector::sendHit().

36  {
37  (*theFile)<<" Momentum "<<px<<" "<<py<<" " << pz << "\n";
38 }
void TkSimHitPrinter::printHitData ( const std::string &  nam,
float  p,
float  de,
float  tof 
) const

Definition at line 33 of file TkSimHitPrinter.cc.

Referenced by TkAccumulatingSensitiveDetector::sendHit().

33  {
34  (*theFile)<< "\n " << nam << " p(GeV): " << p << " Edep(GeV): "<<de<<" ToF: "<<tof;
35 }
void TkSimHitPrinter::printLocal ( const Local3DPoint p,
const Local3DPoint e 
) const

Definition at line 23 of file TkSimHitPrinter.cc.

References PV3DBase< T, PVType, FrameType >::x(), PV3DBase< T, PVType, FrameType >::y(), and PV3DBase< T, PVType, FrameType >::z().

Referenced by TkAccumulatingSensitiveDetector::sendHit().

23  {
24  (*theFile) << "\n Local(cm): "<<p.x()<<" "<<p.y()<<" "<<p.z()
25  <<" ; "<<e.x()<<" "<<e.y()<<" "<<e.z();
26 }
T y() const
Definition: PV3DBase.h:63
T z() const
Definition: PV3DBase.h:64
T x() const
Definition: PV3DBase.h:62
void TkSimHitPrinter::startNewSimHit ( const std::string &  s,
const std::string &  d,
int  i,
int  j,
int  k,
int  eve 
)

Definition at line 19 of file TkSimHitPrinter.cc.

References gen::k.

Referenced by TkAccumulatingSensitiveDetector::sendHit().

19  {
20  (*theFile) <<"Event: "<<eve<<" "<<s<<" "<<d<<" "<<i<<" Track "<<j << " " << k;
21 }
int k[5][pyjets_maxn]

Member Data Documentation

std::ofstream * TkSimHitPrinter::theFile
staticprivate

Definition at line 23 of file TkSimHitPrinter.h.

Referenced by TkSimHitPrinter().