CMS 3D CMS Logo

SimHitPrinter Class Reference

class to print sim hits for validation and debugging More...

#include <SimG4CMS/Muon/interface/SimHitPrinter.h>

List of all members.

Public Member Functions

void printEloss (float) const
void printGlobal (GlobalPoint) const
void printId (int) const
void printLocal (LocalPoint, LocalPoint) const
void printPabs (float) const
void printTrack (int) const
 SimHitPrinter (std::string)
void startNewEvent (int)
void startNewSimHit (std::string)
 ~SimHitPrinter ()

Static Private Attributes

static std::ofstream * theFile


Detailed Description

class to print sim hits for validation and debugging

Author:
Tommaso Boccali <Tommaso.Boccali@cern.ch> Arno Straesser <Arno.Straessner@cern.ch>
Modification:

Definition at line 22 of file SimHitPrinter.h.


Constructor & Destructor Documentation

SimHitPrinter::SimHitPrinter ( std::string  filename  ) 

Definition at line 8 of file SimHitPrinter.cc.

References out, and theFile.

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

SimHitPrinter::~SimHitPrinter (  ) 

Definition at line 14 of file SimHitPrinter.cc.

00014                              {
00015   //  theFile->close();
00016 }


Member Function Documentation

void SimHitPrinter::printEloss ( float  eloss  )  const

Definition at line 56 of file SimHitPrinter.cc.

References GenMuonPlsPt100GeV_cfg::cout, and lat::endl().

00056                                                {
00057   std::cout << " Eloss: "<<eloss<<std::endl;
00058   (*theFile) << " e "<<eloss;
00059 }

void SimHitPrinter::printGlobal ( GlobalPoint  global  )  const

Definition at line 74 of file SimHitPrinter.cc.

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

Referenced by MuonSensitiveDetector::saveHit().

00074                                                         {
00075   (*theFile).width(10);
00076   (*theFile).setf(std::ios::right,std::ios::adjustfield);
00077   (*theFile).setf(std::ios::floatfield);
00078   (*theFile).precision(6);
00079   std::cout << " Global(en): "<<global.x()<<" "<< global.y()<<" "
00080              <<global.z()<<std::endl;
00081   (*theFile) << " gl "<<global.x()<<" "<< global.y()<<" "
00082              <<global.z()<<std::endl;
00083 }

void SimHitPrinter::printId ( int  id  )  const

Definition at line 35 of file SimHitPrinter.cc.

References GenMuonPlsPt100GeV_cfg::cout, and lat::endl().

Referenced by MuonSensitiveDetector::saveHit().

00035                                        {
00036   std::cout << " Id: "<<id<<std::endl;
00037   (*theFile) << " id ";
00038   (*theFile).width(10);
00039   (*theFile).setf(std::ios::right,std::ios::adjustfield);
00040   (*theFile) <<id;
00041 }

void SimHitPrinter::printLocal ( LocalPoint  localen,
LocalPoint  localex 
) const

Definition at line 61 of file SimHitPrinter.cc.

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

Referenced by MuonSensitiveDetector::saveHit().

00061                                                                          {
00062   (*theFile).width(10);
00063   (*theFile).setf(std::ios::right,std::ios::adjustfield);
00064   (*theFile).setf(std::ios::floatfield);
00065   (*theFile).precision(6);
00066   std::cout << " Local(en/ex): "<<localen.x()<<" "<< localen.y()<<" "
00067        <<localen.z()<<" / "<<localex.x()<<" "<< localex.y()<<" "
00068        <<localex.z()<<std::endl;
00069   (*theFile) << " en/ex "<<localen.x()<<" "<< localen.y()<<" "
00070        <<localen.z()<<" / "<<localex.x()<<" "<< localex.y()<<" "
00071        <<localex.z();
00072 }

void SimHitPrinter::printPabs ( float  pabs  )  const

Definition at line 51 of file SimHitPrinter.cc.

References GenMuonPlsPt100GeV_cfg::cout, and lat::endl().

00051                                              {
00052   std::cout << " Pabs: "<<pabs<<std::endl;
00053   (*theFile) << " p "<<pabs;
00054 }

void SimHitPrinter::printTrack ( int  id  )  const

Definition at line 43 of file SimHitPrinter.cc.

References GenMuonPlsPt100GeV_cfg::cout, and lat::endl().

00043                                           {
00044   std::cout << " Track: "<<id<<std::endl;
00045   (*theFile) << " trk ";
00046   (*theFile).width(10);
00047   (*theFile).setf(std::ios::right,std::ios::adjustfield);
00048   (*theFile) << id;
00049 }

void SimHitPrinter::startNewEvent ( int  num  ) 

Definition at line 31 of file SimHitPrinter.cc.

References lat::endl().

00031                                         {
00032   (*theFile) << "Event "<<num<<std::endl;
00033 }

void SimHitPrinter::startNewSimHit ( std::string  s  ) 

Definition at line 18 of file SimHitPrinter.cc.

References GenMuonPlsPt100GeV_cfg::cout, and lat::endl().

Referenced by MuonSensitiveDetector::saveHit().

00018                                              {
00019   std::cout.width(10);
00020   std::cout.setf(std::ios::right,std::ios::adjustfield);
00021   std::cout.setf(std::ios::scientific,std::ios::floatfield);
00022   std::cout.precision(6);
00023   std::cout << "SimHit in "<<s<<std::endl;
00024   (*theFile).width(10);
00025   (*theFile).setf(std::ios::right,std::ios::adjustfield);
00026   (*theFile).setf(std::ios::scientific|std::ios::uppercase|std::ios::showpos,std::ios::floatfield);
00027   (*theFile).precision(5);
00028   (*theFile) << "SimHit in "<<s;
00029 }


Member Data Documentation

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

Definition at line 37 of file SimHitPrinter.h.

Referenced by SimHitPrinter().


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