ATLAS Offline Software
Loading...
Searching...
No Matches
IdDictRegion Class Reference

#include <IdDictRegion.h>

Inheritance diagram for IdDictRegion:
Collaboration diagram for IdDictRegion:

Public Member Functions

 IdDictRegion (const std::string &name, const std::string &group, const std::string &tag)
virtual ~IdDictRegion ()
 IdDictRegion (IdDictRegion &&)
IdDictRegionoperator= (IdDictRegion &&)
 IdDictRegion (const IdDictRegion &)=delete
IdDictRegionoperator= (const IdDictRegion &)=delete
const std::string & name () const
virtual std::string group_name () const override
const std::string & tag () const
size_t fieldSize () const
size_t size () const
size_t index () const
size_t n_implementation () const
const IdDictFieldImplementationimplementation (size_t i) const
double eta0 () const
double deta () const
double phi0 () const
double dphi () const
const IdDictRegionnext_abs_eta () const
const IdDictRegionprev_abs_eta () const
const std::vector< const IdDictRegion * > & prev_samp () const
const std::vector< const IdDictRegion * > & next_samp () const
const std::vector< const IdDictRegion * > & prev_subdet () const
const std::vector< const IdDictRegion * > & next_subdet () const
const std::vector< std::string > & prev_samp_names () const
const std::vector< std::string > & next_samp_names () const
const std::vector< std::string > & prev_subdet_names () const
const std::vector< std::string > & next_subdet_names () const
size_t n_entries () const
const IdDictRegionEntryentry (size_t i) const
bool is_empty () const
void add_entry (std::unique_ptr< IdDictRegionEntry > entry)
 Add entry to the end of the list.
void prepend_entry (std::unique_ptr< IdDictRegionEntry > entry)
 Add entry to the start of the list.
const std::vector< std::unique_ptr< IdDictRegionEntry > > & entries ()
 Non-const access to entry pointers.
IdDictFieldImplementationimplementation (size_t i)
 Non-const access to implementation objects.
IdDictFieldImplementationnew_implementation ()
 Add a new implementation object and return a reference to it.
void set_next_abs_eta_name (const std::string &name)
 Set the name for next_abs_eta.
void add_prev_samp_name (const std::string &name)
 Add a previous sample name.
void add_next_samp_name (const std::string &name)
 Add a next sample name.
void add_prev_subdet_name (const std::string &name)
 Add a previous subdetector name.
void add_next_subdet_name (const std::string &name)
 Add a next subdetector name.
void set_etaphi (double eta0, double deta, double phi0, double dphi)
 Set eta/phi variables.
void set_is_empty ()
 Set is_empty flag.
void find_neighbours (IdDictDictionary &dictionary)
virtual void set_index (size_t index) override
virtual Range build_range () const override
virtual void resolve_references (IdDictMgr &idd, IdDictDictionary &dictionary) override
virtual void generate_implementation (const IdDictMgr &idd, IdDictDictionary &dictionary, const std::string &tag="") override
virtual void reset_implementation () override
virtual bool verify () const override
virtual void clear () override
void integrate_bits ()

Protected Attributes

std::vector< std::unique_ptr< IdDictRegionEntry > > m_entries

Private Attributes

std::vector< IdDictFieldImplementationm_implementation
size_t m_index {}
std::string m_name
std::string m_group
std::string m_tag
bool m_is_empty {false}
std::string m_next_abs_eta_name
std::vector< std::string > m_prev_samp_names
std::vector< std::string > m_next_samp_names
std::vector< std::string > m_prev_subdet_names
std::vector< std::string > m_next_subdet_names
IdDictRegionm_prev_abs_eta {}
IdDictRegionm_next_abs_eta {}
std::vector< const IdDictRegion * > m_prev_samp
std::vector< const IdDictRegion * > m_next_samp
std::vector< const IdDictRegion * > m_prev_subdet
std::vector< const IdDictRegion * > m_next_subdet
float m_eta0 {}
float m_deta {}
float m_phi0 {}
float m_dphi {}
bool m_generated_implementation {}

Detailed Description

Definition at line 21 of file IdDictRegion.h.

Constructor & Destructor Documentation

◆ IdDictRegion() [1/3]

IdDictRegion::IdDictRegion ( const std::string & name,
const std::string & group,
const std::string & tag )

Definition at line 12 of file IdDictRegion.cxx.

15 : m_name (name),
16 m_group (group),
17 m_tag (tag)
18{
19}
std::string m_name
std::string m_group
const std::string & name() const
std::string m_tag
const std::string & tag() const

◆ ~IdDictRegion()

