CMS 3D CMS Logo

Public Member Functions | Private Attributes

MaterialBudgetTxt Class Reference

#include <MaterialBudgetTxt.h>

Inheritance diagram for MaterialBudgetTxt:
MaterialBudgetFormat

List of all members.

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

Detailed Description

Definition at line 9 of file MaterialBudgetTxt.h.


Constructor & Destructor Documentation

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]

Definition at line 18 of file MaterialBudgetTxt.cc.

References theFile.

{
  theFile->close();
}

Member Function Documentation

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;

}

Member Data Documentation

std::ofstream* MaterialBudgetTxt::theFile [private]

Definition at line 20 of file MaterialBudgetTxt.h.

Referenced by MaterialBudgetTxt(), and ~MaterialBudgetTxt().