CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
List of all members | Public Types | Public Member Functions | Private Attributes
SensitiveDetectorCatalog Class Reference

#include <SensitiveDetectorCatalog.h>

Public Types

typedef std::map< std::string,
std::vector< std::string > > 
MapType
 

Public Member Functions

std::string className (const std::string &readoutName) const
 
std::vector< std::string > classNames () const
 
void insert (const std::string &, const std::string &, const std::string &)
 
const std::vector< std::string > & logicalNames (const std::string &readoutName) const
 
std::vector< std::string > logicalNamesFromClassName (const std::string &className) const
 
const std::vector< std::string > & readoutNames (const std::string &className) const
 
std::vector< std::string > readoutNames () const
 

Private Attributes

MapType theClassNameMap
 
MapType theROUNameMap
 

Detailed Description

Definition at line 8 of file SensitiveDetectorCatalog.h.

Member Typedef Documentation

typedef std::map<std::string,std::vector<std::string> > SensitiveDetectorCatalog::MapType

Definition at line 11 of file SensitiveDetectorCatalog.h.

Member Function Documentation

std::string SensitiveDetectorCatalog::className ( const std::string &  readoutName) const

Definition at line 49 of file SensitiveDetectorCatalog.cc.

References groupFilesInBlocks::temp, and theClassNameMap.

Referenced by AttachSD::create().

49  {
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 }
std::vector< std::string > SensitiveDetectorCatalog::classNames ( ) const

Definition at line 61 of file SensitiveDetectorCatalog.cc.

References groupFilesInBlocks::temp, and theClassNameMap.

Referenced by insert().

61  {
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 }
void SensitiveDetectorCatalog::insert ( const std::string &  cN,
const std::string &  rN,
const std::string &  lvN 
)

Definition at line 8 of file SensitiveDetectorCatalog.cc.

References classNames(), LogDebug, readoutNames(), theClassNameMap, and theROUNameMap.

Referenced by BeautifulSoup.PageElement::_invert(), and DDG4SensitiveConverter::upDate().

9  {
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 }
#define LogDebug(id)
std::vector< std::string > classNames() const
std::vector< std::string > readoutNames() const
const std::vector< std::string > & SensitiveDetectorCatalog::logicalNames ( const std::string &  readoutName) const
std::vector< std::string > SensitiveDetectorCatalog::logicalNamesFromClassName ( const std::string &  className) const

Definition at line 40 of file SensitiveDetectorCatalog.cc.

References groupFilesInBlocks::temp, and theClassNameMap.

40  {
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 }
std::string className(const std::string &readoutName) const
const std::vector< std::string > & SensitiveDetectorCatalog::readoutNames ( const std::string &  className) const

Definition at line 32 of file SensitiveDetectorCatalog.cc.

References theClassNameMap.

Referenced by AttachSD::create().

32  {
33  return theClassNameMap.at(className);
34 }
std::string className(const std::string &readoutName) const
std::vector< std::string > SensitiveDetectorCatalog::readoutNames ( ) const

Definition at line 24 of file SensitiveDetectorCatalog.cc.

References groupFilesInBlocks::temp, and theROUNameMap.

Referenced by insert().

24  {
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 }

Member Data Documentation

MapType SensitiveDetectorCatalog::theClassNameMap
private
MapType SensitiveDetectorCatalog::theROUNameMap
private

Definition at line 22 of file SensitiveDetectorCatalog.h.

Referenced by insert(), logicalNames(), and readoutNames().