ATLAS Offline Software
Toggle main menu visibility
Loading...
Searching...
No Matches
LumiBlock
LumiBlockComps
src
BunchCrossingAverageCondTest.cxx
Go to the documentation of this file.
1
/*
2
Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration
3
*/
4
5
// Local include(s):
6
#include "
BunchCrossingAverageCondTest.h
"
7
8
9
StatusCode
BunchCrossingAverageCondTest::initialize
() {
10
ATH_MSG_INFO
(
"Initializing..."
);
11
12
ATH_CHECK
(
m_inputKey
.initialize() );
13
14
if
(
m_fileName
.size()>0) {
15
m_fileOut
.open(
m_fileName
);
16
if
(
m_fileOut
.is_open()) {
17
ATH_MSG_INFO
(
"Writing to file "
<<
m_fileName
);
18
}
19
else
{
20
msg
(MSG::ERROR) <<
"Failed to open file "
<<
m_fileName
<<
endmsg
;
21
return
StatusCode::FAILURE;
22
}
23
}
24
else
25
ATH_MSG_INFO
(
"Writing to stdout"
);
26
27
return
StatusCode::SUCCESS;
28
}
29
30
StatusCode
BunchCrossingAverageCondTest::execute
(
const
EventContext& ctx) {
31
32
// Retrieve the object holding the BCID of the current event:
33
34
std::ostream& out =
m_fileOut
.good() ?
m_fileOut
: std::cout;
35
SG::ReadCondHandle<BunchCrossingAverageCondData>
readHdl(
m_inputKey
, ctx);
36
const
BunchCrossingAverageCondData
* bccd=*readHdl;
37
out <<
"\nTimestamp:"
<< ctx.eventID().time_stamp() <<
" ns:"
<< ctx.eventID().time_stamp_ns_offset() << std::endl;
38
for
(
unsigned
channel=0;channel<2;++channel)
39
printInfo
(bccd,channel,out);
40
41
return
StatusCode::SUCCESS;
42
}
43
44
void
BunchCrossingAverageCondTest::printInfo
(
const
BunchCrossingAverageCondData
* bccd,
unsigned
int
channel, std::ostream& out ) {
45
46
out <<
"channel "
<< channel;
47
out <<
" GetBeam1Intensity "
<< bccd->
GetBeam1Intensity
(channel)
48
<<
" GetBeam2Intensity "
<< bccd->
GetBeam2Intensity
(channel)
49
<<
" GetBeam1IntensityAll "
<< bccd->
GetBeam1IntensityAll
(channel)
50
<<
" GetBeam2IntensityAll "
<< bccd->
GetBeam2IntensityAll
(channel)
51
<<
" GetBeam1IntensitySTD "
<< bccd->
GetBeam1IntensitySTD
(channel)
52
<<
" GetBeam2IntensitySTD "
<< bccd->
GetBeam2IntensitySTD
(channel)
53
<<
" GetBeam1IntensityAllSTD "
<< bccd->
GetBeam1IntensityAllSTD
(channel)
54
<<
" GetBeam2IntensityAllSTD "
<< bccd->
GetBeam2IntensityAllSTD
(channel);
55
out << std::endl;
56
57
}
endmsg
#define endmsg
Definition
AnalysisConfig_Ntuple.cxx:54
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
BunchCrossingAverageCondTest.h
AthCommonAlgorithm< Gaudi::Algorithm >::msg
MsgStream & msg() const
Definition
AthCommonMsg.h:24
BunchCrossingAverageCondData
Definition
BunchCrossingAverageCondData.h:23
BunchCrossingAverageCondData::GetBeam1IntensityAll
float GetBeam1IntensityAll(int channel) const
Definition
BunchCrossingAverageCondData.cxx:10
BunchCrossingAverageCondData::GetBeam2IntensityAll
float GetBeam2IntensityAll(int channel) const
Definition
BunchCrossingAverageCondData.cxx:25
BunchCrossingAverageCondData::GetBeam2Intensity
float GetBeam2Intensity(int channel) const
Definition
BunchCrossingAverageCondData.cxx:55
BunchCrossingAverageCondData::GetBeam2IntensityAllSTD
float GetBeam2IntensityAllSTD(int channel) const
Definition
BunchCrossingAverageCondData.cxx:89
BunchCrossingAverageCondData::GetBeam1IntensitySTD
float GetBeam1IntensitySTD(int channel) const
Definition
BunchCrossingAverageCondData.cxx:104
BunchCrossingAverageCondData::GetBeam2IntensitySTD
float GetBeam2IntensitySTD(int channel) const
Definition
BunchCrossingAverageCondData.cxx:119
BunchCrossingAverageCondData::GetBeam1Intensity
float GetBeam1Intensity(int channel) const
Definition
BunchCrossingAverageCondData.cxx:40
BunchCrossingAverageCondData::GetBeam1IntensityAllSTD
float GetBeam1IntensityAllSTD(int channel) const
Definition
BunchCrossingAverageCondData.cxx:74
BunchCrossingAverageCondTest::m_fileOut
std::ofstream m_fileOut
Definition
BunchCrossingAverageCondTest.h:39
BunchCrossingAverageCondTest::initialize
virtual StatusCode initialize()
Initialization run before the event loop.
Definition
BunchCrossingAverageCondTest.cxx:9
BunchCrossingAverageCondTest::m_inputKey
SG::ReadCondHandleKey< BunchCrossingAverageCondData > m_inputKey
Definition
BunchCrossingAverageCondTest.h:33
BunchCrossingAverageCondTest::execute
virtual StatusCode execute(const EventContext &ctx)
Function called once per event.
Definition
BunchCrossingAverageCondTest.cxx:30
BunchCrossingAverageCondTest::printInfo
static void printInfo(const BunchCrossingAverageCondData *bccd, unsigned int channel, std::ostream &out)
Function for printing detailed info about a given bunch crossing.
Definition
BunchCrossingAverageCondTest.cxx:44
BunchCrossingAverageCondTest::m_fileName
Gaudi::Property< std::string > m_fileName
Definition
BunchCrossingAverageCondTest.h:35
SG::ReadCondHandle
Definition
ReadCondHandle.h:40
Generated on
for ATLAS Offline Software by
1.17.0