CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
SensitiveDetectorCatalog.cc
Go to the documentation of this file.
3 
4 #define DEBUG
5 
6 #include <iostream>
7 
9  const std::string& lvN) {
10  theClassNameMap[cN].push_back(rN);
11  theROUNameMap[rN].push_back(lvN);
12 #ifdef DEBUG
13  LogDebug("SimG4CoreGeometry") << "SenstiveDetectorCatalog: insert (" << cN
14  << "," << rN << "," << lvN << ")\n"
15  << " has "
16  << readoutNames().size() << " ROUs "
17  << readoutNames().front() << "\n"
18  << " has "
19  << classNames().size() << " classes "
20  << classNames().front();
21 #endif
22 }
23 
24 std::vector<std::string> SensitiveDetectorCatalog::readoutNames() const {
25  std::vector<std::string> temp;
26  for (MapType::const_iterator it = theROUNameMap.begin();
27  it != theROUNameMap.end(); it++)
28  temp.push_back(it->first);
29  return temp;
30 }
31 
32 const std::vector<std::string>& SensitiveDetectorCatalog::readoutNames(const std::string & className) const {
33  return theClassNameMap.at(className);
34 }
35 
36 const std::vector<std::string>& SensitiveDetectorCatalog::logicalNames(const std::string & readoutName) const {
37  return theROUNameMap.at(readoutName);
38 }
39 
41  std::vector<std::string> temp;
42  const std::vector<std::string>& rous = theClassNameMap.at(className);
43  for (std::vector<std::string>::const_iterator it = rous.begin();
44  it!= rous.end(); it++)
45  temp.push_back(*it);
46  return temp;
47 }
48 
50  for (MapType::const_iterator it = theClassNameMap.begin();
51  it != theClassNameMap.end(); it++) {
52  std::vector<std::string> temp = (*it).second;
53  for (std::vector<std::string>::const_iterator it2 = temp.begin();
54  it2!=temp.end(); it2++) {
55  if (*it2 == readoutName ) return (*it).first;
56  }
57  }
58  return "NotFound";
59 }
60 
61 std::vector<std::string> SensitiveDetectorCatalog::classNames() const {
62  std::vector<std::string> temp;
63  for (MapType::const_iterator it = theClassNameMap.begin();
64  it != theClassNameMap.end(); it++)
65  temp.push_back(it->first);
66  return temp;
67 }
#define LogDebug(id)
std::vector< std::string > classNames() const
std::vector< std::string > readoutNames() const
const std::vector< std::string > & logicalNames(const std::string &readoutName) const
void insert(const std::string &, const std::string &, const std::string &)
std::string className(const std::string &readoutName) const
std::vector< std::string > logicalNamesFromClassName(const std::string &className) const
std::string className(const T &t)
Definition: ClassName.h:30