IdDictRegion::~IdDictRegion ( )
virtualdefault

◆ IdDictRegion() [2/3]

IdDictRegion::IdDictRegion ( IdDictRegion && )
default

◆ IdDictRegion() [3/3]

IdDictRegion::IdDictRegion ( const IdDictRegion & )
delete

Member Function Documentation

◆ add_entry()

void IdDictRegion::add_entry ( std::unique_ptr< IdDictRegionEntry > entry)

Add entry to the end of the list.

Definition at line 51 of file IdDictRegion.cxx.

51 {
52 m_entries.push_back(std::move(entry));
53}
const IdDictRegionEntry & entry(size_t i) const
std::vector< std::unique_ptr< IdDictRegionEntry > > m_entries

◆ add_next_samp_name()

void IdDictRegion::add_next_samp_name ( const std::string & name)

Add a next sample name.

Definition at line 92 of file IdDictRegion.cxx.

93{
94 m_next_samp_names.push_back (name);
95}
std::vector< std::string > m_next_samp_names

◆ add_next_subdet_name()

void IdDictRegion::add_next_subdet_name ( const std::string & name)

Add a next subdetector name.

Definition at line 106 of file IdDictRegion.cxx.

107{
108 m_next_subdet_names.push_back (name);
109}
std::vector< std::string > m_next_subdet_names

◆ add_prev_samp_name()

void IdDictRegion::add_prev_samp_name ( const std::string & name)

Add a previous sample name.

Definition at line 84 of file IdDictRegion.cxx.

85{
86 m_prev_samp_names.push_back (name);
87
88}
std::vector< std::string > m_prev_samp_names

◆ add_prev_subdet_name()

void IdDictRegion::add_prev_subdet_name ( const std::string & name)

Add a previous subdetector name.

Definition at line 99 of file IdDictRegion.cxx.

100{
101 m_prev_subdet_names.push_back (name);
102}
std::vector< std::string > m_prev_subdet_names

◆ build_range()

Range IdDictRegion::build_range ( ) const
overridevirtual

Implements IdDictDictEntry.

Definition at line 257 of file IdDictRegion.cxx.

257 {
258 Range result;
259
260 for (auto& entry : m_entries) {
261 Range r = entry->build_range();
262 result.add(std::move(r));
263 }
264 return(result);
265}
int r
Definition globals.cxx:22

◆ clear()

void IdDictRegion::clear ( )
overridevirtual

Implements IdDictDictEntry.

Definition at line 223 of file IdDictRegion.cxx.

223 {
224 m_entries.clear();
225}

◆ deta()

double IdDictRegion::deta ( ) const
inline

Definition at line 189 of file IdDictRegion.h.

190{
191 return m_deta;
192}

◆ dphi()

double IdDictRegion::dphi ( ) const
inline

Definition at line 203 of file IdDictRegion.h.

204{
205 return m_dphi;
206}

◆ entries()

const std::vector< std::unique_ptr< IdDictRegionEntry > > & IdDictRegion::entries ( )
inline

Non-const access to entry pointers.

Definition at line 302 of file IdDictRegion.h.

303{
304 return m_entries;
305}

◆ entry()

const IdDictRegionEntry & IdDictRegion::entry ( size_t i) const
inline

Definition at line 287 of file IdDictRegion.h.

288{
289 return *m_entries.at(i);
290}

◆ eta0()

double IdDictRegion::eta0 ( ) const
inline

Definition at line 182 of file IdDictRegion.h.

183{
184 return m_eta0;
185}

◆ fieldSize()

size_t IdDictRegion::fieldSize ( ) const

Definition at line 228 of file IdDictRegion.cxx.

228 {
229 return m_implementation.size();
230}
std::vector< IdDictFieldImplementation > m_implementation

◆ find_neighbours()

void IdDictRegion::find_neighbours ( IdDictDictionary & dictionary)

Definition at line 153 of file IdDictRegion.cxx.

