CMS 3D CMS Logo

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

#include <AlignableMap.h>

Public Member Functions

 AlignableMap ()
 
void dump (void) const
 Print the name of all stored data. More...
 
Alignablesfind (const std::string &name="")
 
Alignablesget (const std::string &name="")
 
virtual ~AlignableMap ()
 

Private Types

typedef std::map< std::string,
Alignables
Container
 

Private Attributes

Container theStore
 

Detailed Description

A helper class to hold Alignables used by modules in alignment.

Alignables are stored in a map<string, Alignables>. Users get Alignables by passing the corresponding name through the method get(), if the name doesn't exist a new entry will be created. The find()-method also delivers Alignables per name, but it does not created new entries and will throw an error in case of an unknown name.

Date:
2008/02/12 18:06:49
Revision:
1.3
Author
Chung Khim Lae

Last Update: Max Stark Date: Mon, 22 Feb 2016 19:58:45 CET

Definition at line 29 of file AlignableMap.h.

Member Typedef Documentation

typedef std::map<std::string, Alignables> AlignableMap::Container
private

Definition at line 31 of file AlignableMap.h.

Constructor & Destructor Documentation

AlignableMap::AlignableMap ( )
inline

Definition at line 35 of file AlignableMap.h.

35 {};
virtual AlignableMap::~AlignableMap ( )
inlinevirtual

Definition at line 36 of file AlignableMap.h.

36 {};

Member Function Documentation

void AlignableMap::dump ( void  ) const

Print the name of all stored data.

Definition at line 34 of file AlignableMap.cc.

References theStore.

35 {
36  edm::LogInfo("AlignableMap") << "Printing out AlignSetup: ";
37  for ( typename Container::const_iterator it = theStore.begin();
38  it != theStore.end(); ++it ) {
39  edm::LogVerbatim("AlignableMap") << it->first << std::endl;
40  }
41 }
Container theStore
Definition: AlignableMap.h:50
Alignables & AlignableMap::find ( const std::string &  name = "")

Find and return an object from map using its name. Throw an exception if the name does not exist.

Definition at line 15 of file AlignableMap.cc.

References Exception, connectstrParser::o, and theStore.

Referenced by BeautifulSoup.Tag::__getattr__(), AlignableCompositeBuilder::buildLevel(), BeautifulSoup.Tag::firstText(), AlignableExtras::subStructures(), and AlignableTracker::subStructures().

16 {
17  typename Container::iterator o = theStore.find(name);
18 
19  if (theStore.end() == o) {
20  std::ostringstream knownKeys;
21  for (auto it = theStore.begin(); it != theStore.end(); ++it) {
22  knownKeys << (it != theStore.begin() ? ", " : "") << it->first;
23  }
24 
25  throw cms::Exception("AlignableMapError")
26  << "Cannot find an object of name " << name << " in AlignableMap, "
27  << "know only " << knownKeys.str() << ".";
28  }
29 
30  return o->second;
31 }
Container theStore
Definition: AlignableMap.h:50
Alignables & AlignableMap::get ( const std::string &  name = "")

Member Data Documentation

Container AlignableMap::theStore
private

Definition at line 50 of file AlignableMap.h.

Referenced by dump(), find(), and get().