CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
MaterialBudgetTxt.cc
Go to the documentation of this file.
3 #include "G4EventManager.hh"
4 #include "G4Event.hh"
5 
6 
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 }
16 
17 
19 {
20  theFile->close();
21 }
22 
23 
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 }
31 
32 
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 }
39 
40 
42 {
43  (*theFile) << G4EventManager::GetEventManager()->GetConstCurrentEvent()->GetEventID() << " " << "finalTrkMB " << theData->getTotalMB() << std::endl;
44 }
45 
float getTotalMB() const
virtual void fillPerStep()
MaterialBudgetData * theData
std::string getPVname() const
virtual void fillEndTrack()
float getEta() const
float getPhi() const
tuple out
Definition: dbtoconf.py:99
virtual ~MaterialBudgetTxt()
float getRadLen() const
float getTrkLen() const
tuple cout
Definition: gather_cfg.py:121
virtual void fillStartTrack()
std::ofstream * theFile
MaterialBudgetTxt(MaterialBudgetData *data, const std::string &fileName)