153 {
154 // Find the neighbours
155 IdDictRegion* region = 0;
156
157 if ("" != m_next_abs_eta_name) {
158 region = dictionary.find_region(m_next_abs_eta_name, m_group);
159 if (region) {
160 region->m_prev_abs_eta = this;
161 m_next_abs_eta = region;
162 }
163 }
164 for (unsigned int i = 0; i < m_prev_samp_names.size(); ++i) {
165 if ("" != m_prev_samp_names[i]) {
166 region = dictionary.find_region(m_prev_samp_names[i], m_group);
167 if (region) {
168 m_prev_samp.push_back(region);
169 }
170 }
171 }
172 for (unsigned int i = 0; i < m_next_samp_names.size(); ++i) {
173 if ("" != m_next_samp_names[i]) {
174 region = dictionary.find_region(m_next_samp_names[i], m_group);
175 if (region) {
176 m_next_samp.push_back(region);
177 }
178 }
179 }
180
181 for (unsigned int i = 0; i < m_prev_subdet_names.size(); ++i) {
182 if ("" != m_prev_subdet_names[i]) {
183 region = dictionary.find_region(m_prev_subdet_names[i], m_group);
184 if (region) {
185 m_prev_subdet.push_back(region);
186 }
187 }
188 }
189 for (unsigned int i = 0; i < m_next_subdet_names.size(); ++i) {
190 if ("" != m_next_subdet_names[i]) {
191 region = dictionary.find_region(m_next_subdet_names[i], m_group);
192 if (region) {
193 m_next_subdet.push_back(region);
194 }
195 }
196 }
197}
std::vector< const IdDictRegion * > m_prev_samp
std::vector< const IdDictRegion * > m_prev_subdet
IdDictRegion(const std::string &name, const std::string &group, const std::string &tag)
std::string m_next_abs_eta_name
IdDictRegion * m_next_abs_eta
std::vector< const IdDictRegion * > m_next_subdet
std::vector< const IdDictRegion * > m_next_samp
IdDictRegion * m_prev_abs_eta
dictionary
Definition master.py:47

◆ generate_implementation()

void IdDictRegion::generate_implementation ( const IdDictMgr & idd,
IdDictDictionary & dictionary,
const std::string & tag = "" )
overridevirtual

Implements IdDictDictEntry.

Reimplemented in IdDictSubRegion.

Definition at line 138 of file IdDictRegion.cxx.

140 {
141 if (Debugger::debug()) {
142 std::cout << "IdDictRegion::generate_implementation>" << std::endl;
143 }
145 for (auto& entry : m_entries) {
146 entry->generate_implementation(idd, dictionary, *this, tag);
147 }
149 }
150}
static bool debug()
Definition Debugger.h:18
bool m_generated_implementation

◆ group_name()

std::string IdDictRegion::group_name ( ) const
overridevirtual

Implements IdDictDictEntry.

Definition at line 27 of file IdDictRegion.cxx.

27 {
28 return(m_group);
29}

◆ implementation() [1/2]

IdDictFieldImplementation & IdDictRegion::implementation ( size_t i)

Non-const access to implementation objects.

Definition at line 63 of file IdDictRegion.cxx.

64{
65 return m_implementation.at(i);
66}

◆ implementation() [2/2]

const IdDictFieldImplementation & IdDictRegion::implementation ( size_t i) const

Definition at line 38 of file IdDictRegion.cxx.

39{
40 return m_implementation.at(i);
41}

◆ index()

size_t IdDictRegion::index ( ) const
inline

Definition at line 175 of file IdDictRegion.h.

176{
177 return m_index;
178}

◆ integrate_bits()

void IdDictRegion::integrate_bits ( )

Definition at line 238 of file IdDictRegion.cxx.

238 {
239 // For each region, loop over its levels and set the bit offset
240 // for each FieldImplementation
241
242 size_t bits_offset = 0;
243 for (IdDictFieldImplementation& impl : m_implementation) {
244 impl.optimize(); // optimize for decoding
245 impl.set_bits_offset(bits_offset);
246 bits_offset += impl.bits();
247
248 // Set whether or not to decode index
249 Range::field field = impl.ored_field();
250 if ((not field.isBounded()) || (0 != field.get_minimum())) {
251 impl.set_decode_index(true);
252 }
253 }
254}

◆ is_empty()

bool IdDictRegion::is_empty ( ) const
inline

Definition at line 294 of file IdDictRegion.h.

295{
296 return m_is_empty;
297}

◆ n_entries()

size_t IdDictRegion::n_entries ( ) const
inline

Definition at line 280 of file IdDictRegion.h.

281{
282 return m_entries.size();
283}

◆ n_implementation()

size_t IdDictRegion::n_implementation ( ) const

Definition at line 32 of file IdDictRegion.cxx.

33{
34 return m_implementation.size();
35}

◆ name()

const std::string & IdDictRegion::name ( ) const
inline

Definition at line 161 of file IdDictRegion.h.

162{
163 return m_name;
164}

◆ new_implementation()

IdDictFieldImplementation & IdDictRegion::new_implementation ( )

Add a new implementation object and return a reference to it.

Definition at line 69 of file IdDictRegion.cxx.

