ATLAS Offline Software
Loading...
Searching...
No Matches
BunchCrossingIntensityCondTest.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
30
32
33 // Retrieve the object holding the BCID of the current event:
34 const EventContext& ctx = Gaudi::Hive::currentContext();
35
36
37 std::ostream& out = m_fileOut.good() ? m_fileOut : std::cout;
38
40 const BunchCrossingIntensityCondData* bccd=*readHdl;
41
42 out << "\nTimestamp:" << ctx.eventID().time_stamp() << " ns:" << ctx.eventID().time_stamp_ns_offset() << std::endl;
43
44 for (unsigned bcid=0;bcid<4;++bcid) {
45
46 printInfo(bccd,bcid,out,0);
47 printInfo(bccd,bcid,out,1);
48
49 }
50
51 return StatusCode::SUCCESS;
52}
53
54
55void BunchCrossingIntensityCondTest::printInfo(const BunchCrossingIntensityCondData* bccd, unsigned int bcid, std::ostream& out , int channel ) {
56
57 out << "BCID " << bcid<< " LB "<<bccd->GetRunLB();
58 out << "Beam1IntensityBCID="<< bccd->GetBeam1IntensityBCID(bcid,channel) << ", Beam2IntensityBCID=" <<bccd->GetBeam2IntensityBCID(bcid,channel);
59 out << std::endl;
60
61}
#define endmsg
#define ATH_CHECK
Evaluate an expression and check for errors.
#define ATH_MSG_INFO(x)
MsgStream & msg() const
float GetBeam2IntensityBCID(const bcid_type bcid, int channel) const
float GetBeam1IntensityBCID(const bcid_type bcid, int channel) const
SG::ReadCondHandleKey< BunchCrossingIntensityCondData > m_inputKey
virtual StatusCode execute()
Function called once per event.
static void printInfo(const BunchCrossingIntensityCondData *bccd, unsigned int bcid, std::ostream &out, int channel)
Function for printing detailed info about a given bunch crossing.
virtual StatusCode initialize()
Initialization run before the event loop.
Gaudi::Property< std::string > m_fileName