CMS 3D CMS Logo

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 10 of file SensitiveDetectorCatalog.h.

Member Function Documentation

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

Definition at line 43 of file SensitiveDetectorCatalog.cc.

References groupFilesInBlocks::temp, and theClassNameMap.

Referenced by AttachSD::create().

43  {
44  for (MapType::const_iterator it = theClassNameMap.begin(); it != theClassNameMap.end(); it++) {
45  std::vector<std::string> temp = (*it).second;
46  for (std::vector<std::string>::const_iterator it2 = temp.begin(); it2 != temp.end(); it2++) {
47  if (*it2 == readoutName)
48  return (*it).first;
49  }
50  }
51  return "NotFound";
52 }
std::vector< std::string > SensitiveDetectorCatalog::classNames ( ) const

Definition at line 54 of file SensitiveDetectorCatalog.cc.

References groupFilesInBlocks::temp, and theClassNameMap.

Referenced by insert().

54  {
55  std::vector<std::string> temp;
56  for (MapType::const_iterator it = theClassNameMap.begin(); it != theClassNameMap.end(); it++)
57  temp.push_back(it->first);
58  return temp;
59 }
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 DDG4SensitiveConverter::upDate().

8  {
9  theClassNameMap[cN].push_back(rN);
10  theROUNameMap[rN].push_back(lvN);
11 #ifdef DEBUG
12  LogDebug("SimG4CoreGeometry") << "SenstiveDetectorCatalog: insert (" << cN << "," << rN << "," << lvN << ")\n"
13  << " has " << readoutNames().size() << " ROUs "
14  << readoutNames().front() << "\n"
15  << " has " << classNames().size() << " classes "
16  << classNames().front();
17 #endif
18 }
#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

Definition at line 31 of file SensitiveDetectorCatalog.cc.

References theROUNameMap.

Referenced by SensitiveDetector::SensitiveDetector().

31  {
32  return theROUNameMap.at(readoutName);
33 }
std::vector< std::string > SensitiveDetectorCatalog::logicalNamesFromClassName ( const std::string &  className) const

Definition at line 35 of file SensitiveDetectorCatalog.cc.

References groupFilesInBlocks::temp, and theClassNameMap.

35  {
36  std::vector<std::string> temp;
37  const std::vector<std::string> &rous = theClassNameMap.at(className);
38  for (std::vector<std::string>::const_iterator it = rous.begin(); it != rous.end(); it++)
39  temp.push_back(*it);
40  return temp;
41 }
std::string className(const std::string &readoutName) const
const std::vector< std::string > & SensitiveDetectorCatalog::readoutNames ( const std::string &  className) const

Definition at line 27 of file SensitiveDetectorCatalog.cc.

References theClassNameMap.

Referenced by AttachSD::create().

27  {
28  return theClassNameMap.at(className);
29 }
std::string className(const std::string &readoutName) const
std::vector< std::string > SensitiveDetectorCatalog::readoutNames ( ) const

Definition at line 20 of file SensitiveDetectorCatalog.cc.

References groupFilesInBlocks::temp, and theROUNameMap.

Referenced by insert().

20  {
21  std::vector<std::string> temp;
22  for (MapType::const_iterator it = theROUNameMap.begin(); it != theROUNameMap.end(); it++)
23  temp.push_back(it->first);
24  return temp;
25 }

Member Data Documentation

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

Definition at line 21 of file SensitiveDetectorCatalog.h.

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