70{
71 m_implementation.resize (m_implementation.size() + 1);
72 return m_implementation.back();
73}

◆ next_abs_eta()

const IdDictRegion * IdDictRegion::next_abs_eta ( ) const
inline

Definition at line 210 of file IdDictRegion.h.

211{
212 return m_next_abs_eta;
213}

◆ next_samp()

const std::vector< const IdDictRegion * > & IdDictRegion::next_samp ( ) const
inline

Definition at line 231 of file IdDictRegion.h.

232{
233 return m_next_samp;
234}

◆ next_samp_names()

const std::vector< std::string > & IdDictRegion::next_samp_names ( ) const
inline

Definition at line 259 of file IdDictRegion.h.

260{
261 return m_next_samp_names;
262}

◆ next_subdet()

const std::vector< const IdDictRegion * > & IdDictRegion::next_subdet ( ) const
inline

Definition at line 245 of file IdDictRegion.h.

246{
247 return m_next_subdet;
248}

◆ next_subdet_names()

const std::vector< std::string > & IdDictRegion::next_subdet_names ( ) const
inline

Definition at line 273 of file IdDictRegion.h.

274{
275 return m_next_subdet_names;
276}

◆ operator=() [1/2]

IdDictRegion & IdDictRegion::operator= ( const IdDictRegion & )
delete

◆ operator=() [2/2]

IdDictRegion & IdDictRegion::operator= ( IdDictRegion && )
default

◆ phi0()

double IdDictRegion::phi0 ( ) const
inline

Definition at line 196 of file IdDictRegion.h.

197{
198 return m_phi0;
199}

◆ prepend_entry()

void IdDictRegion::prepend_entry ( std::unique_ptr< IdDictRegionEntry > entry)

Add entry to the start of the list.

Definition at line 57 of file IdDictRegion.cxx.

57 {
58 m_entries.insert(m_entries.begin(), std::move(entry));
59}

◆ prev_abs_eta()

const IdDictRegion * IdDictRegion::prev_abs_eta ( ) const
inline

Definition at line 217 of file IdDictRegion.h.

218{
219 return m_prev_abs_eta;
220}

◆ prev_samp()

const std::vector< const IdDictRegion * > & IdDictRegion::prev_samp ( ) const
inline

Definition at line 224 of file IdDictRegion.h.

225{
226 return m_prev_samp;
227}

◆ prev_samp_names()

const std::vector< std::string > & IdDictRegion::prev_samp_names ( ) const
inline

Definition at line 252 of file IdDictRegion.h.

253{
254 return m_prev_samp_names;
255}

◆ prev_subdet()

const std::vector< const IdDictRegion * > & IdDictRegion::prev_subdet ( ) const
inline

Definition at line 238 of file IdDictRegion.h.

239{
240 return m_prev_subdet;
241}

◆ prev_subdet_names()

const std::vector< std::string > & IdDictRegion::prev_subdet_names ( ) const
inline

Definition at line 266 of file IdDictRegion.h.

267{
268 return m_prev_subdet_names;
269}

◆ reset_implementation()

void IdDictRegion::reset_implementation ( )
overridevirtual

Implements IdDictDictEntry.

Reimplemented in IdDictSubRegion.

Definition at line 200 of file IdDictRegion.cxx.

200 {
202 m_implementation.clear(); // remove implementation
203 for (auto& entry : m_entries) {
204 entry->reset_implementation();
205 }
206 // reset neighbours
207 m_prev_abs_eta = 0;
208 m_next_abs_eta = 0;
209 m_prev_samp.clear();
210 m_next_samp.clear();
211 m_prev_subdet.clear();
212 m_next_subdet.clear();
213
215 }
216}

◆ resolve_references()

void IdDictRegion::resolve_references ( IdDictMgr & idd,
IdDictDictionary & dictionary )
overridevirtual

Implements IdDictDictEntry.

Definition at line 131 of file IdDictRegion.cxx.

131 {
132 for (auto& entry : m_entries) {
133 entry->resolve_references(idd, dictionary, *this);
134 }
135}

◆ set_etaphi()

void IdDictRegion::set_etaphi ( double eta0,
double deta,
double phi0,
double dphi )

Set eta/phi variables.

Definition at line 113 of file IdDictRegion.cxx.

115{
116 m_eta0 = eta0;
117 m_deta = deta;
118 m_phi0 = phi0;
119 m_dphi = dphi;
120}
double eta0() const
double phi0() const
double deta() const
double dphi() const

◆ set_index()

void IdDictRegion::set_index ( size_t index)
overridevirtual

Implements IdDictDictEntry.

