CMS 3D CMS Logo

Public Types | Public Member Functions | Private Attributes

SensitiveDetectorCatalog Class Reference

#include <SensitiveDetectorCatalog.h>

List of all members.

Public Types

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

Public Member Functions

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

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 ( std::string &  readoutName)

Definition at line 49 of file SensitiveDetectorCatalog.cc.

References cond::rpcobtemp::temp, and theClassNameMap.

Referenced by AttachSD::create(), logicalNamesFromClassName(), and readoutNames().

                                                                     {
  for (MapType::const_iterator it = theClassNameMap.begin();  
       it != theClassNameMap.end(); it++)  {
    std::vector<std::string> temp = (*it).second;
    for (std::vector<std::string>::const_iterator it2 = temp.begin();
         it2!=temp.end(); it2++) {
      if (*it2 == readoutName ) return (*it).first;
    }
  } 
  return "NotFound";
}
std::vector< std::string > SensitiveDetectorCatalog::classNames ( )

Definition at line 61 of file SensitiveDetectorCatalog.cc.

References cond::rpcobtemp::temp, and theClassNameMap.

Referenced by insert().

                                                          {
  std::vector<std::string> temp;
  for (MapType::const_iterator it = theClassNameMap.begin();  
       it != theClassNameMap.end(); it++)
    temp.push_back(it->first);
  return temp;
}
void SensitiveDetectorCatalog::insert ( std::string &  cN,
std::string &  rN,
std::string &  lvN 
)

Definition at line 8 of file SensitiveDetectorCatalog.cc.

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

Referenced by DDG4SensitiveConverter::upDate().

                                                       {
  theClassNameMap[cN].push_back(rN);
  theROUNameMap[rN].push_back(lvN);
#ifdef DEBUG
  LogDebug("SimG4CoreGeometry") << "SenstiveDetectorCatalog: insert (" << cN
                                << "," << rN << "," << lvN << ")\n"
                                << "                         has     "
                                << readoutNames().size() << " ROUs "
                                << readoutNames().front() << "\n"
                                << "                         has     "
                                << classNames().size() << " classes "
                                << classNames().front();
#endif
}
std::vector< std::string > SensitiveDetectorCatalog::logicalNames ( std::string &  readoutName)
std::vector< std::string > SensitiveDetectorCatalog::logicalNamesFromClassName ( std::string &  className)

Definition at line 40 of file SensitiveDetectorCatalog.cc.

References className(), cond::rpcobtemp::temp, and theClassNameMap.

                                                                                              {
  std::vector<std::string> temp;
  std::vector<std::string> rous = theClassNameMap[className];
  for (std::vector<std::string>::const_iterator it = rous.begin(); 
       it!= rous.end(); it++)
    temp.push_back(*it);
  return temp;
}
std::vector< std::string > SensitiveDetectorCatalog::readoutNames ( std::string &  className)

Definition at line 32 of file SensitiveDetectorCatalog.cc.

References className(), and theClassNameMap.

Referenced by AttachSD::create().

                                                                                 { 
  return theClassNameMap[className]; 
}
std::vector< std::string > SensitiveDetectorCatalog::readoutNames ( )

Definition at line 24 of file SensitiveDetectorCatalog.cc.

References cond::rpcobtemp::temp, and theROUNameMap.

Referenced by insert().

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

Member Data Documentation

Definition at line 22 of file SensitiveDetectorCatalog.h.

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