ATLAS Offline Software
Toggle main menu visibility
Loading...
Searching...
No Matches
Trigger
EFTracking
FPGATrackSim
FPGATrackSimInput
src
FPGATrackSimRawHitsWrapperAlg.cxx
Go to the documentation of this file.
1
#include "
FPGATrackSimRawHitsWrapperAlg.h
"
2
#include "
FPGATrackSimObjects/FPGATrackSimEventInputHeader.h
"
3
#include "TObjectTable.h"
4
5
6
7
FPGATrackSimRawHitsWrapperAlg::FPGATrackSimRawHitsWrapperAlg
(
const
std::string& name, ISvcLocator* pSvcLocator) :
8
AthAlgorithm
(name, pSvcLocator){}
9
10
11
StatusCode
FPGATrackSimRawHitsWrapperAlg::initialize
()
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
22
ATH_CHECK
(
BookHistograms
());
23
return
StatusCode::SUCCESS;
24
}
25
26
StatusCode
FPGATrackSimRawHitsWrapperAlg::BookHistograms
(){
27
return
StatusCode::SUCCESS;
28
}
29
30
StatusCode
FPGATrackSimRawHitsWrapperAlg::execute
(
const
EventContext&
/*ctx*/
) {
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
50
StatusCode
FPGATrackSimRawHitsWrapperAlg::finalize
()
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
}
ATH_CHECK
#define ATH_CHECK
Evaluate an expression and check for errors.
Definition
AthCheckMacros.h:40
ATH_MSG_INFO
#define ATH_MSG_INFO(x)
Definition
AthMsgStreamMacros.h:31
ATH_MSG_DEBUG
#define ATH_MSG_DEBUG(x)
Definition
AthMsgStreamMacros.h:29
FPGATrackSimEventInputHeader.h
FPGATrackSimRawHitsWrapperAlg.h
AthAlgorithm::AthAlgorithm
AthAlgorithm(const std::string &name, ISvcLocator *pSvcLocator)
Constructor.
Definition
AthAlgorithm.cxx:10
FPGATrackSimEventInputHeader
Definition
FPGATrackSimEventInputHeader.h:22
FPGATrackSimEventInputHeader::nHits
int nHits() const
Definition
FPGATrackSimEventInputHeader.h:38
FPGATrackSimEventInputHeader::optional
FPGATrackSimOptionalEventInfo const & optional() const
Definition
FPGATrackSimEventInputHeader.h:34
FPGATrackSimOptionalEventInfo::nTruthTracks
size_t nTruthTracks() const
Definition
FPGATrackSimOptionalEventInfo.h:38
FPGATrackSimOptionalEventInfo::nOfflineTracks
size_t nOfflineTracks() const
Definition
FPGATrackSimOptionalEventInfo.h:33
FPGATrackSimRawHitsWrapperAlg::execute
virtual StatusCode execute(const EventContext &ctx) override
Execute method.
Definition
FPGATrackSimRawHitsWrapperAlg.cxx:30
FPGATrackSimRawHitsWrapperAlg::m_readOutputTool
ToolHandle< IFPGATrackSimEventInputHeaderTool > m_readOutputTool
Definition
FPGATrackSimRawHitsWrapperAlg.h:27
FPGATrackSimRawHitsWrapperAlg::finalize
virtual StatusCode finalize() override
Definition
FPGATrackSimRawHitsWrapperAlg.cxx:50
FPGATrackSimRawHitsWrapperAlg::m_tot_hits
unsigned int m_tot_hits
Definition
FPGATrackSimRawHitsWrapperAlg.h:31
FPGATrackSimRawHitsWrapperAlg::BookHistograms
StatusCode BookHistograms()
Definition
FPGATrackSimRawHitsWrapperAlg.cxx:26
FPGATrackSimRawHitsWrapperAlg::initialize
virtual StatusCode initialize() override
Definition
FPGATrackSimRawHitsWrapperAlg.cxx:11
FPGATrackSimRawHitsWrapperAlg::FPGATrackSimRawHitsWrapperAlg
FPGATrackSimRawHitsWrapperAlg(const std::string &name, ISvcLocator *pSvcLocator)
Definition
FPGATrackSimRawHitsWrapperAlg.cxx:7
FPGATrackSimRawHitsWrapperAlg::m_tot_oftracks
unsigned int m_tot_oftracks
Definition
FPGATrackSimRawHitsWrapperAlg.h:33
FPGATrackSimRawHitsWrapperAlg::m_writeOutputTool
ToolHandle< IFPGATrackSimEventInputHeaderTool > m_writeOutputTool
Definition
FPGATrackSimRawHitsWrapperAlg.h:28
FPGATrackSimRawHitsWrapperAlg::m_tot_truth
unsigned int m_tot_truth
Definition
FPGATrackSimRawHitsWrapperAlg.h:32
Generated on
for ATLAS Offline Software by
1.17.0