Definition at line 45 of file IdDictRegion.cxx.

45 {
46 m_index = index;
47}
size_t index() const

◆ set_is_empty()

void IdDictRegion::set_is_empty ( )

Set is_empty flag.

Definition at line 124 of file IdDictRegion.cxx.

125{
126 m_is_empty = true;
127}

◆ set_next_abs_eta_name()

void IdDictRegion::set_next_abs_eta_name ( const std::string & name)

Set the name for next_abs_eta.

Definition at line 77 of file IdDictRegion.cxx.

78{
80}

◆ size()

size_t IdDictRegion::size ( ) const

Definition at line 233 of file IdDictRegion.cxx.

233 {
234 return m_entries.size();
235}

◆ tag()

const std::string & IdDictRegion::tag ( ) const
inline

Definition at line 168 of file IdDictRegion.h.

169{
170 return m_tag;
171}

◆ verify()

bool IdDictRegion::verify ( ) const
overridevirtual

Implements IdDictDictEntry.

Definition at line 218 of file IdDictRegion.cxx.

218 {
219 return(true);
220}

Member Data Documentation

◆ m_deta

float IdDictRegion::m_deta {}
private

Definition at line 152 of file IdDictRegion.h.

152{};

◆ m_dphi

float IdDictRegion::m_dphi {}
private

Definition at line 154 of file IdDictRegion.h.

154{};

◆ m_entries

std::vector<std::unique_ptr<IdDictRegionEntry> > IdDictRegion::m_entries
protected

Definition at line 132 of file IdDictRegion.h.

◆ m_eta0

float IdDictRegion::m_eta0 {}
private

Definition at line 151 of file IdDictRegion.h.

151{};

◆ m_generated_implementation

bool IdDictRegion::m_generated_implementation {}
private

Definition at line 156 of file IdDictRegion.h.

156{};

◆ m_group

std::string IdDictRegion::m_group
private

Definition at line 137 of file IdDictRegion.h.

◆ m_implementation

std::vector<IdDictFieldImplementation> IdDictRegion::m_implementation
private

Definition at line 134 of file IdDictRegion.h.

◆ m_index

size_t IdDictRegion::m_index {}
private

Definition at line 135 of file IdDictRegion.h.

135{};

◆ m_is_empty

bool IdDictRegion::m_is_empty {false}
private

Definition at line 139 of file IdDictRegion.h.

139{false};//?

◆ m_name

std::string IdDictRegion::m_name
private

Definition at line 136 of file IdDictRegion.h.

◆ m_next_abs_eta

IdDictRegion* IdDictRegion::m_next_abs_eta {}
private

Definition at line 146 of file IdDictRegion.h.

146{};

◆ m_next_abs_eta_name

std::string IdDictRegion::m_next_abs_eta_name
private

Definition at line 140 of file IdDictRegion.h.

◆ m_next_samp

std::vector<const IdDictRegion*> IdDictRegion::m_next_samp
private

Definition at line 148 of file IdDictRegion.h.

◆ m_next_samp_names

std::vector<std::string> IdDictRegion::m_next_samp_names
private

Definition at line 142 of file IdDictRegion.h.

◆ m_next_subdet

std::vector<const IdDictRegion*> IdDictRegion::m_next_subdet
private

Definition at line 150 of file IdDictRegion.h.

◆ m_next_subdet_names

std::vector<std::string> IdDictRegion::m_next_subdet_names
private

Definition at line 144 of file IdDictRegion.h.

◆ m_phi0

float IdDictRegion::m_phi0 {}
private

Definition at line 153 of file IdDictRegion.h.

153{};

◆ m_prev_abs_eta

IdDictRegion* IdDictRegion::m_prev_abs_eta {}
private

Definition at line 145 of file IdDictRegion.h.

145{};

◆ m_prev_samp

std::vector<const IdDictRegion*> IdDictRegion::m_prev_samp
private

Definition at line 147 of file IdDictRegion.h.

◆ m_prev_samp_names

std::vector<std::string> IdDictRegion::m_prev_samp_names
private

Definition at line 141 of file IdDictRegion.h.

◆ m_prev_subdet

std::vector<const IdDictRegion*> IdDictRegion::m_prev_subdet
private

Definition at line 149 of file IdDictRegion.h.

◆ m_prev_subdet_names

std::vector<std::string> IdDictRegion::m_prev_subdet_names
private

Definition at line 143 of file IdDictRegion.h.

◆ m_tag

std::string IdDictRegion::m_tag
private

Definition at line 138 of file IdDictRegion.h.


The documentation for this class was generated from the following files: