ATLAS Offline Software
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 
8 SLdata::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  {
19  ++PADpatterns;
20  }
21 }
22 
23 SLdata::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 
35 SLdata
36 SLdata::operator=(const SLdata& sl_data)
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 
45 void
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  {
56  SLpatterns patterns(sector,m_debug);
57  patterns.load_pad_patterns(pad_patterns);
58  m_sl_patterns.push_back(std::move(patterns));
59  }
60 }
61 
62 
64 SLdata::find(const int sector)
65 {
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 
83 
84  while(sl != m_sl_patterns.end())
85  {
86  patterns.push_back(&(*sl));
87  ++sl;
88  }
89 
90  return patterns;
91 }
92 
93 
94 void 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 
122 void 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 }
xAOD::iterator
JetConstituentVector::iterator iterator
Definition: JetConstituentVector.cxx:68
BaseObject::name
const std::string & name() const
Definition: BaseObject.h:23
SLdata::~SLdata
~SLdata()
Definition: SLdata.cxx:30
SLdata::PatternsList
std::list< SLpatterns * > PatternsList
Definition: SLdata.h:19
patterns
std::vector< std::string > patterns
Definition: listroot.cxx:187
SLdata::find
SLpatterns * find(const int)
Definition: SLdata.cxx:64
Data
@ Data
Definition: BaseObject.h:11
SLdata::PrintElement
void PrintElement(std::ostream &, std::string, bool) const
Definition: SLdata.cxx:94
skel.it
it
Definition: skel.GENtoEVGEN.py:396
SLdata
Definition: SLdata.h:16
detail
Definition: extract_histogram_tag.cxx:14
AthenaPoolTestWrite.stream
string stream
Definition: AthenaPoolTestWrite.py:12
mergePhysValFiles.end
end
Definition: DataQuality/DataQualityUtils/scripts/mergePhysValFiles.py:93
PADpatterns
Definition: PADpatterns.h:20
SLdata::SLdata
SLdata(PADdata *, unsigned long int)
Definition: SLdata.cxx:8
SLdata::create_sl_patterns
void create_sl_patterns(PADpatterns *)
Definition: SLdata.cxx:46
PADdata::PatternsList
std::list< PADpatterns * > PatternsList
Definition: PADdata.h:19
PADdata
Definition: PADdata.h:16
SLpatterns
Definition: SLpatterns.h:21
SLdata::Print
void Print(std::ostream &, bool) const
Definition: SLdata.cxx:122
SLdata.h
SLdata::sl_patterns
const PATTERNSlist & sl_patterns(void) const
Definition: SLdata.h:40
name
std::string name
Definition: Control/AthContainers/Root/debug.cxx:228
debug
const bool debug
Definition: MakeUncertaintyPlots.cxx:53
BaseObject
Definition: BaseObject.h:13
Cut::all
@ all
Definition: SUSYToolsAlg.cxx:67
SLdata::m_sl_patterns
PATTERNSlist m_sl_patterns
Definition: SLdata.h:24
SLdata::give_patterns
PatternsList give_patterns(void)
Definition: SLdata.cxx:78
PADpatterns::sector
int sector(void) const
Definition: PADpatterns.h:48
PADdata::give_patterns
PatternsList give_patterns(void)
Definition: PADdata.cxx:77
SLdata::m_debug
unsigned long int m_debug
Definition: SLdata.h:22
SLdata::operator=
SLdata operator=(const SLdata &)
Definition: SLdata.cxx:36
SLdata::debug
unsigned long int debug(void) const
Definition: SLdata.h:38