InDet::GNNTrackReaderTool is a tool that reads track candidates of each event from a CSV file named as "track_runNumber_eventNumber.csv" or with a customized pre-fix. The directory, inputTracksDir, contains CSV files for all events. 1) If the inputTracksDir is not specified, the tool will read the CSV files from the current directory. 2) If the corresponding CSV file does not exist for a given event (runNumber, eventNumber), the tool will print an error message and return an empty list.
More...
#include <GNNTrackReaderTool.h>
|
| GNNTrackReaderTool (const std::string &type, const std::string &name, const IInterface *parent) |
|
virtual void | getTracks (uint32_t runNumber, uint32_t eventNumber, std::vector< std::vector< uint32_t > > &tracks) const override final |
| Get track candidates from a CSV file named by runNumber and eventNumber. More...
|
|
virtual void | getTracks (uint32_t runNumber, uint32_t eventNumber, std::vector< std::vector< uint32_t >> &tracks, std::vector< std::vector< uint32_t >> &seeds) const override final |
|
virtual MsgStream & | dump (MsgStream &out) const override |
|
virtual std::ostream & | dump (std::ostream &out) const override |
|
InDet::GNNTrackReaderTool is a tool that reads track candidates of each event from a CSV file named as "track_runNumber_eventNumber.csv" or with a customized pre-fix. The directory, inputTracksDir, contains CSV files for all events. 1) If the inputTracksDir is not specified, the tool will read the CSV files from the current directory. 2) If the corresponding CSV file does not exist for a given event (runNumber, eventNumber), the tool will print an error message and return an empty list.
- Author
- xiang.nosp@m.yang.nosp@m..ju@c.nosp@m.ern..nosp@m.ch
Definition at line 32 of file GNNTrackReaderTool.h.
◆ GNNTrackReaderTool() [1/3]
InDet::GNNTrackReaderTool::GNNTrackReaderTool |
( |
const std::string & |
type, |
|
|
const std::string & |
name, |
|
|
const IInterface * |
parent |
|
) |
| |
◆ GNNTrackReaderTool() [2/3]
InDet::GNNTrackReaderTool::GNNTrackReaderTool |
( |
| ) |
|
|
protecteddelete |
◆ GNNTrackReaderTool() [3/3]
◆ dump() [1/2]
MsgStream & InDet::GNNTrackReaderTool::dump |
( |
MsgStream & |
out | ) |
const |
|
overridevirtual |
◆ dump() [2/2]
std::ostream & InDet::GNNTrackReaderTool::dump |
( |
std::ostream & |
out | ) |
const |
|
overridevirtual |
◆ dumpevent()
MsgStream & InDet::GNNTrackReaderTool::dumpevent |
( |
MsgStream & |
out | ) |
const |
|
protected |
Definition at line 30 of file GNNTrackReaderTool.cxx.
32 out<<
"|---------------------------------------------------------------------|"
34 out<<
"| Number output tracks | "<<std::setw(12)
36 out<<
"|---------------------------------------------------------------------|"
◆ getTracks() [1/2]
void InDet::GNNTrackReaderTool::getTracks |
( |
uint32_t |
runNumber, |
|
|
uint32_t |
eventNumber, |
|
|
std::vector< std::vector< uint32_t > > & |
tracks |
|
) |
| const |
|
finaloverridevirtual |
Get track candidates from a CSV file named by runNumber and eventNumber.
- Parameters
-
runNumber | run number of the event. |
eventNumber | event number of the event. |
tracks | a list of track candidates in terms of spacepoint indices as read from the CSV file. |
Definition at line 41 of file GNNTrackReaderTool.cxx.
47 trackCandidates.clear();
50 if (!csvFile.is_open()) {
58 while(std::getline(csvFile,
line)){
59 std::stringstream lineStream(
line);
61 std::vector<uint32_t> trackCandidate;
70 cellId = std::stoi(
cell);
71 }
catch (
const std::invalid_argument& ia) {
72 std::cout <<
"Invalid argument: " << ia.what() <<
" for cell " <<
cell << std::endl;
76 if (
std::find(trackCandidate.begin(), trackCandidate.end(), cellId) == trackCandidate.end()) {
77 trackCandidate.push_back(cellId);
80 trackCandidates.push_back(std::move(trackCandidate));
◆ getTracks() [2/2]
void InDet::GNNTrackReaderTool::getTracks |
( |
uint32_t |
runNumber, |
|
|
uint32_t |
eventNumber, |
|
|
std::vector< std::vector< uint32_t >> & |
tracks, |
|
|
std::vector< std::vector< uint32_t >> & |
seeds |
|
) |
| const |
|
finaloverridevirtual |
Definition at line 87 of file GNNTrackReaderTool.cxx.
95 trackCandidates.clear();
98 if (!csvFile.is_open()) {
106 while (std::getline(csvFile,
line)) {
107 std::istringstream lineStream(
line);
108 std::string CLString, SPString;
114 if (std::getline(lineStream, CLString,
'|') &&
115 std::getline(lineStream, SPString)) {
116 std::istringstream CLStream(CLString), SPStream(SPString);
117 std::vector<uint32_t>
cls, sps;
125 sps.push_back(std::stoi(
number));
128 trackCandidates.push_back(
cls);
129 seeds.push_back(sps);
134 ATH_MSG_DEBUG(
"Length of track list " << trackCandidates.size());
◆ operator=()
◆ m_csvPrefix
StringProperty InDet::GNNTrackReaderTool::m_csvPrefix {this, "csvPrefix", "track"} |
|
protected |
◆ m_inputTracksDir
StringProperty InDet::GNNTrackReaderTool::m_inputTracksDir {this, "inputTracksDir", "."} |
|
protected |
The documentation for this class was generated from the following files: