#include <MaterialBudgetTxt.h>
Public Member Functions | |
virtual void | fillEndTrack () |
virtual void | fillPerStep () |
virtual void | fillStartTrack () |
MaterialBudgetTxt (MaterialBudgetData *data, const std::string &fileName) | |
virtual | ~MaterialBudgetTxt () |
Private Attributes | |
std::ofstream * | theFile |
Definition at line 9 of file MaterialBudgetTxt.h.
MaterialBudgetTxt::MaterialBudgetTxt | ( | MaterialBudgetData * | data, |
const std::string & | fileName | ||
) |
Definition at line 7 of file MaterialBudgetTxt.cc.
References benchmark_cfg::cerr, gather_cfg::cout, dbtoconf::out, and theFile.
: MaterialBudgetFormat( data ) { const char * fnamechar = fileName.c_str(); theFile = new std::ofstream(fnamechar, std::ios::out); std::cout <<"Dumping Material Budget to " << fileName << std::endl; if (theFile->fail()){ std::cerr <<" Error opening file" << fileName << std::endl; } }
MaterialBudgetTxt::~MaterialBudgetTxt | ( | ) | [virtual] |
void MaterialBudgetTxt::fillEndTrack | ( | ) | [virtual] |
Implements MaterialBudgetFormat.
Definition at line 41 of file MaterialBudgetTxt.cc.
References MaterialBudgetData::getTotalMB(), and MaterialBudgetFormat::theData.
Referenced by MaterialBudgetAction::update().
{ (*theFile) << G4EventManager::GetEventManager()->GetConstCurrentEvent()->GetEventID() << " " << "finalTrkMB " << theData->getTotalMB() << std::endl; }
void MaterialBudgetTxt::fillPerStep | ( | ) | [virtual] |
Implements MaterialBudgetFormat.
Definition at line 33 of file MaterialBudgetTxt.cc.
References MaterialBudgetData::getPVcopyNo(), MaterialBudgetData::getPVname(), MaterialBudgetData::getRadLen(), MaterialBudgetData::getTotalMB(), MaterialBudgetData::getTrkLen(), and MaterialBudgetFormat::theData.
Referenced by MaterialBudgetAction::update().
{ (*theFile) << "step "<< theData->getTrkLen() << " " << theData->getPVname() << " " << theData->getPVcopyNo() << " " << theData->getTotalMB() << " " << theData->getRadLen() << std::endl; // std::cout << "step "<< theData->getTrkLen() << " " << theData->getPVname() << " " << theData->getPVcopyNo() << " " << theData->getTotalMB() << " " << theData->getRadLen() << std::endl; }
void MaterialBudgetTxt::fillStartTrack | ( | ) | [virtual] |
Implements MaterialBudgetFormat.
Definition at line 24 of file MaterialBudgetTxt.cc.
References gather_cfg::cout, MaterialBudgetData::getEta(), MaterialBudgetData::getPhi(), and MaterialBudgetFormat::theData.
Referenced by MaterialBudgetAction::update().
{ std::cout << " Track "<< G4EventManager::GetEventManager()->GetConstCurrentEvent()->GetEventID() << " " << theData->getEta() << " " << theData->getPhi() << std::endl; (*theFile)<< " Track "<< G4EventManager::GetEventManager()->GetConstCurrentEvent()->GetEventID() << " " << theData->getEta() << " " << theData->getPhi() << std::endl; // + 1 was GEANT3 notation (*theFile)<< " Track "<< G4EventManager::GetEventManager()->GetConstCurrentEvent()->GetEventID() + 1<< " " << theData->getEta() << " " << theData->getPhi() << std::endl; }
std::ofstream* MaterialBudgetTxt::theFile [private] |
Definition at line 20 of file MaterialBudgetTxt.h.
Referenced by MaterialBudgetTxt(), and ~MaterialBudgetTxt().