Validation
Geometry
src
MaterialBudgetTxt.cc
Go to the documentation of this file.
1
#include "
Validation/Geometry/interface/MaterialBudgetTxt.h
"
2
#include "
Validation/Geometry/interface/MaterialBudgetData.h
"
3
#include "G4EventManager.hh"
4
#include "G4Event.hh"
5
6
MaterialBudgetTxt::MaterialBudgetTxt
(std::shared_ptr<MaterialBudgetData>
data
,
const
std::string
&
fileName
)
7
:
MaterialBudgetFormat
(
data
) {
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
16
MaterialBudgetTxt::~MaterialBudgetTxt
() {}
17
18
void
MaterialBudgetTxt::fillStartTrack
() {
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
24
void
MaterialBudgetTxt::fillPerStep
() {
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
30
void
MaterialBudgetTxt::fillEndTrack
() {
31
(*theFile) << G4EventManager::GetEventManager()->GetConstCurrentEvent()->GetEventID() <<
" "
32
<<
"finalTrkMB "
<<
theData
->getTotalMB() << std::endl;
33
}
34
35
void
MaterialBudgetTxt::endOfRun
() {
theFile
->close(); }
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
Generated for CMSSW Reference Manual by
1.8.16