ATLAS Offline Software
Loading...
Searching...
No Matches
L1CaloRxCoolChannelId.cxx
Go to the documentation of this file.
1/*
2 Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
3*/
4
6
7#include <sstream>
8#include <iostream>
9
16
17//==============================================================================
18// constructor
19//==============================================================================
30
31//==============================================================================
32// constructor
33//==============================================================================
38 unsigned int module,
39 unsigned int inputConn,
40 unsigned int inputPair)
41 : m_id(0),
42 m_bOutputIsSet(false),
43 m_outputConn(0),
45{
46 this->setId(crate, module, inputConn, inputPair);
47}
48
49L1CaloRxCoolChannelId::L1CaloRxCoolChannelId(unsigned int crate, unsigned int module, unsigned int inputConn, unsigned int inputPair, unsigned int outputConn, unsigned int outputPair): m_id(0),
50 m_bOutputIsSet(false),
51 m_outputConn(0),
53{
54 this->setId(crate, module, inputConn, inputPair);
55 this->outputAttributes(outputConn, outputPair);
56}
57
58//==============================================================================
59// constructor
60//==============================================================================
65 : m_id(id),
66 m_bOutputIsSet(false),
67 m_outputConn(0),
69{
70}
71
72//==============================================================================
73// copy constructor
74//==============================================================================
85
86//==============================================================================
87// setId
88//==============================================================================
92void
94 unsigned int module,
95 unsigned int inputConn,
96 unsigned int inputPair)
97{
98
99 m_id = inputPair + inputConn*16 + module * 64 + crate*1024;
100}
101
102
104 return m_id<id.m_id;
105}
106
108 return m_id==id.m_id;
109}
110
111
112void L1CaloRxCoolChannelId::outputAttributes(unsigned int conn, unsigned int pair) {
113 if(m_bOutputIsSet) {
114 std::cout<<"Output attributes are already set for this channel: "<<this->id()<<". They cannot be modified"<<std::endl;
115 return;
116 }
117 m_outputConn = conn;
119 m_bOutputIsSet = true;
120}
121
123 if(!m_bOutputIsSet) {
124 std::cout<<"outputConn has not been set for channel "<< this->id() <<". You should not call this method."<<std::endl;
125 }
126 return m_outputConn;
127}
128
130 if(!m_bOutputIsSet) {
131 std::cout<<"outputPair has not been set for channel "<< this->id() <<". You should not call this method."<<std::endl;
132 }
133 return m_outputPair;
134}
135
136std::ostream& operator<<(std::ostream& output, const L1CaloRxCoolChannelId& r) {
137 output << "rxChannelId: 0x" << std::hex <<r.id() << std::dec <<", crate: "<<r.crate()<<", module: "<<r.module()<<", inputConn: "<<r.inputConn()<<", inputPair: "<<r.inputPair()<<" ( outputConn: "<< r.outputConn()<<", outputPair: "<<r.outputPair()<<")";
138 return output;
139}
std::ostream & operator<<(std::ostream &output, const L1CaloRxCoolChannelId &r)
unsigned int outputPair() const
bool operator<(const L1CaloRxCoolChannelId &id) const
unsigned int id() const
void outputAttributes(unsigned int conn, unsigned int pair)
bool operator==(const L1CaloRxCoolChannelId &id) const
unsigned int module() const
unsigned int inputConn() const
unsigned int inputPair() const
unsigned int outputConn() const
void setId(unsigned int crate, unsigned int module, unsigned int inputConn, unsigned int inputPair)
Set the CoolChannelId value from its component fields.
unsigned int crate() const
L1CaloRxCoolChannelId()
Create a L1CaloRxCoolChannelId from the integer ID field.
STL class.
int r
Definition globals.cxx:22