ATLAS Offline Software
Loading...
Searching...
No Matches
CablingObject.cxx
Go to the documentation of this file.
1/*
2 Copyright (C) 2002-2021 CERN for the benefit of the ATLAS collaboration
3*/
4
6
7#include <iomanip>
8
9CablingObject::CablingObject(const CablingObject::cablingParameters& params, const std::string& obj_name) :
10 BaseObject(Logic, obj_name), m_number{params.number}, m_station{params.station}, m_sector_type{params.sectorType} {}
11
12int CablingObject::number() const { return m_number; }
13int CablingObject::station() const { return m_station; }
15
16std::ostream& operator<<(std::ostream& stream, const CablingObject& obj) {
17 stream << obj.name() << " number " << std::setw(3) << obj.number() << " associated to sector type " << std::setw(3)
18 << obj.sector_type() << " in station n. " << obj.station() << std::endl;
19 return stream;
20}
21
22std::string CablingObject::error_header() const {
23 std::ostringstream disp;
24 disp << "Error in Sector Type " << m_sector_type;
25 if (m_station > 0) disp << ", station " << m_station;
26 disp << ":" << std::endl;
27 return disp.str();
28}
29
30std::string CablingObject::no_connection_error(const std::string& conn_name, int num) const {
31 std::ostringstream disp;
32 disp << error_header() << name() << " n. " << number() << " is supposed to receive input from " << conn_name << " n. " << num << " which doesn't exist!";
33 return disp.str();
34}
@ Logic
Definition BaseObject.h:11
std::ostream & operator<<(std::ostream &stream, const CablingObject &obj)
BaseObject(ObjectType, const std::string &)
Definition BaseObject.cxx:7
const std::string & name() const
Definition BaseObject.h:23
std::string no_connection_error(const std::string &, int) const
int number() const
int sector_type() const
int station() const
std::string error_header() const
CablingObject(const cablingParameters &, const std::string &)