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.

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 }

References MillePedeFileConverter_cfg::fileName, MillePedeFileConverter_cfg::out, and 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.

35 { theFile->close(); }

References theFile.

◆ fillEndTrack()

void MaterialBudgetTxt::fillEndTrack ( )
overridevirtual

Reimplemented from MaterialBudgetFormat.

Definition at line 30 of file MaterialBudgetTxt.cc.

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

References MaterialBudgetFormat::theData.

◆ fillPerStep()

void MaterialBudgetTxt::fillPerStep ( )
overridevirtual

Reimplemented from MaterialBudgetFormat.

Definition at line 24 of file MaterialBudgetTxt.cc.

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 }

References MaterialBudgetFormat::theData.

◆ fillStartTrack()

void MaterialBudgetTxt::fillStartTrack ( )
overridevirtual

Reimplemented from MaterialBudgetFormat.

Definition at line 18 of file MaterialBudgetTxt.cc.

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 }

References MaterialBudgetFormat::theData.

Member Data Documentation

◆ theFile

std::ofstream* MaterialBudgetTxt::theFile
private

Definition at line 19 of file MaterialBudgetTxt.h.

Referenced by endOfRun(), and MaterialBudgetTxt().

MaterialBudgetFormat::theData
std::shared_ptr< MaterialBudgetData > theData
Definition: MaterialBudgetFormat.h:20
MaterialBudgetTxt::theFile
std::ofstream * theFile
Definition: MaterialBudgetTxt.h:19
edm::LogInfo
Definition: MessageLogger.h:254
MillePedeFileConverter_cfg.fileName
fileName
Definition: MillePedeFileConverter_cfg.py:32
MaterialBudgetFormat::MaterialBudgetFormat
MaterialBudgetFormat(std::shared_ptr< MaterialBudgetData > data)
Definition: MaterialBudgetFormat.cc:4
edm::LogError
Definition: MessageLogger.h:183
data
char data[epos_bytes_allocation]
Definition: EPOS_Wrapper.h:79
MillePedeFileConverter_cfg.out
out
Definition: MillePedeFileConverter_cfg.py:31