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
MaterialBudgetTxt Class Reference

#include <MaterialBudgetTxt.h>

Inheritance diagram for MaterialBudgetTxt:
MaterialBudgetFormat

Public Member Functions

virtual void fillEndTrack ()
 
virtual void fillPerStep ()
 
virtual void fillStartTrack ()
 
 MaterialBudgetTxt (MaterialBudgetData *data, const std::string &fileName)
 
virtual ~MaterialBudgetTxt ()
 
- Public Member Functions inherited from MaterialBudgetFormat
 MaterialBudgetFormat (MaterialBudgetData *data)
 
virtual ~MaterialBudgetFormat ()
 

Private Attributes

std::ofstream * theFile
 

Additional Inherited Members

- Protected Attributes inherited from MaterialBudgetFormat
MaterialBudgetDatatheData
 
std::string theFileName
 

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 dtNoiseDBValidation_cfg::cerr, gather_cfg::cout, dbtoconf::out, and theFile.

7  : MaterialBudgetFormat( data )
8 {
9  const char * fnamechar = fileName.c_str();
10  theFile = new std::ofstream(fnamechar, std::ios::out);
11  std::cout <<"Dumping Material Budget to " << fileName << std::endl;
12  if (theFile->fail()){
13  std::cerr <<" Error opening file" << fileName << std::endl;
14  }
15 }
tuple out
Definition: dbtoconf.py:99
MaterialBudgetFormat(MaterialBudgetData *data)
tuple cout
Definition: gather_cfg.py:121
std::ofstream * theFile
MaterialBudgetTxt::~MaterialBudgetTxt ( )
virtual

Definition at line 18 of file MaterialBudgetTxt.cc.

References theFile.

19 {
20  theFile->close();
21 }
std::ofstream * theFile

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

42 {
43  (*theFile) << G4EventManager::GetEventManager()->GetConstCurrentEvent()->GetEventID() << " " << "finalTrkMB " << theData->getTotalMB() << std::endl;
44 }
float getTotalMB() const
MaterialBudgetData * theData
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().

34 {
35  (*theFile) << "step "<< theData->getTrkLen() << " " << theData->getPVname() << " " << theData->getPVcopyNo() << " " << theData->getTotalMB() << " " << theData->getRadLen() << std::endl;
36  // std::cout << "step "<< theData->getTrkLen() << " " << theData->getPVname() << " " << theData->getPVcopyNo() << " " << theData->getTotalMB() << " " << theData->getRadLen() << std::endl;
37 
38 }
float getTotalMB() const
MaterialBudgetData * theData
std::string getPVname() const
float getRadLen() const
float getTrkLen() const
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().

25 {
26  std::cout << " Track "<< G4EventManager::GetEventManager()->GetConstCurrentEvent()->GetEventID() << " " << theData->getEta() << " " << theData->getPhi() << std::endl;
27  (*theFile)<< " Track "<< G4EventManager::GetEventManager()->GetConstCurrentEvent()->GetEventID() << " " << theData->getEta() << " " << theData->getPhi() << std::endl;
28  // + 1 was GEANT3 notation (*theFile)<< " Track "<< G4EventManager::GetEventManager()->GetConstCurrentEvent()->GetEventID() + 1<< " " << theData->getEta() << " " << theData->getPhi() << std::endl;
29 
30 }
MaterialBudgetData * theData
float getEta() const
float getPhi() const
tuple cout
Definition: gather_cfg.py:121

Member Data Documentation

std::ofstream* MaterialBudgetTxt::theFile
private

Definition at line 20 of file MaterialBudgetTxt.h.

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