CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
List of all members | Public Member Functions | Private Attributes | Static Private Attributes
TkSimHitPrinter Class Reference

#include <TkSimHitPrinter.h>

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.

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
tuple out
Definition: dbtoconf.py:99
tuple filename
Definition: lut2db_cfg.py:20
TkSimHitPrinter::~TkSimHitPrinter ( )

Definition at line 16 of file TkSimHitPrinter.cc.

16  {
17  // theFile->close();
18 }

Member Function Documentation

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

Definition at line 43 of file TkSimHitPrinter.cc.

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

Referenced by TkAccumulatingSensitiveDetector::sendHit().

43  {
44  float dr;
45  dr = p.x()*(e-p).x()+ p.y()*(e-p).y()+p.z()*(e-p).z();
46  if (dr>0) return +1;
47  return -1;
48 }
T y() const
Definition: PV3DBase.h:63
T z() const
Definition: PV3DBase.h:64
T x() const
Definition: PV3DBase.h:62
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().

29  {
30  (*theFile) << " Global: "<<p.x()<<" "<<p.y()<<" "<<p.z()
31  <<" ; "<<e.x()<<" "<<e.y()<<" "<<e.z();
32 }
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 40 of file TkSimHitPrinter.cc.

Referenced by TkAccumulatingSensitiveDetector::sendHit().

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

Definition at line 34 of file TkSimHitPrinter.cc.

Referenced by TkAccumulatingSensitiveDetector::sendHit().

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

24  {
25  (*theFile) << " Local: "<<p.x()<<" "<<p.y()<<" "<<p.z()
26  <<" ; "<<e.x()<<" "<<e.y()<<" "<<e.z();
27 }
T y() const
Definition: PV3DBase.h:63
T z() const
Definition: PV3DBase.h:64
T x() const
Definition: PV3DBase.h:62
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().

37  {
38  (*theFile)<<" Momentum "<<m*sign<<" Particle "<<s;
39 }
double sign(double x)
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().

20  {
21  (*theFile) <<"Event: "<<eve<<" "<<s<<" "<<d<<" "<<i<<" Track "<<j;
22 }
int i
Definition: DBlmapReader.cc:9
tuple d
Definition: ztail.py:151
int j
Definition: DBlmapReader.cc:9

Member Data Documentation

int TkSimHitPrinter::eventno
private

Definition at line 25 of file TkSimHitPrinter.h.

std::ofstream * TkSimHitPrinter::theFile
staticprivate

Definition at line 26 of file TkSimHitPrinter.h.

Referenced by TkSimHitPrinter().