ATLAS Offline Software
Loading...
Searching...
No Matches
FPGATrackSimDumpOutputStatAlg.cxx
Go to the documentation of this file.
2
6#include "TH2F.h"
7
8
9FPGATrackSimDumpOutputStatAlg::FPGATrackSimDumpOutputStatAlg (const std::string& name, ISvcLocator* pSvcLocator) :
10 AthAlgorithm(name, pSvcLocator) {}
11
12
14{
15 ATH_MSG_INFO ( "FPGATrackSimDumpOutputStatAlg::initialize()");
16 ATH_CHECK( m_readOutputTool.retrieve());
17
18 // TODO: This tool needs to be completely rewritten.
19 // It currently is assuming that there's (at least) one input branch and one output branch in the ROOT files it runs over.
20 // The changes we're making to split up the "main algorithm" will mean that's no longer the case.
21 if (m_inputBranchName != "") {
23 }
24 if (m_outputBranchName != "") {
26 }
27
28 // Hook up the branches for reading.
29 ATH_CHECK(m_readOutputTool->configureReadBranches());
30
31 // Eventually add some histograms for monitoring
33
34 // TO DO: must register the histograms to the TFile in the Tool
35 return StatusCode::SUCCESS;
36}
37
38
40 //m_hits_r_vs_z = new TH2F("h_hits_r_vs_z", "r/z ITK hit map; z[mm];r[mm]", 3500, 0., 3500., 450, 0., 450.);
41 return StatusCode::SUCCESS;
42}
43
44
46 ATH_MSG_DEBUG ("Running on event ");
47
48 bool last=false;
49 ATH_CHECK (m_readOutputTool->readData(last));
50 if (last) return StatusCode::SUCCESS;
51
52 // Assuming we read in an input header... do this.
53 if (m_eventInputHeader != nullptr) {
55 }
56
57 // fill histograms, assuming we read in an output header (and if there are any to fill).
58 if (m_eventOutputHeader != nullptr) {
59 for (const auto& track : m_eventOutputHeader->getFPGATrackSimTracks_1st()) {
60 ATH_MSG_DEBUG (track);
61 //commented out for future debugging
62 //float r= std::sqrt(hit.getX()*hit.getX() + hit.getY()*hit.getY());
63 //m_hits_r_vs_z->Fill(hit.getZ(), r);
64 }
65
66 for (const auto &track : m_eventOutputHeader->getFPGATrackSimTracks_2nd()) {
67 ATH_MSG_DEBUG (track);
68 }
69 }
70
71 // TODO: I suppose the reason for this was that new histograms would get appended to the ROOT file.
72 // But... we don't currently make any, and so I'm not sure there's any reason to just copy the input objects to a new file.
73 //ATH_CHECK (m_writeOutputTool->writeData(&eventInputHeader_1st, &eventInputHeader_2nd, &eventOutputHeader) );
74
75 m_event += 1;
76
77 return StatusCode::SUCCESS;
78}
79
81 ATH_MSG_INFO("Processed " << m_event << " events.");
82 return StatusCode::SUCCESS;
83}
#define ATH_CHECK
Evaluate an expression and check for errors.
#define ATH_MSG_INFO(x)
#define ATH_MSG_VERBOSE(x)
#define ATH_MSG_DEBUG(x)
AthAlgorithm(const std::string &name, ISvcLocator *pSvcLocator)
Constructor with parameters:
FPGATrackSimLogicalEventOutputHeader * m_eventOutputHeader
ToolHandle< FPGATrackSimOutputHeaderTool > m_readOutputTool
Gaudi::Property< std::string > m_inputBranchName
FPGATrackSimDumpOutputStatAlg(const std::string &name, ISvcLocator *pSvcLocator)
FPGATrackSimLogicalEventInputHeader * m_eventInputHeader
Gaudi::Property< std::string > m_outputBranchName