18 m_infile = TFile::Open(
m_inpath.value().c_str(),
"READ");
19 if (m_infile ==
nullptr){
21 return StatusCode::FAILURE;
25 m_EventTree = (TTree*) m_infile->Get(
"FPGATrackSimEventTree");
26 if (m_EventTree ==
nullptr || m_EventTree->GetEntries() == -1 ){
28 return StatusCode::FAILURE;
31 std::string branchName=
"FPGATrackSimEventInputHeader";
32 if(!m_EventTree->GetListOfBranches()->FindObject(branchName.c_str())){
34 return StatusCode::FAILURE;
37 TBranch *
branch = m_EventTree->GetBranch(branchName.c_str());
41 branch->SetAddress(&m_eventHeader);
43 return StatusCode::SUCCESS;
58 m_EventTree->GetEntry(
m_entry++);
62 unsigned long int mbc = 0;
71 for (
const auto& truthtrack :
header->optional().getTruthTracks())
73 if (truthtrack.getBarcode() > mbc) mbc = truthtrack.getBarcode();
78 for (
const auto& offlinetrack :
header->optional().getOfflineTracks())
85 for (
auto truthtrack : m_eventHeader->optional().getTruthTracks())
87 truthtrack.setBarcode(truthtrack.getBarcode() + mbc);
90 for (
auto offlinetrack : m_eventHeader->optional().getOfflineTracks())
92 offlinetrack.setBarcode(offlinetrack.getBarcode() + mbc);
96 header->setOptional(optional);
99 for (
auto rawhit : m_eventHeader->hits())
104 mt.
maximize(uniquecode, rawhit.getBarcodePt());
105 rawhit.setBarcode(rawhit.getBarcode() + mbc);
110 return StatusCode::SUCCESS;
115 ATH_MSG_FATAL(
"This tool is being forced to write things. But it is only designed to read things. Don't worry, everything is fine");
116 return StatusCode::FAILURE;
121 delete m_eventHeader;
122 return StatusCode::SUCCESS;