ATLAS Offline Software
Loading...
Searching...
No Matches
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):
7
8
10 ATH_MSG_INFO( "Initializing..." );
11
12 ATH_CHECK( m_inputKey.initialize() );
13
14 if (m_fileName.size()>0) {
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
31
32 // Retrieve the object holding the BCID of the current event:
33 const EventContext& ctx = Gaudi::Hive::currentContext();
34
35 std::ostream& out = m_fileOut.good() ? m_fileOut : std::cout;
37 const BunchCrossingAverageCondData* bccd=*readHdl;
38 out << "\nTimestamp:" << ctx.eventID().time_stamp() << " ns:" << ctx.eventID().time_stamp_ns_offset() << std::endl;
39 for (unsigned channel=0;channel<2;++channel)
40 printInfo(bccd,channel,out);
41
42 return StatusCode::SUCCESS;
43}
44
45void BunchCrossingAverageCondTest::printInfo(const BunchCrossingAverageCondData* bccd, unsigned int channel, std::ostream& out ) {
46
47 out << "channel " << channel;
48 out << " GetBeam1Intensity " << bccd->GetBeam1Intensity(channel)
49 << " GetBeam2Intensity " << bccd->GetBeam2Intensity(channel)
50 << " GetBeam1IntensityAll " << bccd->GetBeam1IntensityAll(channel)
51 << " GetBeam2IntensityAll " << bccd->GetBeam2IntensityAll(channel)
52 << " GetBeam1IntensitySTD " << bccd->GetBeam1IntensitySTD(channel)
53 << " GetBeam2IntensitySTD " << bccd->GetBeam2IntensitySTD(channel)
54 << " GetBeam1IntensityAllSTD " << bccd->GetBeam1IntensityAllSTD(channel)
55 << " GetBeam2IntensityAllSTD " << bccd->GetBeam2IntensityAllSTD(channel);
56 out << std::endl;
57
58}
#define endmsg
#define ATH_CHECK
Evaluate an expression and check for errors.
#define ATH_MSG_INFO(x)
MsgStream & msg() const
float GetBeam2IntensityAllSTD(int channel) const
float GetBeam1IntensityAllSTD(int channel) const
virtual StatusCode initialize()
Initialization run before the event loop.
virtual StatusCode execute()
Function called once per event.
SG::ReadCondHandleKey< BunchCrossingAverageCondData > m_inputKey
static void printInfo(const BunchCrossingAverageCondData *bccd, unsigned int channel, std::ostream &out)
Function for printing detailed info about a given bunch crossing.
Gaudi::Property< std::string > m_fileName