ATLAS Offline Software
Loading...
Searching...
No Matches
PADreadout.cxx
Go to the documentation of this file.
1/*
2 Copyright (C) 2002-2024 CERN for the benefit of the ATLAS collaboration
3*/
4
7#include <stdexcept>
8
9
11 RPCtrigDataObject(sector*100+pad,"PAD readout"),
13 m_PAD(pad)
14{
15}
16
17
19 RPCtrigDataObject(readout.number(),readout.name()),
20 m_sector(readout.sector()),
21 m_PAD(readout.PAD())
22{
23 for(int i=0;i<8;++i) m_matrices_readout[i] = readout.matrices_readout(i);
24}
25
28{
29 static_cast<RPCtrigDataObject&>(*this) =
30 static_cast<const RPCtrigDataObject&>(readout);
31 m_sector = readout.sector();
32 m_PAD = readout.PAD();
33
34 for(int i=0;i<8;++i) m_matrices_readout[i] = readout.matrices_readout(i);
35 return *this;
36}
37
38
39bool
40PADreadout::operator==(const PADreadout& padReadout) const
41{
42 return( m_sector == padReadout.sector() and m_PAD == padReadout.PAD() );
43}
44
45bool
46PADreadout::operator!=(const PADreadout& padReadout) const
47{
48 return !(*this == padReadout);
49}
50
51bool
52PADreadout::operator< (const PADreadout& padReadout) const
53{
54 if ( m_sector < padReadout.sector() ) return true;
55 if ( m_PAD < padReadout.PAD() ) return true;
56 return false;
57}
58
59void
60PADreadout::load_readout(std::array<MatrixReadOut*, 2>& readout)
61{
62 int mat = 0;
63 for(int i =0; i < 8; ++i) if(m_matrices_readout[i] == 0){mat = i; break;}
64 if( mat > 6 ){
65 throw std::runtime_error("trying to load more than 8 matrices into PAD readout!");
66 }
67 m_matrices_readout[mat] = readout[0];
68 m_matrices_readout[mat+1] = readout[1];
69}
70
73{
74 if(i>7) {
75 return 0;
76 }
77 return m_matrices_readout[i];
78}
79
82{
83 if(!m_pad_readout) m_pad_readout = std::make_unique<PadReadOut>(m_PAD,m_matrices_readout);
84 return m_pad_readout.get();
85}
const std::string & name() const
Definition BaseObject.h:23
bool operator!=(const PADreadout &) const
PadReadOut * give_pad_readout(void)
std::unique_ptr< PadReadOut > m_pad_readout
Definition PADreadout.h:26
bool operator<(const PADreadout &) const
bool operator==(const PADreadout &) const
void load_readout(std::array< MatrixReadOut *, 2 > &)
PADreadout(int, int)
PADreadout operator=(const PADreadout &)
MatrixReadOut * m_matrices_readout[8]
Definition PADreadout.h:25
MatrixReadOut * matrices_readout(int) const
int sector(void) const
Definition PADreadout.h:40
int PAD(void) const
Definition PADreadout.h:41
int number(void) const
RPCtrigDataObject(int, const std::string &)