ATLAS Offline Software
Loading...
Searching...
No Matches
SLdata.cxx
Go to the documentation of this file.
1/*
2 Copyright (C) 2002-2023 CERN for the benefit of the ATLAS collaboration
3*/
4
6
7
8SLdata::SLdata(PADdata* pad_data,unsigned long int debug) :
9 BaseObject(Data,"Sector Logic data"),m_debug(debug)
10{
11 m_sl_patterns.clear();
12
13 PADdata::PatternsList pad_patterns = pad_data->give_patterns();
14 PADdata::PatternsList::const_iterator PADpatterns = pad_patterns.begin();
15
16 while(PADpatterns != pad_patterns.end())
17 {
18 create_sl_patterns(*PADpatterns);
19 ++PADpatterns;
20 }
21}
22
23SLdata::SLdata(const SLdata& sl_data) :
24 BaseObject(Data,sl_data.name()),
25 m_debug(sl_data.debug()),
26 m_sl_patterns(sl_data.sl_patterns())
27{
28}
29
31{
32 m_sl_patterns.clear();
33}
34
37{
38 static_cast<BaseObject&>(*this) = static_cast<const BaseObject&>(sl_data);
39 m_sl_patterns.clear();
40 m_sl_patterns = sl_data.sl_patterns();
41 m_debug = sl_data.debug();
42 return *this;
43}
44
45void
47{
49
50 const int sector = pad_patterns->sector();
51
52 if( (patterns = find(sector)) )
53 patterns->load_pad_patterns(pad_patterns);
54 else
55 {
57 patterns.load_pad_patterns(pad_patterns);
58 m_sl_patterns.push_back(std::move(patterns));
59 }
60}
61
62
64SLdata::find(const int sector)
65{
66 PATTERNSlist::iterator it = m_sl_patterns.begin();
67 while (it != m_sl_patterns.end())
68 {
69 if((*it).sector() == sector ) return &(*it);
70 ++it;
71 }
72
73 return 0;
74}
75
76
79{
81
82 PATTERNSlist::iterator sl = m_sl_patterns.begin();
83
84 while(sl != m_sl_patterns.end())
85 {
86 patterns.push_back(&(*sl));
87 ++sl;
88 }
89
90 return patterns;
91}
92
93
94void SLdata::PrintElement(std::ostream& stream,std::string element,bool detail)
95 const
96{
97 bool all = (element == name() || element == "")? true : false;
98 bool nSL = m_sl_patterns.size();
99 bool printed = false;
100
101 if(nSL && (element == (*m_sl_patterns.begin()).name() || all))
102 {
103 stream << name() << " contains " << m_sl_patterns.size()
104 << " Sector Logic patterns:" << std::endl;
105 printed = true;
106 PATTERNSlist::const_iterator it = m_sl_patterns.begin();
107 while(it != m_sl_patterns.end())
108 {
109 it->Print(stream,detail);
110 ++it;
111 }
112 }
113
114 if(!printed)
115 {
116 if (element == "") element = "Sectors";
117 stream << name() << " contains no " << element << "!" << std::endl;
118 }
119}
120
121
122void SLdata::Print(std::ostream& stream,bool detail) const
123{
124 stream << name() << " contains "
125 << m_sl_patterns.size()
126 << " Sector Logic patterns " << std::endl;
127
128 PATTERNSlist::const_iterator sl = sl_patterns().begin();
129
130 while(sl != sl_patterns().end())
131 {
132 (*sl).Print(stream,detail);
133 ++sl;
134 }
135}
@ Data
Definition BaseObject.h:11
BaseObject(ObjectType, const std::string &)
Definition BaseObject.cxx:7
const std::string & name() const
Definition BaseObject.h:23
PatternsList give_patterns(void)
Definition PADdata.cxx:77
std::list< PADpatterns * > PatternsList
Definition PADdata.h:19
int sector(void) const
Definition PADpatterns.h:48
PatternsList give_patterns(void)
Definition SLdata.cxx:78
SLpatterns * find(const int)
Definition SLdata.cxx:64
void create_sl_patterns(PADpatterns *)
Definition SLdata.cxx:46
~SLdata()
Definition SLdata.cxx:30
unsigned long int m_debug
Definition SLdata.h:22
void PrintElement(std::ostream &, std::string, bool) const
Definition SLdata.cxx:94
SLdata(PADdata *, unsigned long int)
Definition SLdata.cxx:8
void Print(std::ostream &, bool) const
Definition SLdata.cxx:122
PATTERNSlist m_sl_patterns
Definition SLdata.h:24
SLdata operator=(const SLdata &)
Definition SLdata.cxx:36
std::list< SLpatterns * > PatternsList
Definition SLdata.h:19
unsigned long int debug(void) const
Definition SLdata.h:38
const PATTERNSlist & sl_patterns(void) const
Definition SLdata.h:40
std::vector< std::string > patterns
Definition listroot.cxx:187