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 8 of file MaterialBudgetTxt.h.

Constructor & Destructor Documentation

◆ MaterialBudgetTxt()

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

Definition at line 6 of file MaterialBudgetTxt.cc.

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

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

◆ ~MaterialBudgetTxt()

MaterialBudgetTxt::~MaterialBudgetTxt ( )
override

Definition at line 16 of file MaterialBudgetTxt.cc.

16 {}

Member Function Documentation

◆ endOfRun()

void MaterialBudgetTxt::endOfRun ( )
overridevirtual

Reimplemented from MaterialBudgetFormat.

Definition at line 35 of file MaterialBudgetTxt.cc.

References theFile.

35 { theFile->close(); }
std::ofstream * theFile

◆ fillEndTrack()

void MaterialBudgetTxt::fillEndTrack ( )
overridevirtual

Reimplemented from MaterialBudgetFormat.

Definition at line 30 of file MaterialBudgetTxt.cc.

References MaterialBudgetFormat::theData.

30  {
31  (*theFile) << G4EventManager::GetEventManager()->GetConstCurrentEvent()->GetEventID() << " "
32  << "finalTrkMB " << theData->getTotalMB() << std::endl;
33 }
std::shared_ptr< MaterialBudgetData > theData

◆ fillPerStep()

void MaterialBudgetTxt::fillPerStep ( )
overridevirtual

Reimplemented from MaterialBudgetFormat.

Definition at line 24 of file MaterialBudgetTxt.cc.

References MaterialBudgetFormat::theData.

24  {
25  (*theFile) << "step " << theData->getTrkLen() << " " << theData->getPVname() << " " << theData->getPVcopyNo() << " "
26  << theData->getTotalMB() << " " << theData->getRadLen() << std::endl;
27  //- std::cout << "step "<< theData->getTrkLen() << " " << theData->getPVname() << " " << theData->getPVcopyNo() << " " << theData->getTotalMB() << " " << theData->getRadLen() << std::endl;
28 }
std::shared_ptr< MaterialBudgetData > theData

◆ fillStartTrack()

void MaterialBudgetTxt::fillStartTrack ( )
overridevirtual

Reimplemented from MaterialBudgetFormat.

Definition at line 18 of file MaterialBudgetTxt.cc.

References MaterialBudgetFormat::theData.

18  {
19  (*theFile) << " Track " << G4EventManager::GetEventManager()->GetConstCurrentEvent()->GetEventID() << " "
20  << theData->getEta() << " " << theData->getPhi() << std::endl;
21  // + 1 was GEANT3 notation (*theFile)<< " Track "<< G4EventManager::GetEventManager()->GetConstCurrentEvent()->GetEventID() + 1<< " " << theData->getEta() << " " << theData->getPhi() << std::endl;
22 }
std::shared_ptr< MaterialBudgetData > theData

Member Data Documentation

◆ theFile

std::ofstream* MaterialBudgetTxt::theFile
private

Definition at line 19 of file MaterialBudgetTxt.h.

Referenced by endOfRun(), and MaterialBudgetTxt().