ATLAS Offline Software
FPGATrackSimRawHitsWrapperAlg.cxx
Go to the documentation of this file.
3 #include "TObjectTable.h"
4 
5 
6 
7 FPGATrackSimRawHitsWrapperAlg::FPGATrackSimRawHitsWrapperAlg (const std::string& name, ISvcLocator* pSvcLocator) :
8  AthAlgorithm(name, pSvcLocator){}
9 
10 
12 {
13  ATH_MSG_INFO ( "FPGATrackSimRawHitsWrapperAlg::initialize()");
14  ATH_CHECK(m_readOutputTool.retrieve());
15  ATH_CHECK(m_writeOutputTool.retrieve());
16 
17  m_tot_hits =0;
18  m_tot_truth =0;
19  m_tot_oftracks =0;
20 
21  // eventually add some histograms for monitoring
23  return StatusCode::SUCCESS;
24 }
25 
27  return StatusCode::SUCCESS;
28 }
29 
31  ATH_MSG_DEBUG ("Running on event ");
32  FPGATrackSimEventInputHeader eventHeader;
33  bool last=false;
34  ATH_CHECK(m_readOutputTool->readData(&eventHeader, last));
35  if (last) return StatusCode::SUCCESS;
36 
37  ATH_MSG_DEBUG (eventHeader);
38 
39  m_tot_hits += eventHeader.nHits();
40  m_tot_truth += eventHeader.optional().nTruthTracks();
41  m_tot_oftracks += eventHeader.optional().nOfflineTracks();
42 
43  ATH_CHECK (m_writeOutputTool->writeData(&eventHeader) );
44 
45  //gObjectTable->Print();// write down statistcs of memory leak
46  return StatusCode::SUCCESS;
47 }
48 
49 
51 {
52  ATH_MSG_INFO("Finalized: n.hits ="<<m_tot_hits
53  <<" n.truth="<<m_tot_truth
54  <<" n.offline tracks="<<m_tot_oftracks);
55 
56  return StatusCode::SUCCESS;
57 }
FPGATrackSimRawHitsWrapperAlg::FPGATrackSimRawHitsWrapperAlg
FPGATrackSimRawHitsWrapperAlg(const std::string &name, ISvcLocator *pSvcLocator)
Definition: FPGATrackSimRawHitsWrapperAlg.cxx:7
ATH_MSG_INFO
#define ATH_MSG_INFO(x)
Definition: AthMsgStreamMacros.h:31
FPGATrackSimRawHitsWrapperAlg::m_tot_hits
unsigned int m_tot_hits
Definition: FPGATrackSimRawHitsWrapperAlg.h:31
FPGATrackSimOptionalEventInfo::nTruthTracks
size_t nTruthTracks() const
Definition: FPGATrackSimOptionalEventInfo.h:38
FPGATrackSimEventInputHeader::nHits
int nHits() const
Definition: FPGATrackSimEventInputHeader.h:37
FPGATrackSimRawHitsWrapperAlg::execute
virtual StatusCode execute() override
Definition: FPGATrackSimRawHitsWrapperAlg.cxx:30
EL::StatusCode
::StatusCode StatusCode
StatusCode definition for legacy code.
Definition: PhysicsAnalysis/D3PDTools/EventLoop/EventLoop/StatusCode.h:22
ATH_MSG_DEBUG
#define ATH_MSG_DEBUG(x)
Definition: AthMsgStreamMacros.h:29
FPGATrackSimRawHitsWrapperAlg::m_writeOutputTool
ToolHandle< IFPGATrackSimEventInputHeaderTool > m_writeOutputTool
Definition: FPGATrackSimRawHitsWrapperAlg.h:28
ATH_CHECK
#define ATH_CHECK
Definition: AthCheckMacros.h:40
FPGATrackSimEventInputHeader
Definition: FPGATrackSimEventInputHeader.h:22
AthAlgorithm
Definition: AthAlgorithm.h:47
FPGATrackSimRawHitsWrapperAlg::m_tot_oftracks
unsigned int m_tot_oftracks
Definition: FPGATrackSimRawHitsWrapperAlg.h:33
FPGATrackSimOptionalEventInfo::nOfflineTracks
size_t nOfflineTracks() const
Definition: FPGATrackSimOptionalEventInfo.h:33
FPGATrackSimEventInputHeader.h
name
std::string name
Definition: Control/AthContainers/Root/debug.cxx:195
FPGATrackSimEventInputHeader::optional
FPGATrackSimOptionalEventInfo const & optional() const
Definition: FPGATrackSimEventInputHeader.h:33
FPGATrackSimRawHitsWrapperAlg.h
FPGATrackSimRawHitsWrapperAlg::finalize
virtual StatusCode finalize() override
Definition: FPGATrackSimRawHitsWrapperAlg.cxx:50
FPGATrackSimRawHitsWrapperAlg::BookHistograms
StatusCode BookHistograms()
Definition: FPGATrackSimRawHitsWrapperAlg.cxx:26
FPGATrackSimRawHitsWrapperAlg::m_tot_truth
unsigned int m_tot_truth
Definition: FPGATrackSimRawHitsWrapperAlg.h:32
FPGATrackSimRawHitsWrapperAlg::initialize
virtual StatusCode initialize() override
Definition: FPGATrackSimRawHitsWrapperAlg.cxx:11
FPGATrackSimRawHitsWrapperAlg::m_readOutputTool
ToolHandle< IFPGATrackSimEventInputHeaderTool > m_readOutputTool
Definition: FPGATrackSimRawHitsWrapperAlg.h:27