CMS 3D CMS Logo

MaterialBudgetTxt.cc
Go to the documentation of this file.
3 #include "G4EventManager.hh"
4 #include "G4Event.hh"
5 
6 MaterialBudgetTxt::MaterialBudgetTxt(std::shared_ptr<MaterialBudgetData> data, const std::string& fileName)
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 }
15 
17 
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 }
23 
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 }
29 
31  (*theFile) << G4EventManager::GetEventManager()->GetConstCurrentEvent()->GetEventID() << " "
32  << "finalTrkMB " << theData->getTotalMB() << std::endl;
33 }
34 
MaterialBudgetFormat::theData
std::shared_ptr< MaterialBudgetData > theData
Definition: MaterialBudgetFormat.h:20
MaterialBudgetTxt::~MaterialBudgetTxt
~MaterialBudgetTxt() override
Definition: MaterialBudgetTxt.cc:16
MaterialBudgetTxt::theFile
std::ofstream * theFile
Definition: MaterialBudgetTxt.h:19
MaterialBudgetTxt::MaterialBudgetTxt
MaterialBudgetTxt(std::shared_ptr< MaterialBudgetData > data, const std::string &fileName)
Definition: MaterialBudgetTxt.cc:6
MaterialBudgetTxt.h
edm::LogInfo
Log< level::Info, false > LogInfo
Definition: MessageLogger.h:125
MillePedeFileConverter_cfg.fileName
fileName
Definition: MillePedeFileConverter_cfg.py:32
MaterialBudgetTxt::fillStartTrack
void fillStartTrack() override
Definition: MaterialBudgetTxt.cc:18
MaterialBudgetTxt::endOfRun
void endOfRun() override
Definition: MaterialBudgetTxt.cc:35
MaterialBudgetTxt::fillPerStep
void fillPerStep() override
Definition: MaterialBudgetTxt.cc:24
edm::LogError
Log< level::Error, false > LogError
Definition: MessageLogger.h:123
AlCaHLTBitMon_QueryRunRegistry.string
string string
Definition: AlCaHLTBitMon_QueryRunRegistry.py:256
MaterialBudgetData.h
MaterialBudgetTxt::fillEndTrack
void fillEndTrack() override
Definition: MaterialBudgetTxt.cc:30
data
char data[epos_bytes_allocation]
Definition: EPOS_Wrapper.h:79
MillePedeFileConverter_cfg.out
out
Definition: MillePedeFileConverter_cfg.py:31
MaterialBudgetFormat
Definition: MaterialBudgetFormat.h:9