ATLAS Offline Software
CaloTTDescrManager.cxx
Go to the documentation of this file.
1 /*
2  Copyright (C) 2002-2023 CERN for the benefit of the ATLAS collaboration
3 */
4 
5 /***************************************************************************
6  Calo description package
7  -----------------------------------------
8  ***************************************************************************/
9 
10 //<doc><file> $Id: CaloTTDescrManager.cxx,v 1.8 2006-07-21 12:39:14 fledroit Exp $
11 //<version> $Name: not supported by cvs2svn $
12 
13 //<<<<<< INCLUDES >>>>>>
14 
19 #include <iostream>
20 
21 
22 
24  :
25  m_is_initialized(false),
26  m_calo_lvl1_id(nullptr)
27 {
28 }
29 
31 {
32 // Remove regions and descriptors
33  clear();
34 }
35 
38 {
39  calo_region_map::const_iterator p = m_calo_region_map.find(region);
40  if(p != m_calo_region_map.end()) {
41  return p->second;
42  } else {
43  // no CaloTTDescrRegion corresponding to Identifier
44  // this is expected as some Identifiers have no real counter part)
45  return(nullptr);
46  }
47 
48 }
49 
52 {
53  return m_calo_region_vec.begin();
54 }
55 
58 {
59  return m_calo_region_vec.end();
60 }
61 
64 {
65  return m_calo_region_vec.size();
66 }
67 
70 {
71  return m_calo_descr_vec.begin();
72 }
73 
76 {
77  return m_calo_descr_vec.end();
78 }
79 
82 {
83  return m_calo_descr_vec.size();
84 }
85 
87 {
88  return (m_calo_lvl1_id);
89 }
90 
91 
92 
93 void
95 {
96  // initialization actually done in CaloTTMgrDetDescrCnv
97  m_is_initialized = true;
98 }
99 
101 {
102  return m_is_initialized;
103 }
104 
105 
106 void
108 {
109  m_calo_region_vec.push_back(region);
110  // m_calo_region_map[region->identify()] = region;
111  m_calo_region_map.insert(std::pair<Identifier, CaloTTDescrRegion*>((region->identify()),region));
112 }
113 
114 void
116 {
117  m_calo_descr_vec.push_back(descriptor);
118 }
119 
120 void
122 {
123  m_calo_lvl1_id = id_helper;
124 }
125 
126 
127 void
129 {
130  std::cout << "CaloTTDescrManager : " << std::endl;
131  std::cout << " Number of Calo TT Regions : " << m_calo_region_vec.size() << std::endl;
132  std::cout << " Number of Calo descriptors : " << m_calo_descr_vec.size() << std::endl;
133 
136 
137  for (; first != last; ++first) {
138  (*first)->print();
139  }
140 
141 }
142 
144 {
145 // Remove regions and descriptors
148  for (; first != last; ++first) delete (*first);
149  m_calo_region_vec.clear();
150 
153  for (; first2 != last2; ++first2) delete (*first2);
154  m_calo_descr_vec.clear();
155 
156  m_is_initialized = false;
157 }
158 
159 
160 
CaloTTDescrManager::is_initialized
bool is_initialized(void) const
Definition: CaloTTDescrManager.cxx:100
CaloTTDescrManager::calo_descriptors_end
calo_descr_const_iterator calo_descriptors_end(void) const
End iterator on descriptors.
Definition: CaloTTDescrManager.cxx:75
CaloTTDescrManager::calo_descriptors_size
calo_descr_size calo_descriptors_size(void) const
Total number of descriptors.
Definition: CaloTTDescrManager.cxx:81
CaloTTDescrManager::CaloTTDescrManager
CaloTTDescrManager(void)
Definition: CaloTTDescrManager.cxx:23
CaloTTDescriptor.h
CaloTTDescrRegion.h
CaloTTDescrManager::calo_region_end
calo_region_const_iterator calo_region_end(void) const
End iterator on Det Descr regions (== Trigger Towers)
Definition: CaloTTDescrManager.cxx:57
CaloTTDescrManager::calo_descriptors_begin
calo_descr_const_iterator calo_descriptors_begin(void) const
Begin iterator on descriptors.
Definition: CaloTTDescrManager.cxx:69
CaloTTDescrManager::m_calo_descr_vec
calo_descr_vec m_calo_descr_vec
vector of descriptors
Definition: CaloTTDescrManager.h:139
CaloTTDescrManager::calo_region_const_iterator
calo_region_vec::const_iterator calo_region_const_iterator
Definition: CaloTTDescrManager.h:75
CaloTTDescrManager::m_calo_region_vec
calo_region_vec m_calo_region_vec
vector of Det Descr regions (== Trigger Towers)
Definition: CaloTTDescrManager.h:136
CaloTTDescrManager::get_lvl1_id
const CaloLVL1_ID * get_lvl1_id(void) const
access to the offline identifier helper
Definition: CaloTTDescrManager.cxx:86
python.utils.AtlRunQueryDQUtils.p
p
Definition: AtlRunQueryDQUtils.py:210
CaloTTDescrManager::set_helper
void set_helper(const CaloLVL1_ID *id_helper)
set the helper used to decode the TT offline identifiers
Definition: CaloTTDescrManager.cxx:121
CaloTTDescrManager::m_calo_region_map
calo_region_map m_calo_region_map
Definition: CaloTTDescrManager.h:137
CaloTTDescrManager.h
CaloTTDescrManager::calo_descr_const_iterator
calo_descr_vec::const_iterator calo_descr_const_iterator
Definition: CaloTTDescrManager.h:79
CaloTTDescrRegion::identify
virtual Identifier identify() const
Definition: CaloTTDescrRegion.cxx:22
CaloTTDescrManager::m_calo_lvl1_id
const CaloLVL1_ID * m_calo_lvl1_id
Helper used to decode the TT offline identifiers.
Definition: CaloTTDescrManager.h:134
CaloLVL1_ID
Helper class for offline TT identifiers.
Definition: CaloLVL1_ID.h:66
CaloTTDescrManager::clear
void clear(void)
Delete towers and descriptors.
Definition: CaloTTDescrManager.cxx:143
CaloTTDescrManager::calo_region_vec_size
calo_region_vec::size_type calo_region_vec_size
Definition: CaloTTDescrManager.h:74
CaloTTDescrManager::calo_region_size
calo_region_vec_size calo_region_size(void) const
Total number of Det Descr regions (i.e.
Definition: CaloTTDescrManager.cxx:63
CaloTTDescrManager::calo_region_begin
calo_region_const_iterator calo_region_begin(void) const
Begin iterator on Det Descr regions (== Trigger Towers)
Definition: CaloTTDescrManager.cxx:51
CaloTTDescrManager::~CaloTTDescrManager
~CaloTTDescrManager()
Definition: CaloTTDescrManager.cxx:30
CaloTTDescrManager::add
void add(CaloTTDescrRegion *region)
Insertion in the vector of Det Descr regions (== Trigger Towers)
Definition: CaloTTDescrManager.cxx:107
CaloLVL1_ID.h
CaloTTDescrManager::print
void print(void) const
Definition: CaloTTDescrManager.cxx:128
DeMoScan.first
bool first
Definition: DeMoScan.py:536
CaloTTDescrManager::m_is_initialized
bool m_is_initialized
Definition: CaloTTDescrManager.h:132
CaloTTDescrRegion
This class provides an interface to the geometrical description of the Calorimeter Trigger Towers.
Definition: CaloTTDescrRegion.h:48
CaloTTDescrManager::calo_descr_size
calo_descr_vec::size_type calo_descr_size
Definition: CaloTTDescrManager.h:78
CaloTTDescrManager::initialize
void initialize(void)
dummy.
Definition: CaloTTDescrManager.cxx:94
CaloTTDescriptor
This class holds the Calorimeter TriggerTower geometrical description
Definition: CaloTTDescriptor.h:30
CaloTTDescrManager::find_calo_region
CaloTTDescrRegion * find_calo_region(const Identifier &tower_id) const
Access to the Det Descr region (==Trigger Tower) corresponding to a TT identifier.
Definition: CaloTTDescrManager.cxx:37
Identifier
Definition: IdentifierFieldParser.cxx:14