ATLAS Offline Software
Trigger
EFTracking
FPGATrackSim
FPGATrackSimInput
src
FPGATrackSimDumpOutputStatAlg.cxx
Go to the documentation of this file.
1
#include "
FPGATrackSimDumpOutputStatAlg.h
"
2
3
#include "
FPGATrackSimObjects/FPGATrackSimLogicalEventInputHeader.h
"
4
#include "
FPGATrackSimObjects/FPGATrackSimLogicalEventOutputHeader.h
"
5
#include "
FPGATrackSimObjects/FPGATrackSimTrack.h
"
6
#include "TH2F.h"
7
8
9
FPGATrackSimDumpOutputStatAlg::FPGATrackSimDumpOutputStatAlg
(
const
std::string&
name
, ISvcLocator* pSvcLocator) :
10
AthAlgorithm
(
name
, pSvcLocator) {}
11
12
13
StatusCode
FPGATrackSimDumpOutputStatAlg::initialize
()
14
{
15
ATH_MSG_INFO
(
"FPGATrackSimDumpOutputStatAlg::initialize()"
);
16
ATH_CHECK
(
m_readOutputTool
.retrieve());
17
ATH_CHECK
(
m_writeOutputTool
.retrieve());
18
19
// eventually add some histograms for monitoring
20
ATH_CHECK
(
BookHistograms
());
21
22
// TO DO: must register the histograms to the TFile in the Tool
23
return
StatusCode::SUCCESS;
24
}
25
26
27
StatusCode
FPGATrackSimDumpOutputStatAlg::BookHistograms
(){
28
//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.);
29
return
StatusCode::SUCCESS;
30
}
31
32
33
StatusCode
FPGATrackSimDumpOutputStatAlg::execute
() {
34
ATH_MSG_DEBUG
(
"Running on event "
);
35
36
FPGATrackSimLogicalEventInputHeader
eventInputHeader_1st;
37
FPGATrackSimLogicalEventInputHeader
eventInputHeader_2nd;
38
FPGATrackSimLogicalEventOutputHeader
eventOutputHeader;
39
40
bool
last=
false
;
41
ATH_CHECK
(
m_readOutputTool
->readData(&eventInputHeader_1st, &eventInputHeader_2nd, &eventOutputHeader, last));
42
if
(last)
return
StatusCode::SUCCESS;
43
44
45
ATH_MSG_VERBOSE
(eventInputHeader_1st);
46
ATH_MSG_VERBOSE
(eventInputHeader_2nd);
47
48
// fill histograms
49
for
(
const
auto
&
track
: eventOutputHeader.
getFPGATrackSimTracks_1st
()) {
50
ATH_MSG_DEBUG
(
track
);
51
//commented out for future debugging
52
//float r= std::sqrt(hit.getX()*hit.getX() + hit.getY()*hit.getY());
53
//m_hits_r_vs_z->Fill(hit.getZ(), r);
54
}
55
56
for
(
const
auto
&
track
: eventOutputHeader.
getFPGATrackSimTracks_2nd
()) {
57
ATH_MSG_DEBUG
(
track
);
58
}
59
60
ATH_CHECK
(
m_writeOutputTool
->writeData(&eventInputHeader_1st, &eventInputHeader_2nd, &eventOutputHeader) );
61
return
StatusCode::SUCCESS;
62
}
63
FPGATrackSimLogicalEventInputHeader
Definition:
FPGATrackSimLogicalEventInputHeader.h:21
FPGATrackSimDumpOutputStatAlg.h
ATH_MSG_INFO
#define ATH_MSG_INFO(x)
Definition:
AthMsgStreamMacros.h:31
ATH_MSG_VERBOSE
#define ATH_MSG_VERBOSE(x)
Definition:
AthMsgStreamMacros.h:28
FPGATrackSimDumpOutputStatAlg::m_writeOutputTool
ToolHandle< IFPGATrackSimEventOutputHeaderTool > m_writeOutputTool
Definition:
FPGATrackSimDumpOutputStatAlg.h:28
FPGATrackSimDumpOutputStatAlg::FPGATrackSimDumpOutputStatAlg
FPGATrackSimDumpOutputStatAlg(const std::string &name, ISvcLocator *pSvcLocator)
Definition:
FPGATrackSimDumpOutputStatAlg.cxx:9
FPGATrackSimLogicalEventOutputHeader.h
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
FPGATrackSimLogicalEventOutputHeader::getFPGATrackSimTracks_1st
std::vector< FPGATrackSimTrack > const & getFPGATrackSimTracks_1st() const
Definition:
FPGATrackSimLogicalEventOutputHeader.h:33
ATH_CHECK
#define ATH_CHECK
Definition:
AthCheckMacros.h:40
AthAlgorithm
Definition:
AthAlgorithm.h:47
name
std::string name
Definition:
Control/AthContainers/Root/debug.cxx:195
FPGATrackSimDumpOutputStatAlg::execute
virtual StatusCode execute() override
Definition:
FPGATrackSimDumpOutputStatAlg.cxx:33
FPGATrackSimLogicalEventOutputHeader
Definition:
FPGATrackSimLogicalEventOutputHeader.h:12
xAOD::track
@ track
Definition:
TrackingPrimitives.h:512
FPGATrackSimLogicalEventInputHeader.h
FPGATrackSimDumpOutputStatAlg::initialize
virtual StatusCode initialize() override
Definition:
FPGATrackSimDumpOutputStatAlg.cxx:13
FPGATrackSimDumpOutputStatAlg::BookHistograms
StatusCode BookHistograms()
Definition:
FPGATrackSimDumpOutputStatAlg.cxx:27
FPGATrackSimLogicalEventOutputHeader::getFPGATrackSimTracks_2nd
std::vector< FPGATrackSimTrack > const & getFPGATrackSimTracks_2nd() const
Definition:
FPGATrackSimLogicalEventOutputHeader.h:39
FPGATrackSimDumpOutputStatAlg::m_readOutputTool
ToolHandle< IFPGATrackSimEventOutputHeaderTool > m_readOutputTool
Definition:
FPGATrackSimDumpOutputStatAlg.h:27
FPGATrackSimTrack.h
Generated on Thu Jul 4 2024 21:15:57 for ATLAS Offline Software by
1.8.18