ATLAS Offline Software
AGDDDetectorStore.cxx
Go to the documentation of this file.
1 /*
2  Copyright (C) 2002-2021 CERN for the benefit of the ATLAS collaboration
3 */
4 
9 
10 #include <iostream>
11 
12 //using AGDDModel::AGDDTechnology;
13 
15 {
16 }
18 {
19  std::string n=s->GetName();
20  if (m_the_detectors.find(n) != m_the_detectors.end())
21  std::cout<<" Detector "<<n<<" already in store "<<std::endl;
22  else
24 }
25 
27 {
28  std::string n=s->GetName();
29  if (m_the_technologies.find(n) != m_the_technologies.end())
30  std::cout<<" Technology "<<n<<" already in store "<<std::endl;
31  else
33 }
35 {
36  detectorList::const_iterator it = m_the_detectors.begin();
37  detectorList::const_iterator end = m_the_detectors.end();
38  std::cout<<"AGDDDetectorStore::PrintAllDetector"<<std::endl
39  <<"[key] \t name \t subType \t tech"<<std::endl;
40  for( ; it!=end; ++it) {
41  std::cout<<"["<<it->first<<"] :"
42  <<" "<<it->second->GetName()
43  <<" "<<it->second->subType()
44  <<" "<<it->second->tech
45  <<std::endl;
46  }
47 }
48 
50 {
51  return m_the_detectors;
52 }
53 
54 std::vector<AGDDDetector*> AGDDDetectorStore::GetDetectorsByType(const std::string& dt) const
55 {
56  std::vector<AGDDDetector*> detectors;
57  const detectorList& theDetectors=GetDetectorList();
58  detectorList::const_iterator it=theDetectors.begin();
59  for (;it!=theDetectors.end();++it)
60  {
61  AGDDDetector* det=(*it).second;
62  if (dt==det->DetectorType()) detectors.push_back(det);
63  }
64  return detectors;
65 }
66 
68 {
69  const detectorList& theDetectors=GetDetectorList();
70  detectorList::const_iterator it=theDetectors.begin();
71  for (;it!=theDetectors.end();++it)
72  {
73  AGDDDetector* det=(*it).second;
74  if (dt==det->DetectorID()) return det;
75  }
76  return 0;
77 }
78 
79 template<class T> std::vector<T*> AGDDDetectorStore::GetDetectorsByType() const
80 {
81  std::vector<T*> detectors;
82  const detectorList& theDetectors=GetDetectorList();
83  detectorList::const_iterator it=theDetectors.begin();
84  for (;it!=theDetectors.end();++it)
85  {
86  T* det=dynamic_cast<T*>((*it).second);
87  if (det) detectors.push_back(det);
88  }
89  return detectors;
90 }
91 template<class T> T* AGDDDetectorStore::GetDetectorByID(const std::string& id) const
92 {
93  const detectorList& theDetectors=GetDetectorList();
94  detectorList::const_iterator it=theDetectors.begin();
95  for (;it!=theDetectors.end();++it)
96  {
97  if (id==(*it).second->DetectorID())
98  {
99  T* det=dynamic_cast<T*>((*it).second);
100  if (det) return det;
101  }
102  }
103  return 0;
104 }
AGDDDetectorStore.h
python.SystemOfUnits.s
int s
Definition: SystemOfUnits.py:131
AGDDTechnology.h
AGDDDetectorStore::m_the_detectors
detectorList m_the_detectors
Definition: AGDDDetectorStore.h:34
skel.it
it
Definition: skel.GENtoEVGEN.py:423
AGDDDetectorStore::GetDetectorByID
AGDDDetector * GetDetectorByID(const std::string &) const
Definition: AGDDDetectorStore.cxx:67
AGDDDetectorStore::RegisterDetector
void RegisterDetector(AGDDDetector *)
Definition: AGDDDetectorStore.cxx:17
RunPrintSiDetElements.detectors
detectors
Definition: RunPrintSiDetElements.py:59
detectorList
std::map< std::string, AGDDDetector * > detectorList
Definition: AGDDDetectorStore.h:9
AGDDDetectorStore::PrintAllDetectors
void PrintAllDetectors()
Definition: AGDDDetectorStore.cxx:34
mergePhysValFiles.end
end
Definition: DataQuality/DataQualityUtils/scripts/mergePhysValFiles.py:93
AGDDDetectorStore::AGDDDetectorStore
AGDDDetectorStore()
Definition: AGDDDetectorStore.cxx:14
AGDDDetector
Definition: AGDDDetector.h:15
beamspotman.n
n
Definition: beamspotman.py:731
CaloNoise_fillDB.dt
dt
Definition: CaloNoise_fillDB.py:58
WritePulseShapeToCool.det
det
Definition: WritePulseShapeToCool.py:204
AGDDDetectorStore::GetDetectorList
detectorList & GetDetectorList()
Definition: AGDDDetectorStore.h:26
AGDDTechnology
Definition: AGDDTechnology.h:15
AGDDDetector.h
AGDDDetectorStore::RegisterTechnology
void RegisterTechnology(AGDDTechnology *)
Definition: AGDDDetectorStore.cxx:26
AGDDDetectorStore::GetDetectorsByType
std::vector< T * > GetDetectorsByType() const
Definition: AGDDDetectorStore.cxx:79
AGDDDetectorStore::m_the_technologies
technologyList m_the_technologies
Definition: AGDDDetectorStore.h:35
AGDDSection.h
TSU::T
unsigned long long T
Definition: L1TopoDataTypes.h:35