CMS 3D CMS Logo

List of all members | Public Member Functions | Private Attributes
MaterialBudgetTxt Class Reference

#include <MaterialBudgetTxt.h>

Inheritance diagram for MaterialBudgetTxt:
MaterialBudgetFormat

Public Member Functions

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

Private Attributes

std::ofstream * theFile
 

Additional Inherited Members

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

Detailed Description

Definition at line 9 of file MaterialBudgetTxt.h.

Constructor & Destructor Documentation

MaterialBudgetTxt::MaterialBudgetTxt ( std::shared_ptr< MaterialBudgetData data,
const std::string &  fileName 
)

Definition at line 7 of file MaterialBudgetTxt.cc.

References MillePedeFileConverter_cfg::fileName, MillePedeFileConverter_cfg::out, and theFile.

9 {
10  const char * fnamechar = fileName.c_str();
11  theFile = new std::ofstream(fnamechar, std::ios::out);
12  edm::LogInfo("MaterialBudget") << "MaterialBudgetTxt: Dumping Material Budget to " << fileName;
13  if (theFile->fail()){
14  edm::LogError("MaterialBudget") <<"MaterialBudgetTxt: Error opening file" << fileName;
15  }
16 }
MaterialBudgetFormat(std::shared_ptr< MaterialBudgetData > data)
char data[epos_bytes_allocation]
Definition: EPOS_Wrapper.h:82
std::ofstream * theFile
MaterialBudgetTxt::~MaterialBudgetTxt ( )
override

Definition at line 19 of file MaterialBudgetTxt.cc.

20 {
21 }

Member Function Documentation

void MaterialBudgetTxt::endOfRun ( )
overridevirtual

Reimplemented from MaterialBudgetFormat.

Definition at line 45 of file MaterialBudgetTxt.cc.

References theFile.

46 {
47  theFile->close();
48 }
std::ofstream * theFile
void MaterialBudgetTxt::fillEndTrack ( )
overridevirtual

Reimplemented from MaterialBudgetFormat.

Definition at line 40 of file MaterialBudgetTxt.cc.

References MaterialBudgetFormat::theData.

41 {
42  (*theFile) << G4EventManager::GetEventManager()->GetConstCurrentEvent()->GetEventID() << " " << "finalTrkMB " << theData->getTotalMB() << std::endl;
43 }
std::shared_ptr< MaterialBudgetData > theData
void MaterialBudgetTxt::fillPerStep ( )
overridevirtual

Reimplemented from MaterialBudgetFormat.

Definition at line 32 of file MaterialBudgetTxt.cc.

References MaterialBudgetFormat::theData.

33 {
34  (*theFile) << "step "<< theData->getTrkLen() << " " << theData->getPVname() << " " << theData->getPVcopyNo() << " " << theData->getTotalMB() << " " << theData->getRadLen() << std::endl;
35  //- std::cout << "step "<< theData->getTrkLen() << " " << theData->getPVname() << " " << theData->getPVcopyNo() << " " << theData->getTotalMB() << " " << theData->getRadLen() << std::endl;
36 
37 }
std::shared_ptr< MaterialBudgetData > theData
void MaterialBudgetTxt::fillStartTrack ( )
overridevirtual

Reimplemented from MaterialBudgetFormat.

Definition at line 24 of file MaterialBudgetTxt.cc.

References MaterialBudgetFormat::theData.

25 {
26 
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 }
std::shared_ptr< MaterialBudgetData > theData

Member Data Documentation

std::ofstream* MaterialBudgetTxt::theFile
private

Definition at line 21 of file MaterialBudgetTxt.h.

Referenced by endOfRun(), and MaterialBudgetTxt().