CMS 3D CMS Logo

Public Member Functions | Private Attributes | Static Private Attributes

TkSimHitPrinter Class Reference

#include <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 dbtoconf::out, and theFile.

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

Definition at line 16 of file TkSimHitPrinter.cc.

                                 {
  //  theFile->close();
}

Member Function Documentation

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

Definition at line 43 of file TkSimHitPrinter.cc.

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

Referenced by TkAccumulatingSensitiveDetector::sendHit().

                                                                        {
  float dr;
  dr = p.x()*(e-p).x()+ p.y()*(e-p).y()+p.z()*(e-p).z();
  if (dr>0) return +1;
  return -1;
}
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().

                                                                         {
  (*theFile) << " Global: "<<p.x()<<" "<<p.y()<<" "<<p.z()
             <<" ; "<<e.x()<<" "<<e.y()<<" "<<e.z();
}
void TkSimHitPrinter::printGlobalMomentum ( float  px,
float  py,
float  pz 
) const

Definition at line 40 of file TkSimHitPrinter.cc.

Referenced by TkAccumulatingSensitiveDetector::sendHit().

                                                                          {
  (*theFile)<<" Momentum "<<px<<" "<<py<<" "<<pz<<std::endl;
}
void TkSimHitPrinter::printHitData ( float  energy,
float  tof 
) const

Definition at line 34 of file TkSimHitPrinter.cc.

Referenced by TkAccumulatingSensitiveDetector::sendHit().

                                                                {
  (*theFile)<< " Energy: "<<energy<<" ToF: "<<tof;
}
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().

                                                                     {
  (*theFile) << " Local: "<<p.x()<<" "<<p.y()<<" "<<p.z()
             <<" ; "<<e.x()<<" "<<e.y()<<" "<<e.z();
}
void TkSimHitPrinter::printMomentumOfTrack ( float  m,
std::string  s,
int  sign 
) const

Definition at line 37 of file TkSimHitPrinter.cc.

References alignCSCRings::s.

Referenced by TkAccumulatingSensitiveDetector::sendHit().

                                                                              {
  (*theFile)<<" Momentum "<<m*sign<<" Particle "<<s;
}
void TkSimHitPrinter::startNewSimHit ( std::string  s,
std::string  d,
int  i,
int  j,
int  eve 
)

Definition at line 20 of file TkSimHitPrinter.cc.

References j.

Referenced by TkAccumulatingSensitiveDetector::sendHit().

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

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().