#include <FPGATrackSimInputHeaderTool.h>
|
| StatusCode | openFile (std::string const &path) |
|
| StringArrayProperty | m_inpath {this, "InFileName", {"."}, "input file paths"} |
| StringProperty | m_rwoption {this, "RWstatus", std::string("READ"), "define read or write file option: READ, RECREATE, HEADER"} |
| std::atomic< unsigned > | m_event = 0 |
| std::atomic< unsigned > | m_totevent = 0 |
| std::atomic< unsigned > | m_file = 0 |
| std::string | m_branchName |
◆ FPGATrackSimInputHeaderTool()
| FPGATrackSimInputHeaderTool::FPGATrackSimInputHeaderTool |
( |
const std::string & | algname, |
|
|
const std::string & | name, |
|
|
const IInterface * | ifc ) |
◆ ~FPGATrackSimInputHeaderTool()
| virtual FPGATrackSimInputHeaderTool::~FPGATrackSimInputHeaderTool |
( |
| ) |
|
|
virtualdefault |
◆ finalize()
| StatusCode FPGATrackSimInputHeaderTool::finalize |
( |
| ) |
|
|
overridevirtual |
Definition at line 92 of file FPGATrackSimInputHeaderTool.cxx.
92 {
94 if (
m_rwoption.value()==std::string(
"RECREATE")){
95 m_EventTree->Print();
96
97 m_infile ->Write();
98 }
100 m_infile ->Close();
101
102 delete m_eventHeader;
103 return StatusCode::SUCCESS;
104}
◆ initialize()
| StatusCode FPGATrackSimInputHeaderTool::initialize |
( |
| ) |
|
|
overridevirtual |
Definition at line 56 of file FPGATrackSimInputHeaderTool.cxx.
56 {
57
58 m_eventHeader = new FPGATrackSimEventInputHeader();
59
61
62
64 {
66 {
68 return StatusCode::FAILURE;
69 }
71 }
72 if (
m_rwoption.value()==std::string(
"READ") ) {
74 }
75 else if (
m_rwoption.value()==std::string(
"RECREATE") ||
m_rwoption.value()==std::string(
"HEADER")) {
77 m_EventTree = new TTree("FPGATrackSimEventTree","data");
80 &m_eventHeader);
81 }
82 else {
84 return StatusCode::FAILURE;
85 }
88 return StatusCode::SUCCESS;
89}
#define ATH_CHECK
Evaluate an expression and check for errors.
◆ openFile()
| StatusCode FPGATrackSimInputHeaderTool::openFile |
( |
std::string const & | path | ) |
|
|
private |
Definition at line 13 of file FPGATrackSimInputHeaderTool.cxx.
14{
15
16 if (m_infile && m_infile->IsOpen())
17 {
18 m_infile->Close();
19
20 }
21
22
25
26 if (m_infile == nullptr)
27 {
29 return StatusCode::FAILURE;
30 }
32 {
33
34 m_EventTree = (TTree*) m_infile->Get("FPGATrackSimEventTree");
35
36 if (m_EventTree == nullptr || m_EventTree->GetEntries() == -1 ){
38 return StatusCode::FAILURE;
39 }
40 ATH_MSG_INFO (
"Input file: " << path <<
" has "<< m_EventTree->GetEntries() <<
" event entries" );
41
42 if(!m_EventTree->GetListOfBranches()->FindObject(
m_branchName.c_str())){
44 return StatusCode::FAILURE;
45 }
47 TBranch *branch = m_EventTree->GetBranch(
m_branchName.c_str());
48 branch->SetAddress(&m_eventHeader);
49 }
51 return StatusCode::SUCCESS;
52}
path
python interpreter configuration --------------------------------------—
◆ readData()
Definition at line 126 of file FPGATrackSimInputHeaderTool.cxx.
127{
128 if (
m_rwoption.value()!=std::string(
"READ") ){
130 return StatusCode::SUCCESS;
131 }
132
133 last=false;
134
136 if (
m_event >= m_EventTree->GetEntries())
137 {
140 else {
141 last=true;
142 return StatusCode::SUCCESS;
143 }
144 }
145
146
147
148 m_EventTree->GetEntry(
m_event++);
151
153
154 return StatusCode::SUCCESS;
155
156}
#define ATH_MSG_WARNING(x)
◆ writeData()
Definition at line 107 of file FPGATrackSimInputHeaderTool.cxx.
107 {
108 if (
m_rwoption.value()==std::string(
"READ") ){
110 return StatusCode::SUCCESS;
111 }
112
113 if (header != nullptr){
115 m_EventTree->Fill();
118 }
119
120
121
122
123 return StatusCode::SUCCESS;
124}
◆ m_branchName
| std::string FPGATrackSimInputHeaderTool::m_branchName |
|
private |
◆ m_event
| std::atomic<unsigned> FPGATrackSimInputHeaderTool::m_event = 0 |
|
private |
◆ m_file
| std::atomic<unsigned> FPGATrackSimInputHeaderTool::m_file = 0 |
|
private |
◆ m_inpath
| StringArrayProperty FPGATrackSimInputHeaderTool::m_inpath {this, "InFileName", {"."}, "input file paths"} |
|
private |
◆ m_rwoption
| StringProperty FPGATrackSimInputHeaderTool::m_rwoption {this, "RWstatus", std::string("READ"), "define read or write file option: READ, RECREATE, HEADER"} |
|
private |
Definition at line 35 of file FPGATrackSimInputHeaderTool.h.
35{this, "RWstatus", std::string("READ"), "define read or write file option: READ, RECREATE, HEADER"};
◆ m_totevent
| std::atomic<unsigned> FPGATrackSimInputHeaderTool::m_totevent = 0 |
|
private |
The documentation for this class was generated from the following files: