CMS 3D CMS Logo

TkSimHitPrinter Class Reference

#include <SimG4CMS/Tracker/interface/TkSimHitPrinter.h>

List of all members.

Public Member Functions

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

Private Attributes

int eventno

Static Private Attributes

static std::ofstream * theFile


Detailed Description

Definition at line 12 of file TkSimHitPrinter.h.


Constructor & Destructor Documentation

TkSimHitPrinter::TkSimHitPrinter ( std::string  filename  ) 

Definition at line 10 of file TkSimHitPrinter.cc.

References out, and theFile.

00010                                                   {
00011   if (theFile) return;
00012   const char* theName = filename.c_str();
00013   theFile = new std::ofstream(theName, std::ios::out);
00014 }

TkSimHitPrinter::~TkSimHitPrinter (  ) 

Definition at line 16 of file TkSimHitPrinter.cc.

00016                                  {
00017   //  theFile->close();
00018 }


Member Function Documentation

int TkSimHitPrinter::getPropagationSign ( Local3DPoint  p,
Local3DPoint  e 
)

Definition at line 43 of file TkSimHitPrinter.cc.

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

Referenced by TkAccumulatingSensitiveDetector::sendHit().

00043                                                                         {
00044   float dr;
00045   dr = p.x()*(e-p).x()+ p.y()*(e-p).y()+p.z()*(e-p).z();
00046   if (dr>0) return +1;
00047   return -1;
00048 }

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

Definition at line 29 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().

00029                                                                          {
00030   (*theFile) << " Global: "<<p.x()<<" "<<p.y()<<" "<<p.z()
00031              <<" ; "<<e.x()<<" "<<e.y()<<" "<<e.z();
00032 }

void TkSimHitPrinter::printGlobalMomentum ( float  px,
float  py,
float  pz 
) const

Definition at line 40 of file TkSimHitPrinter.cc.

References lat::endl().

Referenced by TkAccumulatingSensitiveDetector::sendHit().

00040                                                                           {
00041   (*theFile)<<" Momentum "<<px<<" "<<py<<" "<<pz<<std::endl;
00042 }

void TkSimHitPrinter::printHitData ( float  energy,
float  tof 
) const

Definition at line 34 of file TkSimHitPrinter.cc.

Referenced by TkAccumulatingSensitiveDetector::sendHit().

00034                                                                 {
00035   (*theFile)<< " Energy: "<<energy<<" ToF: "<<tof;
00036 }

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

Definition at line 24 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().

00024                                                                      {
00025   (*theFile) << " Local: "<<p.x()<<" "<<p.y()<<" "<<p.z()
00026              <<" ; "<<e.x()<<" "<<e.y()<<" "<<e.z();
00027 }

void TkSimHitPrinter::printMomentumOfTrack ( float  m,
std::string  s,
int  sign 
) const

Definition at line 37 of file TkSimHitPrinter.cc.

Referenced by TkAccumulatingSensitiveDetector::sendHit().

00037                                                                               {
00038   (*theFile)<<" Momentum "<<m*sign<<" Particle "<<s;
00039 }

void TkSimHitPrinter::startNewSimHit ( std::string  s,
std::string  d,
int  i,
int  j,
int  eve 
)

Definition at line 20 of file TkSimHitPrinter.cc.

Referenced by TkAccumulatingSensitiveDetector::sendHit().

00020                                                                                  {
00021   (*theFile) <<"Event: "<<eve<<" "<<s<<" "<<d<<" "<<i<<" Track "<<j;
00022 }


Member Data Documentation

int TkSimHitPrinter::eventno [private]

Definition at line 25 of file TkSimHitPrinter.h.

std::ofstream * TkSimHitPrinter::theFile [static, private]

Definition at line 26 of file TkSimHitPrinter.h.

Referenced by TkSimHitPrinter().


The documentation for this class was generated from the following files:
Generated on Tue Jun 9 18:33:38 2009 for CMSSW by  doxygen 1.5.4