ATLAS Offline Software
TBDetDescrManager.h
Go to the documentation of this file.
1 /*
2  Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
3 */
4 
5 //==============================================
6 // File TBDetDescrManager.h
7 // keeps positions of all detectors at the testbeam
8 //=============================================
9 #ifndef TBDetDescrManager_H
10 #define TBDetDescrManager_H
11 
12 #include "AthenaKernel/CLASS_DEF.h"
13 
14 #include "TBDetDescr/TBElement.h"
15 class TBElementContainer;
16 class MsgStream;
17 
18 #include <vector>
19 
21 {
22  public:
24 
25  virtual ~TBDetDescrManager() { }
26 
27  // copy all elements from a vector to private vector
28  void initialize(const std::vector<TBElement> & vec);
29 
30  // copy all elements from container to private vector
31  void initialize(const TBElementContainer * pTBElementContainer);
32 
33  // copy all elements to a container
34  void getAll(TBElementContainer * pTBElementContainer) const;
35 
36  // get one element
38 
39  // re-initialize one element
40  void setElement(const TBElement & element);
41 
42  bool is_initialized (void) const {return (m_elements>0);}
43  int n_elements (void) const {return m_elements; }
44  int max_size (void) const {return m_TBElementVec.size(); }
45 
46  void print (MsgStream& log) const;
47 
48 private:
49 
50  unsigned int m_elements; // number of non-empty elements
51  std::vector<TBElement> m_TBElementVec; // TBElementID::TBElementID as index
52 
53  };
54 
56 
57 #endif
58 
TBDetDescrManager::~TBDetDescrManager
virtual ~TBDetDescrManager()
Definition: TBDetDescrManager.h:25
TBDetDescrManager::TBDetDescrManager
TBDetDescrManager()
Definition: TBDetDescrManager.cxx:16
TBDetDescrManager::is_initialized
bool is_initialized(void) const
Definition: TBDetDescrManager.h:42
TBElementID::TBElementID
TBElementID
Definition: TBElementID.h:11
TBDetDescrManager::n_elements
int n_elements(void) const
Definition: TBDetDescrManager.h:43
vec
std::vector< size_t > vec
Definition: CombinationsGeneratorTest.cxx:12
TBDetDescrManager::setElement
void setElement(const TBElement &element)
Definition: TBDetDescrManager.cxx:128
TBDetDescrManager::getElement
const TBElement & getElement(TBElementID::TBElementID id) const
Definition: TBDetDescrManager.cxx:121
TBDetDescrManager::initialize
void initialize(const std::vector< TBElement > &vec)
Definition: TBDetDescrManager.cxx:74
TBDetDescrManager::getAll
void getAll(TBElementContainer *pTBElementContainer) const
Definition: TBDetDescrManager.cxx:108
TBDetDescrManager::print
void print(MsgStream &log) const
Definition: TBDetDescrManager.cxx:146
TBDetDescrManager::m_TBElementVec
std::vector< TBElement > m_TBElementVec
Definition: TBDetDescrManager.h:51
TBDetDescrManager::m_elements
unsigned int m_elements
Definition: TBDetDescrManager.h:50
TBElementContainer
Definition: TBElementContainer.h:18
TBDetDescrManager
Definition: TBDetDescrManager.h:21
CLASS_DEF
#define CLASS_DEF(NAME, CID, VERSION)
associate a clid and a version to a type eg
Definition: Control/AthenaKernel/AthenaKernel/CLASS_DEF.h:64
TBDetDescrManager::max_size
int max_size(void) const
Definition: TBDetDescrManager.h:44
python.CaloCondTools.log
log
Definition: CaloCondTools.py:20
TBElement
Definition: TBElement.h:20
TBElement.h
CLASS_DEF.h
macros to associate a CLID to a type